diff --git a/ipwb/replay.py b/ipwb/replay.py index 115cee24..b7a7a0e1 100755 --- a/ipwb/replay.py +++ b/ipwb/replay.py @@ -110,10 +110,10 @@ def upload_file(): # TODO: Check if semaphore lock exists, log it if so, wait for the lock # to be released, and create a new lock - print('Indexing file from uploaded WARC at {0} to {1}'.format( - warcPath, app.cdxjFilePath)) + print((f'Indexing file from uploaded WARC at' + f'{warcPath} to {app.cdxjFilePath}')) indexer.indexFileAt(warcPath, outfile=app.cdxjFilePath) - print('Index updated at {0}'.format(app.cdxjFilePath)) + print(f'Index updated at {app.cdxjFilePath}') # TODO: Release semaphore lock resp.location = request.referrer @@ -181,26 +181,25 @@ def showMementosForURIRs(urir): indexPath = ipwbUtils.getIPWBReplayIndexPath() - print('Getting CDXJ Lines with the URI-R {0} from {1}' - .format(urir, indexPath)) + print(f'Getting CDXJ lines with the URI-R {urir} from {indexPath}') cdxjLinesWithURIR = getCDXJLinesWithURIR(urir, indexPath) if len(cdxjLinesWithURIR) == 1: fields = cdxjLinesWithURIR[0].split(' ', 2) - redirectURI = '/memento/{1}/{0}'.format(unsurt(fields[0]), fields[1]) + redirectURI = f'/memento/{fields[1]}/{unsurt(fields[0])}' return redirect(redirectURI, code=302) msg = '' if cdxjLinesWithURIR: - msg += '

{0} capture(s) available: