Переделан конфиг (под dev и production)
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from traceback import format_exc
|
||||
|
||||
import psycopg2.extras
|
||||
|
||||
|
||||
class DBImpl:
|
||||
def __init__(self, engine, params):
|
||||
def __init__(self, engine, db_config):
|
||||
self.db_engine = engine
|
||||
self.connection = engine.connect(**params)
|
||||
self.connection = engine.connect(dbname=db_config.database, user=db_config.user, password=db_config.password,
|
||||
port=db_config.port, host=db_config.host)
|
||||
|
||||
def transaction_commit(self):
|
||||
self.connection.commit()
|
||||
|
||||
@@ -19,6 +19,6 @@ db_shemas['SOCRBASE'] = DbSchema("SOCRBASE", ["LEVEL", "SOCRNAME", "SCNAME", "KO
|
||||
"AddressObjectType")
|
||||
|
||||
db_shemas['AOTRIG'] = DbSchema("AOTRIG", ["WORD", "TRIGRAMM", "FREQUENCY"], "word",
|
||||
None)
|
||||
None)
|
||||
|
||||
allowed_tables = ["ADDROBJ", "SOCRBASE"]
|
||||
|
||||
Reference in New Issue
Block a user