From 804b4750abda8de550b6fe94ca179c7b6700672f Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 4 Feb 2016 21:18:15 +0100 Subject: [PATCH] pdfjs: use list of tuples instead of dictionary Even though the dict seemed to be fine, this gives us a predictable replacement order and helps with debugging in the future. --- qutebrowser/browser/pdfjs.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/qutebrowser/browser/pdfjs.py b/qutebrowser/browser/pdfjs.py index aeb6435af..e6f6098e0 100644 --- a/qutebrowser/browser/pdfjs.py +++ b/qutebrowser/browser/pdfjs.py @@ -77,21 +77,21 @@ def fix_urls(asset): Args: asset: js file or html page as string. """ - new_urls = { - 'viewer.css': 'qute://pdfjs/web/viewer.css', - 'compatibility.js': 'qute://pdfjs/web/compatibility.js', - 'locale/locale.properties': - 'qute://pdfjs/web/locale/locale.properties', - 'l10n.js': 'qute://pdfjs/web/l10n.js', - '../build/pdf.js': 'qute://pdfjs/build/pdf.js', - 'debugger.js': 'qute://pdfjs/web/debugger.js', - 'viewer.js': 'qute://pdfjs/web/viewer.js', - 'compressed.tracemonkey-pldi-09.pdf': '', - './images/': 'qute://pdfjs/web/images/', - '../build/pdf.worker.js': 'qute://pdfjs/build/pdf.worker.js', - '../web/cmaps/': 'qute://pdfjs/web/cmaps/', - } - for original, new in new_urls.items(): + new_urls = [ + ('viewer.css', 'qute://pdfjs/web/viewer.css'), + ('compatibility.js', 'qute://pdfjs/web/compatibility.js'), + ('locale/locale.properties', + 'qute,//pdfjs/web/locale/locale.properties'), + ('l10n.js', 'qute://pdfjs/web/l10n.js'), + ('../build/pdf.js', 'qute://pdfjs/build/pdf.js'), + ('debugger.js', 'qute://pdfjs/web/debugger.js'), + ('viewer.js', 'qute://pdfjs/web/viewer.js'), + ('compressed.tracemonkey-pldi-09.pdf', ''), + ('./images/', 'qute://pdfjs/web/images/'), + ('../build/pdf.worker.js', 'qute://pdfjs/build/pdf.worker.js'), + ('../web/cmaps/', 'qute://pdfjs/web/cmaps/'), + ] + for original, new in new_urls: asset = asset.replace(original, new) return asset