[Pkg-anonymity-tools] [torbrowser-launcher] 13/23: switched to using argparse to parse arguements, and made settings open with "--settings" instead of "-settings"

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 013584d9e63f116ecd7de69116ccd6c2cb4a5c9c
Author: Micah Lee <micah at micahflee.com>
Date:   Mon Nov 24 22:39:56 2014 -0800

    switched to using argparse to parse arguements, and made settings open with "--settings" instead of "-settings"
---
 share/applications/torbrowser-settings.desktop |  2 +-
 torbrowser_launcher/__init__.py                | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/share/applications/torbrowser-settings.desktop b/share/applications/torbrowser-settings.desktop
index cadf71b..3157823 100644
--- a/share/applications/torbrowser-settings.desktop
+++ b/share/applications/torbrowser-settings.desktop
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Name=Tor Browser Settings
 Comment=Tor Browser Launcher Settings
-Exec=/usr/bin/torbrowser-launcher -settings
+Exec=/usr/bin/torbrowser-launcher --settings
 Terminal=false
 Type=Application
 Icon=/usr/share/pixmaps/torbrowser80.xpm
diff --git a/torbrowser_launcher/__init__.py b/torbrowser_launcher/__init__.py
index efcaedc..224ace8 100644
--- a/torbrowser_launcher/__init__.py
+++ b/torbrowser_launcher/__init__.py
@@ -26,13 +26,21 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 """
 
-import os, sys
+import os, sys, argparse
 
 from common import Common, SHARE
 from settings import Settings
 from launcher import Launcher
 
 def main():
+    # parse arguments
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--settings', action='store_true', dest='settings', help='Open Tor Browser Launcher settings')
+    args = parser.parse_args()
+
+    settings = bool(args.settings)
+
+    # load the version and print the banner
     with open(os.path.join(SHARE, 'version')) as buf:
         tor_browser_launcher_version = buf.read().strip()
 
@@ -50,7 +58,9 @@ def main():
         common.bring_window_to_front(tbl_pid)
         sys.exit()
 
-    if '-settings' in sys.argv:
+
+
+    if settings:
         # settings mode
         app = Settings(common)
 

-- 
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