[Pkg-anonymity-tools] [torbrowser-launcher] 14/23: you can pass URLs into torbrowser-launcher now (#103)

Ulrike Uhlig u-guest at moszumanska.debian.org
Mon Dec 1 21:16:48 UTC 2014


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

u-guest pushed a commit to branch debian
in repository torbrowser-launcher.

commit 028bc225ace555adc3314fa95751d29659a14778
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/collab-maint/torbrowser-launcher.git



More information about the Pkg-anonymity-tools mailing list