Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: packagerSafari.py

Issue 29420565: Noissue - Remove some dead code (Closed) Base URL: https://hg.adblockplus.org/buildtools
Patch Set: Created April 24, 2017, 9:43 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « localeTools.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerSafari.py
===================================================================
--- a/packagerSafari.py
+++ b/packagerSafari.py
@@ -95,26 +95,16 @@ def createManifest(params, files):
).encode('utf-8')
def createInfoModule(params):
template = getTemplate('safariInfo.js.tmpl')
return template.render(params).encode('utf-8')
-def fixAbsoluteUrls(files):
- for filename, content in files.iteritems():
- if os.path.splitext(filename)[1].lower() == '.html':
- files[filename] = re.sub(
- r'(<[^<>]*?\b(?:href|src)\s*=\s*["\']?)\/+',
- r'\1' + '/'.join(['..'] * filename.count('/') + ['']),
- content, re.S | re.I
- )
-
-
def _get_sequence(data):
from Crypto.Util import asn1
sequence = asn1.DerSequence()
sequence.decode(data)
return sequence
def get_developer_identifier(certs):
@@ -175,18 +165,16 @@ def createBuild(baseDir, type, outFile=N
certs, key = xarfile.read_certificates_and_key(keyFile)
params['developerIdentifier'] = get_developer_identifier(certs)
files['lib/info.js'] = createInfoModule(params)
files['background.html'] = createScriptPage(params, 'background.html.tmpl',
('general', 'backgroundScripts'))
files['Info.plist'] = createManifest(params, files)
- fixAbsoluteUrls(files)
-
dirname = metadata.get('general', 'basename') + '.safariextension'
for filename in files.keys():
files[os.path.join(dirname, filename)] = files.pop(filename)
if not devenv and keyFile:
from buildtools import xarfile
xarfile.create(outFile, files, keyFile)
else:
« no previous file with comments | « localeTools.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld