[Zope3-checkins] SVN: Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/ we want to sort listAllMethods output, when there's several methods

Tarek Ziadé tziade at nuxeo.com
Sat Oct 8 12:10:08 EDT 2005


Log message for revision 38964:
  we want to sort listAllMethods output, when there's several methods

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-08 16:07:15 UTC (rev 38963)
+++ Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/README.txt	2005-10-08 16:10:08 UTC (rev 38964)
@@ -155,7 +155,55 @@
   </methodResponse>
   <BLANKLINE>
 
+Let's try to add another method, to se if it gets listed...
 
+  >>> class FolderListing2:
+  ...     def contents2(self):
+  ...         return list(self.context.keys())
+  >>> from zope.configuration import xmlconfig
+  >>> ignored = xmlconfig.string("""
+  ... <configure
+  ...     xmlns="http://namespaces.zope.org/zope"
+  ...     xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc"
+  ...     >
+  ...   <!-- We only need to do this include in this example,
+  ...        Normally the include has already been done for us. -->
+  ...   <include package="zope.app.publisher.xmlrpc" file="meta.zcml" />
+  ...
+  ...   <xmlrpc:view
+  ...       for="zope.app.folder.folder.IFolder"
+  ...       methods="contents2"
+  ...       class="zope.app.xmlrpcintrospection.README.FolderListing2"
+  ...       permission="zope.ManageContent"
+  ...       />
+  ... </configure>
+  ... """)
+  >>> print http(r"""
+  ... POST / HTTP/1.0
+  ... Content-Type: text/xml
+  ...
+  ... <?xml version='1.0'?>
+  ... <methodCall>
+  ... <methodName>listAllMethods</methodName>
+  ... <params>
+  ... </params>
+  ... </methodCall>
+  ... """, handle_errors=False)
+  HTTP/1.0 200 Ok
+  Content-Length: ...
+  Content-Type: text/xml...
+  <BLANKLINE>
+  <?xml version='1.0'?>
+  <methodResponse>
+  <params>
+  <param>
+  <value><array><data>
+  <value><string>contents</string></value>
+  <value><string>contents2</string></value>
+  </data></array></value>
+  </param>
+  </params>
+  </methodResponse>
+  <BLANKLINE>
 
 
-

Modified: Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py
===================================================================
--- Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py	2005-10-08 16:07:15 UTC (rev 38963)
+++ Zope3/branches/tziade_xmlintrospection/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py	2005-10-08 16:10:08 UTC (rev 38964)
@@ -46,6 +46,7 @@
                 if result not in adapter_registrations:
                     adapter_registrations.append(result)
 
+        adapter_registrations.sort()
         return adapter_registrations
 
     def listAllMethods(self):



More information about the Zope3-Checkins mailing list