pyams-utils 1.3.5__py3.5.egg → 1.3.7__py3.5.egg
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.
- EGG-INFO/PKG-INFO +9 -1
- pyams_utils/__pycache__/__init__.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/adapter.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/attr.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/cache.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/container.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/context.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/data.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/date.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/decorator.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/dict.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/encoding.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/factory.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/fanstatic.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/html.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/i18n.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/include.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/inherit.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/intids.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/json.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/list.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/lock.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/progress.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/property.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/pygments.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/registry.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/request.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/schema.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/session.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/size.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/tales.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/testing.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/text.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/traversing.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/unicode.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/url.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/vocabulary.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/wsgi.cpython-35.pyc +0 -0
- pyams_utils/__pycache__/zodb.cpython-35.pyc +0 -0
- pyams_utils/doctests/wsgi.rst +16 -0
- pyams_utils/interfaces/__pycache__/__init__.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/data.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/form.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/inherit.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/intids.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/pygments.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/size.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/tales.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/text.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/timezone.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/traversing.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/tree.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/url.cpython-35.pyc +0 -0
- pyams_utils/interfaces/__pycache__/zeo.cpython-35.pyc +0 -0
- pyams_utils/protocol/__pycache__/__init__.cpython-35.pyc +0 -0
- pyams_utils/protocol/__pycache__/http.cpython-35.pyc +0 -0
- pyams_utils/protocol/__pycache__/tcp.cpython-35.pyc +0 -0
- pyams_utils/protocol/__pycache__/xmlrpc.cpython-35.pyc +0 -0
- pyams_utils/tests/__pycache__/__init__.cpython-35.pyc +0 -0
- pyams_utils/tests/__pycache__/test_utilsdocs.cpython-35.pyc +0 -0
- pyams_utils/tests/__pycache__/test_utilsdocstrings.cpython-35.pyc +0 -0
- pyams_utils/timezone/__pycache__/__init__.cpython-35.pyc +0 -0
- pyams_utils/timezone/__pycache__/utility.cpython-35.pyc +0 -0
- pyams_utils/timezone/__pycache__/vocabulary.cpython-35.pyc +0 -0
- pyams_utils/wsgi.py +4 -2
EGG-INFO/PKG-INFO
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyams-utils
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.7
|
|
4
4
|
Summary: PyAMS generic modules
|
|
5
5
|
Home-page: https://pyams.readthedocs.io
|
|
6
6
|
Author: Thierry Florac
|
|
@@ -48,6 +48,14 @@ Description: ===================
|
|
|
48
48
|
Changelog
|
|
49
49
|
=========
|
|
50
50
|
|
|
51
|
+
1.3.7
|
|
52
|
+
-----
|
|
53
|
+
- updated Travis configuration
|
|
54
|
+
|
|
55
|
+
1.3.6
|
|
56
|
+
-----
|
|
57
|
+
- updated WSGI environment decorator to prevent storing null values into request environment
|
|
58
|
+
|
|
51
59
|
1.3.5
|
|
52
60
|
-----
|
|
53
61
|
- updated request's WSGI property decorator to be able to handle caching functions with
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
pyams_utils/doctests/wsgi.rst
CHANGED
|
@@ -17,6 +17,11 @@ The "wsgi_environ_cache" can be used to cache a method result into request envir
|
|
|
17
17
|
... def get_value(self, request):
|
|
18
18
|
... pprint.pprint("Getting value...")
|
|
19
19
|
... return 1
|
|
20
|
+
...
|
|
21
|
+
... @wsgi_environ_cache('MyKey 2', store_none=False)
|
|
22
|
+
... def get_other_value(self, request):
|
|
23
|
+
... pprint.pprint("Getting second value...")
|
|
24
|
+
... return None
|
|
20
25
|
|
|
21
26
|
>>> request = DummyRequest()
|
|
22
27
|
|
|
@@ -31,6 +36,17 @@ The "wsgi_environ_cache" can be used to cache a method result into request envir
|
|
|
31
36
|
>>> request.environ.get('MyKey')
|
|
32
37
|
1
|
|
33
38
|
|
|
39
|
+
>>> utility.get_other_value(request) is None
|
|
40
|
+
'Getting second value...'
|
|
41
|
+
True
|
|
42
|
+
|
|
43
|
+
>>> utility.get_other_value(request) is None
|
|
44
|
+
'Getting second value...'
|
|
45
|
+
True
|
|
46
|
+
|
|
47
|
+
>>> request.environ.get('MyKey 2') is None
|
|
48
|
+
True
|
|
49
|
+
|
|
34
50
|
|
|
35
51
|
Tests cleanup:
|
|
36
52
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
pyams_utils/wsgi.py
CHANGED
|
@@ -18,11 +18,12 @@ This module provides a method decorator which can store it's value into request
|
|
|
18
18
|
__docformat__ = 'restructuredtext'
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
def wsgi_environ_cache(*names):
|
|
21
|
+
def wsgi_environ_cache(*names, store_none=True):
|
|
22
22
|
"""Wrap a function/method to cache its result for call into request.environ
|
|
23
23
|
|
|
24
24
|
:param [string...] names: keys to cache into environ; len(names) must
|
|
25
25
|
be equal to the result's length or scalar
|
|
26
|
+
:param bool store_none: if False, None values are not stored into request environment
|
|
26
27
|
"""
|
|
27
28
|
|
|
28
29
|
def decorator(func):
|
|
@@ -41,7 +42,8 @@ def wsgi_environ_cache(*names):
|
|
|
41
42
|
if scalar:
|
|
42
43
|
env = [env, ]
|
|
43
44
|
for idx, cached_key in enumerate(names):
|
|
44
|
-
|
|
45
|
+
if store_none or (env[idx] is not None):
|
|
46
|
+
request.environ['{}{}'.format(cached_key, args_key)] = env[idx]
|
|
45
47
|
return env[0] if scalar else env
|
|
46
48
|
|
|
47
49
|
return function_wrapper
|