From c1a847c8a538c73df37cf7e2c99109ee1c7c9aa0 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Mon, 6 Dec 2010 17:08:43 -0500 Subject: [PATCH] Properly deal with single line comments in tfw module --- modules/tfw.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/tfw.py b/modules/tfw.py index ce6314d..beb17a1 100755 --- a/modules/tfw.py +++ b/modules/tfw.py @@ -26,7 +26,10 @@ def tfw(phenny, input): # parse comment (broken by
, so we have do it this way) comments = main[0].xpath('text()') - comment = "%s %s" % (comments[1], comments[2]) + if len(comments) > 2: + comment = "%s %s" % (comments[1], comments[2]) + else : + comment = comments[1] # remark is in its own div, so we have it easy remark = weather.get_element_by_id('remark').text_content()