"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "web2ldap/__init__.py" between
web2ldap-1.6.4.tar.gz and web2ldap-1.6.5.tar.gz

About: web2ldap is a full-featured web-based LDAPv3 client.

__init__.py  (web2ldap-1.6.4):__init__.py  (web2ldap-1.6.5)
skipping to change at line 19 skipping to change at line 19
This software is distributed under the terms of the This software is distributed under the terms of the
Apache License Version 2.0 (Apache-2.0) Apache License Version 2.0 (Apache-2.0)
https://www.apache.org/licenses/LICENSE-2.0 https://www.apache.org/licenses/LICENSE-2.0
""" """
import sys import sys
import os import os
import logging import logging
import time import time
import platform
from .log import logger, LogHelper from .log import logger, LogHelper
from .__about__ import __version__ from .__about__ import __version__
# prefixes considered to indicate system-wide installation outside a venv
OS_SYS_PREFIXES = {
'/usr',
'/usr/local',
}
# Path name of [web2ldap]/etc/web2ldap # Path name of [web2ldap]/etc/web2ldap
if 'WEB2LDAP_HOME' in os.environ: if 'WEB2LDAP_HOME' in os.environ:
# env var points to web2ldap root directory # env var points to web2ldap root prefix directory,
# assume configuration is in a sub-directory etc/web2ldap therein
ETC_DIR = os.path.join(os.environ['WEB2LDAP_HOME'], 'etc', 'web2ldap') ETC_DIR = os.path.join(os.environ['WEB2LDAP_HOME'], 'etc', 'web2ldap')
elif os.name == 'posix' and sys.prefix in OS_SYS_PREFIXES: elif (
# assume OS-wide installation on POSIX platform (Linux, BSD, etc.) platform.uname().system == 'Linux'
and sys.prefix == '/usr'
):
# OS-wide installation on GNU/Linux,
# assume configuration is in global /etc/web2ldap
ETC_DIR = '/etc/web2ldap' ETC_DIR = '/etc/web2ldap'
else: else:
# virtual env # assume configuration is in a sub-directory etc/web2ldap
# within system-prefix directory (e.g. in virtual env or on *BSD)
ETC_DIR = os.path.join(sys.prefix, 'etc', 'web2ldap') ETC_DIR = os.path.join(sys.prefix, 'etc', 'web2ldap')
sys.path.append(ETC_DIR) sys.path.append(ETC_DIR)
# Default directory for [web2ldap]/etc/web2ldap/templates # Default directory for [web2ldap]/etc/web2ldap/templates
TEMPLATES_DIR = os.path.join(ETC_DIR, 'templates') TEMPLATES_DIR = os.path.join(ETC_DIR, 'templates')
STARTUP_TIME = time.time() STARTUP_TIME = time.time()
logger.info('Starting web2ldap %s', __version__) logger.info('Starting web2ldap %s', __version__)
logger.debug('ETC_DIR = %r', ETC_DIR) logger.debug('ETC_DIR = %r', ETC_DIR)
 End of changes. 5 change blocks. 
10 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)