update deps, change config to restore changes, color overdue red in main, in loan color based on state
This commit is contained in:
@@ -12,7 +12,7 @@ docport = 6543
|
||||
|
||||
|
||||
config = Config("config/settings.yaml")
|
||||
_config = config
|
||||
_config = Config("config/settings.yaml")._config
|
||||
# Store original values that might be overridden by CLI
|
||||
|
||||
|
||||
@@ -46,13 +46,6 @@ if changes_made:
|
||||
config.save()
|
||||
|
||||
|
||||
def restore_config():
|
||||
global _config
|
||||
config._config = _config
|
||||
config.save()
|
||||
log.info("Restored configuration")
|
||||
|
||||
atexit.register(restore_config)
|
||||
log = logger
|
||||
log.remove()
|
||||
log.add("logs/application.log", rotation="1 week", compression="zip")
|
||||
@@ -68,4 +61,14 @@ if config.debug:
|
||||
|
||||
log.add(
|
||||
sys.stderr,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def restore_config():
|
||||
log.debug("Restoring configuration")
|
||||
print("Changes made: ", changes_made)
|
||||
if not changes_made:
|
||||
return
|
||||
config._config = _config
|
||||
config.save()
|
||||
log.info("Restored configuration, changed values: {config.get_changes(_config)}")
|
||||
|
||||
Reference in New Issue
Block a user