imio.smartweb.common 1.2.15__py3-none-any.whl → 1.2.16__py3-none-any.whl

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.
@@ -8,10 +8,36 @@ from plone.app.dexterity.behaviors.metadata import IBasic
8
8
  from plone.app.textfield.value import IRichTextValue
9
9
  from plone.app.textfield.value import RichTextValue
10
10
  from plone.dexterity.utils import iterSchemata
11
+ from plone.registry.interfaces import IRegistry
12
+ from Products.CMFPlone.resources.browser.resource import update_resource_registry_mtime
13
+ from zope.component import queryUtility
14
+ from zope.component.hooks import setSite
11
15
  from zope.lifecycleevent.interfaces import IAttributes
12
16
  from zope.schema import getFields
13
17
 
14
18
  import DateTime
19
+ import os
20
+ import Zope2
21
+
22
+
23
+ def started_zope(event):
24
+ db = Zope2.DB
25
+ connection = db.open()
26
+ zope_app = connection.root().get("Application", None)
27
+ site_id = os.getenv("SITE_ID", "Plone")
28
+ try:
29
+ site = zope_app.unrestrictedTraverse(site_id)
30
+ except KeyError:
31
+ # This happens when there is no site (ex: tests setups)
32
+ return
33
+ setSite(site)
34
+ registry = queryUtility(IRegistry)
35
+ if registry is None:
36
+ # This happens for example during site creation
37
+ return
38
+ # update resource registry time to invalidate its cache at startup
39
+ # this information is also used as ETag
40
+ update_resource_registry_mtime()
15
41
 
16
42
 
17
43
  def reindex_breadcrumb(obj, event):
@@ -1,6 +1,9 @@
1
1
  <configure
2
2
  xmlns="http://namespaces.zope.org/zope">
3
3
 
4
+ <subscriber for="zope.processlifetime.IProcessStarting"
5
+ handler=".subscribers.started_zope"/>
6
+
4
7
  <subscriber for="plone.dexterity.interfaces.IDexterityContent
5
8
  zope.lifecycleevent.interfaces.IObjectAddedEvent"
6
9
  handler=".subscribers.added_content" />
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imio.smartweb.common
3
- Version: 1.2.15
3
+ Version: 1.2.16
4
4
  Summary: Common utilities, vocabularies, taxonomies for imio.smartweb & co products
5
5
  Home-page: https://github.com/imio/imio.smartweb.common
6
6
  Author: iMio
@@ -161,6 +161,13 @@ Changelog
161
161
  =========
162
162
 
163
163
 
164
+ 1.2.16 (2024-05-30)
165
+ -------------------
166
+
167
+ - WEB-4107 : Update resource registries modification time (used as ETag) at Zope startup
168
+ [laulaz]
169
+
170
+
164
171
  1.2.15 (2024-05-27)
165
172
  -------------------
166
173
 
@@ -1,4 +1,4 @@
1
- imio.smartweb.common-1.2.15-py3.11-nspkg.pth,sha256=XZ3YhlzwpUCC8tXtelHRqxVxo3NWomIiMsUfUshrbeE,1011
1
+ imio.smartweb.common-1.2.16-py3.11-nspkg.pth,sha256=XZ3YhlzwpUCC8tXtelHRqxVxo3NWomIiMsUfUshrbeE,1011
2
2
  imio/smartweb/common/__init__.py,sha256=Na9XBfEQUMrm2c5jbqQgwWeg40ih0aXVG1vT8NeAjMQ,2709
3
3
  imio/smartweb/common/adapters.py,sha256=rLlObjqZm3hs2hgUT-LmJytwhT-E1rTvbpIi0mmKQqY,610
4
4
  imio/smartweb/common/adapters.zcml,sha256=ndYNj0J_BFfVpX_7JhY2asSwLzXG-WmjLdfwL9hX_No,254
@@ -14,8 +14,8 @@ imio/smartweb/common/privacy.py,sha256=ePuR-c-w7AmXSWA6czpfFK-wYNdoCm5yzEUKNSFKD
14
14
  imio/smartweb/common/privacy.zcml,sha256=KHC4JJt-9MbPcHHukN7QLwpMFXj96gXb0-vzU2ZboGk,1772
15
15
  imio/smartweb/common/profiles.zcml,sha256=EJoh-_QIN8ozCsPiEnx2mBmqC0vLrL7KF69PD90b6Zg,1278
