From 9454b6b75cfee4b6ac8327d39a2a0ff828f508ce Mon Sep 17 00:00:00 2001 From: ianb Date: Sat, 7 Jan 2006 22:14:03 +0000 Subject: Added a little argument to profile.profile_decorator, to allow conditional profiling; added an entry point for the built-in http server, so you can use egg:Paste#http in paste.deploy files; small doc update; got rid of MANIFEST.in, which I don't believe is actually needed to make a proper package (and might actually hurt, since setuptools handles things itself when MANIFEST.in doesn't exist). --- paste/debug/profile.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'paste/debug') 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) -- cgit v1.2.1