diff options
author | Ben Sturmfels <ben@sturm.com.au> | 2021-03-05 23:12:19 +1100 |
---|---|---|
committer | Ben Sturmfels <ben@sturm.com.au> | 2021-03-05 23:12:19 +1100 |
commit | dec47c7102cf0aa3a4debf002928db8e460c0d71 (patch) | |
tree | 47631fc15c7af172aa699506adf3d76d3a71976c /mediagoblin/processing/task.py | |
parent | 5f3a782fef4855e10b7259624a14d8afb0f7be93 (diff) | |
download | mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.lz mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.xz mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.zip |
Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.
Diffstat (limited to 'mediagoblin/processing/task.py')
-rw-r--r-- | mediagoblin/processing/task.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mediagoblin/processing/task.py b/mediagoblin/processing/task.py index bedfd32d..c62293e8 100644 --- a/mediagoblin/processing/task.py +++ b/mediagoblin/processing/task.py @@ -38,7 +38,7 @@ def handle_push_urls(feed_url): Retry 3 times every 2 minutes if run in separate process before failing.""" if not mgg.app_config["push_urls"]: return # Nothing to do - _log.debug('Notifying Push servers for feed {0}'.format(feed_url)) + _log.debug('Notifying Push servers for feed {}'.format(feed_url)) hubparameters = { 'hub.mode': 'publish', 'hub.url': feed_url} @@ -57,7 +57,7 @@ def handle_push_urls(feed_url): return handle_push_urls.retry(exc=exc, throw=False) except Exception as e: # All retries failed, Failure is no tragedy here, probably. - _log.warn('Failed to notify PuSH server for feed {0}. ' + _log.warn('Failed to notify PuSH server for feed {}. ' 'Giving up.'.format(feed_url)) return False @@ -95,18 +95,18 @@ class ProcessMedia(celery.Task): with processor_class(manager, entry) as processor: # Initial state change has to be here because # the entry.state gets recorded on processor_class init - entry.state = u'processing' + entry.state = 'processing' entry.save() - _log.debug('Processing {0}'.format(entry)) + _log.debug('Processing {}'.format(entry)) try: processor.process(**reprocess_info) except Exception as exc: if processor.entry_orig_state == 'processed': _log.error( - 'Entry {0} failed to process due to the following' - ' error: {1}'.format(entry.id, exc)) + 'Entry {} failed to process due to the following' + ' error: {}'.format(entry.id, exc)) _log.info( 'Setting entry.state back to "processed"') pass @@ -115,7 +115,7 @@ class ProcessMedia(celery.Task): # We set the state to processed and save the entry here so there's # no need to save at the end of the processing stage, probably ;) - entry.state = u'processed' + entry.state = 'processed' entry.save() # Notify the PuSH servers as async task @@ -130,7 +130,7 @@ class ProcessMedia(celery.Task): except ImportError as exc: _log.error( - 'Entry {0} failed to process due to an import error: {1}'\ + 'Entry {} failed to process due to an import error: {}'\ .format( entry.title, exc)) @@ -140,7 +140,7 @@ class ProcessMedia(celery.Task): except Exception as exc: _log.error('An unhandled exception was raised while' - + ' processing {0}'.format( + + ' processing {}'.format( entry)) mark_entry_failed(entry.id, exc) |