示例#1
0
    def __init__(self):
        """."""

        # Logger.__init__(self)
        self.configfile = sep.join(
            os.path.abspath(os.path.join(os.path.dirname(__file__))).split(sep)
            [:-1]) + sep + "resources" + sep + "config.cfg"
        self.parse_dict = ParseConfig.get_config_dict(self.configfile)
        self.path_section = self.parse_dict.get('emailCredentials')
        self.host_name = self.path_section.get('host_name')
        self.port_no = self.path_section.get('port_no')
        self.username = self.path_section.get('username')
        self.password = self.path_section.get('password')
        self.to_emails = self.path_section.get('to_emails')
        self.cc_emails = self.path_section.get('cc_emails')
        self.receiver_name = self.path_section.get('receiver_name')
示例#2
0
    def __init__(self):
        """Initialize and create log file path and set logger level."""

        self.configfile = sep.join(
            os.path.abspath(os.path.join(os.path.dirname(__file__))).split(sep)
            [:-1]) + sep + "resources" + sep + "config.cfg"
        self.parse_dict = ParseConfig.get_config_dict(self.configfile)
        self.folderPath = self.parse_dict.get('filePath').get('logger_path')
        self.user_dir = sep.join(
            os.path.abspath(os.path.join(
                os.path.dirname(__file__))).split(sep)[:3])
        self.base_dir = '{}/{}/logs/'.format(self.user_dir, self.folderPath)
        self.level = self.LEVELS.get(LOGGER_LEVEL)

        try:
            if not os.path.isdir(self.base_dir):
                os.makedirs(self.base_dir)
        except Exception as e:
            pass
    def __init__(self):
        Logger.__init__(self)
        """Initialize database connection details."""

        base_path = slash.join(os.path.abspath('').split(slash)[:-1])
        conn_file_path = '{base}{sep}{folder}{sep}{file}'.format(
            base=base_path,
            sep=slash,
            folder='resources',
            file='connection.cfg')

        connection_dict = ParseConfig.get_config_dict(conn_file_path)
        conn_type = connection_dict.get(
            "devLocalConnection"
        )  #localConnection / devConnection / UATConnection
        self.host = conn_type.get("host")
        self.user = conn_type.get("user")
        self.password = conn_type.get("pass")
        self.database = conn_type.get("database")
        self.neo4j_user = conn_type.get('neo4j_user')
        self.neo4j_password = conn_type.get('neo4j_pass')
        self.neo4j_url = conn_type.get('neo4j_url')
        self.connect_neo4j()