From ebacbe892dde352914404bd1709689104d9e11f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 6 Jan 2021 17:20:49 +0100 Subject: [PATCH] gettoken.py WORKING IN MY GENTOO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- gettoken.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gettoken.py b/gettoken.py index 462e131..6bb1b14 100755 --- a/gettoken.py +++ b/gettoken.py @@ -6,8 +6,12 @@ from urllib.parse import parse_qs import sys import requests as r +no_browser = False + if len(sys.argv) > 1 : API_ADDRESS = "http://" + sys.argv[1] + ":1285" + if (sys.argv[1] == "no-browser" or sys.argv[2] == "no-browser"): + no_browser = True else: API_ADDRESS = "http://localhost:1285" @@ -39,5 +43,6 @@ def wait_for_request(server_class=HTTPServer, url = 'https://cas.amu.edu.pl/cas/login?service=http://localhost:' + \ str(PORT) + '&locale=pl' -webbrowser.open_new_tab(url) +if no_browser == False: + webbrowser.open_new_tab(url) wait_for_request()