Skip to content

Commit

Permalink
Fixing decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
andresriancho committed Jan 27, 2015
1 parent 66155a1 commit 012d55a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions w3af/core/controllers/profiling/cpu_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@


def should_profile_cpu(wrapped):
def inner(w3af_core):
def inner():
_should_profile = os.environ.get('W3AF_CPU_PROFILING', '0')

if _should_profile.isdigit() and int(_should_profile) == 1:
return wrapped(w3af_core)
return wrapped()

return inner

Expand Down
4 changes: 2 additions & 2 deletions w3af/core/controllers/profiling/memory_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@


def should_profile_memory(wrapped):
def inner(w3af_core):
def inner():
_should_profile = os.environ.get('W3AF_MEMORY_PROFILING', '0')

if _should_profile.isdigit() and int(_should_profile) == 1:
return wrapped(w3af_core)
return wrapped()

return inner

Expand Down
4 changes: 2 additions & 2 deletions w3af/core/controllers/profiling/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@


def should_dump_processes(wrapped):
def inner(w3af_core):
def inner():
_should_profile = os.environ.get('W3AF_PROCESSES', '0')

if _should_profile.isdigit() and int(_should_profile) == 1:
return wrapped(w3af_core)
return wrapped()

return inner

Expand Down
4 changes: 2 additions & 2 deletions w3af/core/controllers/profiling/psutil_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def user_wants_psutil():


def should_dump_psutil(wrapped):
def inner(w3af_core):
def inner():
if user_wants_psutil():
return wrapped(w3af_core)
return wrapped()

return inner

Expand Down
4 changes: 2 additions & 2 deletions w3af/core/controllers/profiling/pytracemalloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def user_wants_pytracemalloc():


def should_dump_tracemalloc(wrapped):
def inner(w3af_core):
def inner():
if user_wants_pytracemalloc():
return wrapped(w3af_core)
return wrapped()

return inner

Expand Down
4 changes: 2 additions & 2 deletions w3af/core/controllers/profiling/thread_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@


def should_dump_thread_stack(wrapped):
def inner(w3af_core):
def inner():
_should_profile = os.environ.get('W3AF_THREAD_ACTIVITY', '0')

if _should_profile.isdigit() and int(_should_profile) == 1:
return wrapped(w3af_core)
return wrapped()

return inner

Expand Down

0 comments on commit 012d55a

Please sign in to comment.