From 83964878e92ce0687d47409b5832e7220e57d79f Mon Sep 17 00:00:00 2001 From: Nate Case Date: Fri, 5 Sep 2008 14:27:31 -0500 Subject: Add XML-RPC interface and command line client Introduce a new XML-RPC Patchwork interface inspired by the SOAP interface from the old Patchwork. The interface itself is fairly lightweight and generic, and provides read-only access to a limited subset of the Patchwork database, along with server-side search and flexible filtering capabilities. The command line client is modeled after the old one with some additional filtering options. The XML-RPC interface is disabled by default. You can enable it by setting ENABLE_XMLRPC = True in local_settings.py This feature uses the django-xmlrpc package available from http://django-xmlrpc.googlecode.com. Signed-off-by: Nate Case Signed-off-by: Jeremy Kerr --- apps/settings.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'apps/settings.py') diff --git a/apps/settings.py b/apps/settings.py index d5fd7b1..f70ac2a 100644 --- a/apps/settings.py +++ b/apps/settings.py @@ -98,8 +98,28 @@ DEFAULT_FROM_EMAIL = 'Patchwork ' ACCOUNT_ACTIVATION_DAYS = 7 +# Set to True to enable the Patchwork XML-RPC interface +ENABLE_XMLRPC = False + +XMLRPC_METHODS = ( + # List methods to be exposed in the form (, ,) + ('patchwork.xmlrpc.pw_rpc_version', 'pw_rpc_version',), + ('patchwork.xmlrpc.patch_list', 'patch_list',), + ('patchwork.xmlrpc.patch_get', 'patch_get',), + ('patchwork.xmlrpc.patch_get_mbox', 'patch_get_mbox',), + ('patchwork.xmlrpc.patch_get_diff', 'patch_get_diff',), + ('patchwork.xmlrpc.project_list', 'project_list',), + ('patchwork.xmlrpc.project_get', 'project_get',), + ('patchwork.xmlrpc.person_list', 'person_list',), + ('patchwork.xmlrpc.person_get', 'person_get',), + ('patchwork.xmlrpc.state_list', 'state_list',), + ('patchwork.xmlrpc.state_get', 'state_get',), +) + try: from local_settings import * + if ENABLE_XMLRPC: + INSTALLED_APPS = INSTALLED_APPS + ('django_xmlrpc',) except ImportError, ex: import sys sys.stderr.write(\ -- cgit v1.2.3