app.logger.info("Config directory didn't exist, created directory: {}".format(config_dir))
logger.info("Config directory didn't exist, created directory: {}".format(config_dir))
exceptPermissionErrorase:
app.logger.error("Error: Not sufficient permissions to create config directory at {} (Running {} as user {})".format(config_dir,application_name,getpass.getuser()))
app.logger.error("Consider creating {} manually with write permissions for {}. After initial write of default config.toml on the first run {} won't write that file ever again".format(config_dir,getpass.getuser(),application_name),file=sys.stderr)
logger.error("Error: Not sufficient permissions to create config directory at {} (Running {} as user {})".format(config_dir,application_name,getpass.getuser()))
logger.error("Consider creating {} manually with write permissions for {}. After initial write of default config.toml on the first run {} won't write that file ever again".format(config_dir,getpass.getuser(),application_name),file=sys.stderr)
exit(1)
exceptFileExistsErrorase:
app.logger.debug("Config dir at {} already existed".format(config_dir))
logger.debug("Config dir at {} already existed".format(config_dir))
# Create a default config if it does exist
ifnotPath.is_file(Path(config_path)):
try:
app.logger.debug("Attempting to write default config to {}".format(config_path))
logger.debug("Attempting to write default config to {}".format(config_path))
write_config(config_path,default_strconfig)
app.logger.info("Created new default config.toml at:\n{}".format(config_path))
logger.info("Created new default config.toml at:\n{}".format(config_path))
config=default_config
exceptPermissionErrorase:
logging.error("Error: Not sufficient permissions to write default config.toml into directory {} (as user {})".format(config_dir,getpass.getuser()))
logging.error("Consider changing permissions on {} manually so writing is allowed for user {}. After initial write of default config.toml on the first run {} won't write that file ever again. so you can make it read only for {} after that".format(config_dir,getpass.getuser(),application_name,getpass.getuser()))
logger.error("Error: Not sufficient permissions to write default config.toml into directory {} (as user {})".format(config_dir,getpass.getuser()))
logger.error("Consider changing permissions on {} manually so writing is allowed for user {}. After initial write of default config.toml on the first run {} won't write that file ever again. so you can make it read only for {} after that".format(config_dir,getpass.getuser(),application_name,getpass.getuser()))
app.logger.error("Error: there are keys missing in the config. Delete to let {} create a new one, or add the missing keys manually".format(application_name))
logger.error("Error: there are keys missing in the config. Delete to let {} create a new one, or add the missing keys manually".format(application_name))