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()
print >> sys.stderr, 'This source does not appear to exist in Ubuntu'
sys.exit(1)
-m = re.search('"/ubuntu/%s/\+source/%s/(\d[^"]+)"' % (release, package), page)
+m = re.search('"/ubuntu/%s/\+source/%s/(\d[^"]+)"' % (release, package.replace('+', '\+')), page)
if not m:
print >> sys.stderr, 'Cannot find this source package in this release'
sys.exit(1)
url = page.geturl()
page = page.read()
for m in re.finditer('"/ubuntu/\+source/%s/%s(/\+build/\d+)"[^\n]+\n\s*(\w+).*?<span>(\w+)</span>.*?</a>\s*([^\n]+)\n' %
- (package, version.replace('+', '\+')), page, re.S):
+ (package.replace('+', '\+'), version.replace('+', '\+')), page, re.S):
if m.group(2) == release:
print '%s: %s' % (m.group(3), m.group(4))
buildstats[url + m.group(1)] = [m.group(3).strip(), m.group(4).strip()]