Hackfut Security File Manager
Current Path:
/opt/alt/python27/lib/python2.7/site-packages/paste/debug
opt
/
alt
/
python27
/
lib
/
python2.7
/
site-packages
/
paste
/
debug
/
📁
..
📄
__init__.py
(221 B)
📄
__init__.pyc
(224 B)
📄
__init__.pyo
(224 B)
📄
debugapp.py
(2.76 KB)
📄
debugapp.pyc
(3.12 KB)
📄
debugapp.pyo
(3.12 KB)
📄
doctest_webapp.py
(14.55 KB)
📄
doctest_webapp.py.stdlib
(14.66 KB)
📄
doctest_webapp.pyc
(14.97 KB)
📄
doctest_webapp.pyo
(14.81 KB)
📄
fsdiff.py
(12.77 KB)
📄
fsdiff.py.stdlib
(12.7 KB)
📄
fsdiff.pyc
(14.25 KB)
📄
fsdiff.pyo
(14.21 KB)
📄
prints.py
(5.43 KB)
📄
prints.pyc
(5.45 KB)
📄
prints.pyo
(5.45 KB)
📄
profile.py
(7.45 KB)
📄
profile.pyc
(8.53 KB)
📄
profile.pyo
(8.53 KB)
📄
testserver.py
(3.31 KB)
📄
testserver.pyc
(4.21 KB)
📄
testserver.pyo
(4.04 KB)
📄
watchthreads.py
(10.61 KB)
📄
watchthreads.pyc
(11.47 KB)
📄
watchthreads.pyo
(11.47 KB)
📄
wdg_validate.py
(4.17 KB)
📄
wdg_validate.py.stdlib
(4.25 KB)
📄
wdg_validate.pyc
(4.51 KB)
📄
wdg_validate.pyo
(4.51 KB)
Editing: debugapp.py
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # (c) 2005 Clark C. Evans # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This code was written with funding by http://prometheusresearch.com """ Various Applications for Debugging/Testing Purposes """ import time __all__ = ['SimpleApplication', 'SlowConsumer'] class SimpleApplication(object): """ Produces a simple web page """ def __call__(self, environ, start_response): body = "<html><body>simple</body></html>" start_response("200 OK", [('Content-Type', 'text/html'), ('Content-Length', str(len(body)))]) return [body] class SlowConsumer(object): """ Consumes an upload slowly... NOTE: This should use the iterator form of ``wsgi.input``, but it isn't implemented in paste.httpserver. """ def __init__(self, chunk_size = 4096, delay = 1, progress = True): self.chunk_size = chunk_size self.delay = delay self.progress = True def __call__(self, environ, start_response): size = 0 total = environ.get('CONTENT_LENGTH') if total: remaining = int(total) while remaining > 0: if self.progress: print "%s of %s remaining" % (remaining, total) if remaining > 4096: chunk = environ['wsgi.input'].read(4096) else: chunk = environ['wsgi.input'].read(remaining) if not chunk: break size += len(chunk) remaining -= len(chunk) if self.delay: time.sleep(self.delay) body = "<html><body>%d bytes</body></html>" % size else: body = ('<html><body>\n' '<form method="post" enctype="multipart/form-data">\n' '<input type="file" name="file">\n' '<input type="submit" >\n' '</form></body></html>\n') print "bingles" start_response("200 OK", [('Content-Type', 'text/html'), ('Content-Length', len(body))]) return [body] def make_test_app(global_conf): return SimpleApplication() make_test_app.__doc__ = SimpleApplication.__doc__ def make_slow_app(global_conf, chunk_size=4096, delay=1, progress=True): from paste.deploy.converters import asbool return SlowConsumer( chunk_size=int(chunk_size), delay=int(delay), progress=asbool(progress)) make_slow_app.__doc__ = SlowConsumer.__doc__
Upload File
Create Folder