[Erp5-report] r39414 nicolas.dumazet - /erp5/trunk/products/ERP5Type/Dynamic/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 21 04:16:54 CEST 2010


Author: nicolas.dumazet
Date: Thu Oct 21 04:16:53 2010
New Revision: 39414

URL: http://svn.erp5.org?rev=39414&view=rev
Log:
naming fixes

Modified:
    erp5/trunk/products/ERP5Type/Dynamic/lazyclass.py
    erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py

Modified: erp5/trunk/products/ERP5Type/Dynamic/lazyclass.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Dynamic/lazyclass.py?rev=39414&r1=39413&r2=39414&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Dynamic/lazyclass.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Dynamic/lazyclass.py [utf8] Thu Oct 21 04:16:53 2010
@@ -3,8 +3,7 @@ from ExtensionClass import Base as Exten
 
 from zLOG import LOG, ERROR, BLATHER
 
-# FIXME: bad name
-def lazyclass(name, portal_type_class_attr_getter):
+def newLazyClass(name, portal_type_class_attr_getter):
     def load(self, attr):
         klass = None
         # self might be a subclass of a portal type class

Modified: erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py?rev=39414&r1=39413&r2=39414&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Dynamic/portaltypeclass.py [utf8] Thu Oct 21 04:16:53 2010
@@ -33,7 +33,7 @@ import inspect
 from types import ModuleType
 
 from dynamicmodule import newDynamicModule
-import lazyclass
+from lazyclass import newLazyClass
 
 from Products.ERP5Type.Globals import InitializeClass
 from Products.ERP5Type.Utils import setDefaultClassProperties
@@ -42,8 +42,7 @@ from Products.ERP5Type import PropertySh
 from ExtensionClass import Base as ExtensionBase
 from zLOG import LOG, ERROR, INFO
 
-# FIXME: bad name
-def _import_class(classpath):
+def _importClass(classpath):
   try:
     module_path, class_name = classpath.rsplit('.', 1)
     module = __import__(module_path, {}, {}, (module_path,))
@@ -94,8 +93,7 @@ def _fillAccessorHolderList(accessor_hol
             "Created accessor holder for %s in %s" % (property_sheet_name,
                                                       accessor_holder_module))
 
-# FIXME: bad name
-def portal_type_factory(portal_type_name):
+def portalTypeFactory(portal_type_name):
   """
   Given a portal type, look up in Types Tool the corresponding
   Base Type object holding the definition of this portal type,
@@ -162,7 +160,7 @@ def portal_type_factory(portal_type_name
   if type_class is None:
     raise AttributeError('Document class is not defined on Portal Type %s' % portal_type_name)
 
-  type_class = _import_class(type_class)
+  type_class = _importClass(type_class)
 
   ## Disabled because there will be no commit of
   ## type_zodb_property_sheet, only use for testing ATM
@@ -203,7 +201,7 @@ def portal_type_factory(portal_type_name
   mixin_path_list = []
   if mixin_list:
     mixin_path_list = map(mixin_class_registry.__getitem__, mixin_list)
-  mixin_class_list = map(_import_class, mixin_path_list)
+  mixin_class_list = map(_importClass, mixin_path_list)
 
   baseclasses = [type_class] + accessor_holder_list + mixin_class_list
 
@@ -236,7 +234,7 @@ def initializeDynamicModules():
     """
     Returns a lazily-loaded "portal-type as a class"
     """
-    return lazyclass.lazyclass(portal_type_name, portal_type_factory)
+    return newLazyClass(portal_type_name, portalTypeFactory)
 
   erp5 = ModuleType("erp5")
   sys.modules["erp5"] = erp5




More information about the Erp5-report mailing list