summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2010-02-17 12:30:24 -0800
committerOwen W. Taylor <otaylor@fishsoup.net>2010-06-05 12:03:59 -0400
commit741cdfb292588d53f8221ac118179e4c71c5bbdd (patch)
treea5dea31fec7afe4202f608a0fdf66f13be85d4a8
parente8544d7b0c67b62596b219a9b83868ff3a52b1f2 (diff)
Added google-chrome as a possible browser
Chromium and Google Chrome have the same basic way of storing cookes, but different config paths. Add a google-chrome browser option with the correct config path for Google Chrome. Based on a patch by Eitan Isaacson <eitan@monotonous.org>
-rwxr-xr-xgit-bz24
1 files changed, 18 insertions, 6 deletions
diff --git a/git-bz b/git-bz
index 6555566..9fa4890 100755
--- a/git-bz
+++ b/git-bz
@@ -505,18 +505,30 @@ def get_bugzilla_cookies_epy(host):
return get_cookies_from_sqlite_xulrunner(host, cookies_sqlite, "Epiphany")
-def get_bugzilla_cookies_chromium(host):
- config_dir = os.path.expanduser('~/.config/chromium/Default')
+# Shared for Chromium and Google Chrome
+def get_bugzilla_cookies_chr(host, browser, config_dir):
+ config_dir = os.path.expanduser(config_dir)
cookies_sqlite = os.path.join(config_dir, "Cookies")
if not os.path.exists(cookies_sqlite):
raise CookieError("%s doesn't exist" % cookies_sqlite)
- return get_cookies_from_sqlite(host, cookies_sqlite, "Chromium",
+ return get_cookies_from_sqlite(host, cookies_sqlite, browser,
"select name,value,path,expires_utc from cookies where host_key = :host",
chromium_time=True)
-browsers = { 'firefox3': get_bugzilla_cookies_ff3,
- 'epiphany': get_bugzilla_cookies_epy,
- 'chromium': get_bugzilla_cookies_chromium }
+def get_bugzilla_cookies_chromium(host):
+ return get_bugzilla_cookies_chromium(host,
+ "Chromium",
+ '~/.config/chromium/Default')
+
+def get_bugzilla_cookies_google_chrome(host):
+ return get_bugzilla_cookies_chromium(host,
+ "Google Chrome",
+ '~/.config/google-chrome/Default')
+
+browsers = { 'firefox3' : get_bugzilla_cookies_ff3,
+ 'epiphany' : get_bugzilla_cookies_epy,
+ 'chromium' : get_bugzilla_cookies_chromium,
+ 'google-chrome': get_bugzilla_cookies_google_chrome }
def browser_list():
return ", ".join(sorted(browsers.keys()))