]> piware.de Git - bin.git/commitdiff
buildd.py: prefer ~/.lpcookie
authorMartin Pitt <martin.pitt@canonical.com>
Sat, 16 Feb 2008 12:41:26 +0000 (13:41 +0100)
committerMartin Pitt <martin.pitt@canonical.com>
Sat, 16 Feb 2008 12:41:26 +0000 (13:41 +0100)
buildd.py

index 598d8d13c20a19ffcf9a408723e72218ff9d7462..766fb49e5643fbfd9f81e340c432bccbbb6a6a07 100755 (executable)
--- a/buildd.py
+++ b/buildd.py
@@ -17,11 +17,13 @@ operation: status | retry | rescore [priority (default 5000)]''' % sys.argv[0]
     sys.exit(1)
 
 # find cookie file
-try:
-    cookiefile = glob.glob(os.path.expanduser('~/.mozilla/*/*/cookies.txt'))[0]
-except IndexError:
-    print >> sys.stderr, 'Could not find Firefox cookie file'
-    sys.exit(1)
+cookiefile = os.path.expanduser('~/.lpcookie')
+if not os.path.exists(cookiefile):
+    try:
+        cookiefile = glob.glob(os.path.expanduser('~/.mozilla/*/*/cookies.txt'))[0]
+    except IndexError:
+        print >> sys.stderr, 'Could not find Firefox cookie file'
+        sys.exit(1)
 
 # build HTML opener with cookie file
 cj = cookielib.MozillaCookieJar()