Skip to content

Commit

Permalink
Config model refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Евгений Грозных authored and Евгений Грозных committed Sep 23, 2020
1 parent 92c2822 commit 33fd1eb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cfg/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from models.logger import createLogFilesDirIfNotExists, logFileNotFoundErrorAndReraise



def getConfigAsJson():
try:
createLogFilesDirIfNotExists()
Expand All @@ -13,5 +14,13 @@ def getConfigAsJson():
except FileNotFoundError as exc:
logFileNotFoundErrorAndReraise()

def getGlobalValuesFromJsonConfig(json_config):
def getGlobalConfigSettingsNames(json_config):
return [setting_name for setting_name in json_config.keys()]

def getGlobalConfigValues(json_config):
return [config_value for config_value in json_config.values()]

def representConfigValuesAsDict(config_settings_names, config_values):
return { k:v for k in config_settings_names for v in global_config_values }


0 comments on commit 33fd1eb

Please sign in to comment.