Added some comments

This commit is contained in:
Bernardo Damele 2008-12-18 21:58:05 +00:00
parent d0d6632c22
commit afbd66f6d9
2 changed files with 13 additions and 3 deletions

View File

@ -306,6 +306,8 @@ def checkStability():
condition &= secondPage == thirdPage
if condition == False:
# Prepare for the comparison algorithm based on Content-Length
# header value
contentLengths = []
requestsHeaders = ( firstHeaders, secondHeaders, thirdHeaders )
@ -328,6 +330,8 @@ def checkStability():
# TODO: go ahead here with the technique to compare True/False
# based upon clAverage discard (conf.contentLengths)
# Prepare for the comparison algorithm based on page content's
# stable lines subset
counter = 0
firstLines = firstPage.split("\n")
secondLines = secondPage.split("\n")

View File

@ -71,7 +71,13 @@ def comparison(page, headers=None, content=False):
if not conf.equalLines and not conf.contentLengths:
return md5.new(page).hexdigest()
# TODO: ahead here
# TODO: go ahead from here
# Comparison algorithm based on Content-Length header value
elif conf.contentLengths:
pass
# Comparison algorithm based on page content's stable lines subset
elif conf.equalLines:
counter = 0
trueLines = 0
@ -87,8 +93,8 @@ def comparison(page, headers=None, content=False):
counter += 1
# TODO: just debug prints
print "trueLines:", trueLines, "len(conf.equalLines):", len(conf.equalLines)
print "result:", ( trueLines * 100 ) / len(conf.equalLines)
#print "trueLines:", trueLines, "len(conf.equalLines):", len(conf.equalLines)
#print "result:", ( trueLines * 100 ) / len(conf.equalLines)
if ( trueLines * 100 ) / len(conf.equalLines) >= 98:
return True