[hamster-applet] parsing fixes



commit 4259bfe7ecf7cd5ae83f5851a4c20110255a9b12
Author: Toms Bauģis <toms baugis gmail com>
Date:   Fri Aug 20 10:34:39 2010 +0100

    parsing fixes

 src/hamster/stuff.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/hamster/stuff.py b/src/hamster/stuff.py
index 0029d46..cf0dcc9 100644
--- a/src/hamster/stuff.py
+++ b/src/hamster/stuff.py
@@ -263,6 +263,7 @@ def parse_activity_input(text):
             self.end_time = None
             self.description = None
             self.tags = []
+            self.ponies = False
 
 
     res = InputParseResult()
@@ -318,8 +319,8 @@ def parse_activity_input(text):
     res.activity_name = text.strip()
 
     #this is most essential
-    if (text.find("bbq") > -1 or text.find("barbeque") > -1
-        or text.find("barbecue") > -1)  and text.find("omg") > -1:
+    if any([b in text for b in ("bbq", "barbeque", "barbecue")]) and "omg" in text:
+        res.ponies = True
         res.description = "[ponies = 1], [rainbows = 0]"
 
     return res



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]