diff options
author | Ben Sturmfels <ben@sturm.com.au> | 2021-09-23 11:51:04 +1000 |
---|---|---|
committer | Ben Sturmfels <ben@sturm.com.au> | 2021-09-23 11:51:04 +1000 |
commit | 6f48143f4c60c555b3f571007cdc929ce90920b1 (patch) | |
tree | 2a2333a365379d4c4c42faf79bcd9db20aaa8626 /mediagoblin/gmg_commands | |
parent | f90707e22c0380bd0f17e2e724e58ecf91abd5a3 (diff) | |
download | mediagoblin-6f48143f4c60c555b3f571007cdc929ce90920b1.tar.lz mediagoblin-6f48143f4c60c555b3f571007cdc929ce90920b1.tar.xz mediagoblin-6f48143f4c60c555b3f571007cdc929ce90920b1.zip |
Apply pyupgrade --py36-plus.
This removes some 'u' prefixes and converts simple format() calls to f-strings.
Diffstat (limited to 'mediagoblin/gmg_commands')
-rw-r--r-- | mediagoblin/gmg_commands/alembic_commands.py | 2 | ||||
-rw-r--r-- | mediagoblin/gmg_commands/dbupdate.py | 4 | ||||
-rw-r--r-- | mediagoblin/gmg_commands/reprocess.py | 10 |
3 files changed, 8 insertions, 8 deletions
diff --git a/mediagoblin/gmg_commands/alembic_commands.py b/mediagoblin/gmg_commands/alembic_commands.py index f5f982d1..0b22bce6 100644 --- a/mediagoblin/gmg_commands/alembic_commands.py +++ b/mediagoblin/gmg_commands/alembic_commands.py @@ -35,7 +35,7 @@ class FudgedCommandLine(config.CommandLine): plugins = global_config.get('plugins', {}).keys() for plugin in plugins: try: - import_component('{}.models:MODELS'.format(plugin)) + import_component(f'{plugin}.models:MODELS') except ImportError: # It doesn't really matter if there's no models to import # here. diff --git a/mediagoblin/gmg_commands/dbupdate.py b/mediagoblin/gmg_commands/dbupdate.py index c62de91e..c802b374 100644 --- a/mediagoblin/gmg_commands/dbupdate.py +++ b/mediagoblin/gmg_commands/dbupdate.py @@ -67,7 +67,7 @@ def gather_database_data(plugins): for plugin in plugins: try: - models = import_component('{}.models:MODELS'.format(plugin)) + models = import_component(f'{plugin}.models:MODELS') except ImportError as exc: _log.debug('No models found for {}: {}'.format( plugin, @@ -115,7 +115,7 @@ def run_foundations(db, global_config): for plugin in plugins: try: foundations = import_component( - '{}.models:FOUNDATIONS'.format(plugin)) + f'{plugin}.models:FOUNDATIONS') all_foundations.append((plugin, foundations)) except ImportError as exc: continue diff --git a/mediagoblin/gmg_commands/reprocess.py b/mediagoblin/gmg_commands/reprocess.py index b2a69819..b2ed62fe 100644 --- a/mediagoblin/gmg_commands/reprocess.py +++ b/mediagoblin/gmg_commands/reprocess.py @@ -145,7 +145,7 @@ def available(args): manager = get_processing_manager_for_type(media_type) except ProcessingManagerDoesNotExist: entry = MediaEntry.query.filter_by(id=args.id_or_type).first() - print('No such processing manager for {}'.format(entry.media_type)) + print(f'No such processing manager for {entry.media_type}') if args.state: processors = manager.list_all_processors_by_state(args.state) @@ -170,7 +170,7 @@ def available(args): else: for processor in processors: if processor.description: - print(" - {}: {}".format(processor.name, processor.description)) + print(f" - {processor.name}: {processor.description}") else: print(" - %s" % processor.name) @@ -205,7 +205,7 @@ def run(args, media_id=None): except ProcessingManagerDoesNotExist: entry = MediaEntry.query.filter_by(id=media_id).first() - print('No such processing manager for {}'.format(entry.media_type)) + print(f'No such processing manager for {entry.media_type}') def bulk_run(args): @@ -262,7 +262,7 @@ def thumbs(args): reprocess_info=reprocess_request) except ProcessingManagerDoesNotExist: - print('No such processing manager for {}'.format(entry.media_type)) + print(f'No such processing manager for {entry.media_type}') def initial(args): @@ -278,7 +278,7 @@ def initial(args): media_entry, reprocess_action='initial') except ProcessingManagerDoesNotExist: - print('No such processing manager for {}'.format(entry.media_type)) + print(f'No such processing manager for {entry.media_type}') def reprocess(args): |