logger.critical("The loglevel \"{}\" set in config.toml is invalid use one of the following: \"Debug\", \"Info\", \"Warning\", \"Error\" or \"Critical\"".format(config["application"]["loglevel"]))
exit(1)
returnlogger
defmain():
defmain():
"""
"""
Gets run only if config.py is called directly or via `poetry run config`
Gets run only if config.py is called directly or via `poetry run config`
print("Error: Didn't have the permissions to create the config directory at {}".format(selection["path"]),file=sys.stderr)
print("Hint: Change the owner of the directory temporarily to {} or run {} config create with more permissions".format(getpass.getuser(),APPLICATION_NAME))
# If the 00-config.toml already exists, ask whether it shall be moved to 00-config.toml.old
# If the 00-config.toml already exists, ask whether it shall be moved to 00-config.toml.old
ifconfig_path.is_file():
ifconfig_path.is_file():
...
@@ -427,7 +460,7 @@ def create_config():
...
@@ -427,7 +460,7 @@ def create_config():
exceptPermissionErrorase:
exceptPermissionErrorase:
print()
print()
print("Error: Didn't have the permissions to write the file to {}".format(config_path),file=sys.stderr)
print("Error: Didn't have the permissions to write the file to {}".format(config_path),file=sys.stderr)
print(" Directory \"{}\" belongs to user {} (was running as user {})".format(selection,selection.owner(),getpass.getuser()),file=sys.stderr)
print(" Directory \"{}\" belongs to user {} (was running as user {})".format(selection["path"],selection["path"].owner(),getpass.getuser()),file=sys.stderr)
print()
print()
print("Hint: Change the owner of the directory temporarily to {} or run {} config create with more permissions".format(getpass.getuser(),APPLICATION_NAME))
print("Hint: Change the owner of the directory temporarily to {} or run {} config create with more permissions".format(getpass.getuser(),APPLICATION_NAME))