From 6fab49d52e6e9812c9250a59e5352332a04a3761 Mon Sep 17 00:00:00 2001 From: rscmbbng Date: Sat, 7 Sep 2013 20:38:27 +0200 Subject: [PATCH] adding a browser version for debug mode --- main.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index d2471a7..eef1ce9 100644 --- a/main.py +++ b/main.py @@ -34,6 +34,7 @@ class bc(object): """ self.browser = "" # "F" Firefox / "C" Chrome self.browser_path = "" + self.browser_version = "" self.url = "" self.old_url = "" @@ -132,10 +133,24 @@ class bc(object): elif os.path.exists(chromium_lin): self.browser = "CHROMIUM" self.browser_path = chromium_lin + print "Browser Options:\n" + '='*45 + "\n" - print "On use:", self.browser, "\n" - print "Version:", "\n" - print "History path:", self.browser_path, "\n" + if self.browser == "F": + print "Browser used: Firefox \n" + self.browser_path = subprocess.check_output(['/Applications/Firefox.app/Contents/MacOS/firefox', '--version']).strip('\n') + elif self.browser == "C": + print "Browser used: Chrome \n" + self.browser_version = subprocess.check_output(['/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', '--version']).strip('\n') + elif self.browser == "CHROMIUM": + print "Browser used: Chromium \n" + self.browser_version = subprocess.check_output(['/Applications/Chromium.app/Contents/MacOS/Chromium', '--version']).strip('\n') + elif self.browser == "S": + print "Browser used: Safari \n" + if options.debug == True: + print "Version:", self.browser_version, "\n" + print "History:", self.browser_path, "\n" + + #move the subprocesses to debug mode def getURL(self): """