модернизация настроек БД
This commit is contained in:
parent
267151f546
commit
27797f35a3
@ -1,6 +1,13 @@
|
|||||||
[postgresql]
|
[export]
|
||||||
host=localhost
|
host=localhost
|
||||||
port=5432
|
port=5432
|
||||||
database=ss14
|
database=ss14
|
||||||
user=ss14_user
|
user=ss14_user
|
||||||
|
password=ss14_password
|
||||||
|
|
||||||
|
[import]
|
||||||
|
host=localhost
|
||||||
|
port=6432
|
||||||
|
database=ss14
|
||||||
|
user=ss14_user
|
||||||
password=ss14_password
|
password=ss14_password
|
||||||
@ -14,13 +14,13 @@ def read_config() -> dict[str, str]:
|
|||||||
parser.read("database.ini")
|
parser.read("database.ini")
|
||||||
|
|
||||||
db = {}
|
db = {}
|
||||||
if parser.has_section("postgresql"):
|
if parser.has_section("export"):
|
||||||
params = parser.items("postgresql")
|
params = parser.items("export")
|
||||||
for param in params:
|
for param in params:
|
||||||
db[param[0]] = param[1]
|
db[param[0]] = param[1]
|
||||||
else:
|
else:
|
||||||
raise ParseConfig(
|
raise ParseConfig(
|
||||||
'Section {0} not found in the {1} file'.format("postgresql",
|
'Section {0} not found in the {1} file'.format("export",
|
||||||
"database.ini"))
|
"database.ini"))
|
||||||
|
|
||||||
return db
|
return db
|
||||||
|
|||||||
@ -18,13 +18,13 @@ def read_config() -> dict[str, str]:
|
|||||||
parser.read("database.ini")
|
parser.read("database.ini")
|
||||||
|
|
||||||
db = {}
|
db = {}
|
||||||
if parser.has_section("postgresql"):
|
if parser.has_section("import"):
|
||||||
params = parser.items("postgresql")
|
params = parser.items("import")
|
||||||
for param in params:
|
for param in params:
|
||||||
db[param[0]] = param[1]
|
db[param[0]] = param[1]
|
||||||
else:
|
else:
|
||||||
raise ParseConfig(
|
raise ParseConfig(
|
||||||
'Section {0} not found in the {1} file'.format("postgresql",
|
'Section {0} not found in the {1} file'.format("import",
|
||||||
"database.ini"))
|
"database.ini"))
|
||||||
|
|
||||||
return db
|
return db
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user