From e8debbe7245fd037a5d98b185e6eb20ade3c73a8 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 29 Mar 2011 06:38:19 +0000 Subject: [PATCH] minor cosmetics and one minor fix (|= is a nono with None) --- lib/controller/controller.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/controller/controller.py b/lib/controller/controller.py index 32632ca54..8fdde4f49 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -326,18 +326,19 @@ def start(): for place in parameters: # Test User-Agent and Referer headers only if # --level >= 3 - condition = (place == PLACE.UA and conf.level < 3) - condition |= (place == PLACE.REFERER and conf.level < 3) + skip = (place == PLACE.UA and conf.level < 3) + skip |= (place == PLACE.REFERER and conf.level < 3) + # Test Cookie header only if --level >= 2 - condition |= (place == PLACE.COOKIE and conf.level < 2) + skip |= (place == PLACE.COOKIE and conf.level < 2) # Test GET parameter in case --data only if --level >= 3 - condition |= (place == PLACE.GET and conf.data and conf.level < 3) + skip |= (place == PLACE.GET and conf.data is not None and conf.level < 3) - condition &= not (place == PLACE.UA and intersect(USER_AGENT_ALIASES, conf.testParameter)) - condition &= not (place == PLACE.REFERER and intersect(REFERER_ALIASES, conf.testParameter)) + skip &= not (place == PLACE.UA and intersect(USER_AGENT_ALIASES, conf.testParameter)) + skip &= not (place == PLACE.REFERER and intersect(REFERER_ALIASES, conf.testParameter)) - if condition: + if skip: continue if not conf.paramDict.has_key(place):