[b4a150]: / Configs / __pycache__ / CONSTANTS.cpython-35.pyc

Download this file

32 lines (32 with data), 3.7 kB



ย๕Yิใ@s„dZddlZddlZddlZddlmZdZdZdgZdZ	dZ
dZdZd	Z
Gd
d„dƒZdS)zS It reads and sets constants, based on the configuration file and input arguments.
้N)ฺPyConfigParserzMohsen Mesgarpourz-Copyright 2016, https://github.com/mesgarpourZGPLz1.1zmohsen.mesgarpour@gmail.comZReleasec@sสeZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZedddeeeeddd„ƒZedd	„ƒZed
d„ƒZeedd
d„ƒZdS)ฺ	CONSTANTSNZlogsz#ConfigInputs/input_features_configszConfigInputs/CONFIGURATIONS)ฺio_pathฺapp_nameฺconfig_features_pathฺconfig_pathcCsytjtjƒt_tjjtƒ|t_tj	j
|ƒt_tj	j
|ƒt_|t_tj
ƒtjƒdS)aYConfigure configuration file and set the constants.
        :param io_path: the input output directory path.
        :param app_name: the application name, which will be used as the log file name.
        :param config_features_path: the configuration of the input features.
        :param config_path: the configuration directory path.
        N)ฺloggingฺ	getLoggerrrฺ_CONSTANTS__loggerฺdebugฺ__name__rฺosฺpathฺabspathrrฺ_CONSTANTS__set_configs_generalฺ%_CONSTANTS__set_config_other_settings)rrrrฉr๚IC:\Users\eagle\Documents\GitHub\Analytics_UoW\TCARER\Configs\CONSTANTS.pyฺset8s		
z
CONSTANTS.setcCsQttjtjddƒ}d}y๑d}t|j|dƒƒt_t|j|dƒƒt_t|j|dƒƒt_t|j|dƒƒt_	t|j|d	ƒƒd
kt_
t|j|dƒƒt_t|j|dƒƒt_
t|j|d
ƒƒjdƒt_Wn8fk
rLtjjtd|dƒtjƒYnXdS)zUSet general configuration constants, including the MySQL database constants.
        ฺextฺiniฺZDatabaseฺdb_hostฺdb_userฺdb_passwordฺdb_portฺdb_echoฺTrueฺdb_pool_timeoutฺdb_pool_recycleฺdb_session_vars๚;z# - Invalid configuration(s) in the z sectionN)rrrrฺstrฺoptionrrrrrฺintrrฺsplitr r
ฺerrorrฺsysฺexit)ฺconfigฺsectionrrrZ__set_configs_generalNs!(
zCONSTANTS.__set_configs_generalcCs,tjtjƒtjjtjƒt_dS)z+Set other configuration constants.
        N)rฺ_CONSTANTS__create_directoriesrr
rrrrrrZ__set_config_other_settingsesz%CONSTANTS.__set_config_other_settings)rcCs“tjj|ƒsytj|ddƒWnctk
rŽ}zCtjjtdj	|j
dt|j
dƒƒƒtj
ƒWYdd}~XnXdS)zQCreate folder if it does not exist.
        :param path: Directory path.
        ฺexist_okTz* - Directory creation error: {0:d}:
 {1:s}r้N)r
rฺexistsฺmakedirsฺOSErrorrr
r&rฺformatฺargsr"r'r()rฺerrrZ__create_directoriesls	+zCONSTANTS.__create_directories)rฺ
__module__ฺ__qualname__r
rrrrrrrrr rrrฺstaticmethodr"rrrr+rrrrr$s*$r)ฺ__doc__r
r'rZReadersWriters.PyConfigParserrฺ
__author__ฺ
__copyright__ฺ__credits__ฺ__license__ฺ__version__Z__maintainer__ฺ	__email__ฺ
__status__rrrrrฺ<module>s