refactory old scripts
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user