[Zope-Checkins] CVS: Zope/lib/python/App - Factory.py:1.27 Product.py:1.61
Shane Hathaway
shane@zope.com
Wed, 14 May 2003 10:44:15 -0400
Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv7560/lib/python/App
Modified Files:
Factory.py Product.py
Log Message:
Fixed some long-standing circular imports. The circular imports are the
reason "import Zope" is often required in unit tests.
=== Zope/lib/python/App/Factory.py 1.26 => 1.27 ===
--- Zope/lib/python/App/Factory.py:1.26 Wed Aug 14 17:31:40 2002
+++ Zope/lib/python/App/Factory.py Wed May 14 10:43:44 2003
@@ -16,7 +16,6 @@
__version__='$Revision$'[11:-2]
import OFS.SimpleItem, Acquisition, Globals, AccessControl.Role
-import Products, Product
class Factory(
AccessControl.Role.RoleManager,
@@ -69,6 +68,7 @@
if REQUEST is not None: return self.manage_main(self, REQUEST)
def manage_afterAdd(self, item, container):
+ import Product # local to avoid circular import
if hasattr(self, 'aq_parent'):
container=self.aq_parent
elif item is not self:
@@ -78,6 +78,7 @@
self._register()
def manage_beforeDelete(self, item, container):
+ import Product # local to avoid circular import
if hasattr(self, 'aq_parent'):
container=self.aq_parent
elif item is not self:
=== Zope/lib/python/App/Product.py 1.60 => 1.61 ===
--- Zope/lib/python/App/Product.py:1.60 Tue Feb 11 12:17:04 2003
+++ Zope/lib/python/App/Product.py Wed May 14 10:43:44 2003
@@ -34,19 +34,19 @@
# on restart if there is still a product directory.
-import Globals, OFS.Folder, OFS.SimpleItem, os, Acquisition, Products
-import re, zlib, Globals, cPickle, marshal, rotor
-import ZClasses, ZClasses.ZClass, AccessControl.Owned
-from urllib import quote
+import os, re, zlib, marshal, rotor, cPickle
from cgi import escape
+from urllib import quote
+import Globals, OFS.Folder, OFS.SimpleItem, Acquisition, Products
+import ZClasses, AccessControl.Owned
from OFS.Folder import Folder
+from HelpSys.HelpSys import ProductHelp
+from AccessControl import Unauthorized
+
from Factory import Factory
from Permission import PermissionManager
-import ZClasses, ZClasses.ZClass
-from HelpSys.HelpSys import ProductHelp
import RefreshFuncs
-from AccessControl import Unauthorized
from App.config import getConfiguration