summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2009-12-09 13:18:48 +0100
committerStefan Ritter <xeno@thehappy.de>2009-12-09 13:18:48 +0100
commitf33b70ac0e60f6c509b5dd0e4be98547034ae2c5 (patch)
treece25d4336a5135c7eba25449a2cb9febe7ee5b01
parentbea3e9ee8dbecc84041acc5dbe3e12b27e7af443 (diff)
Code cleanup
-rwxr-xr-xwnpp-query.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/wnpp-query.py b/wnpp-query.py
index 8b76593..a7dcb3b 100755
--- a/wnpp-query.py
+++ b/wnpp-query.py
@@ -44,22 +44,22 @@ 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):
- if re.match(line_match_desc, line):
+ if line_match.match(line):
+ if line_match_desc.match(line):
line = line.strip()
- link = re.sub('<ul>', '', line)
+ link = line.replace('<ul>', '')
link = line[13:42]
item.append(link)
- name = re.sub('<ul>', '', line)
+ name = line.replace('<ul>', '')
name = name[44:]
name = name.split(':', 1)[0]
item.append(name)
if options.description:
try:
- description = re.sub('</a>,', '', line)
+ description = line.replace('</a>,', '')
description = ' (' + description.split(':')[2].strip() + ')'
except:
description = ''
@@ -67,14 +67,14 @@ for line in url:
else:
item.append('')
- if re.match(line_match_age, line):
+ if line_match_age.match(line):
if options.itp:
- if re.match(in_prep_yesterday, line): days = '1'
- elif re.match(in_prep_today, line): days = '0'
+ if in_prep_yesterday.match(line): days = '1'
+ elif in_prep_today.match(line): days = '0'
else: days = line.split(' ')[0]
else:
- if re.match(req_yesterday, line): days = '1'
- elif re.match(req_today, line): days = '0'
+ if req_yesterday.match(line): days = '1'
+ elif req_today.match(line): days = '0'
else: days = line.split(' ')[1]
item.append(days)