Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit afbd66f

Browse files
committed
Added some comments
1 parent d0d6632 commit afbd66f

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

lib/controller/checks.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ def checkStability():
306306
condition &= secondPage == thirdPage
307307

308308
if condition == False:
309+
# Prepare for the comparison algorithm based on Content-Length
310+
# header value
309311
contentLengths = []
310312
requestsHeaders = ( firstHeaders, secondHeaders, thirdHeaders )
311313

@@ -328,6 +330,8 @@ def checkStability():
328330
# TODO: go ahead here with the technique to compare True/False
329331
# based upon clAverage discard (conf.contentLengths)
330332

333+
# Prepare for the comparison algorithm based on page content's
334+
# stable lines subset
331335
counter = 0
332336
firstLines = firstPage.split("\n")
333337
secondLines = secondPage.split("\n")

lib/request/comparison.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ def comparison(page, headers=None, content=False):
7171
if not conf.equalLines and not conf.contentLengths:
7272
return md5.new(page).hexdigest()
7373

74-
# TODO: ahead here
74+
# TODO: go ahead from here
75+
76+
# Comparison algorithm based on Content-Length header value
77+
elif conf.contentLengths:
78+
pass
79+
80+
# Comparison algorithm based on page content's stable lines subset
7581
elif conf.equalLines:
7682
counter = 0
7783
trueLines = 0
@@ -87,8 +93,8 @@ def comparison(page, headers=None, content=False):
8793
counter += 1
8894

8995
# TODO: just debug prints
90-
print "trueLines:", trueLines, "len(conf.equalLines):", len(conf.equalLines)
91-
print "result:", ( trueLines * 100 ) / len(conf.equalLines)
96+
#print "trueLines:", trueLines, "len(conf.equalLines):", len(conf.equalLines)
97+
#print "result:", ( trueLines * 100 ) / len(conf.equalLines)
9298

9399
if ( trueLines * 100 ) / len(conf.equalLines) >= 98:
94100
return True

0 commit comments

Comments
 (0)