yhttp 9.2.0__tar.gz → 9.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yhttp-9.2.0 → yhttp-9.3.1}/PKG-INFO +6 -2
- {yhttp-9.2.0 → yhttp-9.3.1}/setup.py +5 -1
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_request.py +1 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/guard.py +8 -8
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/request.py +15 -0
- yhttp-9.3.1/yhttp/core/version.py +1 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp.egg-info/PKG-INFO +6 -2
- yhttp-9.2.0/yhttp/core/version.py +0 -1
- {yhttp-9.2.0 → yhttp-9.3.1}/LICENSE +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/README.md +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/setup.cfg +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_application.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_applicationcli.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_builtincli_serve.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_builtincli_version.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_builtincli_yhttp_version.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_cookie.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_cookieset.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_extension.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_form.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_form_json.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_form_multipart.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_form_urlencoded.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_fswatcher.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_guard.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_guard_body.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_guard_contenttypes.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_guard_query.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_headerset.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_jsonencoding.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_locale.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_middleware.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_multidict.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_multipart.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_querystring.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_responseheaders.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_rewrite.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_rewritecli.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_routing.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_static.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_statuses.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/tests/test_statushandler.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/__init__.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/application.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/cli.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/contenttypes.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/cookieset.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/fswatcher.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/headerset.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/main.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/multidict.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/multipart.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/response.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/rewrite.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/static.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp/core/statuses.py +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp.egg-info/SOURCES.txt +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp.egg-info/dependency_links.txt +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp.egg-info/entry_points.txt +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp.egg-info/requires.txt +0 -0
- {yhttp-9.2.0 → yhttp-9.3.1}/yhttp.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yhttp
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.3.1
|
|
4
4
|
Summary: A very micro http framework.
|
|
5
5
|
Home-page: http://github.com/yhttp/yhttp
|
|
6
6
|
Author: Vahid Mardani
|
|
@@ -13,7 +13,11 @@ Classifier: Natural Language :: English
|
|
|
13
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
14
|
Classifier: License :: Other/Proprietary License
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
21
|
Classifier: Topic :: Software Development
|
|
18
22
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
19
23
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
@@ -51,7 +51,11 @@ setup(
|
|
|
51
51
|
'Development Status :: 5 - Production/Stable',
|
|
52
52
|
'License :: Other/Proprietary License',
|
|
53
53
|
'Operating System :: OS Independent',
|
|
54
|
-
'Programming Language :: Python :: 3.
|
|
54
|
+
'Programming Language :: Python :: 3.10',
|
|
55
|
+
'Programming Language :: Python :: 3.11',
|
|
56
|
+
'Programming Language :: Python :: 3.12',
|
|
57
|
+
'Programming Language :: Python :: 3.13',
|
|
58
|
+
'Programming Language :: Python :: 3.14',
|
|
55
59
|
'Topic :: Software Development',
|
|
56
60
|
'Topic :: Internet :: WWW/HTTP',
|
|
57
61
|
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
|
|
@@ -15,7 +15,7 @@ class Field:
|
|
|
15
15
|
implies the ``optional``. default: ``None``.
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
|
-
statusfactory_missing = statuses.badrequest
|
|
18
|
+
statusfactory_missing = staticmethod(statuses.badrequest)
|
|
19
19
|
"""A callable to create an instance of :class:`.statuses.HTTPStatus` when
|
|
20
20
|
the field is missing in the request.
|
|
21
21
|
"""
|
|
@@ -101,12 +101,12 @@ class String(Field):
|
|
|
101
101
|
:param pattern: A regex pattern to specify the data format for the field.
|
|
102
102
|
"""
|
|
103
103
|
|
|
104
|
-
statusfactory_badlength = statuses.badrequest
|
|
104
|
+
statusfactory_badlength = staticmethod(statuses.badrequest)
|
|
105
105
|
"""A callable to create an instance of :class:`.statuses.HTTPStatus` when
|
|
106
106
|
value length is not permitted.
|
|
107
107
|
"""
|
|
108
108
|
|
|
109
|
-
statusfactory_badformat = statuses.badrequest
|
|
109
|
+
statusfactory_badformat = staticmethod(statuses.badrequest)
|
|
110
110
|
"""A callable to create an instance of :class:`.statuses.HTTPStatus` when
|
|
111
111
|
value format is not match with given pattern.
|
|
112
112
|
"""
|
|
@@ -160,7 +160,7 @@ class String(Field):
|
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
class NonStringField(Field):
|
|
163
|
-
statusfactory_badtype = statuses.badrequest
|
|
163
|
+
statusfactory_badtype = staticmethod(statuses.badrequest)
|
|
164
164
|
"""A callable to create an instance of :class:`.statuses.HTTPStatus` when
|
|
165
165
|
the type cast to integer ``int(value)`` is raises :exc:`ValueError`.
|
|
166
166
|
"""
|
|
@@ -180,7 +180,7 @@ class Integer(NonStringField):
|
|
|
180
180
|
minimum and maximum allowed value.
|
|
181
181
|
"""
|
|
182
182
|
|
|
183
|
-
statusfactory_outofrange = statuses.badrequest
|
|
183
|
+
statusfactory_outofrange = staticmethod(statuses.badrequest)
|
|
184
184
|
"""A callable to create an instance of :class:`.statuses.HTTPStatus` when
|
|
185
185
|
value is not in specified range.
|
|
186
186
|
"""
|
|
@@ -244,7 +244,7 @@ class File(Field):
|
|
|
244
244
|
:param extensions: list[str], allowd file extensions
|
|
245
245
|
"""
|
|
246
246
|
|
|
247
|
-
statusfactory_badfileextension = statuses.badrequest
|
|
247
|
+
statusfactory_badfileextension = staticmethod(statuses.badrequest)
|
|
248
248
|
"""A callable to create an instance of :class:`.statuses.HTTPStatus` when
|
|
249
249
|
the received file's extension is not acceptable.
|
|
250
250
|
"""
|
|
@@ -303,7 +303,7 @@ class Guard:
|
|
|
303
303
|
define the allowed fields and field attributes.
|
|
304
304
|
|
|
305
305
|
"""
|
|
306
|
-
statusfactory_unknownfields = statuses.badrequest
|
|
306
|
+
statusfactory_unknownfields = staticmethod(statuses.badrequest)
|
|
307
307
|
"""A callable to create an instance of :class:`.statuses.HTTPStatus` when
|
|
308
308
|
the field is not desired.
|
|
309
309
|
"""
|
|
@@ -359,7 +359,7 @@ class BodyGuard(Guard):
|
|
|
359
359
|
``content-types``.
|
|
360
360
|
"""
|
|
361
361
|
|
|
362
|
-
statusfactory_invalidcontenttype = statuses.badrequest
|
|
362
|
+
statusfactory_invalidcontenttype = staticmethod(statuses.badrequest)
|
|
363
363
|
"""A callable to create an instance of :class:`.statuses.HTTPStatus` when
|
|
364
364
|
the request's content-type is not supported.
|
|
365
365
|
"""
|
|
@@ -37,6 +37,21 @@ class Request:
|
|
|
37
37
|
self.environ = environ
|
|
38
38
|
self.response = response
|
|
39
39
|
|
|
40
|
+
@cached_property
|
|
41
|
+
def locales_oldstyle(self):
|
|
42
|
+
"""Same as the :attr:`Request.locales` but in old-style(system) format.
|
|
43
|
+
|
|
44
|
+
It means the dash(`-`) replaced with underscore(`_`) in all entries.
|
|
45
|
+
for example it returns `fa_IR` instead of `fa-IR`.
|
|
46
|
+
|
|
47
|
+
It will be ``['*']`` if ``Accept-Languages`` header is not presents in
|
|
48
|
+
the request.
|
|
49
|
+
|
|
50
|
+
.. versionadded:: 9.3
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
return [locale.replace('-', '_') for locale in self.locales]
|
|
54
|
+
|
|
40
55
|
@cached_property
|
|
41
56
|
def locales(self):
|
|
42
57
|
"""List of agent's locales ordered based on priority.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '9.3.1'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yhttp
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.3.1
|
|
4
4
|
Summary: A very micro http framework.
|
|
5
5
|
Home-page: http://github.com/yhttp/yhttp
|
|
6
6
|
Author: Vahid Mardani
|
|
@@ -13,7 +13,11 @@ Classifier: Natural Language :: English
|
|
|
13
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
14
|
Classifier: License :: Other/Proprietary License
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
21
|
Classifier: Topic :: Software Development
|
|
18
22
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
19
23
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '9.2.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|