Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.198
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
python37 /
share /
doc /
alt-python37-webob /
Delete
Unzip
Name
Size
Permission
Date
Action
comment-example-code
[ DIR ]
drwxr-xr-x
2026-05-01 04:21
jsonrpc-example-code
[ DIR ]
drwxr-xr-x
2026-05-01 04:21
modules
[ DIR ]
drwxr-xr-x
2026-05-01 04:21
pycon2011
[ DIR ]
drwxr-xr-x
2026-05-01 04:21
wiki-example-code
[ DIR ]
drwxr-xr-x
2026-05-01 04:21
comment-example.txt
13.66
KB
-rw-r--r--
2012-04-17 15:24
conf.py
948
B
-rw-r--r--
2011-10-13 21:16
differences.txt
19.09
KB
-rw-r--r--
2012-04-17 15:24
do-it-yourself.txt
26.41
KB
-rw-r--r--
2011-09-22 11:35
doctests.py
695
B
-rw-r--r--
2011-09-22 11:35
file-example.txt
7.47
KB
-rw-r--r--
2012-04-17 15:24
index.txt
11.89
KB
-rw-r--r--
2012-10-11 20:45
jsonrpc-example.txt
20.73
KB
-rw-r--r--
2012-04-17 15:24
license.txt
1.06
KB
-rw-r--r--
2011-09-22 11:35
news.txt
34.79
KB
-rw-r--r--
2012-10-11 21:36
reference.txt
30.22
KB
-rw-r--r--
2012-10-11 20:45
test-file.txt
35
B
-rw-r--r--
2011-09-18 22:25
test_dec.txt
3.06
KB
-rw-r--r--
2011-09-22 11:35
test_request.txt
15.78
KB
-rw-r--r--
2012-10-11 20:45
test_response.txt
12.89
KB
-rw-r--r--
2011-09-22 11:35
wiki-example.txt
23.8
KB
-rw-r--r--
2011-10-13 21:16
Save
Rename
A test of the decorator module:: >>> from doctest import ELLIPSIS >>> from webob.dec import wsgify >>> from webob import Response, Request >>> from webob import exc >>> @wsgify ... def test_app(req): ... return 'hey, this is a test: %s' % req.url >>> def testit(app, req): ... if isinstance(req, basestring): ... req = Request.blank(req) ... resp = req.get_response(app) ... print resp >>> testit(test_app, '/a url') 200 OK Content-Type: text/html; charset=UTF-8 Content-Length: 45 <BLANKLINE> hey, this is a test: http://localhost/a%20url >>> test_app wsgify(test_app) Now some middleware testing:: >>> @wsgify.middleware ... def set_urlvar(req, app, **vars): ... req.urlvars.update(vars) ... return app(req) >>> @wsgify ... def show_vars(req): ... return 'These are the vars: %r' % (sorted(req.urlvars.items())) >>> show_vars2 = set_urlvar(show_vars, a=1, b=2) >>> show_vars2 wsgify.middleware(set_urlvar)(wsgify(show_vars), a=1, b=2) >>> testit(show_vars2, '/path') 200 OK Content-Type: text/html; charset=UTF-8 Content-Length: 40 <BLANKLINE> These are the vars: [('a', 1), ('b', 2)] Some examples from Sergey:: >>> class HostMap(dict): ... @wsgify ... def __call__(self, req): ... return self[req.host.split(':')[0]] >>> app = HostMap() >>> app['example.com'] = Response('1') >>> app['other.com'] = Response('2') >>> print Request.blank('http://example.com/').get_response(wsgify(app)) 200 OK Content-Type: text/html; charset=UTF-8 Content-Length: 1 <BLANKLINE> 1 >>> @wsgify.middleware ... def override_https(req, normal_app, secure_app): ... if req.scheme == 'https': ... return secure_app ... else: ... return normal_app >>> app = override_https(Response('http'), secure_app=Response('https')) >>> print Request.blank('http://x.com/').get_response(app) 200 OK Content-Type: text/html; charset=UTF-8 Content-Length: 4 <BLANKLINE> http A status checking middleware:: >>> @wsgify.middleware ... def catch(req, app, catchers): ... resp = req.get_response(app) ... return catchers.get(resp.status_int, resp) >>> @wsgify ... def simple(req): ... return other_app # Just to mess around >>> @wsgify ... def other_app(req): ... return Response('hey', status_int=int(req.path_info.strip('/'))) >>> app = catch(simple, catchers={500: Response('error!'), 404: Response('nothing')}) >>> print Request.blank('/200').get_response(app) 200 OK Content-Type: text/html; charset=UTF-8 Content-Length: 3 <BLANKLINE> hey >>> print Request.blank('/500').get_response(app) 200 OK Content-Type: text/html; charset=UTF-8 Content-Length: 6 <BLANKLINE> error! >>> print Request.blank('/404').get_response(app) 200 OK Content-Type: text/html; charset=UTF-8 Content-Length: 7 <BLANKLINE> nothing