Code cleanup
This commit is contained in:
parent
d4966fabe4
commit
e8ce24d57f
1 changed files with 9 additions and 8 deletions
|
@ -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 = ''
|
||||
|
|
Loading…
Reference in a new issue