diff options
author | ianb <devnull@localhost> | 2006-01-07 22:14:03 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-01-07 22:14:03 +0000 |
commit | 9454b6b75cfee4b6ac8327d39a2a0ff828f508ce (patch) | |
tree | c69165879c6153d8e3bd6a4d50ebad7a96659f6c | |
parent | e74273a11b048ec1f4c4ed0a6712e15376d15b97 (diff) | |
download | paste-9454b6b75cfee4b6ac8327d39a2a0ff828f508ce.tar.gz |
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).
-rw-r--r-- | MANIFEST.in | 6 | ||||
-rw-r--r-- | docs/index.txt | 4 | ||||
-rw-r--r-- | paste/debug/profile.py | 7 | ||||
-rwxr-xr-x | paste/util/httpserver.py | 15 | ||||
-rw-r--r-- | setup.cfg | 6 | ||||
-rw-r--r-- | setup.py | 3 |
6 files changed, 32 insertions, 9 deletions
diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 25dbd86..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -recursive-include docs *.txt *.html *.css -recursive-include examples *.py *.txt *.cgi -recursive-include *.py -recursive-include *.html -recursive-include *.css -recursive-include *.txt diff --git a/docs/index.txt b/docs/index.txt index e27d6cf..dbc6c60 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -10,14 +10,14 @@ Python Paste Paste: paper over your inconsistencies. Paste: a soft mixture of malleable consistency. Paste: a tasty mixture to be spread on bread or crackers. - Paste: the glue that won't hurt you when you eat it. + Paste: glue that won't hurt you if you eat it. Python Paste: the web extruded into the form of a snake. Paste: the vinegar eel. Paste: you bring the cut. Paste: a doughy substance from which to make metaphorical web cupcakes. LAMP? LAMPP! Putting the P in Wep 2.0! - Frankenweb smush tiny humans! + Frankenweb crush tiny humans! Python Paste brings consistency to Python web development and web application installation, providing tools for both developers and 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) diff --git a/paste/util/httpserver.py b/paste/util/httpserver.py index 8048873..b317a84 100755 --- a/paste/util/httpserver.py +++ b/paste/util/httpserver.py @@ -348,6 +348,21 @@ def serve(application, host=None, port=None, handler=None, ssl_pem=None, pass return server +# For paste.deploy server instantiation (egg:Paste#http) +# Note: this gets a separate function because it has to expect string +# arguments (though that's not much of an issue yet, ever?) +def server_runner(wsgi_app, global_conf, host=None, port=None, ssl_pem=None, + server_version=None, protocol_version=None): + """ + A simple HTTP server. Also supports SSL if you give it an + ``ssl_pem`` argument. + """ + if port: + port = int(port) + serve(wsgi_app, host=host, port=port, ssl_pem=ssl_pem, + server_version=server_version, protocol_version=protocol_version, + start_loop=True) + if __name__ == '__main__': # serve exactly 3 requests and then stop, use an external # program like wget or curl to submit these 3 requests. @@ -13,6 +13,10 @@ docs = docs/index.txt docs/DeveloperGuidelines.txt docs/StyleGuide.txt docs/develop-example.txt docs/developer-features.txt docs/enabled.txt docs/install-example.txt docs/related-projects.txt +exclude_modules = paste.script paste.deploy paste.webkit + paste.util.subprocess24 paste.util.doctest24 + paste.util.string24 paste.util.UserDict24 + paste.util.PySourceColor doc_base = docs/ dest = docs/html @@ -25,7 +29,7 @@ blog_url = http://pythonpaste.org/news/ trac_url = http://pythonpaste.org/trac/ settings = no_about=true link1=/deploy/ paste.deploy - link2=/script/ paster script + link2=/script/ paste.script link3=/download/ Download extra_credits=Hosting courtesy of <a href="http://tummy.com">Tummy.com</a> @@ -156,5 +156,8 @@ Other Tools paste_session = paste.session:SessionMiddleware wdg_validate = paste.debug.wdg_validate:WDGValidateMiddleware [subprocess] evalerror = paste.evalexception:EvalException + + [paste.server_runner] + http = paste.util.httpserver:server_runner """, ) |