Rev 183: Implemented exceedingly simple XMLRPC. in http://bzr.daniel-watkins.co.uk/pqm/xmlrpc

Daniel Watkins daniel at daniel-watkins.co.uk
Thu Jul 31 05:18:50 BST 2008


At http://bzr.daniel-watkins.co.uk/pqm/xmlrpc

------------------------------------------------------------
revno: 183
revision-id: daniel at daniel-watkins.co.uk-20080731041714-k5jdyurosjwtzbxi
parent: robertc at robertcollins.net-20080717100934-40fjde09nglggsub
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: xmlrpc
timestamp: Thu 2008-07-31 05:17:14 +0100
message:
  Implemented exceedingly simple XMLRPC.
-------------- next part --------------
=== modified file 'pqm/ui/twistd.py'
--- a/pqm/ui/twistd.py	2008-04-16 10:23:52 +0000
+++ b/pqm/ui/twistd.py	2008-07-31 04:17:14 +0000
@@ -28,6 +28,8 @@
 import pqm
 from pqm.PQMConfigParser import ConfigParser
 from pqm.commandline import default_pqm_config_files
+from pqm.ui.xmlrpc import PQM_XMLRPC
+
 
 class QueueResource(resource.Resource):
     """A resource that shows a PQM queue."""
@@ -180,7 +182,10 @@
     pqminfo = PQMInfo(default_pqm_config_files())
     serviceCollection = service.IServiceCollection(application)
     port_str = os.environ.get('PQM_PORT', '8000')
-    internet.TCPServer(int(port_str), server.Site(QueueResource(pqminfo))
+    r = resource.Resource()
+    r.putChild('', QueueResource(pqminfo))
+    r.putChild('RPC2', PQM_XMLRPC())
+    internet.TCPServer(int(port_str), server.Site(r)
         ).setServiceParent(serviceCollection)
     internet.TimerService(30, pqminfo.refresh).setServiceParent(serviceCollection)
 

=== added file 'pqm/ui/xmlrpc.py'
--- a/pqm/ui/xmlrpc.py	1970-01-01 00:00:00 +0000
+++ b/pqm/ui/xmlrpc.py	2008-07-31 04:17:14 +0000
@@ -0,0 +1,9 @@
+from twisted.web.xmlrpc import XMLRPC
+
+
+class PQM_XMLRPC(XMLRPC):
+
+    def xmlrpc_submit(self, text):
+        print text
+
+        return text



More information about the bazaar-commits mailing list