diff options
author | Stefan Ritter <xeno@thehappy.de> | 2009-10-28 14:22:58 +0100 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2009-10-28 14:22:58 +0100 |
commit | d4966fabe48964644d413a64b4d46806bebf74d1 (patch) | |
tree | 7fda716f9f2e763f741faa83e55b13764b532426 | |
parent | 900fe4e36ad85349bb03b0f957a9b8a90d32513a (diff) |
Fixed bug that occours when description is missing in subject
-rwxr-xr-x | wnpp-query.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/wnpp-query.py b/wnpp-query.py index 8d4fc35..0b7e626 100755 --- a/wnpp-query.py +++ b/wnpp-query.py @@ -55,7 +55,11 @@ for line in url: if options.description: description = line.strip() - description = ' (' + re.sub('</a>,', '', re.sub('(.*):(.*):', '', description))[:50].strip() + '...)' + try: + description = re.sub('</a>,', '', description) + description = ' (' + description.split(':')[2] + ')' + except: + description = '' item.append(description) else: item.append('') |