cleanup Parser
authorFlorian Schweikert <kelvan@logic.at>
Thu, 17 Mar 2011 01:57:43 +0000 (02:57 +0100)
committerFlorian Schweikert <kelvan@logic.at>
Thu, 17 Mar 2011 01:57:43 +0000 (02:57 +0100)
parseHtml.py

index 6f21e1a..498d41d 100644 (file)
@@ -13,16 +13,14 @@ class ParserError(Exception):
          return repr(self.value)
 
 class Parser:
-    _overview = None
-    _details = None
     STATE_ERROR = -1
-    STATE_START = 0
-    STATE_SEARCH = 1
-    STATE_RESULT = 2
-    _current_state = 0
+    STATE_START, STATE_SEARCH, STATE_RESULT = range(3)
 
     def __init__(self, html):
         self.soup = BeautifulSoup(html)
+        self._overview = None
+        self._details = None
+        self._current_state = 0
 
     def __iter__(self):
         for detail in self.details():