SVN: Zope/trunk/src/ Move Persistence patch into startup code

Hanno Schlichting <[email protected]>
Newsgroups gmane.comp.web.zope.cvs
Message-ID <20110703152242.EDCD0940C9__14755.792838014$1309706570$gmane$org@cvs.zope.org>
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
 

_______________________________________________
Zope-Checkins maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-checkins
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.