Lot of cleanups

This commit is contained in:
Johannes Findeisen 2021-12-27 04:24:33 +01:00
commit 05b056a30c
2 changed files with 11 additions and 9 deletions

View file

@ -110,9 +110,9 @@ if __name__ == "__main__":
with open(config_path, 'r') as configfile:
config_data = configfile.read()
config = json.loads(config_data)
except "OSError, PermissionDenied, RuntimeError, ValueError" as err:
except Exception as err:
# TODO: Replace all lines like this with generic Python logging
print(str("Uplink: Configuration Error!" + err))
print(str("Uplink: Configuration Error!" + str(err)))
sys.exit(1)
try:
@ -141,8 +141,7 @@ if __name__ == "__main__":
time.sleep(config["interval"])
except KeyboardInterrupt as err:
print(str("uplink: program terminated by user!"))
exit(0)
sys.exit(0)
else:
print("uplink: error: no run mode selected; use --cron (-c), --daemon (-d) or --foreground (-f) to run uplink. "
"use --help for more information")
print("uplink: error: no run mode selected; use --cron (-c), --daemon (-d) or "
"--foreground (-f) to run uplink. use --help for more information")