diff options
author | Stefan Ritter <xeno@thehappy.de> | 2009-11-03 15:00:34 +0100 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2009-11-03 15:00:34 +0100 |
commit | 605a5f6c933be20f0b60a2dc6e084ffba9efc2f4 (patch) | |
tree | 57caf4b4eec31e5b2c7c4aa5c1d45e263fe3b4ca | |
parent | 071730a33ccc848229a9d712c9af200c1c5213b1 (diff) |
Precompile all remaining regexp
-rwxr-xr-x | wnpp-query.py | 19 |
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) |