From 605a5f6c933be20f0b60a2dc6e084ffba9efc2f4 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Tue, 3 Nov 2009 15:00:34 +0100 Subject: Precompile all remaining regexp --- wnpp-query.py | 19 ++++++++++++------- 1 file 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('(^\(.*),|^ \\,)') -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('(^\(.*),|^ \\,)') +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) -- cgit v1.2.3