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"
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")
if not test or test[0] in ("y", "Y"):

View File

@ -78,8 +78,8 @@ def checkCharEncoding(encoding):
else:
return encoding
#http://www.destructor.de/charsets/index.htm
translate = { 'windows-874':'iso-8859-11', 'en_us':'utf8' }
# http://www.destructor.de/charsets/index.htm
translate = { 'windows-874': 'iso-8859-11', 'en_us': 'utf8' }
for delimiter in (';', ','):
if delimiter in encoding:
@ -117,9 +117,10 @@ def decodePage(page, contentEncoding, contentType):
page = data.read()
#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):
charset = checkCharEncoding(contentType.split('charset=')[-1])
if 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:
for item in kb.dynamicMarkings:
prefix, postfix = item
if prefix is None:
page = re.sub('(?s)^.+%s' % postfix, postfix, page)
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:
ratio = 1. * pageLength / len(conf.seqMatcher.a)
if ratio > 1.:
ratio = 1. / ratio
else: