"""Declare the Koztumize application using Pynuts."""

import ldap
from pynuts import Pynuts


class Koztumize(Pynuts):
    """The class which open the ldap."""
    @property
    def ldap(self):
        """Open the ldap."""
        if 'LDAP' not in self.config:  # pragma: no cover
            self.config['LDAP'] = ldap.open(self.config['LDAP_HOST'])
        return self.config['LDAP']


app = Koztumize(
    __name__, config_file='config/config.cfg')  # pylint: disable=C0103

"""Declare the Koztumize application using Pynuts."""

import os
import ldap
from pynuts import Pynuts


class Koztumize(Pynuts):
    """The class which open the ldap."""
    @property
    def ldap(self):
        """Open the ldap."""
        if 'LDAP' not in self.config:  # pragma: no cover
            self.config['LDAP'] = ldap.open(self.config['LDAP_HOST'])
        return self.config['LDAP']


app = Koztumize(  # pylint: disable=E1101
    __name__,
    config_file=os.environ.get('KOZTUMIZE_CONFIG') or 'config/config.cfg')

Use an environment variable as config file
Use an environment variable as config file
