[Pkg-mozext-commits] [adblock-plus] 281/464: Added script to rewrite all necessary Adblock Plus files automatically

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit 00ee10c83cf7d49707a3a7bfcb46a20ecc52bb61
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Fri Aug 24 14:32:57 2012 +0200

    Added script to rewrite all necessary Adblock Plus files automatically
---
 abp_rewrite.py | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/abp_rewrite.py b/abp_rewrite.py
new file mode 100644
index 0000000..fbbcecc
--- /dev/null
+++ b/abp_rewrite.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# coding: utf-8
+
+# This Source Code is subject to the terms of the Mozilla Public License
+# version 2.0 (the "License"). You can obtain a copy of the License at
+# http://mozilla.org/MPL/2.0/.
+
+import sys, os, subprocess
+
+def doRewrite():
+  if len(sys.argv) < 3:
+    print '''Usage:
+
+%s <abp_firefox_dir> <abp_chrome_dir>
+''' % sys.argv[0]
+    sys.exit(2)
+
+  sourceDir = sys.argv[1]
+  targetDir = sys.argv[2]
+
+  basedir = os.path.dirname(sys.argv[0])
+  if not basedir:
+    basedir = '.'
+
+  if os.name == 'nt':
+    application = os.path.join(basedir, 'jshydra.exe')
+  else:
+    application = os.path.join(basedir, 'jshydra')
+  command = [application, os.path.join(basedir, 'scripts', 'abprewrite.js'), '--trueast', '--arg', 'module=true']
+  for module in ('filterNotifier', 'filterClasses', 'subscriptionClasses', 'filterStorage', 'elemHide', 'matcher', 'filterListener', 'synchronizer'):
+    sourceFile = os.path.join(sourceDir, 'lib', module + '.js')
+    if not os.path.exists(sourceFile):
+      print 'Source file %s could not be found' % sourceFile
+      sys.exit(2)
+    command.append(sourceFile)
+
+  out = open(os.path.join(targetDir, 'lib', 'adblockplus.js'), 'wb')
+  subprocess.Popen(command, stdout=out).communicate()
+
+if __name__ == '__main__':
+  doRewrite()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list