summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xwnpp-query.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/wnpp-query.py b/wnpp-query.py
index 75e61a8..9b0900f 100755
--- a/wnpp-query.py
+++ b/wnpp-query.py
@@ -34,9 +34,14 @@ else: url = urllib2.urlopen('http://www.debian.org/devel/wnpp/requeste
reports = []
item = []
-line_match = re.compile('(^(.*)bugs\.debian\.org(.*)$|^requested(.*)$|^in preparation since(.*)$|^(.*)days in preparation\.$)')
-line_match_desc = re.compile('(^\<ul\>(.*),|^ \<li\>\<a href(.*)\</a\>,)')
-line_match_age = re.compile('(^requested(.*)$|^(.*)days in preparation(.*)$|^in preparation since(.*)$)')
+line_match = re.compile('(^(.*)bugs\.debian\.org(.*)$|^requested(.*)$|^in preparation since(.*)$|^(.*)days in preparation\.$)')
+line_match_desc = re.compile('(^\<ul\>(.*),|^ \<li\>\<a href(.*)\</a\>,)')
+line_match_age = re.compile('(^requested(.*)$|^(.*)days in preparation(.*)$|^in preparation since(.*)$)')
+
+req_today = re.compile('^requested today\.$')
+req_yesterday = re.compile('^requested yesterday\.$')
+in_prep_today = re.compile('^in preparation since today\.$')
+in_prep_yesterday = re.compile('^in preparation since yesterday\.$)
for line in url:
if re.match(line_match, line):
@@ -64,12 +69,12 @@ for line in url:
if re.match(line_match_age, line):
if options.itp:
- if re.match('^in preparation since yesterday\.$', line): days = '1'
- elif re.match('^in preparation since today\.$', line): days = '0'
+ if re.match(in_prep_yesterday, line): days = '1'
+ elif re.match(in_prep_today, line): days = '0'
else: days = line.split(' ')[0]
else:
- if re.match('^requested yesterday\.$', line): days = '1'
- elif re.match('^requested today\.$', line): days = '0'
+ if re.match(req_yesterday, line): days = '1'
+ elif re.match(req_today, line): days = '0'
else: days = line.split(' ')[1]
item.append(days)