Release 1.1:

* Sorting by 'days ago'
* Changed output order
This commit is contained in:
Stefan Ritter 2009-10-29 10:34:47 +01:00
parent e8ce24d57f
commit 8a96696731

View file

@ -47,7 +47,7 @@ for line in url:
line = line.strip()
link = re.sub('<ul>', '', line)
link = line[14:43]
link = line[13:42]
item.append(link)
name = re.sub('<ul>', '', line)
@ -58,7 +58,7 @@ for line in url:
if options.description:
try:
description = re.sub('</a>,', '', line)
description = ' (' + description.split(':')[2] + ')'
description = ' (' + description.split(':')[2].strip() + ')'
except:
description = ''
item.append(description)
@ -75,6 +75,7 @@ for line in url:
else:
if re.match('^requested yesterday\.$', line): days = '1'
elif re.match('^requested today\.$', line): days = '0'
else: days = line.split(' ')[1]
item.append(days)
@ -83,7 +84,8 @@ for line in url:
reports.append(item)
item = []
reports.sort(key = lambda x: x[3])
for entry in reports:
if int(entry[3]) <= options.max_days_old \
and int(entry[3]) >= options.min_days_old:
print entry[1] + entry[2] + ': ' + entry[3] + ' days ago (' + entry[0] + ')'
print entry[3], 'days ago:', entry[1], entry[0], entry[2]