summaryrefslogtreecommitdiff
path: root/paste/debug/profile.py
diff options
context:
space:
mode:
Diffstat (limited to 'paste/debug/profile.py')
-rw-r--r--paste/debug/profile.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/paste/debug/profile.py b/paste/debug/profile.py
index b112041..6fdc48e 100644
--- a/paste/debug/profile.py
+++ b/paste/debug/profile.py
@@ -124,8 +124,15 @@ def profile_decorator(**options):
log_filename:
The temporary filename to log profiling data to. Default;
``./profile_data.log.tmp``
+ no_profile:
+ If true, then don't actually profile anything. Useful for
+ conditional profiling.
"""
+ if options.get('no_profile'):
+ def decorator(func):
+ return func
+ return decorator
def decorator(func):
def replacement(*args, **kw):
return DecoratedProfile(func, **options)(*args, **kw)