Skip to content

Commit

Permalink
update read_settings.py and main.py
Browse files Browse the repository at this point in the history
rename debuglevellogfile to debuglevel_logfile and import old settings
  • Loading branch information
elschnorro77 committed Jan 20, 2021
1 parent b2150b1 commit f1f3de5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def main():
fh.setLevel(logging.getLevelName(debuglevel_logfile))
ch.setLevel(logging.getLevelName(debuglevel))
print("Debuglevel: " + logging.getLevelName(debuglevel))
print("debuglevel_logfile: " + logging.getLevelName(debuglevel_logfile))
print("Debuglevel logfile: " + logging.getLevelName(debuglevel_logfile))
time.sleep(5)
if debuglevel <= 10:
debug = True # flag to enable debug mode (HDMI output enabled and no rebooting)
Expand Down
24 changes: 14 additions & 10 deletions read_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,22 @@ def validate_settings(settings):
try:
settings["debuglevel_logfile"]
except:
# Migrate debug to debuglevel
# Migrate debuglevellogfile to debuglevel_logfile
try:
settings["debug"]
if settings["debug"]:
settings["debuglevel_logfile"] = 10
else:
settings["debuglevel_logfile"] = get_defaults()["debuglevel_logfile"]
updateSettingsFile = True
#settings.remove("debug")
settings["debuglevel_logfile"] = settings["debuglevellogfile"]
# Migrate debug to debuglevel
except:
settings["debuglevel_logfile"] = get_defaults()["debuglevel_logfile"]
updateSettingsFile = True
try:
settings["debug"]
if settings["debug"]:
settings["debuglevel_logfile"] = 10
else:
settings["debuglevel_logfile"] = get_defaults()["debuglevel_logfile"]
updateSettingsFile = True
#settings.remove("debug")
except:
settings["debuglevel_logfile"] = get_defaults()["debuglevel_logfile"]
updateSettingsFile = True

try:
settings["debuglevel"]
Expand Down

0 comments on commit f1f3de5

Please sign in to comment.