From 27797f35a3c5921c5d249ce2fae0299bc801ad85 Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Fri, 5 May 2023 14:25:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=BE=D0=B4=D0=B5=D1=80=D0=BD=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BD=D0=B0=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B5=D0=BA=20=D0=91=D0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- database.sample.ini | 9 ++++++++- export.py | 6 +++--- import.py | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/database.sample.ini b/database.sample.ini index cb79ea8..dd8079e 100644 --- a/database.sample.ini +++ b/database.sample.ini @@ -1,6 +1,13 @@ -[postgresql] +[export] host=localhost port=5432 database=ss14 user=ss14_user +password=ss14_password + +[import] +host=localhost +port=6432 +database=ss14 +user=ss14_user password=ss14_password \ No newline at end of file diff --git a/export.py b/export.py index 129099b..c8af5b5 100644 --- a/export.py +++ b/export.py @@ -14,13 +14,13 @@ def read_config() -> dict[str, str]: parser.read("database.ini") db = {} - if parser.has_section("postgresql"): - params = parser.items("postgresql") + if parser.has_section("export"): + params = parser.items("export") for param in params: db[param[0]] = param[1] else: raise ParseConfig( - 'Section {0} not found in the {1} file'.format("postgresql", + 'Section {0} not found in the {1} file'.format("export", "database.ini")) return db diff --git a/import.py b/import.py index d754386..1fd9a62 100644 --- a/import.py +++ b/import.py @@ -18,13 +18,13 @@ def read_config() -> dict[str, str]: parser.read("database.ini") db = {} - if parser.has_section("postgresql"): - params = parser.items("postgresql") + if parser.has_section("import"): + params = parser.items("import") for param in params: db[param[0]] = param[1] else: raise ParseConfig( - 'Section {0} not found in the {1} file'.format("postgresql", + 'Section {0} not found in the {1} file'.format("import", "database.ini")) return db