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