update code to reflect the new minimum python version 3.7

- update string format method
- remove redundant default arguments from function  calls
- remove unused imports
- remove unicode identifier from strings, it's default in py3 (see: https://stackoverflow.com/a/4182635/12201331)
This commit is contained in:
Peter Pfeufer
2021-10-18 11:59:05 +02:00
parent 2fe1de1c97
commit a6b340c179
199 changed files with 499 additions and 590 deletions

View File

@@ -41,7 +41,7 @@ def create_project(parser, options, args):
# Call the command with extra context
call_command(StartProject(), *args, **command_options)
print("Success! %(project_name)s has been created." % {'project_name': args[0]}) # noqa
print(f"Success! {args[0]} has been created.") # noqa
def update_settings(parser, options, args):
@@ -69,10 +69,10 @@ def update_settings(parser, options, args):
template_settings_path = os.path.join(template_path, 'project_name/settings/base.py')
# overwrite the local project's base settings
with open(template_settings_path, 'r') as template, open(settings_path, 'w') as target:
with open(template_settings_path) as template, open(settings_path, 'w') as target:
target.write(template.read())
print("Successfully updated %(project_name)s settings." % {'project_name': project_name})
print(f"Successfully updated {project_name} settings.")
COMMANDS = {