[Erp5-report] r39197 jm - in /erp5/trunk/products: ERP5Type/ ZSQLCatalog/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 14 20:44:41 CEST 2010


Author: jm
Date: Thu Oct 14 20:44:40 2010
New Revision: 39197

URL: http://svn.erp5.org?rev=39197&view=rev
Log:
Change 2 common warnings so that they are reported only once per instance

Modified:
    erp5/trunk/products/ERP5Type/Utils.py
    erp5/trunk/products/ZSQLCatalog/SQLExpression.py

Modified: erp5/trunk/products/ERP5Type/Utils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Utils.py?rev=39197&r1=39196&r2=39197&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Utils.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Utils.py [utf8] Thu Oct 14 20:44:40 2010
@@ -1350,7 +1350,8 @@ def getExistingBaseCategoryList(portal, 
     except KeyError:
       value = category_tool._getOb(base_cat, None)
       if value is None:
-        LOG('ERP5Type.Utils.getExistingBaseCategoryList', PROBLEM, 'base_category "%s" is missing, can not generate Accessors' % (base_cat))
+        warnings.warn("Base Category %r is missing."
+                      " Accessors can not be generated." % base_cat, Warning)
       cache[key] = value
     if value is not None:
       new_base_cat_list.append(base_cat)

Modified: erp5/trunk/products/ZSQLCatalog/SQLExpression.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SQLExpression.py?rev=39197&r1=39196&r2=39197&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SQLExpression.py [utf8] (original)
+++ erp5/trunk/products/ZSQLCatalog/SQLExpression.py [utf8] Thu Oct 14 20:44:40 2010
@@ -27,7 +27,7 @@
 #
 ##############################################################################
 
-from zLOG import LOG
+import warnings
 from interfaces.sql_expression import ISQLExpression
 from zope.interface.verify import verifyClass
 from zope.interface import implements
@@ -132,7 +132,8 @@ class SQLExpression(object):
     else:
       self.limit = (limit, )
     if from_expression is not None:
-      LOG('SQLExpression', 0, 'Providing a from_expression is deprecated.')
+      warnings.warn("Providing a 'from_expression' is deprecated.",
+                    DeprecationWarning)
     self.from_expression = from_expression
 
   @profiler_decorator




More information about the Erp5-report mailing list