some code refactoring and beautification

This commit is contained in:
Miroslav Stampar
2010-11-02 09:06:38 +00:00
parent 13e93f564a
commit 5269cb8c08
4 changed files with 13 additions and 10 deletions

View File

@@ -58,8 +58,8 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
else:
page = re.sub('(?s)%s.+%s' % (prefix, postfix), '%s%s' % (prefix, postfix), page)
if kb.data.seqLock:
kb.data.seqLock.acquire()
if kb.locks.seqLock:
kb.locks.seqLock.acquire()
if not conf.eRegexp and not conf.eString and kb.nullConnection:
ratio = 1. * pageLength / len(conf.seqMatcher.a)
@@ -69,8 +69,8 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
conf.seqMatcher.set_seq2(page if not conf.textOnly else getFilteredPageContent(page))
ratio = round(conf.seqMatcher.ratio(), 3)
if kb.data.seqLock:
kb.data.seqLock.release()
if kb.locks.seqLock:
kb.locks.seqLock.release()
# If the url is stable and we did not set yet the match ratio and the
# current injected value changes the url page content