changeset 5810:83fe7e86cc0b

xmlrpc: new method get_format for retrieving the format of a page
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 07 Dec 2011 08:47:53 +0100
parents 7cd445089a84
children 23a9acba224c
files MoinMoin/xmlrpc/__init__.py
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/xmlrpc/__init__.py	Wed Dec 07 08:46:01 2011 +0100
+++ b/MoinMoin/xmlrpc/__init__.py	Wed Dec 07 08:47:53 2011 +0100
@@ -447,6 +447,19 @@
             'version': version,
             }
 
+    def xmlrpc_get_format(self, pagename):
+        """
+        Returns format of a page
+        """
+        # User may read page?
+        if not self.request.user.may.read(pagename):
+            return self.notAllowedFault()
+        page = Page(self.request, pagename)
+        if not page.exists():
+            return xmlrpclib.Fault("NOT_EXIST", "Page does not exist.")
+        format = page.pi['format']
+        return self._outstr(format)
+
     def xmlrpc_getPage(self, pagename):
         """
         Invoke xmlrpc_getPageVersion with rev=None