minor refactoring/optimization

This commit is contained in:
Miroslav Stampar 2011-11-16 16:06:21 +00:00
parent 7314de3490
commit 0df768e24a
2 changed files with 3 additions and 9 deletions

View File

@ -39,7 +39,7 @@ def headersParser(headers):
} }
for header in headers: for header in headers:
if header in topHeaders.keys(): if header in topHeaders:
value = headers[header] value = headers[header]
xmlfile = topHeaders[header] xmlfile = topHeaders[header]

View File

@ -28,8 +28,6 @@ class htmlHandler(ContentHandler):
self.__dbms = None self.__dbms = None
self.__page = page self.__page = page
self.__regexp = None
self.__match = None
self.dbms = None self.dbms = None
@ -37,13 +35,9 @@ class htmlHandler(ContentHandler):
if name == "dbms": if name == "dbms":
self.__dbms = attrs.get("value") self.__dbms = attrs.get("value")
if name == "error": elif name == "error":
self.__regexp = attrs.get("regexp") if re.search(attrs.get("regexp"), self.__page, re.I):
self.__match = re.search(self.__regexp, self.__page, re.I)
if self.__match:
self.dbms = self.__dbms self.dbms = self.__dbms
self.__match = None
threadData = getCurrentThreadData() threadData = getCurrentThreadData()
threadData.lastErrorPage = (threadData.lastRequestUID, self.__page) threadData.lastErrorPage = (threadData.lastRequestUID, self.__page)