[CMF-checkins] SVN: CMF/branches/1.6/CMFCore/TypesTool.py * re-adding 'meta_type' attribute to FactoryTypeInformation and

Rob Miller ra at burningman.com
Mon Jan 2 19:07:39 EST 2006


Log message for revision 41089:
  * re-adding 'meta_type' attribute to FactoryTypeInformation and
    ScriptableTypeInformation classes
  
  * changing manage_addTypeInformation method to log a warning instead of
    raise an exception when passed a typeinfo_name that isn't found
  
  

Changed:
  U   CMF/branches/1.6/CMFCore/TypesTool.py

-=-
Modified: CMF/branches/1.6/CMFCore/TypesTool.py
===================================================================
--- CMF/branches/1.6/CMFCore/TypesTool.py	2006-01-02 18:51:22 UTC (rev 41088)
+++ CMF/branches/1.6/CMFCore/TypesTool.py	2006-01-03 00:07:39 UTC (rev 41089)
@@ -479,6 +479,7 @@
     implements(ITypeInformation)
     __implements__ = z2ITypeInformation
 
+    meta_type = 'Factory-based Type Information'
     security = ClassSecurityInfo()
 
     _properties = (TypeInformation._basic_properties + (
@@ -586,6 +587,7 @@
     implements(ITypeInformation)
     __implements__ = z2ITypeInformation
 
+    meta_type = 'Scriptable Type Information'
     security = ClassSecurityInfo()
 
     _properties = (TypeInformation._basic_properties + (
@@ -762,7 +764,7 @@
         if typeinfo_name:
             info = self.listDefaultTypeInformation()
 
-            # Nasty orkaround to stay backwards-compatible
+            # Nasty workaround to stay backwards-compatible
             # This workaround will disappear in CMF 2.0
             if typeinfo_name.endswith(')'):
                 # This is a new-style name. Proceed normally.
@@ -790,9 +792,15 @@
                         break
 
             if fti is None:
-                raise BadRequest('%s not found.' % typeinfo_name)
-            if not id:
-                id = fti.get('id', None)
+                warn("Typeinfo name %r not found. "
+                     "Note that the typeinfo_name "
+                     "argument will not be used at all "
+                     "in CMF 2.0." % typeinfo_name,
+                     DeprecationWarning, stacklevel=2)
+            else:
+                if not id:
+                    id = fti.get('id', None)
+
         if not id:
             raise BadRequest('An id is required.')
         for mt in Products.meta_types:



More information about the CMF-checkins mailing list