Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | -rw-r--r--···0·root·········(0)·root·········(0)·····9243·2024-03-08·11:59:56.000000·.BUILDINFO | 1 | -rw-r--r--···0·root·········(0)·root·········(0)·····9243·2024-03-08·11:59:56.000000·.BUILDINFO |
2 | -rw-r--r--···0·root·········(0)·root·········(0)·····529 | 2 | -rw-r--r--···0·root·········(0)·root·········(0)·····5297·2024-03-08·11:59:56.000000·.MTREE |
3 | -rw-r--r--···0·root·········(0)·root·········(0)······523·2024-03-08·11:59:56.000000·.PKGINFO | 3 | -rw-r--r--···0·root·········(0)·root·········(0)······523·2024-03-08·11:59:56.000000·.PKGINFO |
4 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/ | 4 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/ |
5 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/share/ | 5 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/share/ |
6 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/share/doc/ | 6 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/share/doc/ |
7 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/share/doc/python-webob/ | 7 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/share/doc/python-webob/ |
8 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/share/doc/python-webob/html/ | 8 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-08·11:59:56.000000·usr/share/doc/python-webob/html/ |
9 | -rw-r--r--···0·root·········(0)·root·········(0)······230·2024-03-08·11:59:56.000000·usr/share/doc/python-webob/html/.buildinfo | 9 | -rw-r--r--···0·root·········(0)·root·········(0)······230·2024-03-08·11:59:56.000000·usr/share/doc/python-webob/html/.buildinfo |
Offset 1, 38 lines modified | Offset 1, 38 lines modified | ||
1 | #mtree | 1 | #mtree |
2 | /set·type=file·uid=0·gid=0·mode=644 | 2 | /set·type=file·uid=0·gid=0·mode=644 |
3 | ./.BUILDINFO·time=1709899196.0·size=9243·md5digest=65e3730cc36b318b6d4fa24854d9e2a3·sha256digest=4634abf42442fe0e827852216b34f8b4948ba506b85ac7f644b3f92ce795d8e5 | 3 | ./.BUILDINFO·time=1709899196.0·size=9243·md5digest=65e3730cc36b318b6d4fa24854d9e2a3·sha256digest=4634abf42442fe0e827852216b34f8b4948ba506b85ac7f644b3f92ce795d8e5 |
4 | ./.PKGINFO·time=1709899196.0·size=523·md5digest= | 4 | ./.PKGINFO·time=1709899196.0·size=523·md5digest=c7ca449b39c6d17af600cc9c66076f85·sha256digest=ec7dda333c8a495925fc07ac00fb1f5e3d2bc8da4760465a04097009c9647c6e |
5 | ./usr·time=1709899196.0·mode=755·type=dir | 5 | ./usr·time=1709899196.0·mode=755·type=dir |
6 | /set·mode=755 | 6 | /set·mode=755 |
7 | ./usr/share·time=1709899196.0·type=dir | 7 | ./usr/share·time=1709899196.0·type=dir |
8 | ./usr/share/doc·time=1709899196.0·type=dir | 8 | ./usr/share/doc·time=1709899196.0·type=dir |
9 | ./usr/share/doc/python-webob·time=1709899196.0·type=dir | 9 | ./usr/share/doc/python-webob·time=1709899196.0·type=dir |
10 | /set·mode=644 | 10 | /set·mode=644 |
11 | ./usr/share/doc/python-webob/html·time=1709899196.0·mode=755·type=dir | 11 | ./usr/share/doc/python-webob/html·time=1709899196.0·mode=755·type=dir |
12 | ./usr/share/doc/python-webob/html/.buildinfo·time=1709899196.0·size=230·md5digest=54a43d7fb7bb47439d1e0f194c774202·sha256digest=f69935059115f689bef5a0ca087c07e9e26886fdd02832acec0c9b7a77654137 | 12 | ./usr/share/doc/python-webob/html/.buildinfo·time=1709899196.0·size=230·md5digest=54a43d7fb7bb47439d1e0f194c774202·sha256digest=f69935059115f689bef5a0ca087c07e9e26886fdd02832acec0c9b7a77654137 |
13 | ./usr/share/doc/python-webob/html/changes.html·time=1709899196.0·size=133827·md5digest=c6b20f7e786c91cf3960d102ed9d782d·sha256digest=abd87ffb40c1fa958013ba3dc5abdc1932ee6048a4de0ff823643cab37185cbe | 13 | ./usr/share/doc/python-webob/html/changes.html·time=1709899196.0·size=133827·md5digest=c6b20f7e786c91cf3960d102ed9d782d·sha256digest=abd87ffb40c1fa958013ba3dc5abdc1932ee6048a4de0ff823643cab37185cbe |
14 | ./usr/share/doc/python-webob/html/comment-example.html·time=1709899196.0·size=52620·md5digest=50fede98338d87c7bbe0a8ddaa036020·sha256digest=1daf646016787848a47b622e9034f5292cb789f9297569cd565521bb77e827d7 | 14 | ./usr/share/doc/python-webob/html/comment-example.html·time=1709899196.0·size=52620·md5digest=50fede98338d87c7bbe0a8ddaa036020·sha256digest=1daf646016787848a47b622e9034f5292cb789f9297569cd565521bb77e827d7 |
15 | ./usr/share/doc/python-webob/html/differences.html·time=1709899196.0·size=63995·md5digest=cdba8eefc514455344867d472a2379e2·sha256digest=ad3ae366bcb8483078fa2094ccc057617f3daed699d26b936567e60c272788ca | ||
16 | ./usr/share/doc/python-webob/html/d | 15 | ./usr/share/doc/python-webob/html/differences.html·time=1709899196.0·size=63857·md5digest=d78839fa90b03d07b82836ac8fc35f03·sha256digest=4204bcf2dd6a959f740c0456848ed66911b5901a89531e5f67afbbe24da76a2f |
16 | ./usr/share/doc/python-webob/html/do-it-yourself.html·time=1709899196.0·size=83794·md5digest=07ce4a1be5b87e344d2fb12a45d54953·sha256digest=35f7e243460c77866e66501c98c49a9a471f9181e0f0046a8b12ddd3de2e8724 | ||
17 | ./usr/share/doc/python-webob/html/file-example.html·time=1709899196.0·size=37205·md5digest=4af79f4220df2eaab2beca11bfd3f64c·sha256digest=a6018bdcb8637797b1c169b08653b4218cec621fc4a05e477de8a2a2b4321493 | 17 | ./usr/share/doc/python-webob/html/file-example.html·time=1709899196.0·size=37205·md5digest=4af79f4220df2eaab2beca11bfd3f64c·sha256digest=a6018bdcb8637797b1c169b08653b4218cec621fc4a05e477de8a2a2b4321493 |
18 | ./usr/share/doc/python-webob/html/genindex.html·time=1709899196.0·size=81647·md5digest=0cbb40a3b1b2d533735d6ccf134c7ee8·sha256digest=73ca879d2cefc761395df28ba35c476961b4b5b2af51a91181dd4da9ebff9e74 | 18 | ./usr/share/doc/python-webob/html/genindex.html·time=1709899196.0·size=81647·md5digest=0cbb40a3b1b2d533735d6ccf134c7ee8·sha256digest=73ca879d2cefc761395df28ba35c476961b4b5b2af51a91181dd4da9ebff9e74 |
19 | ./usr/share/doc/python-webob/html/index.html·time=1709899196.0·size=39601·md5digest=99874117df4f229cadc70bb17d012ef0·sha256digest=50acdf65f87ce293c46b68cb8e43dc8c5e626b3ea55fe92bef419f69cd9d9c43 | ||
20 | ./usr/share/doc/python-webob/html/ | 19 | ./usr/share/doc/python-webob/html/index.html·time=1709899196.0·size=39468·md5digest=3050c58982b82c281b3fab428d307387·sha256digest=48804fff7bf4fb07dfdead06c3c062ac6c1d07cb43428d602bcfb7553fa0aebe |
20 | ./usr/share/doc/python-webob/html/jsonrpc-example.html·time=1709899196.0·size=73484·md5digest=9ee213c5603a6342cdf95824b9df5a4e·sha256digest=1ecd602fb37b2c9992fff561b633c7c6cad94136251680b00ab9421dd5401e63 | ||
21 | ./usr/share/doc/python-webob/html/license.html·time=1709899196.0·size=7776·md5digest=265bd42dfa7a07b18412c298a0539e3e·sha256digest=ee8716c224d3d80804b33ee139146e07b0770130cd0820f5f566a7cc024e3f92 | 21 | ./usr/share/doc/python-webob/html/license.html·time=1709899196.0·size=7776·md5digest=265bd42dfa7a07b18412c298a0539e3e·sha256digest=ee8716c224d3d80804b33ee139146e07b0770130cd0820f5f566a7cc024e3f92 |
22 | ./usr/share/doc/python-webob/html/objects.inv·time=1709899196.0·size=3800·md5digest=fe1064968e6c706e4d6e9c4de990e5ad·sha256digest=13a6eb792003a2b417e3e49331b0e413ac7c117e4dacc6a0ce64614e6e497c34 | 22 | ./usr/share/doc/python-webob/html/objects.inv·time=1709899196.0·size=3800·md5digest=fe1064968e6c706e4d6e9c4de990e5ad·sha256digest=13a6eb792003a2b417e3e49331b0e413ac7c117e4dacc6a0ce64614e6e497c34 |
23 | ./usr/share/doc/python-webob/html/py-modindex.html·time=1709899196.0·size=9169·md5digest=e5eb988a5e794b5d5e17f452e94ed0ca·sha256digest=73fd6ec315b8b0a88214b1f104ec22fe96bc5a091ab538920e03eba173e181f7 | 23 | ./usr/share/doc/python-webob/html/py-modindex.html·time=1709899196.0·size=9169·md5digest=e5eb988a5e794b5d5e17f452e94ed0ca·sha256digest=73fd6ec315b8b0a88214b1f104ec22fe96bc5a091ab538920e03eba173e181f7 |
24 | ./usr/share/doc/python-webob/html/reference.html·time=1709899196.0·size=106 | 24 | ./usr/share/doc/python-webob/html/reference.html·time=1709899196.0·size=106156·md5digest=c14ad332f87b0950db7b85e50d0330b7·sha256digest=94f4546072cc96b9c4911ed110f19bb265c11af180d478d6874891896e408962 |
25 | ./usr/share/doc/python-webob/html/search.html·time=1709899196.0·size=6154·md5digest=cce85458fcec557dd963f1af11ea2cd8·sha256digest=b039c3a2bad3de72c286fed98de9606c7e926e26f0b36467a258296c6773b5a6 | 25 | ./usr/share/doc/python-webob/html/search.html·time=1709899196.0·size=6154·md5digest=cce85458fcec557dd963f1af11ea2cd8·sha256digest=b039c3a2bad3de72c286fed98de9606c7e926e26f0b36467a258296c6773b5a6 |
26 | ./usr/share/doc/python-webob/html/searchindex.js·time=1709899196.0·size=146279·md5digest=14ac0cc7dec55587373290fe8665c67b·sha256digest=85f92a54a382bd9b23aa22757d9cd495d537ef18911c168dea10668366130ebe | 26 | ./usr/share/doc/python-webob/html/searchindex.js·time=1709899196.0·size=146279·md5digest=14ac0cc7dec55587373290fe8665c67b·sha256digest=85f92a54a382bd9b23aa22757d9cd495d537ef18911c168dea10668366130ebe |
27 | ./usr/share/doc/python-webob/html/whatsnew-1.5.html·time=1709899196.0·size=14543·md5digest=99c2c74969064ab4d9935d38048f66bb·sha256digest=e72461d0a1438ac5c332ee617507b0afba55551cc845bf473992193741f0e9c2 | 27 | ./usr/share/doc/python-webob/html/whatsnew-1.5.html·time=1709899196.0·size=14543·md5digest=99c2c74969064ab4d9935d38048f66bb·sha256digest=e72461d0a1438ac5c332ee617507b0afba55551cc845bf473992193741f0e9c2 |
28 | ./usr/share/doc/python-webob/html/whatsnew-1.6.html·time=1709899196.0·size=12080·md5digest=e4a4826e65a2ff490f13fa9baba109b6·sha256digest=442ae81d5da2fc3a6f0d929d8c7ee4199fa91c88ce7213856732d41d1008a366 | 28 | ./usr/share/doc/python-webob/html/whatsnew-1.6.html·time=1709899196.0·size=12080·md5digest=e4a4826e65a2ff490f13fa9baba109b6·sha256digest=442ae81d5da2fc3a6f0d929d8c7ee4199fa91c88ce7213856732d41d1008a366 |
29 | ./usr/share/doc/python-webob/html/whatsnew-1.7.html·time=1709899196.0·size=28483·md5digest=867c0d0f9ab071ae554c951fb3f21038·sha256digest=a1738faa36930647b9ed17edf5b360e50a285fa6b418d8378fda48b31130d9ef | ||
30 | ./usr/share/doc/python-webob/html/whatsnew-1.8.html·time=1709899196.0·size=17946·md5digest=177bdf0e18ba4fe7df28349ee93636d1·sha256digest=8e7a80eae1c50d2b08d5b90fc12ef48052cecb6cf77273e59bd97022f2756b2f | ||
31 | ./usr/share/doc/python-webob/html/w | 29 | ./usr/share/doc/python-webob/html/whatsnew-1.7.html·time=1709899196.0·size=28350·md5digest=b1dc2467a5c75b0eccfac8616fff6622·sha256digest=520f7faa3200c509860a622938baa8ed7208cb077c23892e71a1cea0852bc48b |
30 | ./usr/share/doc/python-webob/html/whatsnew-1.8.html·time=1709899196.0·size=17818·md5digest=95af7058b512117e25af09bbb954b175·sha256digest=2388e415b22956ae5aca88fd0560719469b59af800599ffe4f1a65a5f773460c | ||
31 | ./usr/share/doc/python-webob/html/wiki-example.html·time=1709899196.0·size=79158·md5digest=594457a71719f527289a6337b8000cdd·sha256digest=dcf7f6d81dcec4b7490aebd5e299c8a8e451adab72beccd305b7e4dc2be14708 | ||
32 | ./usr/share/doc/python-webob/html/_sources·time=1709899196.0·mode=755·type=dir | 32 | ./usr/share/doc/python-webob/html/_sources·time=1709899196.0·mode=755·type=dir |
33 | ./usr/share/doc/python-webob/html/_sources/changes.txt·time=1709899196.0·size=116·md5digest=b03ad01af40f5bba234c6f367cce59dc·sha256digest=68fafa94fc4a1b1dedb2025bbfb17789908a0292d0e3280d54c58c33c5f942f2 | 33 | ./usr/share/doc/python-webob/html/_sources/changes.txt·time=1709899196.0·size=116·md5digest=b03ad01af40f5bba234c6f367cce59dc·sha256digest=68fafa94fc4a1b1dedb2025bbfb17789908a0292d0e3280d54c58c33c5f942f2 |
34 | ./usr/share/doc/python-webob/html/_sources/comment-example.txt·time=1709899196.0·size=13985·md5digest=279eaeb0931ac423be8e106afd4b61ea·sha256digest=cd833ca15e744f67fbd05599754b18d44b5c6108a60d65cc1730a0a7a86d67e6 | 34 | ./usr/share/doc/python-webob/html/_sources/comment-example.txt·time=1709899196.0·size=13985·md5digest=279eaeb0931ac423be8e106afd4b61ea·sha256digest=cd833ca15e744f67fbd05599754b18d44b5c6108a60d65cc1730a0a7a86d67e6 |
35 | ./usr/share/doc/python-webob/html/_sources/differences.txt·time=1709899196.0·size=19641·md5digest=36886ef3b8e5ddcad684cfad909a38ae·sha256digest=56a3de5e516b9c79eaf1e3939a8d8fed965530b5084d01416012c1c2015bcce1 | 35 | ./usr/share/doc/python-webob/html/_sources/differences.txt·time=1709899196.0·size=19641·md5digest=36886ef3b8e5ddcad684cfad909a38ae·sha256digest=56a3de5e516b9c79eaf1e3939a8d8fed965530b5084d01416012c1c2015bcce1 |
36 | ./usr/share/doc/python-webob/html/_sources/do-it-yourself.txt·time=1709899196.0·size=27080·md5digest=43c748ba714a1d605c0dbf853d25915f·sha256digest=0c7cbbec4233c641a3198cee4b9bcb36d6afac2dfe6720352731964bb87643d1 | 36 | ./usr/share/doc/python-webob/html/_sources/do-it-yourself.txt·time=1709899196.0·size=27080·md5digest=43c748ba714a1d605c0dbf853d25915f·sha256digest=0c7cbbec4233c641a3198cee4b9bcb36d6afac2dfe6720352731964bb87643d1 |
37 | ./usr/share/doc/python-webob/html/_sources/file-example.txt·time=1709899196.0·size=7779·md5digest=99cda9ee7e6b2de46d3dca39e6eb4066·sha256digest=8a0bfbba767552d5c15367a66ff3809b000aeec6317f9b1dd128841ec4dd7900 | 37 | ./usr/share/doc/python-webob/html/_sources/file-example.txt·time=1709899196.0·size=7779·md5digest=99cda9ee7e6b2de46d3dca39e6eb4066·sha256digest=8a0bfbba767552d5c15367a66ff3809b000aeec6317f9b1dd128841ec4dd7900 |
38 | ./usr/share/doc/python-webob/html/_sources/index.txt·time=1709899196.0·size=12188·md5digest=b75805b3a884c3f1ce6cc217f142b48f·sha256digest=889e77dbbc674414bbe71243fb81f5fa7751dc9baa490a896770f9cbf29bfb16 | 38 | ./usr/share/doc/python-webob/html/_sources/index.txt·time=1709899196.0·size=12188·md5digest=b75805b3a884c3f1ce6cc217f142b48f·sha256digest=889e77dbbc674414bbe71243fb81f5fa7751dc9baa490a896770f9cbf29bfb16 |
Offset 3, 15 lines modified | Offset 3, 15 lines modified | ||
3 | pkgname·=·python-webob-docs | 3 | pkgname·=·python-webob-docs |
4 | pkgbase·=·python-webob | 4 | pkgbase·=·python-webob |
5 | pkgver·=·1.8.7-7 | 5 | pkgver·=·1.8.7-7 |
6 | pkgdesc·=·WSGI·request·and·response·object | 6 | pkgdesc·=·WSGI·request·and·response·object |
7 | url·=·http://pythonpaste.org/webob/ | 7 | url·=·http://pythonpaste.org/webob/ |
8 | builddate·=·1709899196 | 8 | builddate·=·1709899196 |
9 | packager·=·Reproducible·Arch·Linux·tests·<reproducible@archlinux.org> | 9 | packager·=·Reproducible·Arch·Linux·tests·<reproducible@archlinux.org> |
10 | size·=·20 | 10 | size·=·2065339 |
11 | arch·=·any | 11 | arch·=·any |
12 | license·=·MIT | 12 | license·=·MIT |
13 | depend·=·python | 13 | depend·=·python |
14 | makedepend·=·python-setuptools | 14 | makedepend·=·python-setuptools |
15 | makedepend·=·python-sphinx | 15 | makedepend·=·python-sphinx |
16 | makedepend·=·python-build | 16 | makedepend·=·python-build |
17 | makedepend·=·python-installer | 17 | makedepend·=·python-installer |
Offset 65, 29 lines modified | Offset 65, 29 lines modified | ||
65 | Can·be·passed·an·iterable·containing·multiple·domains,·this·will·set | 65 | Can·be·passed·an·iterable·containing·multiple·domains,·this·will·set |
66 | multiple·cookies·one·for·each·domain.</p> | 66 | multiple·cookies·one·for·each·domain.</p> |
67 | </dd> | 67 | </dd> |
68 | <dt><code·class="docutils·literal·notranslate"><span·class="pre">serializer</span></code></dt><dd><p>An·object·with·two·methods:·<code·class="docutils·literal·notranslate"><span·class="pre">loads</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">dumps</span></code>.··The·<code·class="docutils·literal·notranslate"><span·class="pre">loads</span></code>·method | 68 | <dt><code·class="docutils·literal·notranslate"><span·class="pre">serializer</span></code></dt><dd><p>An·object·with·two·methods:·<code·class="docutils·literal·notranslate"><span·class="pre">loads</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">dumps</span></code>.··The·<code·class="docutils·literal·notranslate"><span·class="pre">loads</span></code>·method |
69 | should·accept·a·bytestring·and·return·a·Python·object.··The·<code·class="docutils·literal·notranslate"><span·class="pre">dumps</span></code> | 69 | should·accept·a·bytestring·and·return·a·Python·object.··The·<code·class="docutils·literal·notranslate"><span·class="pre">dumps</span></code> |
70 | method·should·accept·a·Python·object·and·return·bytes.··A·<code·class="docutils·literal·notranslate"><span·class="pre">ValueError</span></code> | 70 | method·should·accept·a·Python·object·and·return·bytes.··A·<code·class="docutils·literal·notranslate"><span·class="pre">ValueError</span></code> |
71 | should·be·raised·for·malformed·inputs.··Default:·<code·class="docutils·literal·notranslate"><span·class="pre">None</span></code>,·which·will·use | 71 | should·be·raised·for·malformed·inputs.··Default:·<code·class="docutils·literal·notranslate"><span·class="pre">None</span></code>,·which·will·use |
72 | a·derivation·of·< | 72 | a·derivation·of·<code·class="xref·py·py-func·docutils·literal·notranslate"><span·class="pre">json.dumps()</span></code>·and·<code·class="xref·py·py-func·docutils·literal·notranslate"><span·class="pre">json.loads()</span></code>.</p> |
73 | </dd> | 73 | </dd> |
74 | </dl> | 74 | </dl> |
75 | <dl·class="py·method"> | 75 | <dl·class="py·method"> |
76 | <dt·class="sig·sig-object·py"·id="webob.cookies.CookieProfile.bind"> | 76 | <dt·class="sig·sig-object·py"·id="webob.cookies.CookieProfile.bind"> |
77 | <span·class="sig-name·descname"><span·class="pre">bind</span></span><span·class="sig-paren">(</span><em·class="sig-param"><span·class="n"><span·class="pre">request</span></span></em><span·class="sig-paren">)</span><a·class="headerlink"·href="#webob.cookies.CookieProfile.bind"·title="Link·to·this·definition">¶</a></dt> | 77 | <span·class="sig-name·descname"><span·class="pre">bind</span></span><span·class="sig-paren">(</span><em·class="sig-param"><span·class="n"><span·class="pre">request</span></span></em><span·class="sig-paren">)</span><a·class="headerlink"·href="#webob.cookies.CookieProfile.bind"·title="Link·to·this·definition">¶</a></dt> |
78 | <dd><p>Bind·a·request·to·a·copy·of·this·instance·and·return·it</p> | 78 | <dd><p>Bind·a·request·to·a·copy·of·this·instance·and·return·it</p> |
79 | </dd></dl> | 79 | </dd></dl> |
80 | <dl·class="py·method"> | 80 | <dl·class="py·method"> |
81 | <dt·class="sig·sig-object·py"·id="webob.cookies.CookieProfile.get_value"> | 81 | <dt·class="sig·sig-object·py"·id="webob.cookies.CookieProfile.get_value"> |
82 | <span·class="sig-name·descname"><span·class="pre">get_value</span></span><span·class="sig-paren">(</span><span·class="sig-paren">)</span><a·class="headerlink"·href="#webob.cookies.CookieProfile.get_value"·title="Link·to·this·definition">¶</a></dt> | 82 | <span·class="sig-name·descname"><span·class="pre">get_value</span></span><span·class="sig-paren">(</span><span·class="sig-paren">)</span><a·class="headerlink"·href="#webob.cookies.CookieProfile.get_value"·title="Link·to·this·definition">¶</a></dt> |
83 | <dd><p>Looks·for·a·cookie·by·name·in·the·currently·bound·request,·and | 83 | <dd><p>Looks·for·a·cookie·by·name·in·the·currently·bound·request,·and |
84 | returns·its·value.··If·the·cookie·profile·is·not·bound·to·a·request, | 84 | returns·its·value.··If·the·cookie·profile·is·not·bound·to·a·request, |
85 | this·method·will·raise·a·< | 85 | this·method·will·raise·a·<code·class="xref·py·py-exc·docutils·literal·notranslate"><span·class="pre">ValueError</span></code>.</p> |
86 | <p>Looks·for·the·cookie·in·the·cookies·jar,·and·if·it·can·find·it·it·will | 86 | <p>Looks·for·the·cookie·in·the·cookies·jar,·and·if·it·can·find·it·it·will |
87 | attempt·to·deserialize·it.··Returns·<code·class="docutils·literal·notranslate"><span·class="pre">None</span></code>·if·there·is·no·cookie·or | 87 | attempt·to·deserialize·it.··Returns·<code·class="docutils·literal·notranslate"><span·class="pre">None</span></code>·if·there·is·no·cookie·or |
88 | if·the·value·in·the·cookie·cannot·be·successfully·deserialized.</p> | 88 | if·the·value·in·the·cookie·cannot·be·successfully·deserialized.</p> |
89 | </dd></dl> | 89 | </dd></dl> |
90 | <dl·class="py·method"> | 90 | <dl·class="py·method"> |
91 | <dt·class="sig·sig-object·py"·id="webob.cookies.CookieProfile.set_cookies"> | 91 | <dt·class="sig·sig-object·py"·id="webob.cookies.CookieProfile.set_cookies"> |
Offset 28, 21 lines modified | Offset 28, 21 lines modified | ||
28 | ············domain).·Can·be·passed·an·iterable·containing·multiple·domains, | 28 | ············domain).·Can·be·passed·an·iterable·containing·multiple·domains, |
29 | ············this·will·set·multiple·cookies·one·for·each·domain. | 29 | ············this·will·set·multiple·cookies·one·for·each·domain. |
30 | ········serializer | 30 | ········serializer |
31 | ············An·object·with·two·methods:·loads·and·dumps.·The·loads·method | 31 | ············An·object·with·two·methods:·loads·and·dumps.·The·loads·method |
32 | ············should·accept·a·bytestring·and·return·a·Python·object.·The·dumps | 32 | ············should·accept·a·bytestring·and·return·a·Python·object.·The·dumps |
33 | ············method·should·accept·a·Python·object·and·return·bytes.·A·ValueError | 33 | ············method·should·accept·a·Python·object·and·return·bytes.·A·ValueError |
34 | ············should·be·raised·for·malformed·inputs.·Default:·None,·which·will | 34 | ············should·be·raised·for·malformed·inputs.·Default:·None,·which·will |
35 | ············use·a·derivation·of· | 35 | ············use·a·derivation·of·json.dumps()·and·json.loads(). |
36 | ········bind(r\x8re\x8eq\x8qu\x8ue\x8es\x8st\x8t)_\x8¶ | 36 | ········bind(r\x8re\x8eq\x8qu\x8ue\x8es\x8st\x8t)_\x8¶ |
37 | ············Bind·a·request·to·a·copy·of·this·instance·and·return·it | 37 | ············Bind·a·request·to·a·copy·of·this·instance·and·return·it |
38 | ········get_value()_\x8¶ | 38 | ········get_value()_\x8¶ |
39 | ············Looks·for·a·cookie·by·name·in·the·currently·bound·request,·and | 39 | ············Looks·for·a·cookie·by·name·in·the·currently·bound·request,·and |
40 | ············returns·its·value.·If·the·cookie·profile·is·not·bound·to·a·request, | 40 | ············returns·its·value.·If·the·cookie·profile·is·not·bound·to·a·request, |
41 | ············this·method·will·raise·a· | 41 | ············this·method·will·raise·a·ValueError. |
42 | ············Looks·for·the·cookie·in·the·cookies·jar,·and·if·it·can·find·it·it | 42 | ············Looks·for·the·cookie·in·the·cookies·jar,·and·if·it·can·find·it·it |
43 | ············will·attempt·to·deserialize·it.·Returns·None·if·there·is·no·cookie | 43 | ············will·attempt·to·deserialize·it.·Returns·None·if·there·is·no·cookie |
44 | ············or·if·the·value·in·the·cookie·cannot·be·successfully·deserialized. | 44 | ············or·if·the·value·in·the·cookie·cannot·be·successfully·deserialized. |
45 | ········set_cookies(r\x8re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e,·v\x8va\x8al\x8lu\x8ue\x8e,·d\x8do\x8om\x8ma\x8ai\x8in\x8ns\x8s=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t·o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·m\x8ma\x8ax\x8x_\x8_a\x8ag\x8ge\x8e=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t | 45 | ········set_cookies(r\x8re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e,·v\x8va\x8al\x8lu\x8ue\x8e,·d\x8do\x8om\x8ma\x8ai\x8in\x8ns\x8s=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t·o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·m\x8ma\x8ax\x8x_\x8_a\x8ag\x8ge\x8e=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t |
46 | ········o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·p\x8pa\x8at\x8th\x8h=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t·o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·s\x8se\x8ec\x8cu\x8ur\x8re\x8e=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t·o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·h\x8ht\x8tt\x8tp\x8po\x8on\x8nl\x8ly\x8y=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t | 46 | ········o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·p\x8pa\x8at\x8th\x8h=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t·o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·s\x8se\x8ec\x8cu\x8ur\x8re\x8e=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t·o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·h\x8ht\x8tt\x8tp\x8po\x8on\x8nl\x8ly\x8y=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t |
47 | ········o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·s\x8sa\x8am\x8me\x8es\x8si\x8it\x8te\x8e=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t·o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>)_\x8¶ | 47 | ········o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·s\x8sa\x8am\x8me\x8es\x8si\x8it\x8te\x8e=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t·o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>)_\x8¶ |
48 | ············Set·the·cookies·on·a·response. | 48 | ············Set·the·cookies·on·a·response. |
Offset 42, 46 lines modified | Offset 42, 46 lines modified | ||
42 | <dd><p>Represents·a·WSGI·response.</p> | 42 | <dd><p>Represents·a·WSGI·response.</p> |
43 | <p>If·no·arguments·are·passed,·creates·a·<a·class="reference·internal"·href="#webob.response.Response"·title="webob.response.Response"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Response</span></code></a>·that·uses·a | 43 | <p>If·no·arguments·are·passed,·creates·a·<a·class="reference·internal"·href="#webob.response.Response"·title="webob.response.Response"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Response</span></code></a>·that·uses·a |
44 | variety·of·defaults.·The·defaults·may·be·changed·by·sub-classing·the | 44 | variety·of·defaults.·The·defaults·may·be·changed·by·sub-classing·the |
45 | <a·class="reference·internal"·href="#webob.response.Response"·title="webob.response.Response"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Response</span></code></a>.·See·the·<a·class="reference·internal"·href="#response-subclassing-notes"><span·class="std·std-ref">sub-classing·notes</span></a>.</p> | 45 | <a·class="reference·internal"·href="#webob.response.Response"·title="webob.response.Response"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Response</span></code></a>.·See·the·<a·class="reference·internal"·href="#response-subclassing-notes"><span·class="std·std-ref">sub-classing·notes</span></a>.</p> |
46 | <dl·class="field-list·simple"> | 46 | <dl·class="field-list·simple"> |
47 | <dt·class="field-odd">Variables<span·class="colon">:</span></dt> | 47 | <dt·class="field-odd">Variables<span·class="colon">:</span></dt> |
48 | <dd·class="field-odd"><ul·class="simple"> | 48 | <dd·class="field-odd"><ul·class="simple"> |
49 | <li><p><strong>~Response.body</strong>·(< | 49 | <li><p><strong>~Response.body</strong>·(<em>bytes</em><em>·or·</em><em>text_type</em>)·--·If·<code·class="docutils·literal·notranslate"><span·class="pre">body</span></code>·is·a·<code·class="docutils·literal·notranslate"><span·class="pre">text_type</span></code>,·then·it·will·be |
50 | encoded·using·either·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·when·provided·or·<code·class="docutils·literal·notranslate"><span·class="pre">default_encoding</span></code> | 50 | encoded·using·either·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·when·provided·or·<code·class="docutils·literal·notranslate"><span·class="pre">default_encoding</span></code> |
51 | when·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·is·not·provided·if·the·<code·class="docutils·literal·notranslate"><span·class="pre">content_type</span></code>·allows·for·a | 51 | when·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·is·not·provided·if·the·<code·class="docutils·literal·notranslate"><span·class="pre">content_type</span></code>·allows·for·a |
52 | <code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>.·This·argument·is·mutually··exclusive·with·<code·class="docutils·literal·notranslate"><span·class="pre">app_iter</span></code>.</p></li> | 52 | <code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>.·This·argument·is·mutually··exclusive·with·<code·class="docutils·literal·notranslate"><span·class="pre">app_iter</span></code>.</p></li> |
53 | <li><p><strong>~Response.status</strong>·(< | 53 | <li><p><strong>~Response.status</strong>·(<em>int</em><em>·or·</em><em>str</em>)·--·Either·an·<code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">int</span></code>·or·a·string·that·is |
54 | an·integer·followed·by·the·status·text.·If·it·is·an·integer,·it·will·be | 54 | an·integer·followed·by·the·status·text.·If·it·is·an·integer,·it·will·be |
55 | converted·to·a·proper·status·that·also·includes·the·status·text.··Any | 55 | converted·to·a·proper·status·that·also·includes·the·status·text.··Any |
56 | existing·status·text·will·be·kept.·Non-standard·values·are·allowed.</p></li> | 56 | existing·status·text·will·be·kept.·Non-standard·values·are·allowed.</p></li> |
57 | <li><p><strong>~Response.headerlist</strong>·(< | 57 | <li><p><strong>~Response.headerlist</strong>·(<em>list</em>)·--·A·list·of·HTTP·headers·for·the·response.</p></li> |
58 | <li><p><strong>~Response.app_iter</strong>·(<em>iterable</em>)·--·An·iterator·that·is·used·as·the·body·of·the | 58 | <li><p><strong>~Response.app_iter</strong>·(<em>iterable</em>)·--·An·iterator·that·is·used·as·the·body·of·the |
59 | response.·Should·conform·to·the·WSGI·requirements·and·should·provide | 59 | response.·Should·conform·to·the·WSGI·requirements·and·should·provide |
60 | bytes.·This·argument·is·mutually·exclusive·with·<code·class="docutils·literal·notranslate"><span·class="pre">body</span></code>.</p></li> | 60 | bytes.·This·argument·is·mutually·exclusive·with·<code·class="docutils·literal·notranslate"><span·class="pre">body</span></code>.</p></li> |
61 | <li><p><strong>~Response.content_type</strong>·(< | 61 | <li><p><strong>~Response.content_type</strong>·(<em>str</em><em>·or·</em><em>None</em>)·--·Sets·the·<code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>·header.·If·no |
62 | <code·class="docutils·literal·notranslate"><span·class="pre">content_type</span></code>·is·provided,·and·there·is·no·<code·class="docutils·literal·notranslate"><span·class="pre">headerlist</span></code>,·the | 62 | <code·class="docutils·literal·notranslate"><span·class="pre">content_type</span></code>·is·provided,·and·there·is·no·<code·class="docutils·literal·notranslate"><span·class="pre">headerlist</span></code>,·the |
63 | <code·class="docutils·literal·notranslate"><span·class="pre">default_content_type</span></code>·will·be·automatically·set.·If·<code·class="docutils·literal·notranslate"><span·class="pre">headerlist</span></code> | 63 | <code·class="docutils·literal·notranslate"><span·class="pre">default_content_type</span></code>·will·be·automatically·set.·If·<code·class="docutils·literal·notranslate"><span·class="pre">headerlist</span></code> |
64 | is·provided·then·this·value·is·ignored.</p></li> | 64 | is·provided·then·this·value·is·ignored.</p></li> |
65 | <li><p><strong>conditional_response</strong>·(< | 65 | <li><p><strong>conditional_response</strong>·(<em>bool</em>)·--·Used·to·change·the·behavior·of·the |
66 | <a·class="reference·internal"·href="#webob.response.Response"·title="webob.response.Response"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Response</span></code></a>·to·check·the·original·request·for·conditional | 66 | <a·class="reference·internal"·href="#webob.response.Response"·title="webob.response.Response"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Response</span></code></a>·to·check·the·original·request·for·conditional |
67 | response·headers.·See·<a·class="reference·internal"·href="#webob.response.Response.conditional_response_app"·title="webob.response.Response.conditional_response_app"><code·class="xref·py·py-meth·docutils·literal·notranslate"><span·class="pre">conditional_response_app()</span></code></a>·for | 67 | response·headers.·See·<a·class="reference·internal"·href="#webob.response.Response.conditional_response_app"·title="webob.response.Response.conditional_response_app"><code·class="xref·py·py-meth·docutils·literal·notranslate"><span·class="pre">conditional_response_app()</span></code></a>·for |
68 | more·information.</p></li> | 68 | more·information.</p></li> |
69 | <li><p><strong>~Response.charset</strong>·(< | 69 | <li><p><strong>~Response.charset</strong>·(<em>str</em><em>·or·</em><em>None</em>)·--·Adds·a·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·<code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>·parameter.·If |
70 | no·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·is·provided·and·the·<code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>·is·text,·then·the | 70 | no·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·is·provided·and·the·<code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>·is·text,·then·the |
71 | <code·class="docutils·literal·notranslate"><span·class="pre">default_charset</span></code>·will·automatically·be·added.··Currently·the·only | 71 | <code·class="docutils·literal·notranslate"><span·class="pre">default_charset</span></code>·will·automatically·be·added.··Currently·the·only |
72 | <code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>'s·that·allow·for·a·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·are·defined·to·be | 72 | <code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>'s·that·allow·for·a·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·are·defined·to·be |
73 | <code·class="docutils·literal·notranslate"><span·class="pre">text/*</span></code>,·<code·class="docutils·literal·notranslate"><span·class="pre">application/xml</span></code>,·and·<code·class="docutils·literal·notranslate"><span·class="pre">*/*+xml</span></code>.·Any·other | 73 | <code·class="docutils·literal·notranslate"><span·class="pre">text/*</span></code>,·<code·class="docutils·literal·notranslate"><span·class="pre">application/xml</span></code>,·and·<code·class="docutils·literal·notranslate"><span·class="pre">*/*+xml</span></code>.·Any·other |
74 | <code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>'s·will·not·have·a·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·added.·If·a | 74 | <code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>'s·will·not·have·a·<code·class="docutils·literal·notranslate"><span·class="pre">charset</span></code>·added.·If·a |
75 | <code·class="docutils·literal·notranslate"><span·class="pre">headerlist</span></code>·is·provided·this·value·is·ignored.</p></li> | 75 | <code·class="docutils·literal·notranslate"><span·class="pre">headerlist</span></code>·is·provided·this·value·is·ignored.</p></li> |
76 | </ul> | 76 | </ul> |
77 | </dd> | 77 | </dd> |
78 | </dl> | 78 | </dl> |
79 | <p>All·other·response·attributes·may·be·set·on·the·response·by·providing·them | 79 | <p>All·other·response·attributes·may·be·set·on·the·response·by·providing·them |
80 | as·keyword·arguments.·A·< | 80 | as·keyword·arguments.·A·<code·class="xref·py·py-exc·docutils·literal·notranslate"><span·class="pre">TypeError</span></code>·will·be·raised·for·any·unexpected |
81 | keywords.</p> | 81 | keywords.</p> |
82 | <p·id="response-subclassing-notes"><strong>Sub-classing·notes:</strong></p> | 82 | <p·id="response-subclassing-notes"><strong>Sub-classing·notes:</strong></p> |
83 | <ul·class="simple"> | 83 | <ul·class="simple"> |
84 | <li><p>The·<code·class="docutils·literal·notranslate"><span·class="pre">default_content_type</span></code>·is·used·as·the·default·for·the | 84 | <li><p>The·<code·class="docutils·literal·notranslate"><span·class="pre">default_content_type</span></code>·is·used·as·the·default·for·the |
85 | <code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>·header·that·is·returned·on·the·response.·It·is | 85 | <code·class="docutils·literal·notranslate"><span·class="pre">Content-Type</span></code>·header·that·is·returned·on·the·response.·It·is |
86 | <code·class="docutils·literal·notranslate"><span·class="pre">text/html</span></code>.</p></li> | 86 | <code·class="docutils·literal·notranslate"><span·class="pre">text/html</span></code>.</p></li> |
87 | <li><p>The·<code·class="docutils·literal·notranslate"><span·class="pre">default_charset</span></code>·is·used·as·the·default·character·set·to·return·on | 87 | <li><p>The·<code·class="docutils·literal·notranslate"><span·class="pre">default_charset</span></code>·is·used·as·the·default·character·set·to·return·on |
Offset 4, 47 lines modified | Offset 4, 47 lines modified | ||
4 | ··a\x8ap\x8pp\x8p_\x8_i\x8it\x8te\x8er\x8r=\x8=N\x8No\x8on\x8ne\x8e,·c\x8co\x8on\x8nt\x8te\x8en\x8nt\x8t_\x8_t\x8ty\x8yp\x8pe\x8e=\x8=N\x8No\x8on\x8ne\x8e,·c\x8co\x8on\x8nd\x8di\x8it\x8ti\x8io\x8on\x8na\x8al\x8l_\x8_r\x8re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e=\x8=N\x8No\x8on\x8ne\x8e,·c\x8ch\x8ha\x8ar\x8rs\x8se\x8et\x8t=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t | 4 | ··a\x8ap\x8pp\x8p_\x8_i\x8it\x8te\x8er\x8r=\x8=N\x8No\x8on\x8ne\x8e,·c\x8co\x8on\x8nt\x8te\x8en\x8nt\x8t_\x8_t\x8ty\x8yp\x8pe\x8e=\x8=N\x8No\x8on\x8ne\x8e,·c\x8co\x8on\x8nd\x8di\x8it\x8ti\x8io\x8on\x8na\x8al\x8l_\x8_r\x8re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e=\x8=N\x8No\x8on\x8ne\x8e,·c\x8ch\x8ha\x8ar\x8rs\x8se\x8et\x8t=\x8=<\x8<o\x8ob\x8bj\x8je\x8ec\x8ct\x8t |
5 | ··o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·*\x8**\x8*k\x8kw\x8w)_\x8¶ | 5 | ··o\x8ob\x8bj\x8je\x8ec\x8ct\x8t>\x8>,·*\x8**\x8*k\x8kw\x8w)_\x8¶ |
6 | ······Represents·a·WSGI·response. | 6 | ······Represents·a·WSGI·response. |
7 | ······If·no·arguments·are·passed,·creates·a·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e·that·uses·a·variety·of | 7 | ······If·no·arguments·are·passed,·creates·a·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e·that·uses·a·variety·of |
8 | ······defaults.·The·defaults·may·be·changed·by·sub-classing·the·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e.·See | 8 | ······defaults.·The·defaults·may·be·changed·by·sub-classing·the·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e.·See |
9 | ······the·_\x8s_\x8u_\x8b_\x8-_\x8c_\x8l_\x8a_\x8s_\x8s_\x8i_\x8n_\x8g_\x8·_\x8n_\x8o_\x8t_\x8e_\x8s. | 9 | ······the·_\x8s_\x8u_\x8b_\x8-_\x8c_\x8l_\x8a_\x8s_\x8s_\x8i_\x8n_\x8g_\x8·_\x8n_\x8o_\x8t_\x8e_\x8s. |
10 | ········Variables: | 10 | ········Variables: |
11 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.b\x8bo\x8od\x8dy\x8y·( | 11 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.b\x8bo\x8od\x8dy\x8y·(b.by.yt.te.es\x8s·o\x8or\x8r·t\x8te\x8ex\x8xt\x8t_\x8_t\x8ty\x8yp\x8pe\x8e)·--·If·body·is·a |
12 | ··················text_type,·then·it·will·be·encoded·using·either·charset·when | 12 | ··················text_type,·then·it·will·be·encoded·using·either·charset·when |
13 | ··················provided·or·default_encoding·when·charset·is·not·provided·if | 13 | ··················provided·or·default_encoding·when·charset·is·not·provided·if |
14 | ··················the·content_type·allows·for·a·charset.·This·argument·is | 14 | ··················the·content_type·allows·for·a·charset.·This·argument·is |
15 | ··················mutually·exclusive·with·app_iter. | 15 | ··················mutually·exclusive·with·app_iter. |
16 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.s\x8st\x8ta\x8at\x8tu\x8us\x8s·( | 16 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.s\x8st\x8ta\x8at\x8tu\x8us\x8s·(i.in.nt.t·o.or.r·s.st.tr.r)·--·Either·an·int·or·a·string |
17 | ··················that·is·an·integer·followed·by·the·status·text.·If·it·is·an | 17 | ··················that·is·an·integer·followed·by·the·status·text.·If·it·is·an |
18 | ··················integer,·it·will·be·converted·to·a·proper·status·that·also | 18 | ··················integer,·it·will·be·converted·to·a·proper·status·that·also |
19 | ··················includes·the·status·text.·Any·existing·status·text·will·be | 19 | ··················includes·the·status·text.·Any·existing·status·text·will·be |
20 | ··················kept.·Non-standard·values·are·allowed. | 20 | ··················kept.·Non-standard·values·are·allowed. |
21 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.h\x8he\x8ea\x8ad\x8de\x8er\x8rl\x8li\x8is\x8st\x8t·( | 21 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.h\x8he\x8ea\x8ad\x8de\x8er\x8rl\x8li\x8is\x8st\x8t·(l.li.is.st\x8t)·--·A·list·of·HTTP·headers·for·the |
22 | ··················response. | 22 | ··················response. |
23 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.a\x8ap\x8pp\x8p_\x8_i\x8it\x8te\x8er\x8r·(i\x8it\x8te\x8er\x8ra\x8ab\x8bl\x8le\x8e)·--·An·iterator·that·is·used·as | 23 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.a\x8ap\x8pp\x8p_\x8_i\x8it\x8te\x8er\x8r·(i\x8it\x8te\x8er\x8ra\x8ab\x8bl\x8le\x8e)·--·An·iterator·that·is·used·as |
24 | ··················the·body·of·the·response.·Should·conform·to·the·WSGI | 24 | ··················the·body·of·the·response.·Should·conform·to·the·WSGI |
25 | ··················requirements·and·should·provide·bytes.·This·argument·is | 25 | ··················requirements·and·should·provide·bytes.·This·argument·is |
26 | ··················mutually·exclusive·with·body. | 26 | ··················mutually·exclusive·with·body. |
27 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.c\x8co\x8on\x8nt\x8te\x8en\x8nt\x8t_\x8_t\x8ty\x8yp\x8pe\x8e·( | 27 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.c\x8co\x8on\x8nt\x8te\x8en\x8nt\x8t_\x8_t\x8ty\x8yp\x8pe\x8e·(s.st.tr\x8r·o\x8or\x8r·N\x8No\x8on\x8ne\x8e)·--·Sets·the·Content-Type |
28 | ··················header.·If·no·content_type·is·provided,·and·there·is·no | 28 | ··················header.·If·no·content_type·is·provided,·and·there·is·no |
29 | ··················headerlist,·the·default_content_type·will·be·automatically | 29 | ··················headerlist,·the·default_content_type·will·be·automatically |
30 | ··················set.·If·headerlist·is·provided·then·this·value·is·ignored. | 30 | ··················set.·If·headerlist·is·provided·then·this·value·is·ignored. |
31 | ················*·c\x8co\x8on\x8nd\x8di\x8it\x8ti\x8io\x8on\x8na\x8al\x8l_\x8_r\x8re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e·( | 31 | ················*·c\x8co\x8on\x8nd\x8di\x8it\x8ti\x8io\x8on\x8na\x8al\x8l_\x8_r\x8re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e·(b.bo.oo.ol\x8l)·--·Used·to·change·the·behavior·of |
32 | ··················the·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e·to·check·the·original·request·for·conditional | 32 | ··················the·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e·to·check·the·original·request·for·conditional |
33 | ··················response·headers.·See·_\x8c_\x8o_\x8n_\x8d_\x8i_\x8t_\x8i_\x8o_\x8n_\x8a_\x8l_\x8__\x8r_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e_\x8__\x8a_\x8p_\x8p_\x8(_\x8)·for·more | 33 | ··················response·headers.·See·_\x8c_\x8o_\x8n_\x8d_\x8i_\x8t_\x8i_\x8o_\x8n_\x8a_\x8l_\x8__\x8r_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e_\x8__\x8a_\x8p_\x8p_\x8(_\x8)·for·more |
34 | ··················information. | 34 | ··················information. |
35 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.c\x8ch\x8ha\x8ar\x8rs\x8se\x8et\x8t·( | 35 | ················*·~\x8~R\x8Re\x8es\x8sp\x8po\x8on\x8ns\x8se\x8e.\x8.c\x8ch\x8ha\x8ar\x8rs\x8se\x8et\x8t·(s.st.tr\x8r·o\x8or\x8r·N\x8No\x8on\x8ne\x8e)·--·Adds·a·charset·Content- |
36 | ··················Type·parameter.·If·no·charset·is·provided·and·the·Content- | 36 | ··················Type·parameter.·If·no·charset·is·provided·and·the·Content- |
37 | ··················Type·is·text,·then·the·default_charset·will·automatically·be | 37 | ··················Type·is·text,·then·the·default_charset·will·automatically·be |
38 | ··················added.·Currently·the·only·Content-Type's·that·allow·for·a | 38 | ··················added.·Currently·the·only·Content-Type's·that·allow·for·a |
39 | ··················charset·are·defined·to·be·text/*,·application/xml,·and·*/ | 39 | ··················charset·are·defined·to·be·text/*,·application/xml,·and·*/ |
40 | ··················*+xml.·Any·other·Content-Type's·will·not·have·a·charset | 40 | ··················*+xml.·Any·other·Content-Type's·will·not·have·a·charset |
41 | ··················added.·If·a·headerlist·is·provided·this·value·is·ignored. | 41 | ··················added.·If·a·headerlist·is·provided·this·value·is·ignored. |
42 | ······All·other·response·attributes·may·be·set·on·the·response·by·providing | 42 | ······All·other·response·attributes·may·be·set·on·the·response·by·providing |
43 | ······them·as·keyword·arguments.·A· | 43 | ······them·as·keyword·arguments.·A·TypeError·will·be·raised·for·any·unexpected |
44 | ······keywords. | 44 | ······keywords. |
45 | ······S\x8Su\x8ub\x8b-\x8-c\x8cl\x8la\x8as\x8ss\x8si\x8in\x8ng\x8g·n\x8no\x8ot\x8te\x8es\x8s:\x8: | 45 | ······S\x8Su\x8ub\x8b-\x8-c\x8cl\x8la\x8as\x8ss\x8si\x8in\x8ng\x8g·n\x8no\x8ot\x8te\x8es\x8s:\x8: |
46 | ··········*·The·default_content_type·is·used·as·the·default·for·the·Content- | 46 | ··········*·The·default_content_type·is·used·as·the·default·for·the·Content- |
47 | ············Type·header·that·is·returned·on·the·response.·It·is·text/html. | 47 | ············Type·header·that·is·returned·on·the·response.·It·is·text/html. |
48 | ··········*·The·default_charset·is·used·as·the·default·character·set·to·return | 48 | ··········*·The·default_charset·is·used·as·the·default·character·set·to·return |
49 | ············on·the·Content-Type·header,·if·the·Content-Type·allows·for·a | 49 | ············on·the·Content-Type·header,·if·the·Content-Type·allows·for·a |
50 | ············charset·parameter.·Currently·the·only·Content-Type's·that·allow·for | 50 | ············charset·parameter.·Currently·the·only·Content-Type's·that·allow·for |
Offset 181, 15 lines modified | Offset 181, 15 lines modified | ||
181 | <div·class="line"><em>extension_params</em>·is·the·extension·parameters,·as·a·list | 181 | <div·class="line"><em>extension_params</em>·is·the·extension·parameters,·as·a·list |
182 | where·each·item·is·either·a·parameter·string·or·a·(parameter | 182 | where·each·item·is·either·a·parameter·string·or·a·(parameter |
183 | name,·value)·tuple.</div> | 183 | name,·value)·tuple.</div> |
184 | </div> | 184 | </div> |
185 | </p> | 185 | </p> |
186 | </dd> | 186 | </dd> |
187 | <dt·class="field-odd">Raises<span·class="colon">:</span></dt> | 187 | <dt·class="field-odd">Raises<span·class="colon">:</span></dt> |
188 | <dd·class="field-odd"><p>< | 188 | <dd·class="field-odd"><p><strong>ValueError</strong>·--·if·<cite>value</cite>·is·an·invalid·header</p> |
189 | </dd> | 189 | </dd> |
190 | </dl> | 190 | </dl> |
191 | </dd></dl> | 191 | </dd></dl> |
192 | </dd></dl> | 192 | </dd></dl> |
193 | <dl·class="py·class"> | 193 | <dl·class="py·class"> |
Offset 19, 15 lines modified | Offset 19, 15 lines modified | ||
19 | ··c\x8cl\x8la\x8as\x8ss\x8s·webob.acceptparse.Accept_\x8¶ | 19 | ··c\x8cl\x8la\x8as\x8ss\x8s·webob.acceptparse.Accept_\x8¶ |
20 | ······Represent·an·Accept·header. | 20 | ······Represent·an·Accept·header. |
21 | ······Base·class·for·_\x8A_\x8c_\x8c_\x8e_\x8p_\x8t_\x8V_\x8a_\x8l_\x8i_\x8d_\x8H_\x8e_\x8a_\x8d_\x8e_\x8r,·_\x8A_\x8c_\x8c_\x8e_\x8p_\x8t_\x8N_\x8o_\x8H_\x8e_\x8a_\x8d_\x8e_\x8r,·and | 21 | ······Base·class·for·_\x8A_\x8c_\x8c_\x8e_\x8p_\x8t_\x8V_\x8a_\x8l_\x8i_\x8d_\x8H_\x8e_\x8a_\x8d_\x8e_\x8r,·_\x8A_\x8c_\x8c_\x8e_\x8p_\x8t_\x8N_\x8o_\x8H_\x8e_\x8a_\x8d_\x8e_\x8r,·and |
22 | ······_\x8A_\x8c_\x8c_\x8e_\x8p_\x8t_\x8I_\x8n_\x8v_\x8a_\x8l_\x8i_\x8d_\x8H_\x8e_\x8a_\x8d_\x8e_\x8r. | 22 | ······_\x8A_\x8c_\x8c_\x8e_\x8p_\x8t_\x8I_\x8n_\x8v_\x8a_\x8l_\x8i_\x8d_\x8H_\x8e_\x8a_\x8d_\x8e_\x8r. |
23 | ········c\x8cl\x8la\x8as\x8ss\x8sm\x8me\x8et\x8th\x8ho\x8od\x8d·parse(v\x8va\x8al\x8lu\x8ue\x8e)_\x8¶ | 23 | ········c\x8cl\x8la\x8as\x8ss\x8sm\x8me\x8et\x8th\x8ho\x8od\x8d·parse(v\x8va\x8al\x8lu\x8ue\x8e)_\x8¶ |
24 | ············Parse·an·Accept·header. | 24 | ············Parse·an·Accept·header. |
25 | ··············Raises: | 25 | ··············Raises: |
26 | ·················· | 26 | ··················V.Va.al.lu.ue.eE.Er.rr.ro.or\x8r·--·ifvalueis·an·invalid·header |
27 | ··c\x8cl\x8la\x8as\x8ss\x8s·webob.acceptparse.AcceptOffer(t\x8ty\x8yp\x8pe\x8e,·s\x8su\x8ub\x8bt\x8ty\x8yp\x8pe\x8e,·p\x8pa\x8ar\x8ra\x8am\x8ms\x8s)_\x8¶ | 27 | ··c\x8cl\x8la\x8as\x8ss\x8s·webob.acceptparse.AcceptOffer(t\x8ty\x8yp\x8pe\x8e,·s\x8su\x8ub\x8bt\x8ty\x8yp\x8pe\x8e,·p\x8pa\x8ar\x8ra\x8am\x8ms\x8s)_\x8¶ |
28 | ······A·pre-parsed·offer·tuple·represeting·a·value·in·the·format·type/ | 28 | ······A·pre-parsed·offer·tuple·represeting·a·value·in·the·format·type/ |
29 | ······subtype;param0=value0;param1=value1. | 29 | ······subtype;param0=value0;param1=value1. |
30 | ········Variables: | 30 | ········Variables: |
31 | ················*·t\x8ty\x8yp\x8pe\x8e·--·The·media·type's·root·category. | 31 | ················*·t\x8ty\x8yp\x8pe\x8e·--·The·media·type's·root·category. |
32 | ················*·s\x8su\x8ub\x8bt\x8ty\x8yp\x8pe\x8e·--·The·media·type's·subtype. | 32 | ················*·s\x8su\x8ub\x8bt\x8ty\x8yp\x8pe\x8e·--·The·media·type's·subtype. |
33 | ················*·p\x8pa\x8ar\x8ra\x8am\x8ms\x8s·--·A·tuple·of·2-tuples·containing·parameter·names·and | 33 | ················*·p\x8pa\x8ar\x8ra\x8am\x8ms\x8s·--·A·tuple·of·2-tuples·containing·parameter·names·and |
Offset 588, 15 lines modified | Offset 588, 15 lines modified | ||
588 | your·preferred·encoding,·it·always·uses·UTF-8).··The·WebOb·method | 588 | your·preferred·encoding,·it·always·uses·UTF-8).··The·WebOb·method |
589 | <code·class="docutils·literal·notranslate"><span·class="pre">resp.write(text)</span></code>·is·basically·equivalent,·and·also·accepts | 589 | <code·class="docutils·literal·notranslate"><span·class="pre">resp.write(text)</span></code>·is·basically·equivalent,·and·also·accepts |
590 | unicode·(using·<code·class="docutils·literal·notranslate"><span·class="pre">resp.charset</span></code>·for·the·encoding).··You·can·also | 590 | unicode·(using·<code·class="docutils·literal·notranslate"><span·class="pre">resp.charset</span></code>·for·the·encoding).··You·can·also |
591 | write·to·<code·class="docutils·literal·notranslate"><span·class="pre">resp.body_file</span></code>,·but·it·does·not·allow·unicode.</p> | 591 | write·to·<code·class="docutils·literal·notranslate"><span·class="pre">resp.body_file</span></code>,·but·it·does·not·allow·unicode.</p> |
592 | </dd> | 592 | </dd> |
593 | </dl> | 593 | </dl> |
594 | <p>Besides·exposing·a·<code·class="docutils·literal·notranslate"><span·class="pre">.headers</span></code>·attribute·(based·on | 594 | <p>Besides·exposing·a·<code·class="docutils·literal·notranslate"><span·class="pre">.headers</span></code>·attribute·(based·on |
595 | < | 595 | <code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">wsgiref.headers.Headers</span></code>) |
596 | there·is·no·other·API·for·the·webapp·response·object.··This·means·the | 596 | there·is·no·other·API·for·the·webapp·response·object.··This·means·the |
597 | response·lacks:</p> | 597 | response·lacks:</p> |
598 | <ul·class="simple"> | 598 | <ul·class="simple"> |
599 | <li><p>A·usefully·readable·body·or·status.</p></li> | 599 | <li><p>A·usefully·readable·body·or·status.</p></li> |
600 | <li><p>A·useful·constructor·that·makes·it·easy·to·treat·responses·like | 600 | <li><p>A·useful·constructor·that·makes·it·easy·to·treat·responses·like |
601 | objects.</p></li> | 601 | objects.</p></li> |
602 | <li><p>Providing·a·non-string·<code·class="docutils·literal·notranslate"><span·class="pre">app_iter</span></code>·for·the·body·(like·a·generator).</p></li> | 602 | <li><p>Providing·a·non-string·<code·class="docutils·literal·notranslate"><span·class="pre">app_iter</span></code>·for·the·body·(like·a·generator).</p></li> |
Offset 417, 15 lines modified | Offset 417, 15 lines modified | ||
417 | ······This·writes·to·an·internal·StringIO·instance·of·the·response.·This·uses | 417 | ······This·writes·to·an·internal·StringIO·instance·of·the·response.·This·uses |
418 | ······the·ability·of·the·standard·StringIO·object·to·hold·either·unicode·or·str | 418 | ······the·ability·of·the·standard·StringIO·object·to·hold·either·unicode·or·str |
419 | ······text,·and·so·long·as·you·are·always·consistent·it·will·encode·your | 419 | ······text,·and·so·long·as·you·are·always·consistent·it·will·encode·your |
420 | ······content·(but·it·does·not·respect·your·preferred·encoding,·it·always·uses | 420 | ······content·(but·it·does·not·respect·your·preferred·encoding,·it·always·uses |
421 | ······UTF-8).·The·WebOb·method·resp.write(text)·is·basically·equivalent,·and | 421 | ······UTF-8).·The·WebOb·method·resp.write(text)·is·basically·equivalent,·and |
422 | ······also·accepts·unicode·(using·resp.charset·for·the·encoding).·You·can·also | 422 | ······also·accepts·unicode·(using·resp.charset·for·the·encoding).·You·can·also |
423 | ······write·to·resp.body_file,·but·it·does·not·allow·unicode. | 423 | ······write·to·resp.body_file,·but·it·does·not·allow·unicode. |
424 | Besides·exposing·a·.headers·attribute·(based·on· | 424 | Besides·exposing·a·.headers·attribute·(based·on·wsgiref.headers.Headers)·there |
425 | is·no·other·API·for·the·webapp·response·object.·This·means·the·response·lacks: | 425 | is·no·other·API·for·the·webapp·response·object.·This·means·the·response·lacks: |
426 | ····*·A·usefully·readable·body·or·status. | 426 | ····*·A·usefully·readable·body·or·status. |
427 | ····*·A·useful·constructor·that·makes·it·easy·to·treat·responses·like·objects. | 427 | ····*·A·useful·constructor·that·makes·it·easy·to·treat·responses·like·objects. |
428 | ····*·Providing·a·non-string·app_iter·for·the·body·(like·a·generator). | 428 | ····*·Providing·a·non-string·app_iter·for·the·body·(like·a·generator). |
429 | ····*·Parsing·of·the·Content-Type·charset. | 429 | ····*·Parsing·of·the·Content-Type·charset. |
430 | ····*·Getter/setters·for·parsed·forms·of·headers,·specifically·cache_control | 430 | ····*·Getter/setters·for·parsed·forms·of·headers,·specifically·cache_control |
431 | ······and·last_modified. | 431 | ······and·last_modified. |
Offset 125, 15 lines modified | Offset 125, 15 lines modified | ||
125 | <h2><a·class="toc-backref"·href="#id5"·role="doc-backlink">Serving·Your·Application</a><a·class="headerlink"·href="#serving-your-application"·title="Link·to·this·heading">¶</a></h2> | 125 | <h2><a·class="toc-backref"·href="#id5"·role="doc-backlink">Serving·Your·Application</a><a·class="headerlink"·href="#serving-your-application"·title="Link·to·this·heading">¶</a></h2> |
126 | <p>While·we·can·test·the·application·using·WebOb,·you·might·want·to·serve·the·application.··Here's·the·basic·recipe,·using·the·<a·class="reference·external"·href="https://pypi.python.org/pypi/Paste">Paste</a>·HTTP·server:</p> | 126 | <p>While·we·can·test·the·application·using·WebOb,·you·might·want·to·serve·the·application.··Here's·the·basic·recipe,·using·the·<a·class="reference·external"·href="https://pypi.python.org/pypi/Paste">Paste</a>·HTTP·server:</p> |
127 | <div·class="highlight-python·notranslate"><div·class="highlight"><pre><span></span><span·class="k">if</span>·<span·class="vm">__name__</span>·<span·class="o">==</span>·<span·class="s1">'__main__'</span><span·class="p">:</span> | 127 | <div·class="highlight-python·notranslate"><div·class="highlight"><pre><span></span><span·class="k">if</span>·<span·class="vm">__name__</span>·<span·class="o">==</span>·<span·class="s1">'__main__'</span><span·class="p">:</span> |
128 | ····<span·class="kn">from</span>·<span·class="nn">paste</span>·<span·class="kn">import</span>·<span·class="n">httpserver</span> | 128 | ····<span·class="kn">from</span>·<span·class="nn">paste</span>·<span·class="kn">import</span>·<span·class="n">httpserver</span> |
129 | ····<span·class="n">httpserver</span><span·class="o">.</span><span·class="n">serve</span><span·class="p">(</span><span·class="n">app</span><span·class="p">,</span>·<span·class="n">host</span><span·class="o">=</span><span·class="s1">'127.0.0.1'</span><span·class="p">,</span>·<span·class="n">port</span><span·class="o">=</span><span·class="mi">8080</span><span·class="p">)</span> | 129 | ····<span·class="n">httpserver</span><span·class="o">.</span><span·class="n">serve</span><span·class="p">(</span><span·class="n">app</span><span·class="p">,</span>·<span·class="n">host</span><span·class="o">=</span><span·class="s1">'127.0.0.1'</span><span·class="p">,</span>·<span·class="n">port</span><span·class="o">=</span><span·class="mi">8080</span><span·class="p">)</span> |
130 | </pre></div> | 130 | </pre></div> |
131 | </div> | 131 | </div> |
132 | <p>You·could·also·use·< | 132 | <p>You·could·also·use·<code·class="xref·py·py-mod·docutils·literal·notranslate"><span·class="pre">wsgiref.simple_server</span></code>·from·the·standard·library,·but·this·is·mostly·appropriate·for·testing·as·it·is·single-threaded:</p> |
133 | <div·class="highlight-python·notranslate"><div·class="highlight"><pre><span></span><span·class="k">if</span>·<span·class="vm">__name__</span>·<span·class="o">==</span>·<span·class="s1">'__main__'</span><span·class="p">:</span> | 133 | <div·class="highlight-python·notranslate"><div·class="highlight"><pre><span></span><span·class="k">if</span>·<span·class="vm">__name__</span>·<span·class="o">==</span>·<span·class="s1">'__main__'</span><span·class="p">:</span> |
134 | ····<span·class="kn">from</span>·<span·class="nn">wsgiref.simple_server</span>·<span·class="kn">import</span>·<span·class="n">make_server</span> | 134 | ····<span·class="kn">from</span>·<span·class="nn">wsgiref.simple_server</span>·<span·class="kn">import</span>·<span·class="n">make_server</span> |
135 | ····<span·class="n">server</span>·<span·class="o">=</span>·<span·class="n">make_server</span><span·class="p">(</span><span·class="s1">'127.0.0.1'</span><span·class="p">,</span>·<span·class="mi">8080</span><span·class="p">,</span>·<span·class="n">app</span><span·class="p">)</span> | 135 | ····<span·class="n">server</span>·<span·class="o">=</span>·<span·class="n">make_server</span><span·class="p">(</span><span·class="s1">'127.0.0.1'</span><span·class="p">,</span>·<span·class="mi">8080</span><span·class="p">,</span>·<span·class="n">app</span><span·class="p">)</span> |
136 | ····<span·class="n">server</span><span·class="o">.</span><span·class="n">serve_forever</span><span·class="p">()</span> | 136 | ····<span·class="n">server</span><span·class="o">.</span><span·class="n">serve_forever</span><span·class="p">()</span> |
137 | </pre></div> | 137 | </pre></div> |
138 | </div> | 138 | </div> |
139 | </section> | 139 | </section> |
Offset 94, 15 lines modified | Offset 94, 15 lines modified | ||
94 | number·of·unicode·issues. | 94 | number·of·unicode·issues. |
95 | *\x8**\x8**\x8**\x8**\x8*·_\x8S\x8S_\x8e\x8e_\x8r\x8r_\x8v\x8v_\x8i\x8i_\x8n\x8n_\x8g\x8g_\x8·_\x8Y\x8Y_\x8o\x8o_\x8u\x8u_\x8r\x8r_\x8·_\x8A\x8A_\x8p\x8p_\x8p\x8p_\x8l\x8l_\x8i\x8i_\x8c\x8c_\x8a\x8a_\x8t\x8t_\x8i\x8i_\x8o\x8o_\x8n\x8n_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* | 95 | *\x8**\x8**\x8**\x8**\x8*·_\x8S\x8S_\x8e\x8e_\x8r\x8r_\x8v\x8v_\x8i\x8i_\x8n\x8n_\x8g\x8g_\x8·_\x8Y\x8Y_\x8o\x8o_\x8u\x8u_\x8r\x8r_\x8·_\x8A\x8A_\x8p\x8p_\x8p\x8p_\x8l\x8l_\x8i\x8i_\x8c\x8c_\x8a\x8a_\x8t\x8t_\x8i\x8i_\x8o\x8o_\x8n\x8n_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* |
96 | While·we·can·test·the·application·using·WebOb,·you·might·want·to·serve·the | 96 | While·we·can·test·the·application·using·WebOb,·you·might·want·to·serve·the |
97 | application.·Here's·the·basic·recipe,·using·the·_\x8P_\x8a_\x8s_\x8t_\x8e·HTTP·server: | 97 | application.·Here's·the·basic·recipe,·using·the·_\x8P_\x8a_\x8s_\x8t_\x8e·HTTP·server: |
98 | if·__name__·==·'__main__': | 98 | if·__name__·==·'__main__': |
99 | ····from·paste·import·httpserver | 99 | ····from·paste·import·httpserver |
100 | ····httpserver.serve(app,·host='127.0.0.1',·port=8080) | 100 | ····httpserver.serve(app,·host='127.0.0.1',·port=8080) |
101 | You·could·also·use· | 101 | You·could·also·use·wsgiref.simple_server·from·the·standard·library,·but·this·is |
102 | mostly·appropriate·for·testing·as·it·is·single-threaded: | 102 | mostly·appropriate·for·testing·as·it·is·single-threaded: |
103 | if·__name__·==·'__main__': | 103 | if·__name__·==·'__main__': |
104 | ····from·wsgiref.simple_server·import·make_server | 104 | ····from·wsgiref.simple_server·import·make_server |
105 | ····server·=·make_server('127.0.0.1',·8080,·app) | 105 | ····server·=·make_server('127.0.0.1',·8080,·app) |
106 | ····server.serve_forever() | 106 | ····server.serve_forever() |
107 | *\x8**\x8**\x8**\x8**\x8*·_\x8M\x8M_\x8a\x8a_\x8k\x8k_\x8i\x8i_\x8n\x8n_\x8g\x8g_\x8·_\x8A\x8A_\x8·_\x8F\x8F_\x8r\x8r_\x8a\x8a_\x8m\x8m_\x8e\x8e_\x8w\x8w_\x8o\x8o_\x8r\x8r_\x8k\x8k_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* | 107 | *\x8**\x8**\x8**\x8**\x8*·_\x8M\x8M_\x8a\x8a_\x8k\x8k_\x8i\x8i_\x8n\x8n_\x8g\x8g_\x8·_\x8A\x8A_\x8·_\x8F\x8F_\x8r\x8r_\x8a\x8a_\x8m\x8m_\x8e\x8e_\x8w\x8w_\x8o\x8o_\x8r\x8r_\x8k\x8k_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* |
108 | Well,·now·we·need·to·start·work·on·our·framework. | 108 | Well,·now·we·need·to·start·work·on·our·framework. |
Offset 153, 15 lines modified | Offset 153, 15 lines modified | ||
153 | </div></blockquote> | 153 | </div></blockquote> |
154 | <p>Also·for·standard·HTTP·request·headers,·there·are·usually·attributes,·e.g., | 154 | <p>Also·for·standard·HTTP·request·headers,·there·are·usually·attributes,·e.g., |
155 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.accept_language"·title="webob.request.BaseRequest.accept_language"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">req.accept_language</span></code></a>, | 155 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.accept_language"·title="webob.request.BaseRequest.accept_language"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">req.accept_language</span></code></a>, |
156 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.content_length"·title="webob.request.BaseRequest.content_length"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">req.content_length</span></code></a>,·and | 156 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.content_length"·title="webob.request.BaseRequest.content_length"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">req.content_length</span></code></a>,·and |
157 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.user_agent"·title="webob.request.BaseRequest.user_agent"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">req.user_agent</span></code></a>.·These·properties | 157 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.user_agent"·title="webob.request.BaseRequest.user_agent"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">req.user_agent</span></code></a>.·These·properties |
158 | expose·the·<em>parsed</em>·form·of·each·header,·for·whatever·parsing·makes·sense.·For | 158 | expose·the·<em>parsed</em>·form·of·each·header,·for·whatever·parsing·makes·sense.·For |
159 | instance,·<a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.if_modified_since"·title="webob.request.BaseRequest.if_modified_since"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">req.if_modified_since</span></code></a>·returns·a | 159 | instance,·<a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.if_modified_since"·title="webob.request.BaseRequest.if_modified_since"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">req.if_modified_since</span></code></a>·returns·a |
160 | < | 160 | <code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">datetime</span></code>·object·(or·<code·class="docutils·literal·notranslate"><span·class="pre">None</span></code>·if·the·header·is·was·not |
161 | provided).·Details·are·in·the·<a·class="reference·internal"·href="api/request.html#module-webob.request"·title="webob.request"><code·class="xref·py·py-mod·docutils·literal·notranslate"><span·class="pre">Request</span>·<span·class="pre">object</span>·<span·class="pre">API</span>·<span·class="pre">documentation</span></code></a>.</p> | 161 | provided).·Details·are·in·the·<a·class="reference·internal"·href="api/request.html#module-webob.request"·title="webob.request"><code·class="xref·py·py-mod·docutils·literal·notranslate"><span·class="pre">Request</span>·<span·class="pre">object</span>·<span·class="pre">API</span>·<span·class="pre">documentation</span></code></a>.</p> |
162 | <section·id="urls"> | 162 | <section·id="urls"> |
163 | <h3>URLs<a·class="headerlink"·href="#urls"·title="Link·to·this·heading">¶</a></h3> | 163 | <h3>URLs<a·class="headerlink"·href="#urls"·title="Link·to·this·heading">¶</a></h3> |
164 | <p>In·addition·to·these·attributes,·there·are·several·ways·to·get·the·URL | 164 | <p>In·addition·to·these·attributes,·there·are·several·ways·to·get·the·URL |
165 | of·the·request.··I'll·show·various·values·for·an·example·URL | 165 | of·the·request.··I'll·show·various·values·for·an·example·URL |
166 | <code·class="docutils·literal·notranslate"><span·class="pre">http://localhost/app-root/doc?article_id=10</span></code>,·where·the·application | 166 | <code·class="docutils·literal·notranslate"><span·class="pre">http://localhost/app-root/doc?article_id=10</span></code>,·where·the·application |
167 | is·mounted·at·<code·class="docutils·literal·notranslate"><span·class="pre">http://localhost/app-root</span></code>.</p> | 167 | is·mounted·at·<code·class="docutils·literal·notranslate"><span·class="pre">http://localhost/app-root</span></code>.</p> |
Offset 70, 15 lines modified | Offset 70, 15 lines modified | ||
70 | ·················A·simple·dictionary·of·all·the·cookies. | 70 | ·················A·simple·dictionary·of·all·the·cookies. |
71 | ·········*···_\x8r_\x8e_\x8q_\x8._\x8h_\x8e_\x8a_\x8d_\x8e_\x8r_\x8s: | 71 | ·········*···_\x8r_\x8e_\x8q_\x8._\x8h_\x8e_\x8a_\x8d_\x8e_\x8r_\x8s: |
72 | ·················A·dictionary·of·all·the·headers.·This·dictionary·is·case- | 72 | ·················A·dictionary·of·all·the·headers.·This·dictionary·is·case- |
73 | ·················insensitive. | 73 | ·················insensitive. |
74 | Also·for·standard·HTTP·request·headers,·there·are·usually·attributes,·e.g., | 74 | Also·for·standard·HTTP·request·headers,·there·are·usually·attributes,·e.g., |
75 | _\x8r_\x8e_\x8q_\x8._\x8a_\x8c_\x8c_\x8e_\x8p_\x8t_\x8__\x8l_\x8a_\x8n_\x8g_\x8u_\x8a_\x8g_\x8e,·_\x8r_\x8e_\x8q_\x8._\x8c_\x8o_\x8n_\x8t_\x8e_\x8n_\x8t_\x8__\x8l_\x8e_\x8n_\x8g_\x8t_\x8h,·and·_\x8r_\x8e_\x8q_\x8._\x8u_\x8s_\x8e_\x8r_\x8__\x8a_\x8g_\x8e_\x8n_\x8t.·These·properties | 75 | _\x8r_\x8e_\x8q_\x8._\x8a_\x8c_\x8c_\x8e_\x8p_\x8t_\x8__\x8l_\x8a_\x8n_\x8g_\x8u_\x8a_\x8g_\x8e,·_\x8r_\x8e_\x8q_\x8._\x8c_\x8o_\x8n_\x8t_\x8e_\x8n_\x8t_\x8__\x8l_\x8e_\x8n_\x8g_\x8t_\x8h,·and·_\x8r_\x8e_\x8q_\x8._\x8u_\x8s_\x8e_\x8r_\x8__\x8a_\x8g_\x8e_\x8n_\x8t.·These·properties |
76 | expose·the·p\x8pa\x8ar\x8rs\x8se\x8ed\x8d·form·of·each·header,·for·whatever·parsing·makes·sense.·For | 76 | expose·the·p\x8pa\x8ar\x8rs\x8se\x8ed\x8d·form·of·each·header,·for·whatever·parsing·makes·sense.·For |
77 | instance,·_\x8r_\x8e_\x8q_\x8._\x8i_\x8f_\x8__\x8m_\x8o_\x8d_\x8i_\x8f_\x8i_\x8e_\x8d_\x8__\x8s_\x8i_\x8n_\x8c_\x8e·returns·a· | 77 | instance,·_\x8r_\x8e_\x8q_\x8._\x8i_\x8f_\x8__\x8m_\x8o_\x8d_\x8i_\x8f_\x8i_\x8e_\x8d_\x8__\x8s_\x8i_\x8n_\x8c_\x8e·returns·a·datetime·object·(or·None·if·the |
78 | header·is·was·not·provided).·Details·are·in·the·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8·_\x8o_\x8b_\x8j_\x8e_\x8c_\x8t_\x8·_\x8A_\x8P_\x8I | 78 | header·is·was·not·provided).·Details·are·in·the·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8·_\x8o_\x8b_\x8j_\x8e_\x8c_\x8t_\x8·_\x8A_\x8P_\x8I |
79 | _\x8d_\x8o_\x8c_\x8u_\x8m_\x8e_\x8n_\x8t_\x8a_\x8t_\x8i_\x8o_\x8n. | 79 | _\x8d_\x8o_\x8c_\x8u_\x8m_\x8e_\x8n_\x8t_\x8a_\x8t_\x8i_\x8o_\x8n. |
80 | *\x8**\x8**\x8**\x8*·U\x8UR\x8RL\x8Ls\x8s_\x8?\x8¶·*\x8**\x8**\x8**\x8* | 80 | *\x8**\x8**\x8**\x8*·U\x8UR\x8RL\x8Ls\x8s_\x8?\x8¶·*\x8**\x8**\x8**\x8* |
81 | In·addition·to·these·attributes,·there·are·several·ways·to·get·the·URL·of·the | 81 | In·addition·to·these·attributes,·there·are·several·ways·to·get·the·URL·of·the |
82 | request.·I'll·show·various·values·for·an·example·URL·http://localhost/app-root/ | 82 | request.·I'll·show·various·values·for·an·example·URL·http://localhost/app-root/ |
83 | doc?article_id=10,·where·the·application·is·mounted·at·http://localhost/app- | 83 | doc?article_id=10,·where·the·application·is·mounted·at·http://localhost/app- |
84 | root. | 84 | root. |
Offset 117, 15 lines modified | Offset 117, 15 lines modified | ||
117 | HTTP,·we·choose·a·500·resonse,·as·giving·an·error·with·a·200 | 117 | HTTP,·we·choose·a·500·resonse,·as·giving·an·error·with·a·200 |
118 | response·is·irresponsible.</p></li> | 118 | response·is·irresponsible.</p></li> |
119 | </ul> | 119 | </ul> |
120 | </section> | 120 | </section> |
121 | <section·id="infrastructure"> | 121 | <section·id="infrastructure"> |
122 | <h2><a·class="toc-backref"·href="#id5"·role="doc-backlink">Infrastructure</a><a·class="headerlink"·href="#infrastructure"·title="Link·to·this·heading">¶</a></h2> | 122 | <h2><a·class="toc-backref"·href="#id5"·role="doc-backlink">Infrastructure</a><a·class="headerlink"·href="#infrastructure"·title="Link·to·this·heading">¶</a></h2> |
123 | <p>To·make·this·easier·to·test,·we'll·set·up·a·bit·of·infrastructure. | 123 | <p>To·make·this·easier·to·test,·we'll·set·up·a·bit·of·infrastructure. |
124 | This·will·open·up·a·server·(using·< | 124 | This·will·open·up·a·server·(using·<code·class="xref·py·py-mod·docutils·literal·notranslate"><span·class="pre">wsgiref.simple_server</span></code>) |
125 | and·serve·up·our·application·(note·that·<em>creating</em>·the·application·is | 125 | and·serve·up·our·application·(note·that·<em>creating</em>·the·application·is |
126 | left·out·to·start·with):</p> | 126 | left·out·to·start·with):</p> |
127 | <div·class="highlight-python·notranslate"><div·class="highlight"><pre><span></span><span·class="kn">import</span>·<span·class="nn">sys</span> | 127 | <div·class="highlight-python·notranslate"><div·class="highlight"><pre><span></span><span·class="kn">import</span>·<span·class="nn">sys</span> |
128 | <span·class="k">def</span>·<span·class="nf">main</span><span·class="p">(</span><span·class="n">args</span><span·class="o">=</span><span·class="kc">None</span><span·class="p">):</span> | 128 | <span·class="k">def</span>·<span·class="nf">main</span><span·class="p">(</span><span·class="n">args</span><span·class="o">=</span><span·class="kc">None</span><span·class="p">):</span> |
129 | ····<span·class="kn">import</span>·<span·class="nn">optparse</span> | 129 | ····<span·class="kn">import</span>·<span·class="nn">optparse</span> |
130 | ····<span·class="kn">from</span>·<span·class="nn">wsgiref</span>·<span·class="kn">import</span>·<span·class="n">simple_server</span> | 130 | ····<span·class="kn">from</span>·<span·class="nn">wsgiref</span>·<span·class="kn">import</span>·<span·class="n">simple_server</span> |
Offset 51, 15 lines modified | Offset 51, 15 lines modified | ||
51 | ·······"id":·"arbitrary-something"} | 51 | ·······"id":·"arbitrary-something"} |
52 | ····*·It·doesn't·seem·to·indicate·if·an·error·response·should·have·a·200 | 52 | ····*·It·doesn't·seem·to·indicate·if·an·error·response·should·have·a·200 |
53 | ······response·or·a·500·response.·So·as·not·to·be·completely·stupid·about·HTTP, | 53 | ······response·or·a·500·response.·So·as·not·to·be·completely·stupid·about·HTTP, |
54 | ······we·choose·a·500·resonse,·as·giving·an·error·with·a·200·response·is | 54 | ······we·choose·a·500·resonse,·as·giving·an·error·with·a·200·response·is |
55 | ······irresponsible. | 55 | ······irresponsible. |
56 | *\x8**\x8**\x8**\x8**\x8*·_\x8I\x8I_\x8n\x8n_\x8f\x8f_\x8r\x8r_\x8a\x8a_\x8s\x8s_\x8t\x8t_\x8r\x8r_\x8u\x8u_\x8c\x8c_\x8t\x8t_\x8u\x8u_\x8r\x8r_\x8e\x8e_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* | 56 | *\x8**\x8**\x8**\x8**\x8*·_\x8I\x8I_\x8n\x8n_\x8f\x8f_\x8r\x8r_\x8a\x8a_\x8s\x8s_\x8t\x8t_\x8r\x8r_\x8u\x8u_\x8c\x8c_\x8t\x8t_\x8u\x8u_\x8r\x8r_\x8e\x8e_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* |
57 | To·make·this·easier·to·test,·we'll·set·up·a·bit·of·infrastructure.·This·will | 57 | To·make·this·easier·to·test,·we'll·set·up·a·bit·of·infrastructure.·This·will |
58 | open·up·a·server·(using· | 58 | open·up·a·server·(using·wsgiref.simple_server)·and·serve·up·our·application |
59 | (note·that·c\x8cr\x8re\x8ea\x8at\x8ti\x8in\x8ng\x8g·the·application·is·left·out·to·start·with): | 59 | (note·that·c\x8cr\x8re\x8ea\x8at\x8ti\x8in\x8ng\x8g·the·application·is·left·out·to·start·with): |
60 | import·sys | 60 | import·sys |
61 | def·main(args=None): | 61 | def·main(args=None): |
62 | ····import·optparse | 62 | ····import·optparse |
63 | ····from·wsgiref·import·simple_server | 63 | ····from·wsgiref·import·simple_server |
64 | ····parser·=·optparse.OptionParser( | 64 | ····parser·=·optparse.OptionParser( |
Offset 81, 15 lines modified | Offset 81, 15 lines modified | ||
81 | </ul> | 81 | </ul> |
82 | </li> | 82 | </li> |
83 | </ul> | 83 | </ul> |
84 | </nav> | 84 | </nav> |
85 | <section·id="introduction"> | 85 | <section·id="introduction"> |
86 | <h2><a·class="toc-backref"·href="#id5"·role="doc-backlink">Introduction</a><a·class="headerlink"·href="#introduction"·title="Link·to·this·heading">¶</a></h2> | 86 | <h2><a·class="toc-backref"·href="#id5"·role="doc-backlink">Introduction</a><a·class="headerlink"·href="#introduction"·title="Link·to·this·heading">¶</a></h2> |
87 | <p>This·document·covers·all·the·details·of·the·Request·and·Response | 87 | <p>This·document·covers·all·the·details·of·the·Request·and·Response |
88 | objects.··It·is·written·to·be·testable·with·< | 88 | objects.··It·is·written·to·be·testable·with·<code·class="xref·py·py-mod·docutils·literal·notranslate"><span·class="pre">doctest</span></code>·--·this |
89 | affects·the·flavor·of·the·documentation,·perhaps·to·its·detriment. | 89 | affects·the·flavor·of·the·documentation,·perhaps·to·its·detriment. |
90 | But·it·also·means·you·can·feel·confident·that·the·documentation·is | 90 | But·it·also·means·you·can·feel·confident·that·the·documentation·is |
91 | correct.</p> | 91 | correct.</p> |
92 | <div·class="admonition·note"> | 92 | <div·class="admonition·note"> |
93 | <p·class="admonition-title">Note</p> | 93 | <p·class="admonition-title">Note</p> |
94 | <p>All·of·the·code·samples·below·are·for·Python·3,·and·will·not·function·as-is | 94 | <p>All·of·the·code·samples·below·are·for·Python·3,·and·will·not·function·as-is |
95 | on·Python·2.</p> | 95 | on·Python·2.</p> |
Offset 23, 15 lines modified | Offset 23, 15 lines modified | ||
23 | ················#·_\x8C_\x8o_\x8o_\x8k_\x8i_\x8e_\x8s | 23 | ················#·_\x8C_\x8o_\x8o_\x8k_\x8i_\x8e_\x8s |
24 | ················#·_\x8B_\x8i_\x8n_\x8d_\x8i_\x8n_\x8g_\x8·_\x8a_\x8·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t | 24 | ················#·_\x8B_\x8i_\x8n_\x8d_\x8i_\x8n_\x8g_\x8·_\x8a_\x8·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t |
25 | ················#·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e_\x8·_\x8a_\x8s_\x8·_\x8a_\x8·_\x8W_\x8S_\x8G_\x8I_\x8·_\x8a_\x8p_\x8p_\x8l_\x8i_\x8c_\x8a_\x8t_\x8i_\x8o_\x8n | 25 | ················#·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e_\x8·_\x8a_\x8s_\x8·_\x8a_\x8·_\x8W_\x8S_\x8G_\x8I_\x8·_\x8a_\x8p_\x8p_\x8l_\x8i_\x8c_\x8a_\x8t_\x8i_\x8o_\x8n |
26 | ··········o·_\x8E_\x8x_\x8c_\x8e_\x8p_\x8t_\x8i_\x8o_\x8n_\x8s | 26 | ··········o·_\x8E_\x8x_\x8c_\x8e_\x8p_\x8t_\x8i_\x8o_\x8n_\x8s |
27 | ················#·_\x8C_\x8o_\x8n_\x8d_\x8i_\x8t_\x8i_\x8o_\x8n_\x8a_\x8l_\x8·_\x8W_\x8S_\x8G_\x8I_\x8·_\x8A_\x8p_\x8p_\x8l_\x8i_\x8c_\x8a_\x8t_\x8i_\x8o_\x8n | 27 | ················#·_\x8C_\x8o_\x8n_\x8d_\x8i_\x8t_\x8i_\x8o_\x8n_\x8a_\x8l_\x8·_\x8W_\x8S_\x8G_\x8I_\x8·_\x8A_\x8p_\x8p_\x8l_\x8i_\x8c_\x8a_\x8t_\x8i_\x8o_\x8n |
28 | *\x8**\x8**\x8**\x8**\x8*·_\x8I\x8I_\x8n\x8n_\x8t\x8t_\x8r\x8r_\x8o\x8o_\x8d\x8d_\x8u\x8u_\x8c\x8c_\x8t\x8t_\x8i\x8i_\x8o\x8o_\x8n\x8n_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* | 28 | *\x8**\x8**\x8**\x8**\x8*·_\x8I\x8I_\x8n\x8n_\x8t\x8t_\x8r\x8r_\x8o\x8o_\x8d\x8d_\x8u\x8u_\x8c\x8c_\x8t\x8t_\x8i\x8i_\x8o\x8o_\x8n\x8n_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* |
29 | This·document·covers·all·the·details·of·the·Request·and·Response·objects.·It·is | 29 | This·document·covers·all·the·details·of·the·Request·and·Response·objects.·It·is |
30 | written·to·be·testable·with· | 30 | written·to·be·testable·with·doctest·--·this·affects·the·flavor·of·the |
31 | documentation,·perhaps·to·its·detriment.·But·it·also·means·you·can·feel | 31 | documentation,·perhaps·to·its·detriment.·But·it·also·means·you·can·feel |
32 | confident·that·the·documentation·is·correct. | 32 | confident·that·the·documentation·is·correct. |
33 | Note | 33 | Note |
34 | All·of·the·code·samples·below·are·for·Python·3,·and·will·not·function·as-is·on | 34 | All·of·the·code·samples·below·are·for·Python·3,·and·will·not·function·as-is·on |
35 | Python·2. | 35 | Python·2. |
36 | This·is·a·somewhat·different·approach·to·reference·documentation·compared·to | 36 | This·is·a·somewhat·different·approach·to·reference·documentation·compared·to |
37 | the·extracted·documentation·for·the·_\x8r_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t·and·_\x8r_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e. | 37 | the·extracted·documentation·for·the·_\x8r_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t·and·_\x8r_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e. |
Offset 186, 15 lines modified | Offset 186, 15 lines modified | ||
186 | <section·id="bugfix"> | 186 | <section·id="bugfix"> |
187 | <h2>Bugfix<a·class="headerlink"·href="#bugfix"·title="Link·to·this·heading">¶</a></h2> | 187 | <h2>Bugfix<a·class="headerlink"·href="#bugfix"·title="Link·to·this·heading">¶</a></h2> |
188 | <ul> | 188 | <ul> |
189 | <li><p>Fixup·<code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">cgi.FieldStorage</span></code>·on·Python·3.x·to·work-around·issue·reported | 189 | <li><p>Fixup·<code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">cgi.FieldStorage</span></code>·on·Python·3.x·to·work-around·issue·reported |
190 | in·Python·bug·report·27777·and·24764.·This·is·currently·applied·for·Python | 190 | in·Python·bug·report·27777·and·24764.·This·is·currently·applied·for·Python |
191 | versions·less·than·3.7.·See·<a·class="reference·external"·href="https://github.com/Pylons/webob/pull/294">https://github.com/Pylons/webob/pull/294</a></p></li> | 191 | versions·less·than·3.7.·See·<a·class="reference·external"·href="https://github.com/Pylons/webob/pull/294">https://github.com/Pylons/webob/pull/294</a></p></li> |
192 | <li><p><a·class="reference·internal"·href="api/response.html#webob.response.Response.set_cookie"·title="webob.response.Response.set_cookie"><code·class="xref·py·py-func·docutils·literal·notranslate"><span·class="pre">Response.set_cookie</span></code></a>·now·accepts | 192 | <li><p><a·class="reference·internal"·href="api/response.html#webob.response.Response.set_cookie"·title="webob.response.Response.set_cookie"><code·class="xref·py·py-func·docutils·literal·notranslate"><span·class="pre">Response.set_cookie</span></code></a>·now·accepts |
193 | < | 193 | <code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">datetime</span></code>·objects·for·the·<code·class="docutils·literal·notranslate"><span·class="pre">expires</span></code>·kwarg·and·will |
194 | correctly·convert·them·to·UTC·with·no·<code·class="docutils·literal·notranslate"><span·class="pre">tzinfo</span></code>·for·use·in·calculating·the | 194 | correctly·convert·them·to·UTC·with·no·<code·class="docutils·literal·notranslate"><span·class="pre">tzinfo</span></code>·for·use·in·calculating·the |
195 | <code·class="docutils·literal·notranslate"><span·class="pre">max_age</span></code>.·See·<a·class="reference·external"·href="https://github.com/Pylons/webob/issues/254">https://github.com/Pylons/webob/issues/254</a>·and | 195 | <code·class="docutils·literal·notranslate"><span·class="pre">max_age</span></code>.·See·<a·class="reference·external"·href="https://github.com/Pylons/webob/issues/254">https://github.com/Pylons/webob/issues/254</a>·and |
196 | <a·class="reference·external"·href="https://github.com/Pylons/webob/pull/292">https://github.com/Pylons/webob/pull/292</a></p></li> | 196 | <a·class="reference·external"·href="https://github.com/Pylons/webob/pull/292">https://github.com/Pylons/webob/pull/292</a></p></li> |
197 | <li><p>Fixes·<code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">request.PATH_SAFE</span></code>·to·contain·all·of | 197 | <li><p>Fixes·<code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">request.PATH_SAFE</span></code>·to·contain·all·of |
198 | the·path·safe·characters·according·to·RFC3986.·See | 198 | the·path·safe·characters·according·to·RFC3986.·See |
199 | <a·class="reference·external"·href="https://github.com/Pylons/webob/pull/291">https://github.com/Pylons/webob/pull/291</a></p></li> | 199 | <a·class="reference·external"·href="https://github.com/Pylons/webob/pull/291">https://github.com/Pylons/webob/pull/291</a></p></li> |
200 | <li><p>WebOb's·exceptions·will·lazily·read·underlying·variables·when·inserted·into | 200 | <li><p>WebOb's·exceptions·will·lazily·read·underlying·variables·when·inserted·into |
Offset 105, 15 lines modified | Offset 105, 15 lines modified | ||
105 | ······@wsgify | 105 | ······@wsgify |
106 | ······def·app(req): | 106 | ······def·app(req): |
107 | ············return·'hi' | 107 | ············return·'hi' |
108 | *\x8**\x8**\x8**\x8**\x8*·B\x8Bu\x8ug\x8gf\x8fi\x8ix\x8x_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* | 108 | *\x8**\x8**\x8**\x8**\x8*·B\x8Bu\x8ug\x8gf\x8fi\x8ix\x8x_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* |
109 | ····*·Fixup·cgi.FieldStorage·on·Python·3.x·to·work-around·issue·reported·in | 109 | ····*·Fixup·cgi.FieldStorage·on·Python·3.x·to·work-around·issue·reported·in |
110 | ······Python·bug·report·27777·and·24764.·This·is·currently·applied·for·Python | 110 | ······Python·bug·report·27777·and·24764.·This·is·currently·applied·for·Python |
111 | ······versions·less·than·3.7.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x82_\x89_\x84 | 111 | ······versions·less·than·3.7.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x82_\x89_\x84 |
112 | ····*·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e_\x8._\x8s_\x8e_\x8t_\x8__\x8c_\x8o_\x8o_\x8k_\x8i_\x8e·now·accepts· | 112 | ····*·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e_\x8._\x8s_\x8e_\x8t_\x8__\x8c_\x8o_\x8o_\x8k_\x8i_\x8e·now·accepts·datetime·objects·for·the·expires·kwarg |
113 | ······and·will·correctly·convert·them·to·UTC·with·no·tzinfo·for·use·in | 113 | ······and·will·correctly·convert·them·to·UTC·with·no·tzinfo·for·use·in |
114 | ······calculating·the·max_age.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8i_\x8s_\x8s_\x8u_\x8e_\x8s_\x8/_\x82_\x85_\x84 | 114 | ······calculating·the·max_age.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8i_\x8s_\x8s_\x8u_\x8e_\x8s_\x8/_\x82_\x85_\x84 |
115 | ······and·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x82_\x89_\x82 | 115 | ······and·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x82_\x89_\x82 |
116 | ····*·Fixes·request.PATH_SAFE·to·contain·all·of·the·path·safe·characters | 116 | ····*·Fixes·request.PATH_SAFE·to·contain·all·of·the·path·safe·characters |
117 | ······according·to·RFC3986.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x82_\x89_\x81 | 117 | ······according·to·RFC3986.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x82_\x89_\x81 |
118 | ····*·WebOb's·exceptions·will·lazily·read·underlying·variables·when·inserted | 118 | ····*·WebOb's·exceptions·will·lazily·read·underlying·variables·when·inserted |
119 | ······into·templates·to·avoid·expensive·computations/crashes·when·inserting | 119 | ······into·templates·to·avoid·expensive·computations/crashes·when·inserting |
Offset 112, 15 lines modified | Offset 112, 15 lines modified | ||
112 | <ul·class="simple"> | 112 | <ul·class="simple"> |
113 | <li><p><a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.host_url"·title="webob.request.BaseRequest.host_url"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">Request.host_url</span></code></a>, | 113 | <li><p><a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.host_url"·title="webob.request.BaseRequest.host_url"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">Request.host_url</span></code></a>, |
114 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.host_port"·title="webob.request.BaseRequest.host_port"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">Request.host_port</span></code></a>, | 114 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.host_port"·title="webob.request.BaseRequest.host_port"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">Request.host_port</span></code></a>, |
115 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.domain"·title="webob.request.BaseRequest.domain"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">Request.domain</span></code></a>·correctly·parse | 115 | <a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.domain"·title="webob.request.BaseRequest.domain"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">Request.domain</span></code></a>·correctly·parse |
116 | IPv6·Host·headers·as·provided·by·a·browser.·See | 116 | IPv6·Host·headers·as·provided·by·a·browser.·See |
117 | <a·class="reference·external"·href="https://github.com/Pylons/webob/pull/332">https://github.com/Pylons/webob/pull/332</a></p></li> | 117 | <a·class="reference·external"·href="https://github.com/Pylons/webob/pull/332">https://github.com/Pylons/webob/pull/332</a></p></li> |
118 | <li><p><a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.authorization"·title="webob.request.BaseRequest.authorization"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">Request.authorization</span></code></a>·would | 118 | <li><p><a·class="reference·internal"·href="api/request.html#webob.request.BaseRequest.authorization"·title="webob.request.BaseRequest.authorization"><code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">Request.authorization</span></code></a>·would |
119 | raise·< | 119 | raise·<code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">ValueError</span></code>·for·unusual·or·malformed·header |
120 | values.·Now·it·simply·returns·an·empty·value.·See | 120 | values.·Now·it·simply·returns·an·empty·value.·See |
121 | <a·class="reference·external"·href="https://github.com/Pylons/webob/issues/231">https://github.com/Pylons/webob/issues/231</a></p></li> | 121 | <a·class="reference·external"·href="https://github.com/Pylons/webob/issues/231">https://github.com/Pylons/webob/issues/231</a></p></li> |
122 | <li><p>Allow·unnamed·fields·in·form·data·to·be·properly·transcoded·when·calling | 122 | <li><p>Allow·unnamed·fields·in·form·data·to·be·properly·transcoded·when·calling |
123 | <code·class="xref·py·py-func·docutils·literal·notranslate"><span·class="pre">request.decode</span></code>·with·an·alternate | 123 | <code·class="xref·py·py-func·docutils·literal·notranslate"><span·class="pre">request.decode</span></code>·with·an·alternate |
124 | encoding.·See·<a·class="reference·external"·href="https://github.com/Pylons/webob/pull/309">https://github.com/Pylons/webob/pull/309</a></p></li> | 124 | encoding.·See·<a·class="reference·external"·href="https://github.com/Pylons/webob/pull/309">https://github.com/Pylons/webob/pull/309</a></p></li> |
125 | <li><p><a·class="reference·internal"·href="api/response.html#webob.response.Response"·title="webob.response.Response"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Response.__init__</span></code></a>·would·discard | 125 | <li><p><a·class="reference·internal"·href="api/response.html#webob.response.Response"·title="webob.response.Response"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Response.__init__</span></code></a>·would·discard |
126 | <code·class="docutils·literal·notranslate"><span·class="pre">app_iter</span></code>·when·a·<code·class="docutils·literal·notranslate"><span·class="pre">Response</span></code>·had·no·body,·this·would·cause·issues·when | 126 | <code·class="docutils·literal·notranslate"><span·class="pre">app_iter</span></code>·when·a·<code·class="docutils·literal·notranslate"><span·class="pre">Response</span></code>·had·no·body,·this·would·cause·issues·when |
Offset 47, 15 lines modified | Offset 47, 15 lines modified | ||
47 | ····*·The·cookie·APIs·now·have·the·ability·to·set·the·SameSite·attribute·on·a | 47 | ····*·The·cookie·APIs·now·have·the·ability·to·set·the·SameSite·attribute·on·a |
48 | ······cookie·in·both·_\x8w_\x8e_\x8b_\x8o_\x8b_\x8._\x8c_\x8o_\x8o_\x8k_\x8i_\x8e_\x8s_\x8._\x8m_\x8a_\x8k_\x8e_\x8__\x8c_\x8o_\x8o_\x8k_\x8i_\x8e_\x8(_\x8)·and | 48 | ······cookie·in·both·_\x8w_\x8e_\x8b_\x8o_\x8b_\x8._\x8c_\x8o_\x8o_\x8k_\x8i_\x8e_\x8s_\x8._\x8m_\x8a_\x8k_\x8e_\x8__\x8c_\x8o_\x8o_\x8k_\x8i_\x8e_\x8(_\x8)·and |
49 | ······_\x8w_\x8e_\x8b_\x8o_\x8b_\x8._\x8c_\x8o_\x8o_\x8k_\x8i_\x8e_\x8s_\x8._\x8C_\x8o_\x8o_\x8k_\x8i_\x8e_\x8P_\x8r_\x8o_\x8f_\x8i_\x8l_\x8e.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x82_\x85_\x85 | 49 | ······_\x8w_\x8e_\x8b_\x8o_\x8b_\x8._\x8c_\x8o_\x8o_\x8k_\x8i_\x8e_\x8s_\x8._\x8C_\x8o_\x8o_\x8k_\x8i_\x8e_\x8P_\x8r_\x8o_\x8f_\x8i_\x8l_\x8e.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x82_\x85_\x85 |
50 | *\x8**\x8**\x8**\x8**\x8*·B\x8Bu\x8ug\x8gf\x8fi\x8ix\x8x_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* | 50 | *\x8**\x8**\x8**\x8**\x8*·B\x8Bu\x8ug\x8gf\x8fi\x8ix\x8x_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* |
51 | ····*·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8._\x8h_\x8o_\x8s_\x8t_\x8__\x8u_\x8r_\x8l,·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8._\x8h_\x8o_\x8s_\x8t_\x8__\x8p_\x8o_\x8r_\x8t,·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8._\x8d_\x8o_\x8m_\x8a_\x8i_\x8n·correctly·parse·IPv6 | 51 | ····*·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8._\x8h_\x8o_\x8s_\x8t_\x8__\x8u_\x8r_\x8l,·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8._\x8h_\x8o_\x8s_\x8t_\x8__\x8p_\x8o_\x8r_\x8t,·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8._\x8d_\x8o_\x8m_\x8a_\x8i_\x8n·correctly·parse·IPv6 |
52 | ······Host·headers·as·provided·by·a·browser.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/ | 52 | ······Host·headers·as·provided·by·a·browser.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/ |
53 | ······_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x83_\x83_\x82 | 53 | ······_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x83_\x83_\x82 |
54 | ····*·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8._\x8a_\x8u_\x8t_\x8h_\x8o_\x8r_\x8i_\x8z_\x8a_\x8t_\x8i_\x8o_\x8n·would·raise· | 54 | ····*·_\x8R_\x8e_\x8q_\x8u_\x8e_\x8s_\x8t_\x8._\x8a_\x8u_\x8t_\x8h_\x8o_\x8r_\x8i_\x8z_\x8a_\x8t_\x8i_\x8o_\x8n·would·raise·ValueError·for·unusual·or·malformed |
55 | ······header·values.·Now·it·simply·returns·an·empty·value.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/ | 55 | ······header·values.·Now·it·simply·returns·an·empty·value.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/ |
56 | ······_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8i_\x8s_\x8s_\x8u_\x8e_\x8s_\x8/_\x82_\x83_\x81 | 56 | ······_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8i_\x8s_\x8s_\x8u_\x8e_\x8s_\x8/_\x82_\x83_\x81 |
57 | ····*·Allow·unnamed·fields·in·form·data·to·be·properly·transcoded·when·calling | 57 | ····*·Allow·unnamed·fields·in·form·data·to·be·properly·transcoded·when·calling |
58 | ······request.decode·with·an·alternate·encoding.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/ | 58 | ······request.decode·with·an·alternate·encoding.·See·_\x8h_\x8t_\x8t_\x8p_\x8s_\x8:_\x8/_\x8/_\x8g_\x8i_\x8t_\x8h_\x8u_\x8b_\x8._\x8c_\x8o_\x8m_\x8/_\x8P_\x8y_\x8l_\x8o_\x8n_\x8s_\x8/ |
59 | ······_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x83_\x80_\x89 | 59 | ······_\x8w_\x8e_\x8b_\x8o_\x8b_\x8/_\x8p_\x8u_\x8l_\x8l_\x8/_\x83_\x80_\x89 |
60 | ····*·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e_\x8._\x8__\x8__\x8i_\x8n_\x8i_\x8t_\x8__\x8_·would·discard·app_iter·when·a·Response·had·no·body, | 60 | ····*·_\x8R_\x8e_\x8s_\x8p_\x8o_\x8n_\x8s_\x8e_\x8._\x8__\x8__\x8i_\x8n_\x8i_\x8t_\x8__\x8_·would·discard·app_iter·when·a·Response·had·no·body, |
61 | ······this·would·cause·issues·when·app_iter·was·an·object·that·was·tied·to·the | 61 | ······this·would·cause·issues·when·app_iter·was·an·object·that·was·tied·to·the |
Offset 125, 15 lines modified | Offset 125, 15 lines modified | ||
125 | ········<span·class="n">httpd</span><span·class="o">.</span><span·class="n">serve_forever</span><span·class="p">()</span> | 125 | ········<span·class="n">httpd</span><span·class="o">.</span><span·class="n">serve_forever</span><span·class="p">()</span> |
126 | ····<span·class="k">except</span>·<span·class="ne">KeyboardInterrupt</span><span·class="p">:</span> | 126 | ····<span·class="k">except</span>·<span·class="ne">KeyboardInterrupt</span><span·class="p">:</span> |
127 | ········<span·class="nb">print</span>·<span·class="s1">'^C'</span> | 127 | ········<span·class="nb">print</span>·<span·class="s1">'^C'</span> |
128 | </pre></div> | 128 | </pre></div> |
129 | </div> | 129 | </div> |
130 | <p>There's·not·much·to·talk·about·in·this·code·block.··The·application·is | 130 | <p>There's·not·much·to·talk·about·in·this·code·block.··The·application·is |
131 | instantiated·and·served·with·the·built-in·module | 131 | instantiated·and·served·with·the·built-in·module |
132 | < | 132 | <code·class="xref·py·py-mod·docutils·literal·notranslate"><span·class="pre">wsgiref.simple_server</span></code>.</p> |
133 | </section> | 133 | </section> |
134 | <section·id="the-wsgi-application"> | 134 | <section·id="the-wsgi-application"> |
135 | <h2><a·class="toc-backref"·href="#id5"·role="doc-backlink">The·WSGI·Application</a><a·class="headerlink"·href="#the-wsgi-application"·title="Link·to·this·heading">¶</a></h2> | 135 | <h2><a·class="toc-backref"·href="#id5"·role="doc-backlink">The·WSGI·Application</a><a·class="headerlink"·href="#the-wsgi-application"·title="Link·to·this·heading">¶</a></h2> |
136 | <p>Of·course·all·the·interesting·stuff·is·in·that·<code·class="docutils·literal·notranslate"><span·class="pre">__call__</span></code>·method. | 136 | <p>Of·course·all·the·interesting·stuff·is·in·that·<code·class="docutils·literal·notranslate"><span·class="pre">__call__</span></code>·method. |
137 | WebOb·lets·you·ignore·some·of·the·details·of·WSGI,·like·what | 137 | WebOb·lets·you·ignore·some·of·the·details·of·WSGI,·like·what |
138 | <code·class="docutils·literal·notranslate"><span·class="pre">start_response</span></code>·really·is.··<code·class="docutils·literal·notranslate"><span·class="pre">environ</span></code>·is·a·CGI-like·dictionary, | 138 | <code·class="docutils·literal·notranslate"><span·class="pre">start_response</span></code>·really·is.··<code·class="docutils·literal·notranslate"><span·class="pre">environ</span></code>·is·a·CGI-like·dictionary, |
139 | but·<code·class="docutils·literal·notranslate"><span·class="pre">webob.Request</span></code>·gives·an·object·interface·to·it. | 139 | but·<code·class="docutils·literal·notranslate"><span·class="pre">webob.Request</span></code>·gives·an·object·interface·to·it. |
Offset 63, 15 lines modified | Offset 63, 15 lines modified | ||
63 | ····httpd·=·make_server('localhost',·options.port,·app) | 63 | ····httpd·=·make_server('localhost',·options.port,·app) |
64 | ····print·'Serving·on·http://localhost:%s'·%·options.port | 64 | ····print·'Serving·on·http://localhost:%s'·%·options.port |
65 | ····try: | 65 | ····try: |
66 | ········httpd.serve_forever() | 66 | ········httpd.serve_forever() |
67 | ····except·KeyboardInterrupt: | 67 | ····except·KeyboardInterrupt: |
68 | ········print·'^C' | 68 | ········print·'^C' |
69 | There's·not·much·to·talk·about·in·this·code·block.·The·application·is | 69 | There's·not·much·to·talk·about·in·this·code·block.·The·application·is |
70 | instantiated·and·served·with·the·built-in·module· | 70 | instantiated·and·served·with·the·built-in·module·wsgiref.simple_server. |
71 | *\x8**\x8**\x8**\x8**\x8*·_\x8T\x8T_\x8h\x8h_\x8e\x8e_\x8·_\x8W\x8W_\x8S\x8S_\x8G\x8G_\x8I\x8I_\x8·_\x8A\x8A_\x8p\x8p_\x8p\x8p_\x8l\x8l_\x8i\x8i_\x8c\x8c_\x8a\x8a_\x8t\x8t_\x8i\x8i_\x8o\x8o_\x8n\x8n_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* | 71 | *\x8**\x8**\x8**\x8**\x8*·_\x8T\x8T_\x8h\x8h_\x8e\x8e_\x8·_\x8W\x8W_\x8S\x8S_\x8G\x8G_\x8I\x8I_\x8·_\x8A\x8A_\x8p\x8p_\x8p\x8p_\x8l\x8l_\x8i\x8i_\x8c\x8c_\x8a\x8a_\x8t\x8t_\x8i\x8i_\x8o\x8o_\x8n\x8n_\x8?\x8¶·*\x8**\x8**\x8**\x8**\x8* |
72 | Of·course·all·the·interesting·stuff·is·in·that·__call__·method.·WebOb·lets·you | 72 | Of·course·all·the·interesting·stuff·is·in·that·__call__·method.·WebOb·lets·you |
73 | ignore·some·of·the·details·of·WSGI,·like·what·start_response·really·is.·environ | 73 | ignore·some·of·the·details·of·WSGI,·like·what·start_response·really·is.·environ |
74 | is·a·CGI-like·dictionary,·but·webob.Request·gives·an·object·interface·to·it. | 74 | is·a·CGI-like·dictionary,·but·webob.Request·gives·an·object·interface·to·it. |
75 | webob.Response·represents·a·response,·and·is·itself·a·WSGI·application.·Here's | 75 | webob.Response·represents·a·response,·and·is·itself·a·WSGI·application.·Here's |
76 | kind·of·the·hello·world·of·WSGI·applications·using·these·objects: | 76 | kind·of·the·hello·world·of·WSGI·applications·using·these·objects: |
77 | from·webob·import·Request,·Response | 77 | from·webob·import·Request,·Response |