Cosmetics

This commit is contained in:
Bernardo Damele 2010-11-07 16:23:03 +00:00
parent 6716315a76
commit 4d81da6bc8
3 changed files with 7 additions and 4 deletions

View File

@ -308,7 +308,7 @@ def start():
warnMsg = "Ctrl+C detected in multiple target mode" warnMsg = "Ctrl+C detected in multiple target mode"
logger.warn(warnMsg) logger.warn(warnMsg)
message = "do you want to skip to the next target in list [Y/n/q]" message = "do you want to skip to the next target in list? [Y/n/q]"
test = readInput(message, default="Y") test = readInput(message, default="Y")
if not test or test[0] in ("y", "Y"): if not test or test[0] in ("y", "Y"):

View File

@ -120,6 +120,7 @@ def decodePage(page, contentEncoding, contentType):
# http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode # http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode
if contentType and (contentType.find('charset=') != -1): if contentType and (contentType.find('charset=') != -1):
charset = checkCharEncoding(contentType.split('charset=')[-1]) charset = checkCharEncoding(contentType.split('charset=')[-1])
if charset: if charset:
page = getUnicode(page, charset) page = getUnicode(page, charset)

View File

@ -55,6 +55,7 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
if not kb.nullConnection and not conf.longestCommon: if not kb.nullConnection and not conf.longestCommon:
for item in kb.dynamicMarkings: for item in kb.dynamicMarkings:
prefix, postfix = item prefix, postfix = item
if prefix is None: if prefix is None:
page = re.sub('(?s)^.+%s' % postfix, postfix, page) page = re.sub('(?s)^.+%s' % postfix, postfix, page)
elif postfix is None: elif postfix is None:
@ -75,6 +76,7 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
elif not conf.eRegexp and not conf.eString and kb.nullConnection and pageLength: elif not conf.eRegexp and not conf.eString and kb.nullConnection and pageLength:
ratio = 1. * pageLength / len(conf.seqMatcher.a) ratio = 1. * pageLength / len(conf.seqMatcher.a)
if ratio > 1.: if ratio > 1.:
ratio = 1. / ratio ratio = 1. / ratio
else: else: