[Erp5-report] r42609 nicolas.dumazet - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jan 24 06:42:09 CET 2011


Author: nicolas.dumazet
Date: Mon Jan 24 06:42:09 2011
New Revision: 42609

URL: http://svn.erp5.org?rev=42609&view=rev
Log:
reduce code duplication

Modified:
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=42609&r1=42608&r2=42609&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Base.py [utf8] Mon Jan 24 06:42:09 2011
@@ -464,9 +464,7 @@ class PropertyHolder:
     """
     Return the list of workflow method IDs
     """
-    return [x[0] for x in self._getItemList() if isinstance(x[1], WorkflowMethod)
-        or (isinstance(x[1], types.TupleType)
-            and x[1] is WORKFLOW_METHOD_MARKER)]
+    return [x[0] for x in self.getWorkflowMethodItemList()]
 
   def _getClassDict(self, klass, inherited=1, local=1):
     """
@@ -499,8 +497,7 @@ class PropertyHolder:
     """
     Return the list of class method IDs
     """
-    return [x[0] for x in self._getClassItemList(klass, inherited=inherited,
-      local=local) if callable(x[1]) and not isinstance(x[1], Method)]
+    return [x[0] for x in self.getClassMethodItemList()]
 
   def getClassPropertyItemList(self, klass, inherited=1, local=1):
     """
@@ -513,8 +510,7 @@ class PropertyHolder:
     """
     Return the list of class method IDs
     """
-    return [x[0] for x in self._getClassItemList(klass, inherited=inherited,
-      local=local) if not callable(x[1])]
+    return [x[0] for x in self.getClassPropertyItemList()]
 
 def getClassPropertyList(klass):
   ps_list = getattr(klass, 'property_sheets', ())



More information about the Erp5-report mailing list