one bug fix in dynamic content engine and some code refactoring

This commit is contained in:
Miroslav Stampar
2010-11-02 07:32:08 +00:00
parent 73b33ed765
commit 13e93f564a
5 changed files with 27 additions and 23 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 conf.seqLock:
conf.seqLock.acquire()
if kb.data.seqLock:
kb.data.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 conf.seqLock:
conf.seqLock.release()
if kb.data.seqLock:
kb.data.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