refactory old scripts

This commit is contained in:
2025-10-11 22:31:54 +02:00
parent 0f91cf1fd4
commit 1cbc619942
23 changed files with 2615 additions and 54 deletions

View File

@@ -1,5 +1,6 @@
from configparser import ConfigParser
def read_db_config(filename='../env/config.ini', section='mysql'):
parser = ConfigParser()
parser.read(filename)
@@ -10,6 +11,6 @@ def read_db_config(filename='../env/config.ini', section='mysql'):
for item in items:
db[item[0]] = item[1]
else:
raise Exception('{0} not found in the {1} file'.format(section, filename))
raise Exception(f'{section} not found in the {filename} file')
return db