From d4966fabe48964644d413a64b4d46806bebf74d1 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Wed, 28 Oct 2009 14:22:58 +0100 Subject: Fixed bug that occours when description is missing in subject --- wnpp-query.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(',', '', re.sub('(.*):(.*):', '', description))[:50].strip() + '...)' + try: + description = re.sub(',', '', description) + description = ' (' + description.split(':')[2] + ')' + except: + description = '' item.append(description) else: item.append('') -- cgit v1.2.3