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

Delta Between Two Patch Sets: packagerChrome.py

Issue 11544056: Prepared buildtools for Safari (Closed)
Left Patch Set: Addressed comments Created Oct. 30, 2013, 5:22 p.m.
Right Patch Set: Created Oct. 31, 2013, 3:40 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « packager.py ('k') | packagerGecko.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus build tools, 3 # This file is part of the Adblock Plus build tools,
4 # Copyright (C) 2006-2013 Eyeo GmbH 4 # Copyright (C) 2006-2013 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 'pt': 'pt_PT', 272 'pt': 'pt_PT',
273 } 273 }
274 for chromeLocale, operaLocale in operaMapping.iteritems(): 274 for chromeLocale, operaLocale in operaMapping.iteritems():
275 chromeFile = '_locales/%s/messages.json' % chromeLocale 275 chromeFile = '_locales/%s/messages.json' % chromeLocale
276 operaFile = '_locales/%s/messages.json' % operaLocale if operaLocale != No ne else None 276 operaFile = '_locales/%s/messages.json' % operaLocale if operaLocale != No ne else None
277 if chromeFile in files: 277 if chromeFile in files:
278 if operaFile != None: 278 if operaFile != None:
279 files[operaFile] = files[chromeFile] 279 files[operaFile] = files[chromeFile]
280 del files[chromeFile] 280 del files[chromeFile]
281 281
282 if params['type'] in ('opera', 'safari'):
283 # Hack: Replace "Chrome" by "Opera" or "Safari" in the locales
284 for path, data in files.iteritems():
285 if path.startswith("_locales/") and path.endswith("/messages.json"):
286 # Hack: There is exactly one text (in the first run page) that contains
287 # "Google Chrome" and means Google Chrome, even though it is only shown
288 # on Safari.
289 files[path] = re.sub(r"\b(?<!Google )Chrome\b", params['type'].capitaliz e(), data)
290
291 def signBinary(zipdata, keyFile): 282 def signBinary(zipdata, keyFile):
292 import M2Crypto 283 import M2Crypto
293 if not os.path.exists(keyFile): 284 if not os.path.exists(keyFile):
294 M2Crypto.RSA.gen_key(1024, 65537, callback=lambda x: None).save_key(keyFile, cipher=None) 285 M2Crypto.RSA.gen_key(1024, 65537, callback=lambda x: None).save_key(keyFile, cipher=None)
295 key = M2Crypto.EVP.load_key(keyFile) 286 key = M2Crypto.EVP.load_key(keyFile)
296 key.sign_init() 287 key.sign_init()
297 key.sign_update(zipdata) 288 key.sign_update(zipdata)
298 return key.final() 289 return key.final()
299 290
300 def getPublicKey(keyFile): 291 def getPublicKey(keyFile):
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 def shutdown_server(server): 384 def shutdown_server(server):
394 time.sleep(10) 385 time.sleep(10)
395 server.shutdown() 386 server.shutdown()
396 thread.start_new_thread(shutdown_server, (server,)) 387 thread.start_new_thread(shutdown_server, (server,))
397 server.serve_forever() 388 server.serve_forever()
398 389
399 if connections[0] == 0: 390 if connections[0] == 0:
400 print 'Warning: No incoming connections, extension probably not active in th e browser yet' 391 print 'Warning: No incoming connections, extension probably not active in th e browser yet'
401 else: 392 else:
402 print 'Handled %i connection(s)' % connections[0] 393 print 'Handled %i connection(s)' % connections[0]
LEFTRIGHT

Powered by Google App Engine
This is Rietveld