From 683e266fee80594e5123bce2776d7fa8b595453b Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Tue, 27 Oct 2009 17:02:56 +0100 Subject: Code cleanup --- wnpp-query.py | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/wnpp-query.py b/wnpp-query.py index fc0e0af..058fd22 100755 --- a/wnpp-query.py +++ b/wnpp-query.py @@ -12,7 +12,6 @@ import urllib2, sys, re from optparse import OptionParser -# Parse commandline arguments parser = OptionParser() parser.add_option('-i', action='store_true', dest='itp', default=False, help='Query ITPs') parser.add_option('-r', action='store_true', dest='rfp', default=False, help='Query RFPs') @@ -27,38 +26,41 @@ 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 -# Here we go... 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') + +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') for line in url: - if re.findall('bugs\.debian\.org', line) or re.match('requested(.*)ago', line) or re.match('^(.*)days in preparation\.$', line) or re.match('^in preparation since(.*)$', line): - # First line - if re.match('^\(.*),', line) or re.match ('^ \\,', line): - # Link - link = re.sub('