16
16
  imio/smartweb/common/setuphandlers.py,sha256=ejKHdgROXjmDM7dgoAh9sITiAJDfQGNxTEOO5JaSEaE,1053
17
- imio/smartweb/common/subscribers.py,sha256=GHG_PIqsNV7K-pr_cXceQx1WCXylvQiv1lCgSGNJIno,2608
18
- imio/smartweb/common/subscribers.zcml,sha256=WZNhGtbTux2DoWHhLCQd1uJY27VhVLsibf0bdsclHOU,860
17
+ imio/smartweb/common/subscribers.py,sha256=pbPQJ1YrfPlYCfxLAJ5sOy_5OToAfs2egX68z2-EFRw,3490
18
+ imio/smartweb/common/subscribers.zcml,sha256=8v2lqNNVAHlrh2G3jtjVgr3Asrw8WJLS9jSX5U6juFg,971
19
19
  imio/smartweb/common/testing.py,sha256=GKlYMHJUSxZFVX0o_R_c_Au1VYlkd-GjykQqfONHv7I,1985
20
20
  imio/smartweb/common/testing.zcml,sha256=7N-ALtklyWeLSzZmlxN2Tp-aZe_3An--w_6BGl1991E,172
21
21
  imio/smartweb/common/utils.py,sha256=jzNLR41JVehAxqqQV2WaUiYkB1V6xpMpPGE-G3JJ7Pc,7041
@@ -132,10 +132,10 @@ imio/smartweb/common/viewlets/privacy.pt,sha256=bAD-I6s3LUgkh30vyTbP3pNUZQYua1Kx
132
132
  imio/smartweb/common/viewlets/privacy.py,sha256=H752etTTIFCM0wTwjESQFl0PStJfCoSRfcePSUQOp8E,449
133
133
  imio/smartweb/common/viewlets/skip_to_content.pt,sha256=FFfTxvRl8V52FzFE6In6B34ApgShNntvMp6F1qwfL0g,376
134
134
  imio/smartweb/common/viewlets/skip_to_content.py,sha256=wm22NUf8Qh5uzz8p4vkLCdFNiDv9zUGAueRyXAIXQDo,496
135
- imio.smartweb.common-1.2.15.dist-info/LICENSE.GPL,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
136
- imio.smartweb.common-1.2.15.dist-info/LICENSE.rst,sha256=5dd78Fdt0e-oM2ICBrMpjHnT8vEP-jhBDF7akXni6B4,655
137
- imio.smartweb.common-1.2.15.dist-info/METADATA,sha256=hpPy5ZJ6R9wtfDuXI7FP-z057PBjqVekgZ-hGJX-Qcg,14848
138
- imio.smartweb.common-1.2.15.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
139
- imio.smartweb.common-1.2.15.dist-info/namespace_packages.txt,sha256=Pg8AH8t9viMMW1hJbNZvTy_n2jXG2igIYUpon5RA4Js,19
140
- imio.smartweb.common-1.2.15.dist-info/top_level.txt,sha256=ZktC0EGzThvMTAin9_q_41rzvvfMT2FYbP8pbhSLMSA,5
141
- imio.smartweb.common-1.2.15.dist-info/RECORD,,
135
+ imio.smartweb.common-1.2.16.dist-info/LICENSE.GPL,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
136
+ imio.smartweb.common-1.2.16.dist-info/LICENSE.rst,sha256=5dd78Fdt0e-oM2ICBrMpjHnT8vEP-jhBDF7akXni6B4,655
137
+ imio.smartweb.common-1.2.16.dist-info/METADATA,sha256=bBz92b0w6IdWYYo6S7iK0SrTqpBx454D-WwWXFNEuYw,14991
138
+ imio.smartweb.common-1.2.16.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
139
+ imio.smartweb.common-1.2.16.dist-info/namespace_packages.txt,sha256=Pg8AH8t9viMMW1hJbNZvTy_n2jXG2igIYUpon5RA4Js,19
140
+ imio.smartweb.common-1.2.16.dist-info/top_level.txt,sha256=ZktC0EGzThvMTAin9_q_41rzvvfMT2FYbP8pbhSLMSA,5
141
+ imio.smartweb.common-1.2.16.dist-info/RECORD,,