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.
This commit is contained in:
parent
da4f69cf72
commit
804b4750ab
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user