[Erp5-report] r6840 - /erp5/trunk/products/ERP5Type/Utils.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Apr 20 23:39:02 CEST 2006
Author: jerome
Date: Thu Apr 20 23:38:59 2006
New Revision: 6840
URL: http://svn.erp5.org?rev=6840&view=rev
Log:
Add a warning when calling convertToUpperCase with a key which is not a string
Modified:
erp5/trunk/products/ERP5Type/Utils.py
Modified: erp5/trunk/products/ERP5Type/Utils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Utils.py?rev=6840&r1=6839&r2=6840&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Utils.py (original)
+++ erp5/trunk/products/ERP5Type/Utils.py Thu Apr 20 23:38:59 2006
@@ -133,6 +133,9 @@
This function turns an attribute name into
a method name according to the ERP5 naming conventions
"""
+ if not isinstance(key, str):
+ LOG('ERP5Type.Utils.convertToUpperCase', PROBLEM,
+ 'key `%s` is type %s' % (key, type(key)))
return ''.join([part.capitalize() for part in str(key).split('_')])
UpperCase = convertToUpperCase
@@ -142,6 +145,9 @@
This function turns an attribute name into
a method name according to the ERP5 naming conventions
"""
+ if not isinstance(key, str):
+ LOG('ERP5Type.Utils.convertToMixedCase', PROBLEM,
+ 'key `%s` is type %s' % (key, type(key)))
parts = str(key).split('_', 1)
if len(parts) == 2:
parts[1] = convertToUpperCase(parts[1])
More information about the Erp5-report
mailing list