[Zope-Checkins] SVN: Zope/trunk/src/ Move Persistence patch into startup code
Hanno Schlichting
hannosch at hannosch.eu
Sun Jul 3 11:22:42 EDT 2011
Log message for revision 122085:
Move Persistence patch into startup code
Changed:
D Zope/trunk/src/App/PersistentExtra.py
U Zope/trunk/src/Zope2/App/startup.py
-=-
Deleted: Zope/trunk/src/App/PersistentExtra.py
===================================================================
--- Zope/trunk/src/App/PersistentExtra.py 2011-07-03 15:19:22 UTC (rev 122084)
+++ Zope/trunk/src/App/PersistentExtra.py 2011-07-03 15:22:42 UTC (rev 122085)
@@ -1,26 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Foundation and Contributors.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-
-_patched = False
-
-
-def patchPersistent():
- global _patched
- if _patched:
- return
-
- _patched = True
-
- from Persistence import Persistent
- from AccessControl.class_init import InitializeClass
- Persistent.__class_init__ = InitializeClass
Modified: Zope/trunk/src/Zope2/App/startup.py
===================================================================
--- Zope/trunk/src/Zope2/App/startup.py 2011-07-03 15:19:22 UTC (rev 122084)
+++ Zope/trunk/src/Zope2/App/startup.py 2011-07-03 15:22:42 UTC (rev 122085)
@@ -44,6 +44,7 @@
app = None
startup_time = asctime()
+_patched = False
def load_zcml():
@@ -56,10 +57,20 @@
configure_vocabulary_registry()
+def patch_persistent():
+ global _patched
+ if _patched:
+ return
+ _patched = True
+
+ from Persistence import Persistent
+ from AccessControl.class_init import InitializeClass
+ Persistent.__class_init__ = InitializeClass
+
+
def startup():
- from App.PersistentExtra import patchPersistent
import Globals # to set / fetch data
- patchPersistent()
+ patch_persistent()
global app
More information about the Zope-Checkins
mailing list