Переделан конфиг (под dev и production)

This commit is contained in:
Jack Stdin
2016-01-31 23:23:52 +03:00
parent c65f78dd06
commit 1a221d9a93
16 changed files with 117 additions and 106 deletions

View File

@@ -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()

View File

@@ -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"]