Commit a9fcfcef authored by Hanno Schlichting's avatar Hanno Schlichting

Move Persistence patch into startup code

parent e1276ff7
##############################################################################
#
# 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
......@@ -44,6 +44,7 @@ from zope.processlifetime import DatabaseOpenedWithRoot
app = None
startup_time = asctime()
_patched = False
def load_zcml():
......@@ -56,10 +57,20 @@ def load_zcml():
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment