pyams-layer 2.0.0__tar.gz → 2.1.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.
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/PKG-INFO +14 -1
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/docs/HISTORY.rst +10 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/setup.py +1 -1
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/resources.py +33 -32
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/skin.py +17 -3
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer.egg-info/PKG-INFO +14 -1
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/LICENSE +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/MANIFEST.in +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/docs/PyAMS layers.puml +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/docs/PyAMS_layers.png +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/docs/README.rst +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/setup.cfg +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/__init__.py +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/doctests/README.rst +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/include.py +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/interfaces.py +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/locales/fr/LC_MESSAGES/pyams_layer.mo +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/locales/fr/LC_MESSAGES/pyams_layer.po +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/locales/pyams_layer.pot +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/tests/__init__.py +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/tests/test_utilsdocs.py +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/tests/test_utilsdocstrings.py +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/vocabulary.py +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer.egg-info/SOURCES.txt +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer.egg-info/dependency_links.txt +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer.egg-info/namespace_packages.txt +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer.egg-info/not-zip-safe +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer.egg-info/requires.txt +0 -0
- {pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer.egg-info/top_level.txt +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyams_layer
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.1
|
|
4
4
|
Summary: PyAMS base layers management
|
|
5
5
|
Home-page: https://pyams.readthedocs.io
|
|
6
6
|
Author: Thierry Florac
|
|
7
7
|
Author-email: tflorac@ulthar.net
|
|
8
8
|
License: ZPL
|
|
9
9
|
Keywords: Pyramid PyAMS
|
|
10
|
+
Platform: UNKNOWN
|
|
10
11
|
Classifier: License :: OSI Approved :: Zope Public License
|
|
11
12
|
Classifier: Development Status :: 4 - Beta
|
|
12
13
|
Classifier: Programming Language :: Python
|
|
@@ -54,6 +55,16 @@ interfaces).
|
|
|
54
55
|
Changelog
|
|
55
56
|
=========
|
|
56
57
|
|
|
58
|
+
2.1.1
|
|
59
|
+
-----
|
|
60
|
+
- replaced datetime.utcnow() with datetime.now(timezone.utc)
|
|
61
|
+
- reduced method complexity
|
|
62
|
+
|
|
63
|
+
2.1.0
|
|
64
|
+
-----
|
|
65
|
+
- added deleters to files properties
|
|
66
|
+
- added support for Python 3.11 and 3.12
|
|
67
|
+
|
|
57
68
|
2.0.0
|
|
58
69
|
-----
|
|
59
70
|
- migrated to Pyramid 2.0
|
|
@@ -116,3 +127,5 @@ Changelog
|
|
|
116
127
|
1.0.0
|
|
117
128
|
-----
|
|
118
129
|
- initial release
|
|
130
|
+
|
|
131
|
+
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
2.1.1
|
|
5
|
+
-----
|
|
6
|
+
- replaced datetime.utcnow() with datetime.now(timezone.utc)
|
|
7
|
+
- reduced method complexity
|
|
8
|
+
|
|
9
|
+
2.1.0
|
|
10
|
+
-----
|
|
11
|
+
- added deleters to files properties
|
|
12
|
+
- added support for Python 3.11 and 3.12
|
|
13
|
+
|
|
4
14
|
2.0.0
|
|
5
15
|
-----
|
|
6
16
|
- migrated to Pyramid 2.0
|
|
@@ -23,7 +23,7 @@ DOCS = os.path.join(os.path.dirname(__file__),
|
|
|
23
23
|
README = os.path.join(DOCS, 'README.rst')
|
|
24
24
|
HISTORY = os.path.join(DOCS, 'HISTORY.rst')
|
|
25
25
|
|
|
26
|
-
version = '2.
|
|
26
|
+
version = '2.1.1'
|
|
27
27
|
long_description = open(README).read() + '\n\n' + open(HISTORY).read()
|
|
28
28
|
|
|
29
29
|
tests_require = [
|
|
@@ -16,7 +16,7 @@ This module provides adapters and TALES extensions used to manage static resourc
|
|
|
16
16
|
which are associated with skins.
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
|
-
from datetime import datetime
|
|
19
|
+
from datetime import datetime, timezone
|
|
20
20
|
|
|
21
21
|
from pyramid.interfaces import IRequest
|
|
22
22
|
from zope.dublincore.interfaces import IZopeDublinCore
|
|
@@ -68,37 +68,38 @@ class CustomSkinResourcesAdapter(ContextRequestViewAdapter):
|
|
|
68
68
|
request = self.request
|
|
69
69
|
main_resources = request.registry.queryMultiAdapter(
|
|
70
70
|
(self.context, request, self.view), IResources)
|
|
71
|
-
if main_resources is
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
71
|
+
if main_resources is None:
|
|
72
|
+
return
|
|
73
|
+
main_resource = main_resources.resources[-1]
|
|
74
|
+
library = main_resource.library
|
|
75
|
+
parent_resources = (main_resource,)
|
|
76
|
+
skin_parent = get_parent(request.context, ISkinnable).skin_parent
|
|
77
|
+
# include custom CSS files
|
|
78
|
+
custom_css = skin_parent.custom_stylesheet # pylint: disable=no-member
|
|
79
|
+
if custom_css:
|
|
80
|
+
dc = IZopeDublinCore(custom_css, None) # pylint: disable=invalid-name
|
|
81
|
+
modified = dc.modified if dc is not None else datetime.now(timezone.utc)
|
|
82
|
+
# pylint: disable=no-member
|
|
83
|
+
custom_css_url = absolute_url(custom_css, request,
|
|
84
|
+
query={'_': modified.timestamp()})
|
|
85
|
+
resource = library.known_resources.get(custom_css_url)
|
|
86
|
+
if resource is None:
|
|
87
|
+
resource = ExternalResource(library, custom_css_url, resource_type='css',
|
|
88
|
+
depends=parent_resources)
|
|
89
|
+
yield resource
|
|
90
|
+
# include custom JS files
|
|
91
|
+
custom_js = skin_parent.custom_script # pylint: disable=no-member
|
|
92
|
+
if custom_js:
|
|
93
|
+
dc = IZopeDublinCore(custom_js, None) # pylint: disable=invalid-name
|
|
94
|
+
modified = dc.modified if dc is not None else datetime.now(timezone.utc)
|
|
95
|
+
# pylint: disable=no-member
|
|
96
|
+
custom_js_url = absolute_url(custom_js, request,
|
|
97
|
+
query={'_': modified.timestamp()})
|
|
98
|
+
resource = library.known_resources.get(custom_js_url)
|
|
99
|
+
if resource is None:
|
|
100
|
+
resource = ExternalResource(library, custom_js_url, resource_type='js',
|
|
101
|
+
depends=parent_resources, bottom=True)
|
|
102
|
+
yield resource
|
|
102
103
|
|
|
103
104
|
|
|
104
105
|
@adapter_config(name='resources',
|
|
@@ -36,7 +36,6 @@ from pyams_utils.request import check_request
|
|
|
36
36
|
from pyams_utils.traversing import get_parent
|
|
37
37
|
from pyams_utils.zodb import volatile_property
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
__docformat__ = 'restructuredtext'
|
|
41
40
|
|
|
42
41
|
from pyams_layer import _ # pylint: disable=ungrouped-imports
|
|
@@ -139,6 +138,11 @@ class SkinnableContentMixin:
|
|
|
139
138
|
if value and (value is not TO_BE_DELETED):
|
|
140
139
|
self._custom_stylesheet.content_type = 'text/css'
|
|
141
140
|
IFileInfo(self._custom_stylesheet).filename = 'skin.css'
|
|
141
|
+
|
|
142
|
+
@custom_stylesheet.deleter
|
|
143
|
+
def custom_stylesheet(self):
|
|
144
|
+
"""Delete custom stylesheet"""
|
|
145
|
+
del self._custom_stylesheet
|
|
142
146
|
|
|
143
147
|
@property
|
|
144
148
|
def editor_stylesheet(self):
|
|
@@ -158,7 +162,12 @@ class SkinnableContentMixin:
|
|
|
158
162
|
if value and (value is not TO_BE_DELETED):
|
|
159
163
|
self._editor_stylesheet.content_type = 'text/css'
|
|
160
164
|
IFileInfo(self._editor_stylesheet).filename = 'editor-skin.css'
|
|
161
|
-
|
|
165
|
+
|
|
166
|
+
@editor_stylesheet.deleter
|
|
167
|
+
def editor_stylesheet(self):
|
|
168
|
+
"""Delete editor stylesheet"""
|
|
169
|
+
del self._editor_stylesheet
|
|
170
|
+
|
|
162
171
|
@property
|
|
163
172
|
def custom_script(self):
|
|
164
173
|
"""Get custom script"""
|
|
@@ -177,7 +186,12 @@ class SkinnableContentMixin:
|
|
|
177
186
|
if value and (value is not TO_BE_DELETED):
|
|
178
187
|
self._custom_script.content_type = 'text/javascript'
|
|
179
188
|
IFileInfo(self.custom_script).filename = 'skin.js'
|
|
180
|
-
|
|
189
|
+
|
|
190
|
+
@custom_script.deleter
|
|
191
|
+
def custom_script(self):
|
|
192
|
+
"""Delete custom script"""
|
|
193
|
+
del self._custom_script
|
|
194
|
+
|
|
181
195
|
def get_skin(self, request=None):
|
|
182
196
|
"""Get skin utility matching current settings"""
|
|
183
197
|
parent = self.skin_parent
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyams-layer
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.1
|
|
4
4
|
Summary: PyAMS base layers management
|
|
5
5
|
Home-page: https://pyams.readthedocs.io
|
|
6
6
|
Author: Thierry Florac
|
|
7
7
|
Author-email: tflorac@ulthar.net
|
|
8
8
|
License: ZPL
|
|
9
9
|
Keywords: Pyramid PyAMS
|
|
10
|
+
Platform: UNKNOWN
|
|
10
11
|
Classifier: License :: OSI Approved :: Zope Public License
|
|
11
12
|
Classifier: Development Status :: 4 - Beta
|
|
12
13
|
Classifier: Programming Language :: Python
|
|
@@ -54,6 +55,16 @@ interfaces).
|
|
|
54
55
|
Changelog
|
|
55
56
|
=========
|
|
56
57
|
|
|
58
|
+
2.1.1
|
|
59
|
+
-----
|
|
60
|
+
- replaced datetime.utcnow() with datetime.now(timezone.utc)
|
|
61
|
+
- reduced method complexity
|
|
62
|
+
|
|
63
|
+
2.1.0
|
|
64
|
+
-----
|
|
65
|
+
- added deleters to files properties
|
|
66
|
+
- added support for Python 3.11 and 3.12
|
|
67
|
+
|
|
57
68
|
2.0.0
|
|
58
69
|
-----
|
|
59
70
|
- migrated to Pyramid 2.0
|
|
@@ -116,3 +127,5 @@ Changelog
|
|
|
116
127
|
1.0.0
|
|
117
128
|
-----
|
|
118
129
|
- initial release
|
|
130
|
+
|
|
131
|
+
|
|
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
|
{pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/locales/fr/LC_MESSAGES/pyams_layer.mo
RENAMED
|
File without changes
|
{pyams_layer-2.0.0 → pyams_layer-2.1.1}/src/pyams_layer/locales/fr/LC_MESSAGES/pyams_layer.po
RENAMED
|
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
|