[Zope3-checkins] CVS: Zope3/src/zope/app/registration - factories.py:1.1 registration.py:1.2

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Mar 13 13:11:23 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/registration
In directory cvs.zope.org:/tmp/cvs-serv29117/src/zope/app/registration

Modified Files:
	registration.py 
Added Files:
	factories.py 
Log Message:
Moved factories.py to zope.app.registration as well, since it is used by 
the registration machinery.


=== Added File Zope3/src/zope/app/registration/factories.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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.
#
##############################################################################
"""A collection of factory functions for various registration classes.

See method factory() in class ComponentRegistrationAdapter in file
registration.py.

The functions here may create invalid objects; a subsequent setBody()
call to the adapter's setBody() method will make the object valid.

$Id: factories.py,v 1.1 2004/03/13 18:10:52 srichter Exp $
"""

def CacheRegistration():
    from zope.app.services.cache import CacheRegistration
    return CacheRegistration("", "") # name, componentPath

def ConnectionRegistration():
    from zope.app.services.connection import ConnectionRegistration
    return ConnectionRegistration("", "") # name, componentPath

def ServiceRegistration():
    from zope.app.site.service import ServiceRegistration
    return ServiceRegistration("", "") # name, componentPath

def UtilityRegistration():
    from zope.app.services.utility import UtilityRegistration
    return UtilityRegistration("", None, "") # name, interface, componentPath


=== Zope3/src/zope/app/registration/registration.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/registration/registration.py:1.1	Sat Mar 13 13:01:16 2004
+++ Zope3/src/zope/app/registration/registration.py	Sat Mar 13 13:10:52 2004
@@ -694,7 +694,7 @@
     and (b) add a function to factories.py, like this:
 
         def UtilityRegistration():
-            from zope.app.services.utility import UtilityRegistration
+            from zope.app.utility import UtilityRegistration
             return UtilityRegistration("", None, "")
 
     The file representation of a registration object is an XML pickle
@@ -709,7 +709,7 @@
     def factory(self):
         """See IObjectEntry."""
         name = self.context.__class__.__name__
-        return "zope.app.services.factories." + name
+        return "zope.app.registration.factories." + name
 
     def getBody(self):
         """See IObjectEntry."""
@@ -736,4 +736,4 @@
 sys.modules['zope.app.services.registrationmanager'
             ] = sys.modules['zope.app.registration']
 sys.modules['zope.app.services.configuration'
-            ] = sys.modules['zope.app.registration']
+            ] = sys.modules['zope.app.registration.registration']




More information about the Zope3-Checkins mailing list