summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--paste/pony.py30
-rw-r--r--setup.py4
2 files changed, 34 insertions, 0 deletions
diff --git a/paste/pony.py b/paste/pony.py
new file mode 100644
index 0000000..83268be
--- /dev/null
+++ b/paste/pony.py
@@ -0,0 +1,30 @@
+"""
+We have a pony
+"""
+
+DATA = """
+eJyFkkFuxCAMRfdzCisbJxK2D5D2JpbMrlI3XXQZDt9PCG0ySgcWIMT79rcN0XClUJlZRB9jVmci
+FmV19khjgRFl0RzrKmqzvY8lRUWFlXvCrD7UbAQR/17NUvGhypAF9og16vWtkC8DzUayS6pN3/dR
+ki0OnpzKjUBFpmlC7zVFRNL1rwoq6PWXXQSnIm9WoTzlM2//ke21o5g/l1ckRhiPbkDZXsKIR7l1
+36hF9uMhnRiVjI8UgYjlsIKCrXXpcA9iX5y7zMmtG0fUpW61Ssttipf6cp3WARfkMVoYFryi2a+w
+o/2dhW0OXfcMTnmh53oR9egzPs+qkpY9IKxdUVRP5wHO7UDAuI6moA2N+/z4vtc2k8B+AIBimVU=
+"""
+
+class PonyMiddleware(object):
+
+ def __init__(self, application):
+ self.application = application
+
+ def __call__(self, environ, start_response):
+ path_info = environ.get('PATH_INFO', '')
+ if path_info == '/pony':
+ msg = DATA.decode('base64').decode('zlib')
+ msg = '<pre>%s</pre>' % msg
+ start_response('200 OK', [('content-type', 'text/html')])
+ return [msg]
+ else:
+ return self.application(environ, start_response)
+
+def make_pony(app, global_conf):
+ return PonyMiddleware(app)
+
diff --git a/setup.py b/setup.py
index 3847097..fdc4561 100644
--- a/setup.py
+++ b/setup.py
@@ -143,6 +143,8 @@ For the latest changes see the `news file
static = paste.urlparser:make_static
pkg_resources = paste.urlparser:make_pkg_resources
proxy = paste.proxy:make_proxy
+ test = paste.debug.debugapp:make_test_app
+ test_slow = paste.debug.debugapp:make_slow_app
[paste.composit_factory]
urlmap = paste.urlmap:urlmap_factory
@@ -165,6 +167,8 @@ For the latest changes see the `news file
auth_tkt = paste.auth.auth_tkt:make_auth_tkt_middleware
grantip = paste.auth.grantip:make_grantip
openid = paste.auth.open_id:make_open_id_middleware [openid]
+ recorder = paste.debug.recorder.record:make_recorder
+ pony = paste.pony:make_pony
[paste.server_runner]
http = paste.httpserver:server_runner