summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xwnpp-query.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/wnpp-query.py b/wnpp-query.py
index 0b7e626..704e282 100755
--- a/wnpp-query.py
+++ b/wnpp-query.py
@@ -28,15 +28,15 @@ if not options.min_days_old and not options.max_days_old or not options.itp and
if not options.min_days_old: options.min_days_old = 0
if not options.max_days_old: options.max_days_old = 9999
-reports = []
-item = []
-
if options.itp: url = urllib2.urlopen('http://www.debian.org/devel/wnpp/being_packaged')
else: url = urllib2.urlopen('http://www.debian.org/devel/wnpp/requested')
+reports = []
+item = []
+
for line in url:
- if re.findall('bugs\.debian\.org', line) \
+ if re.match('^(.*)bugs\.debian\.org(.*)$', line) \
or re.match('^requested(.*)$', line) \
or re.match('^in preparation since(.*)$', line) \
or re.match('^(.*)days in preparation\.$', line):
@@ -44,19 +44,20 @@ for line in url:
if re.match('^\<ul\>(.*),', line) \
or re.match ('^ \<li\>\<a href(.*)\</a\>,', line):
- link = re.sub('<ul>', '', line).strip()
+ line = line.strip()
+
+ link = re.sub('<ul>', '', line)
link = line[14:43]
item.append(link)
- name = re.sub('<ul>', '', line).strip()
+ name = re.sub('<ul>', '', line)
name = name[44:]
name = name.split(':', 1)[0]
item.append(name)
if options.description:
- description = line.strip()
try:
- description = re.sub('</a>,', '', description)
+ description = re.sub('</a>,', '', line)
description = ' (' + description.split(':')[2] + ')'
except:
description = ''