[Reproducible-commits] [diffoscope] 01/01: bin/trydiffoscope: Optionally open URL in web browser

Chris Lamb chris at chris-lamb.co.uk
Tue Aug 2 02:29:27 UTC 2016


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 1676581d51dc36a2c3b5e537dad2c38b4b0a0924
Author: Chris Lamb <lamby at debian.org>
Date:   Mon Aug 1 22:28:22 2016 -0400

    bin/trydiffoscope: Optionally open URL in web browser
---
 bin/trydiffoscope | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/bin/trydiffoscope b/bin/trydiffoscope
index 390e8ec..8d813b9 100755
--- a/bin/trydiffoscope
+++ b/bin/trydiffoscope
@@ -22,6 +22,7 @@ import os
 import sys
 import argparse
 import requests
+import webbrowser
 
 class TryDiffoscope(object):
     def __init__(self, args):
@@ -35,7 +36,12 @@ class TryDiffoscope(object):
 
         response.raise_for_status()
 
-        print(response.json()['url'])
+        url = response.json()['url']
+
+        print(url)
+
+        if self.args.webbrowser:
+            webbrowser.open(url)
 
         return 0
 
@@ -55,6 +61,13 @@ if __name__ == '__main__':
         default='https://try.diffoscope.org/api/v1/compare',
     )
 
+    parser.add_argument(
+        '-w',
+        '--webbrowser',
+        help="Open a web browser after uploading.",
+        action='store_true',
+    )
+
     args = parser.parse_args()
 
     for x in args.file:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git



More information about the Reproducible-commits mailing list