[Zope3-checkins] SVN: Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/ using 'undef' for undefined types

Tarek Ziadé tziade at nuxeo.com
Sun Oct 9 06:29:02 EDT 2005


Log message for revision 38998:
  using 'undef' for undefined types

Changed:
  U   Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/README.txt
  U   Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py

-=-
Modified: Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/README.txt
===================================================================
--- Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/README.txt	2005-10-09 10:23:56 UTC (rev 38997)
+++ Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/README.txt	2005-10-09 10:29:01 UTC (rev 38998)
@@ -323,8 +323,12 @@
   <param>
   <value><array><data>
   <value><array><data>
-  <value><nil/></value><value><nil/></value><value><nil/></value><value><nil/></value></data></array></value>
+  <value><string>undef</string></value>
+  <value><string>undef</string></value>
+  <value><string>undef</string></value>
+  <value><string>undef</string></value>
   </data></array></value>
+  </data></array></value>
   </param>
   </params>
   </methodResponse>

Modified: Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py
===================================================================
--- Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py	2005-10-09 10:23:56 UTC (rev 38997)
+++ Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py	2005-10-09 10:29:01 UTC (rev 38998)
@@ -94,11 +94,17 @@
             signature = [func.return_type] + list(func.parameters_types)
             # we want to return the type name as string
             # to avoid marshall problems
-            return [[element.__name__ for element in signature]]
+            str_signature = []
+            for element in signature:
+                if element is None or not hasattr(element, '__name__'):
+                    str_signature.append('undef')
+                else:
+                    str_signature.append(element.__name__)
+            return [str_signature]
 
         # no decorator, let's just return Nones
         # XXX: if defaults are given, we can render their type
-        return [[None] * (self._getFunctionArgumentSize(func) + 1)]
+        return [['undef'] * (self._getFunctionArgumentSize(func) + 1)]
 
     #
     # Lookup APIS



More information about the Zope3-Checkins mailing list