[Checkins] SVN: zope.app.appsetup/trunk/ Using ``zope.processlifetime`` interfaces and implementations directly instead of BBB imports from ``zope.app.appsetup``.
Michael Howitz
mh at gocept.com
Fri Jun 12 14:59:04 EDT 2009
Log message for revision 100899:
Using ``zope.processlifetime`` interfaces and implementations directly instead of BBB imports from ``zope.app.appsetup``.
Changed:
U zope.app.appsetup/trunk/CHANGES.txt
U zope.app.appsetup/trunk/setup.py
U zope.app.appsetup/trunk/src/zope/app/appsetup/__init__.py
U zope.app.appsetup/trunk/src/zope/app/appsetup/appsetup.py
U zope.app.appsetup/trunk/src/zope/app/appsetup/bootstrap.py
U zope.app.appsetup/trunk/src/zope/app/appsetup/bootstrap.txt
U zope.app.appsetup/trunk/src/zope/app/appsetup/configure.zcml
U zope.app.appsetup/trunk/src/zope/app/appsetup/debug.py
U zope.app.appsetup/trunk/src/zope/app/appsetup/tests.py
-=-
Modified: zope.app.appsetup/trunk/CHANGES.txt
===================================================================
--- zope.app.appsetup/trunk/CHANGES.txt 2009-06-12 16:24:04 UTC (rev 100898)
+++ zope.app.appsetup/trunk/CHANGES.txt 2009-06-12 18:59:03 UTC (rev 100899)
@@ -1,6 +1,13 @@
-zope.app.appsetup Changelog
-===========================
+Changelog
+=========
+3.11.1 (unreleased)
+-------------------
+
+- Using ``zope.processlifetime`` interfaces and implementations
+ directly instead of BBB imports from ``zope.app.appsetup``.
+
+
3.11 (2009-05-13)
-----------------
Modified: zope.app.appsetup/trunk/setup.py
===================================================================
--- zope.app.appsetup/trunk/setup.py 2009-06-12 16:24:04 UTC (rev 100898)
+++ zope.app.appsetup/trunk/setup.py 2009-06-12 18:59:03 UTC (rev 100899)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2006 Zope Corporation and Contributors.
+# Copyright (c) 2006-2009 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -25,7 +25,7 @@
setup(
name='zope.app.appsetup',
- version = '3.11',
+ version = '3.11.1dev',
author='Zope Corporation and Contributors',
author_email='zope-dev at zope.org',
description="Zope app setup helper",
Modified: zope.app.appsetup/trunk/src/zope/app/appsetup/__init__.py
===================================================================
--- zope.app.appsetup/trunk/src/zope/app/appsetup/__init__.py 2009-06-12 16:24:04 UTC (rev 100898)
+++ zope.app.appsetup/trunk/src/zope/app/appsetup/__init__.py 2009-06-12 18:59:03 UTC (rev 100899)
@@ -11,12 +11,14 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Zope Application Server setup package
+"""Zope Application Server setup package
$Id$
"""
__docformat__ = 'restructuredtext'
+from zope.app.appsetup.appsetup import config, database
+
+#BBB
from zope.app.appsetup.interfaces import IDatabaseOpenedEvent, DatabaseOpened
from zope.app.appsetup.interfaces import IProcessStartingEvent, ProcessStarting
-from zope.app.appsetup.appsetup import config, database
Modified: zope.app.appsetup/trunk/src/zope/app/appsetup/appsetup.py
===================================================================
--- zope.app.appsetup/trunk/src/zope/app/appsetup/appsetup.py 2009-06-12 16:24:04 UTC (rev 100898)
+++ zope.app.appsetup/trunk/src/zope/app/appsetup/appsetup.py 2009-06-12 18:59:03 UTC (rev 100899)
@@ -24,7 +24,7 @@
import zope.site.hooks
from zope.security.interfaces import IParticipation
from zope.security.management import system_user
-from zope.app.appsetup import interfaces
+import zope.processlifetime
class SystemConfigurationParticipation(object):
zope.interface.implements(IParticipation)
@@ -144,7 +144,7 @@
# The following will fail unless the application has been configured.
from zope.event import notify
- notify(interfaces.DatabaseOpened(db))
+ notify(zope.processlifetime.DatabaseOpened(db))
return db
Modified: zope.app.appsetup/trunk/src/zope/app/appsetup/bootstrap.py
===================================================================
--- zope.app.appsetup/trunk/src/zope/app/appsetup/bootstrap.py 2009-06-12 16:24:04 UTC (rev 100898)
+++ zope.app.appsetup/trunk/src/zope/app/appsetup/bootstrap.py 2009-06-12 18:59:03 UTC (rev 100899)
@@ -21,15 +21,14 @@
__docformat__ = 'restructuredtext'
-import transaction
import logging
+import transaction
import warnings
-
import zope.event
import zope.lifecycleevent
+import zope.processlifetime
from zope.app.publication.zopepublication import ZopePublication
-from zope.app.appsetup import interfaces
from zope.container.interfaces import INameChooser
from zope.location.interfaces import ISite
from zope.security.management import getSecurityPolicy
@@ -173,7 +172,7 @@
connection.close()
- zope.event.notify(interfaces.DatabaseOpenedWithRoot(db))
+ zope.event.notify(zope.processlifetime.DatabaseOpenedWithRoot(db))
########################################################################
Modified: zope.app.appsetup/trunk/src/zope/app/appsetup/bootstrap.txt
===================================================================
--- zope.app.appsetup/trunk/src/zope/app/appsetup/bootstrap.txt 2009-06-12 16:24:04 UTC (rev 100898)
+++ zope.app.appsetup/trunk/src/zope/app/appsetup/bootstrap.txt 2009-06-12 18:59:03 UTC (rev 100899)
@@ -8,11 +8,11 @@
object. It subscribes to DatabaseOpened events:
>>> from zope.app.appsetup import bootstrap
- >>> from zope.app.appsetup import interfaces
+ >>> import zope.processlifetime
>>> from ZODB.tests import util
>>> db = util.DB()
- >>> bootstrap.bootStrapSubscriber(interfaces.DatabaseOpened(db))
+ >>> bootstrap.bootStrapSubscriber(zope.processlifetime.DatabaseOpened(db))
The subscriber makes ure that there is a root folder:
@@ -25,7 +25,7 @@
A DatabaseOpenedWithRoot is generated with the database.
>>> from zope.component.eventtesting import getEvents
- >>> [event] = getEvents(interfaces.IDatabaseOpenedWithRootEvent)
+ >>> [event] = getEvents(zope.processlifetime.IDatabaseOpenedWithRoot)
>>> event.database is db
True
@@ -36,8 +36,8 @@
The subscriber generates the event whether or not the root had to be
set up:
- >>> bootstrap.bootStrapSubscriber(interfaces.DatabaseOpened(db))
- >>> [e, event] = getEvents(interfaces.IDatabaseOpenedWithRootEvent)
+ >>> bootstrap.bootStrapSubscriber(zope.processlifetime.DatabaseOpened(db))
+ >>> [e, event] = getEvents(zope.processlifetime.IDatabaseOpenedWithRoot)
>>> event.database is db
True
Modified: zope.app.appsetup/trunk/src/zope/app/appsetup/configure.zcml
===================================================================
--- zope.app.appsetup/trunk/src/zope/app/appsetup/configure.zcml 2009-06-12 16:24:04 UTC (rev 100898)
+++ zope.app.appsetup/trunk/src/zope/app/appsetup/configure.zcml 2009-06-12 18:59:03 UTC (rev 100899)
@@ -2,22 +2,22 @@
<subscriber
handler=".bootstrap.bootStrapSubscriber"
- for="zope.app.appsetup.interfaces.IDatabaseOpenedEvent"
+ for="zope.processlifetime.IDatabaseOpened"
/>
<subscriber
handler=".bootstrap.checkSecurityPolicy"
- for="zope.app.appsetup.interfaces.IDatabaseOpenedEvent"
- />
+ for="zope.processlifetime.IDatabaseOpened"
+ />
<subscriber
handler=".errorlog.bootStrapSubscriber"
- for="zope.app.appsetup.interfaces.IDatabaseOpenedWithRootEvent"
+ for="zope.processlifetime.IDatabaseOpenedWithRoot"
/>
<subscriber
handler=".session.bootStrapSubscriber"
- for="zope.app.appsetup.interfaces.IDatabaseOpenedWithRootEvent"
+ for="zope.processlifetime.IDatabaseOpenedWithRoot"
/>
</configure>
Modified: zope.app.appsetup/trunk/src/zope/app/appsetup/debug.py
===================================================================
--- zope.app.appsetup/trunk/src/zope/app/appsetup/debug.py 2009-06-12 16:24:04 UTC (rev 100898)
+++ zope.app.appsetup/trunk/src/zope/app/appsetup/debug.py 2009-06-12 18:59:03 UTC (rev 100899)
@@ -16,14 +16,15 @@
$Id$
"""
__docformat__ = 'restructuredtext'
+
+from zope.app.publication.zopepublication import ZopePublication
import os
import sys
import zdaemon.zdoptions
import zope.app.appsetup.appsetup
-import zope.app.appsetup.interfaces
import zope.app.appsetup.product
import zope.event
-from zope.app.publication.zopepublication import ZopePublication
+import zope.processlifetime
def load_options(args=None):
@@ -50,7 +51,7 @@
zope.app.appsetup.config(options.site_definition)
db = zope.app.appsetup.appsetup.multi_database(options.databases)[0][0]
- zope.event.notify(zope.app.appsetup.interfaces.DatabaseOpened(db))
+ zope.event.notify(zope.processlifetime.DatabaseOpened(db))
return db
Modified: zope.app.appsetup/trunk/src/zope/app/appsetup/tests.py
===================================================================
--- zope.app.appsetup/trunk/src/zope/app/appsetup/tests.py 2009-06-12 16:24:04 UTC (rev 100898)
+++ zope.app.appsetup/trunk/src/zope/app/appsetup/tests.py 2009-06-12 18:59:03 UTC (rev 100899)
@@ -40,7 +40,7 @@
from zope.app.appsetup.bootstrap import bootStrapSubscriber
from zope.app.appsetup.bootstrap import getInformationFromEvent, \
ensureObject, ensureUtility
-from zope.app.appsetup.interfaces import DatabaseOpened
+from zope.processlifetime import DatabaseOpened
from zope.app.appsetup.errorlog import bootStrapSubscriber as errorlogBootStrapSubscriber
from zope.app.appsetup.session import bootStrapSubscriber as sessionBootstrapSubscriber
from zope.session.interfaces import IClientIdManager
@@ -172,7 +172,7 @@
"""
self.createRFAndSM()
- event = DatabaseOpened(self.db)
+ event = DatabaseOpened(self.db)
# this will open and close the database by itself
errorlogBootStrapSubscriber(event)
@@ -188,7 +188,7 @@
def test_bootstrapSusbcriber(self):
self.createRFAndSM()
- event = DatabaseOpened(self.db)
+ event = DatabaseOpened(self.db)
# this will open and close the database by itself
sessionBootstrapSubscriber(event)
@@ -201,11 +201,11 @@
got_utility = zope.component.getUtility(ISessionDataContainer,
context=root_folder)
self.failUnless(ISessionDataContainer.providedBy(got_utility))
-
+
# we need to close again in the end
connection.close()
-
+
class TestConfigurationSchema(unittest.TestCase):
def setUp(self):
More information about the Checkins
mailing list