def __init__(self, loglevel, db_config_file, section_name):
     self.pool_size = 2
     self.min_db_conn_size = 2
     logging.config.fileConfig('logger_test.conf')
     self.logger = logging.getLogger(loglevel)
     self.config = configparser.ConfigParser()
     self.config.read(db_config_file)
     self.host = self.config[section_name]['host']
     self.port = self.config[section_name]['port']
     self.user = self.config[section_name]['user']
     self.password = self.config[section_name]['password']
     self.database = self.config[section_name]['database']
     self.conn_pool = ThreadedConnectionPool(self.min_db_conn_size,
                                             self.pool_size,
                                             host=self.host,
                                             port=self.port,
                                             user=self.user,
                                             database=self.database)
     self.main_db_conn = db_connecter.DBConnecter(db_config_file,
                                                  section_name)
     self.main_db_conn.connect()
     pass
Exemplo n.º 2
0
 def __init__(self, loglevel):
     logging.config.fileConfig('logger.conf')
     self.logger = logging.getLogger(loglevel)
     self.db_conn = db_connecter.DBConnecter('db.conf', 'default')
     self.db_conn.connect()
     pass
Exemplo n.º 3
0
 def __init__(self):
     logging.config.fileConfig('logger_test.conf')
     self.logger = logging.getLogger(GetMatchsInfo.logLevel)
     self.db_conn = db_connecter.DBConnecter('db.conf', 'test')
     self.db_conn.connect()
     pass
Exemplo n.º 4
0
 def __init__(self, db_config_file, config_section_name):
     self.db_conn = db_connecter.DBConnecter(db_config_file,
                                             config_section_name)
     self.db_conn.connect()