minor code restyling

This commit is contained in:
Miroslav Stampar 2011-04-07 13:27:29 +00:00
parent e33a48d40f
commit 6a8a5db9aa

View File

@ -1054,18 +1054,18 @@ def __setHTTPUserAgent():
return return
__count = len(kb.userAgents) count = len(kb.userAgents)
if __count == 1: if count == 1:
__userAgent = kb.userAgents[0] userAgent = kb.userAgents[0]
else: else:
__userAgent = kb.userAgents[randomRange(stop=__count-1)] userAgent = kb.userAgents[randomRange(stop=count-1)]
__userAgent = sanitizeStr(__userAgent) userAgent = sanitizeStr(userAgent)
conf.httpHeaders.append((HTTPHEADER.USER_AGENT, __userAgent)) conf.httpHeaders.append((HTTPHEADER.USER_AGENT, userAgent))
logMsg = "fetched random HTTP User-Agent header from " logMsg = "fetched random HTTP User-Agent header from "
logMsg += "file '%s': %s" % (paths.USER_AGENTS, __userAgent) logMsg += "file '%s': %s" % (paths.USER_AGENTS, userAgent)
logger.info(logMsg) logger.info(logMsg)
def __setHTTPReferer(): def __setHTTPReferer():