some updates and fixes

Didn't get around to it in my previous attempt, so doing it now.
 - updated deprecated .warn() to .warning()
 - unnecessary f-strings
 - imported sys to allow sys.exit calls instead of exit
 - simplified some not checks
 - replaced type with isinstance
 -
This commit is contained in:
Mark Mayo 2023-04-17 12:02:39 +12:00
parent 6896025288
commit 43e9a86394
5 changed files with 25 additions and 24 deletions

View file

@ -121,7 +121,7 @@ def read_config(directory, config_file=C.CONFIG_FILE):
def write_config(directory, config, config_file=C.CONFIG_FILE):
if type(config) is not list and 'repos' not in config:
if not isinstance(config, list) and 'repos' not in config:
assert isinstance(config, dict), config
config = {'repos': [config]}
with open(os.path.join(directory, config_file), 'w') as outfile: