[Pkg-privacy-commits] [torbrowser-launcher] 30/48: you can pass URLs into torbrowser-launcher now (#103)

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:22:18 UTC 2015


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

infinity0 pushed a commit to branch master
in repository torbrowser-launcher.

commit ecad826f2a832163305648c7d5e687abb3a589fb
Author: Micah Lee <micah at micahflee.com>
Date:   Mon Nov 24 22:53:05 2014 -0800

    you can pass URLs into torbrowser-launcher now (#103)
---
 torbrowser_launcher/__init__.py | 6 +++---
 torbrowser_launcher/launcher.py | 8 ++++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/torbrowser_launcher/__init__.py b/torbrowser_launcher/__init__.py
index 224ace8..5807117 100644
--- a/torbrowser_launcher/__init__.py
+++ b/torbrowser_launcher/__init__.py
@@ -36,9 +36,11 @@ def main():
     # parse arguments
     parser = argparse.ArgumentParser()
     parser.add_argument('--settings', action='store_true', dest='settings', help='Open Tor Browser Launcher settings')
+    parser.add_argument('url', nargs='*', help='URL to load')
     args = parser.parse_args()
 
     settings = bool(args.settings)
+    url_list = args.url
 
     # load the version and print the banner
     with open(os.path.join(SHARE, 'version')) as buf:
@@ -58,15 +60,13 @@ def main():
         common.bring_window_to_front(tbl_pid)
         sys.exit()
 
-
-
     if settings:
         # settings mode
         app = Settings(common)
 
     else:
         # launcher mode
-        app = Launcher(common)
+        app = Launcher(common, url_list)
 
 if __name__ == "__main__":
     main()
diff --git a/torbrowser_launcher/launcher.py b/torbrowser_launcher/launcher.py
index cca60cd..284f224 100644
--- a/torbrowser_launcher/launcher.py
+++ b/torbrowser_launcher/launcher.py
@@ -63,9 +63,10 @@ class VerifyTorProjectCert(ClientContextFactory):
         return cert.digest('sha256') == self.torproject_ca.digest('sha256')
 
 class Launcher:
-    def __init__(self, common):
+    def __init__(self, common, url_list):
         print _('Starting launcher dialog')
         self.common = common
+        self.url_list = url_list
 
         # init launcher
         self.set_gui(None, '', [])
@@ -633,7 +634,10 @@ class Launcher:
                 gtk.main_iteration_do(True)
 
         # run Tor Browser
-        subprocess.call([self.common.paths['tbb']['start']])
+        if len(self.url_list) == 0:
+            subprocess.call([self.common.paths['tbb']['start']])
+        else:
+            subprocess.call([self.common.paths['tbb']['start'], '-allow-remote'] + self.url_list)
 
         if run_next_task:
             self.run_task()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list