[Python-modules-commits] r29589 - in packages/django-xmlrpc/trunk (18 files)
bam at users.alioth.debian.org
bam at users.alioth.debian.org
Wed Jul 2 23:49:51 UTC 2014
Date: Wednesday, July 2, 2014 @ 23:49:51
Author: bam
Revision: 29589
[svn-inject] Applying Debian modifications (0.1.5-1) to trunk
Added:
packages/django-xmlrpc/trunk/debian/
packages/django-xmlrpc/trunk/debian/changelog
packages/django-xmlrpc/trunk/debian/compat
packages/django-xmlrpc/trunk/debian/control
packages/django-xmlrpc/trunk/debian/copyright
packages/django-xmlrpc/trunk/debian/patches/
packages/django-xmlrpc/trunk/debian/patches/csrf
packages/django-xmlrpc/trunk/debian/patches/no_import_loop
packages/django-xmlrpc/trunk/debian/patches/packaging
packages/django-xmlrpc/trunk/debian/patches/series
packages/django-xmlrpc/trunk/debian/patches/upstream
packages/django-xmlrpc/trunk/debian/pycompat
packages/django-xmlrpc/trunk/debian/python-django-xmlrpc.install
packages/django-xmlrpc/trunk/debian/rules
packages/django-xmlrpc/trunk/debian/source/
packages/django-xmlrpc/trunk/debian/source/format
packages/django-xmlrpc/trunk/debian/source/options
packages/django-xmlrpc/trunk/debian/watch
Property changes on: packages/django-xmlrpc/trunk/debian
___________________________________________________________________
Added: mergeWithUpstream
+ 1
Added: packages/django-xmlrpc/trunk/debian/changelog
===================================================================
--- packages/django-xmlrpc/trunk/debian/changelog (rev 0)
+++ packages/django-xmlrpc/trunk/debian/changelog 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1,45 @@
+django-xmlrpc (0.1.5-1) unstable; urgency=low
+
+ * New upstream release.
+ * Bump Standards version to 3.9.4.
+ * Use DEP5 format for d/copyright.
+ * Rename to python-django-xmlrpc, provide transitional dummy package
+
+ -- Brian May <bam at debian.org> Mon, 24 Jun 2013 14:46:36 +1000
+
+django-xmlrpc (0.1-6) unstable; urgency=low
+
+ * Update Debian packaging.
+ * Avoid circular import loop.
+
+ -- Brian May <bam at debian.org> Wed, 29 May 2013 09:08:17 +1000
+
+django-xmlrpc (0.1-5) unstable; urgency=low
+
+ * Fix various packaging issues.
+
+ -- Brian May <bam at debian.org> Mon, 02 Apr 2012 14:53:40 +1000
+
+django-xmlrpc (0.1-4) unstable; urgency=low
+
+ * Make it work for Django 1.1 and Django 1.2
+
+ -- Brian May <bam at debian.org> Fri, 23 Jul 2010 16:31:10 +1000
+
+django-xmlrpc (0.1-3) unstable; urgency=low
+
+ * Require Django >= 1.2.
+
+ -- Brian May <bam at debian.org> Fri, 23 Jul 2010 16:14:21 +1000
+
+django-xmlrpc (0.1-2) unstable; urgency=low
+
+ * Override CSRF check.
+
+ -- Brian May <bam at debian.org> Wed, 21 Jul 2010 15:12:41 +1000
+
+django-xmlrpc (0.1-1) unstable; urgency=low
+
+ * Initial release. Created from upstream trunk on this date.
+
+ -- Sam Morrison <sam at vpac.org> Mon, 22 Mar 2010 13:30:13 +1100
Added: packages/django-xmlrpc/trunk/debian/compat
===================================================================
--- packages/django-xmlrpc/trunk/debian/compat (rev 0)
+++ packages/django-xmlrpc/trunk/debian/compat 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1 @@
+7
Added: packages/django-xmlrpc/trunk/debian/control
===================================================================
--- packages/django-xmlrpc/trunk/debian/control (rev 0)
+++ packages/django-xmlrpc/trunk/debian/control 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1,25 @@
+Source: django-xmlrpc
+Section: python
+Priority: optional
+Maintainer: Brian May <bam at debian.org>
+Build-Depends: debhelper (>=7.0.0), python (>= 2.6.6-3), cdbs (>= 0.4.90), python-setuptools
+Standards-Version: 3.9.4
+X-Python-Version: >= 2.5
+Homepage: https://pypi.python.org/pypi/django-xmlrpc/
+
+Package: python-django-xmlrpc
+Architecture: all
+Depends: ${misc:Depends}, ${python:Depends}, python-django (>= 1.4.5)
+Replaces: django-xmlrpc (<< 0.1.5)
+Breaks: django-xmlrpc (<< 0.1.5)
+Description: XMLRPC library for Django
+ django_xmlrpc offers a means by which a Django developer can expose their
+ views (or indeed any other function) using XML-RPC.
+
+Package: django-xmlrpc
+Depends: python-django-xmlrpc, ${misc:Depends}
+Architecture: all
+Priority: extra
+Section: oldlibs
+Description: XMLRPC library for Django (transitional package)
+ This is a dummy package to aid switching to python-django-xmlrpc.
Added: packages/django-xmlrpc/trunk/debian/copyright
===================================================================
--- packages/django-xmlrpc/trunk/debian/copyright (rev 0)
+++ packages/django-xmlrpc/trunk/debian/copyright 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1,35 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: django-xmlrpc
+Upstream-Contact: Fache Julien <fantomas42 at gmail.com>
+Source: http://github.com/Fantomas42/django-xmlrpc
+
+Files: *
+Copyright: 2007, Graham Binns
+License: BSD-django-xmlrpc
+
+Files: debian/*
+Copyright: 2010, Brian May <bam at debian.org>
+License: BSD-django-xmlrpc
+
+License: BSD-django-xmlrpc
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * The names of its contributors may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Added: packages/django-xmlrpc/trunk/debian/patches/csrf
===================================================================
--- packages/django-xmlrpc/trunk/debian/patches/csrf (rev 0)
+++ packages/django-xmlrpc/trunk/debian/patches/csrf 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1,41 @@
+Description: Fix CSRF processing.
+Author: Brian May <bam at debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+--- django-xmlrpc-0.1.orig/django_xmlrpc/views.py
++++ django-xmlrpc-0.1/django_xmlrpc/views.py
+@@ -45,6 +45,14 @@ from django.conf import settings
+ from django.shortcuts import render_to_response
+ from dispatcher import DjangoXMLRPCDispatcher
+ from decorators import xmlrpc_func, permission_required
++try:
++ from django.views.decorators.csrf import csrf_exempt
++except ImportError:
++ class csrf_exempt(object):
++ def __init__(self, f):
++ self.f = f
++ def __call__(self, request):
++ return self.f(request)
+
+
+ # We create a local DEBUG variable from the data in settings.
+@@ -64,6 +72,7 @@ def test_xmlrpc(text):
+ return "Here's a response! %s" % str(text)
+
+
++ at csrf_exempt
+ def handle_xmlrpc(request):
+ """Handles XML-RPC requests. All XML-RPC calls should be forwarded here
+
Added: packages/django-xmlrpc/trunk/debian/patches/no_import_loop
===================================================================
--- packages/django-xmlrpc/trunk/debian/patches/no_import_loop (rev 0)
+++ packages/django-xmlrpc/trunk/debian/patches/no_import_loop 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1,21 @@
+Description: Avoid circular import loop.
+Author: Brian May <bam at debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: other, https://github.com/VPAC/django-xmlrpc/commit/365c58f0791274055e3623d68d4132fd30e6e0c8
+Forwarded: no
+Reviewed-By: Brian May <bam at debian.org>
+Last-Update: 2012-04-04
+
+--- django-xmlrpc-0.1.orig/django_xmlrpc/__init__.py
++++ django-xmlrpc-0.1/django_xmlrpc/__init__.py
+@@ -37,4 +37,4 @@ LIABILITY, WHETHER IN CONTRACT, STRICT L
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ """
+-from views import xmlrpcdispatcher
++#from views import xmlrpcdispatcher
Added: packages/django-xmlrpc/trunk/debian/patches/packaging
===================================================================
--- packages/django-xmlrpc/trunk/debian/patches/packaging (rev 0)
+++ packages/django-xmlrpc/trunk/debian/patches/packaging 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1,150 @@
+Description: Changes for to create formal package.
+Author: Brian May <bam at debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+--- /dev/null
++++ django-xmlrpc-0.1/setup.py
+@@ -0,0 +1,78 @@
++from distutils.core import setup
++from distutils.command.install_data import install_data
++from distutils.command.install import INSTALL_SCHEMES
++import os
++import sys
++
++class osx_install_data(install_data):
++ # On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../
++ # which is wrong. Python 2.5 supplied with MacOS 10.5 has an Apple-specific fix
++ # for this in distutils.command.install_data#306. It fixes install_lib but not
++ # install_data, which is why we roll our own install_data class.
++
++ def finalize_options(self):
++ # By the time finalize_options is called, install.install_lib is set to the
++ # fixed directory, so we set the installdir to install_lib. The
++ # install_data class uses ('install_data', 'install_dir') instead.
++ self.set_undefined_options('install', ('install_lib', 'install_dir'))
++ install_data.finalize_options(self)
++
++if sys.platform == "darwin":
++ cmdclasses = {'install_data': osx_install_data}
++else:
++ cmdclasses = {'install_data': install_data}
++
++def fullsplit(path, result=None):
++ """
++ Split a pathname into components (the opposite of os.path.join) in a
++ platform-neutral way.
++ """
++ if result is None:
++ result = []
++ head, tail = os.path.split(path)
++ if head == '':
++ return [tail] + result
++ if head == path:
++ return result
++ return fullsplit(head, [tail] + result)
++
++# Tell distutils to put the data_files in platform-specific installation
++# locations. See here for an explanation:
++# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
++for scheme in INSTALL_SCHEMES.values():
++ scheme['data'] = scheme['purelib']
++
++# Compile the list of packages available, because distutils doesn't have
++# an easy way to do this.
++packages, data_files = [], []
++root_dir = os.path.dirname(__file__)
++if root_dir != '':
++ os.chdir(root_dir)
++code_dir = 'django_xmlrpc'
++
++for dirpath, dirnames, filenames in os.walk(code_dir):
++ # Ignore dirnames that start with '.'
++ for i, dirname in enumerate(dirnames):
++ if dirname.startswith('.'): del dirnames[i]
++ if '__init__.py' in filenames:
++ packages.append('.'.join(fullsplit(dirpath)))
++ elif filenames:
++ data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
++
++# Small hack for working with bdist_wininst.
++# See http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html
++if len(sys.argv) > 1 and sys.argv[1] == 'bdist_wininst':
++ for file_info in data_files:
++ file_info[0] = '\\PURELIB\\%s' % file_info[0]
++
++setup(
++ name = "django-xmlrpc",
++ version = '0.1debian1',
++ url = 'https://launchpad.net/django-xmlrpc',
++ author = 'Graham Binns',
++ author_email = 'graham at grahambinns.com',
++ description = 'XMLRPC library for Django',
++ packages = packages,
++ cmdclass = cmdclasses,
++ data_files = data_files,
++)
+--- /dev/null
++++ django-xmlrpc-0.1/Makefile
+@@ -0,0 +1,37 @@
++PYTHON=`which python`
++DESTDIR=/
++BUILDIR=$(CURDIR)/debian/django-xmlrpc
++PROJECT=django-xmlrpc
++VERSION="0.1debian1"
++
++all:
++ @echo "make source - Create source package"
++ @echo "make install - Install on local system"
++ @echo "make buildrpm - Generate a rpm package"
++ @echo "make builddeb - Generate a deb package"
++ @echo "make clean - Get rid of scratch and byte files"
++
++source:
++ $(PYTHON) setup.py sdist $(COMPILE)
++
++install:
++ $(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE)
++
++buildrpm:
++ $(PYTHON) setup.py bdist_rpm --post-install=rpm/postinstall --pre-uninstall=rpm/preuninstall
++
++builddeb:
++ # build the source package in the parent directory
++ # then rename it to project_version.orig.tar.gz
++ $(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../ --prune
++ rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
++ # build the package
++ dpkg-buildpackage -i -I -rfakeroot
++
++clean:
++ $(PYTHON) setup.py clean
++ $(MAKE) -f $(CURDIR)/debian/rules clean
++ rm -rf build/ MANIFEST
++ find . -name '*.pyc' -delete
++
++
+--- /dev/null
++++ django-xmlrpc-0.1/PKG-INFO
+@@ -0,0 +1,10 @@
++Metadata-Version: 1.0
++Name: django-xmlrpc
++Version: 0.1debian1
++Summary: XMLRPC library for Django
++Home-page: https://launchpad.net/django-xmlrpc
++Author: Graham Binns
++Author-email: graham at grahambinns.com
++License: UNKNOWN
++Description: UNKNOWN
++Platform: UNKNOWN
Added: packages/django-xmlrpc/trunk/debian/patches/series
===================================================================
Added: packages/django-xmlrpc/trunk/debian/patches/upstream
===================================================================
--- packages/django-xmlrpc/trunk/debian/patches/upstream (rev 0)
+++ packages/django-xmlrpc/trunk/debian/patches/upstream 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1,522 @@
+Description: Changes made in upstream bzr repository.
+Author: Brian May <bam at debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+--- /dev/null
++++ django-xmlrpc-0.1/django_xmlrpc/dispatcher.py
+@@ -0,0 +1,76 @@
++"""Offers a simple XML-RPC dispatcher for django_xmlrpc
++
++Author::
++ Graham Binns
++
++Credit must go to Brendan W. McAdams <brendan.mcadams at thewintergrp.com>, who
++posted the original SimpleXMLRPCDispatcher to the Django wiki:
++http://code.djangoproject.com/wiki/XML-RPC
++
++New BSD License
++===============
++Copyright (c) 2007, Graham Binns http://launchpad.net/~codedragon
++
++All rights reserved.
++
++Redistribution and use in source and binary forms, with or without
++modification, are permitted provided that the following conditions are met:
++
++ * Redistributions of source code must retain the above copyright notice,
++ this list of conditions and the following disclaimer.
++ * Redistributions in binary form must reproduce the above copyright notice,
++ this list of conditions and the following disclaimer in the documentation
++ and/or other materials provided with the distribution.
++ * Neither the name of the <ORGANIZATION> nor the names of its contributors
++ may be used to endorse or promote products derived from this software
++ without specific prior written permission.
++
++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++"""
++from inspect import getargspec
++from SimpleXMLRPCServer import SimpleXMLRPCDispatcher
++from django.conf import settings
++
++
++# If we need to debug, now we know
++DEBUG = hasattr(settings, 'XMLRPC_DEBUG') and settings.XMLRPC_DEBUG
++
++
++class DjangoXMLRPCDispatcher(SimpleXMLRPCDispatcher):
++ """A simple XML-RPC dispatcher for Django.
++
++ Subclassess SimpleXMLRPCServer.SimpleXMLRPCDispatcher for the purpose of
++ overriding certain built-in methods (it's nicer than monkey-patching them,
++ that's for sure).
++ """
++
++ def system_methodSignature(self, method):
++ """Returns the signature details for a specified method
++
++ method
++ The name of the XML-RPC method to get the details for
++ """
++ # See if we can find the method in our funcs dict
++ # TODO: Handle this better: We really should return something more
++ # formal than an AttributeError
++ func = self.funcs[method]
++
++ try:
++ sig = func._xmlrpc_signature
++ except:
++ sig = {
++ 'returns': 'string',
++ 'args': ['string' for arg in getargspec(func)[0]],
++ }
++
++ return [sig['returns']] + sig['args']
+--- django-xmlrpc-0.1.orig/django_xmlrpc/views.py
++++ django-xmlrpc-0.1/django_xmlrpc/views.py
+@@ -1,9 +1,16 @@
+-"""
+-Uses SimpleXMLRPCServer's SimpleXMLRPCDispatcher to serve XML-RPC requests
++"""Uses SimpleXMLRPCServer's SimpleXMLRPCDispatcher to serve XML-RPC requests
++
++Authors::
++ Graham Binns,
++ Reza Mohammadi
++
++Credit must go to Brendan W. McAdams <brendan.mcadams at thewintergrp.com>, who
++posted the original SimpleXMLRPCDispatcher to the Django wiki:
++http://code.djangoproject.com/wiki/XML-RPC
+
+ New BSD License
+ ===============
+-Copyright (c) 2007, Graham Binns
++Copyright (c) 2007, Graham Binns http://launchpad.net/~codedragon
+
+ All rights reserved.
+
+@@ -31,74 +38,110 @@ LIABILITY, WHETHER IN CONTRACT, STRICT L
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ """
++import sys
+ from django.core.exceptions import ImproperlyConfigured
+-from SimpleXMLRPCServer import SimpleXMLRPCDispatcher
+-from xmlrpclib import Fault
+ from django.http import HttpResponse, HttpResponseServerError
+ from django.conf import settings
+ from django.shortcuts import render_to_response
+-import sys
++from dispatcher import DjangoXMLRPCDispatcher
++from decorators import xmlrpc_func, permission_required
++
++
++# We create a local DEBUG variable from the data in settings.
++DEBUG = hasattr(settings, 'XMLRPC_DEBUG') and settings.XMLRPC_DEBUG
++
+
+ # Declare xmlrpcdispatcher correctly depending on our python version
+-if sys.version_info[:3] >= (2,5,):
+- xmlrpcdispatcher = SimpleXMLRPCDispatcher(allow_none=False, encoding=None)
++if sys.version_info[:3] >= (2, 5,):
++ xmlrpcdispatcher = DjangoXMLRPCDispatcher(allow_none=False, encoding=None)
+ else:
+- xmlrpcdispatcher = SimpleXMLRPCDispatcher()
++ xmlrpcdispatcher = DjangoXMLRPCDispatcher()
++
+
++ at xmlrpc_func(returns='string', args=['string'])
+ def test_xmlrpc(text):
+- """
+- Simply returns the args passed to it as a string
+- """
+- return "Here's a response! %s" % str(locals())
++ """Simply returns the args passed to it as a string"""
++ return "Here's a response! %s" % str(text)
++
+
+ def handle_xmlrpc(request):
+- """
+- Handles XML-RPC requests. All XML-RPC calls should be forwarded here
++ """Handles XML-RPC requests. All XML-RPC calls should be forwarded here
+
+ request
+ The HttpRequest object that carries the XML-RPC call. If this is a
+ GET request, nothing will happen (we only accept POST requests)
+ """
+- response = HttpResponse()
+ if request.method == "POST":
+- if settings.DEBUG:
++ if DEBUG:
+ print request.raw_post_data
+ try:
++ response = HttpResponse(content_type='text/xml')
+ response.write(
+ xmlrpcdispatcher._marshaled_dispatch(request.raw_post_data))
+- if settings.DEBUG:
++ if DEBUG:
+ print response
+ return response
+- except Exception, e:
++ except:
+ return HttpResponseServerError()
+ else:
+- return render_to_response(settings.XMLRPC_GET_TEMPLATE)
++ methods = xmlrpcdispatcher.system_listMethods()
++ method_list = []
++
++ for method in methods:
++ sig_ = xmlrpcdispatcher.system_methodSignature(method)
++ sig = {
++ 'returns': sig_[0],
++ 'args': ", ".join(sig_[1:]),
++ }
++
++ # this just reads your docblock, so fill it in!
++ method_help = xmlrpcdispatcher.system_methodHelp(method)
++
++ method_list.append((method, sig, method_help))
++
++ if hasattr(settings, 'XMLRPC_GET_TEMPLATE'):
++ # This behaviour is deprecated
++ if settings.DEBUG:
++ print "Use of settings.XMLRPC_GET_TEMPLATE is deprecated " \
++ + "Please update your code to use django_xmlrpc/templates"
++ template = settings.XMLRPC_GET_TEMPLATE
++ else:
++ template = 'xmlrpc_get.html'
++ return render_to_response(template, {'methods': method_list})
++
+
+ # Load up any methods that have been registered with the server in settings
+-for path, name in settings.XMLRPC_METHODS:
+- # if "path" is actually a function, just add it without fuss
+- if callable(path):
+- xmlrpcdispatcher.register_function(path, name)
+- continue
+-
+- # Otherwise we try and find something that we can call
+- i = path.rfind('.')
+- module, attr = path[:i], path[i+1:]
+-
+- try:
+- mod = __import__(module, globals(), locals(), [attr])
+- except ImportError, e:
+- raise ImproperlyConfigured, "Error registering XML-RPC method: " \
+- + "module %s can't be imported" % module
+-
+- try:
+- func = getattr(mod, attr)
+- except AttributeError:
+- raise ImproperlyConfigured, 'Error registering XML-RPC method: ' \
+- + 'module %s doesn\'t define a method "%s"' % (module, attr)
+-
+- if not callable(func):
+- raise ImproperlyConfigured, 'Error registering XML-RPC method: ' \
+- + '"%s" is not callable in module %s' % (attr, module)
++if hasattr(settings, 'XMLRPC_METHODS'):
++ for path, name in settings.XMLRPC_METHODS:
++ # if "path" is actually a function, just add it without fuss
++ if callable(path):
++ xmlrpcdispatcher.register_function(path, name)
++ continue
++
++ # Otherwise we try and find something that we can call
++ i = path.rfind('.')
++ module, attr = path[:i], path[i+1:]
+
+- xmlrpcdispatcher.register_function(func, name)
++ try:
++ mod = __import__(module, globals(), locals(), [attr])
++ except ImportError, ex:
++ raise ImproperlyConfigured, "Error registering XML-RPC method: " \
++ + "module %s can't be imported" % module
++
++ try:
++ func = getattr(mod, attr)
++ except AttributeError:
++ raise ImproperlyConfigured, 'Error registering XML-RPC method: ' \
++ + 'module %s doesn\'t define a method "%s"' % (module, attr)
++
++ if not callable(func):
++ raise ImproperlyConfigured, 'Error registering XML-RPC method: ' \
++ + '"%s" is not callable in module %s' % (attr, module)
++
++ xmlrpcdispatcher.register_function(func, name)
++
++
++# Finally, register the introspection and multicall methods with the XML-RPC
++# namespace
++xmlrpcdispatcher.register_introspection_functions()
++xmlrpcdispatcher.register_multicall_functions()
+--- django-xmlrpc-0.1.orig/django_xmlrpc/__init__.py
++++ django-xmlrpc-0.1/django_xmlrpc/__init__.py
+@@ -1,9 +1,15 @@
+-"""
+-__init__ module for the django_xmlrpc package
++"""__init__ module for the django_xmlrpc package
++
++Author::
++ Graham Binns
++
++Credit must go to Brendan W. McAdams <brendan.mcadams at thewintergrp.com>, who
++posted the original SimpleXMLRPCDispatcher to the Django wiki:
++http://code.djangoproject.com/wiki/XML-RPC
+
+ New BSD License
+ ===============
+-Copyright (c) 2007, Graham Binns
++Copyright (c) 2007, Graham Binns http://launchpad.net/~codedragon
+
+ All rights reserved.
+
+@@ -31,4 +37,4 @@ LIABILITY, WHETHER IN CONTRACT, STRICT L
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ """
+-from views import xmlrpcdispatcher
+\ No newline at end of file
++from views import xmlrpcdispatcher
+--- /dev/null
++++ django-xmlrpc-0.1/django_xmlrpc/decorators.py
+@@ -0,0 +1,179 @@
++"""Offers decorators to make the use of django_xmlrpc a great deal simpler
++
++Authors::
++ Graham Binns,
++ Reza Mohammadi
++
++Credit must go to Brendan W. McAdams <brendan.mcadams at thewintergrp.com>, who
++posted the original SimpleXMLRPCDispatcher to the Django wiki:
++http://code.djangoproject.com/wiki/XML-RPC
++
++New BSD License
++===============
++Copyright (c) 2007, Graham Binns http://launchpad.net/~codedragon
++
++All rights reserved.
++
++Redistribution and use in source and binary forms, with or without
++modification, are permitted provided that the following conditions are met:
++
++ * Redistributions of source code must retain the above copyright notice,
++ this list of conditions and the following disclaimer.
++ * Redistributions in binary form must reproduce the above copyright notice,
++ this list of conditions and the following disclaimer in the documentation
++ and/or other materials provided with the distribution.
++ * Neither the name of the <ORGANIZATION> nor the names of its contributors
++ may be used to endorse or promote products derived from this software
++ without specific prior written permission.
++
++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++"""
++from xmlrpclib import Fault
++from django.contrib.auth import authenticate
++from django.utils.translation import gettext as _
++
++
++# Some constants for your pleasure
++#XXX: Any standardization?
++AUTHENTICATION_FAILED_CODE = 81
++PERMISSION_DENIED_CODE = 82
++
++
++class AuthenticationFailedException(Fault):
++ """An XML-RPC fault to be raised when a permission_required authentication
++ check fails
++
++ Author
++ """
++ def __init__(self):
++ Fault.__init__(self, AUTHENTICATION_FAILED_CODE,
++ _('Username and/or password is incorrect'))
++
++
++class PermissionDeniedException(Fault):
++ """An XML-RPC fault to be raised when a permission_required permission
++ check fails
++ """
++ def __init__(self):
++ Fault.__init__(self, PERMISSION_DENIED_CODE, _('Permission denied'))
++
++
++def xmlrpc_method(returns='string', args=None, name=None):
++ """Adds a signature to an XML-RPC function and register it with the dispatcher.
++
++ returns
++ The return type of the function. This can either be a string
++ description (e.g. 'string') or a type (e.g. str, bool) etc.
++
++ args
++ A list of the types of the arguments that the function accepts. These
++ can be strings or types or a mixture of the two e.g.
++ [str, bool, 'string']
++ """
++ # Args should be a list
++ if args is None:
++ args = []
++
++
++ def _xmlrpc_func(func):
++ """Inner function for XML-RPC method decoration. Adds a signature to
++ the method passed to it.
++
++ func
++ The function to add the signature to
++ """
++ # If name is not None, register the method with the dispatcher.
++ from django_xmlrpc.views import xmlrpcdispatcher
++ if name is not None:
++ xmlrpcdispatcher.register_function(func, name)
++
++ # Add a signature to the function
++ func._xmlrpc_signature = {
++ 'returns': returns,
++ 'args': args
++ }
++ return func
++
++ return _xmlrpc_func
++
++xmlrpc_func = xmlrpc_method
++
++
++# Don't use this decorator when your service is going to be
++# available in an unencrpted/untrusted network.
++# Configure HTTPS transport for your web server.
++def permission_required(perm=None):
++ """Decorator for authentication. Uses Django's built in authentication
++ framework to provide authenticated-only and permission-related access
++ to XML-RPC methods
++
++ perm
++ The permission (as a string) that the user must hold to be able to
++ call the function that is decorated with permission_required.
++ """
++ def _dec(func):
++ """An inner decorator. Adds the lookup code for the permission passed
++ in the outer method to the function passed to it.
++
++ func
++ The function to add the permission check to
++ """
++ def __authenticated_call(username, password, *args):
++ """Inner inner decorator. Adds username and password parameters to
++ a given XML-RPC function for authentication and permission
++ checking purposes and modifies the method signature appropriately
++
++ username
++ The username used for authentication
++
++ password
++ The password used for authentication
++ """
++ try:
++ user = authenticate(username=username, password=password)
++ if not user:
++ raise AuthenticationFailedException
++ if perm and not user.has_perm(perm):
++ raise PermissionDeniedException
++ except AuthenticationFailedException:
++# log.error("Authentication Failed for username '%s'" % username)
++ raise
++ except PermissionDeniedException:
++# log.error(("Permission Denied. Username: '%s', " + \
++# "Required permission: %s") % (username, perm))
++ raise
++ except:
++# log.error(traceback.format_exc())
++ raise AuthenticationFailedException
++ return func(user, *args)
++
++ # Update the function's XML-RPC signature, if the method has one
++ if hasattr(func, '_xmlrpc_signature'):
++ sig = func._xmlrpc_signature
++
++ # We just stick two string args on the front of sign['args'] to
++ # represent username and password
++ sig['args'] = (['string'] * 2) + sig['args']
++ __authenticated_call._xmlrpc_signature = sig
++
++ # Update the function's docstring
++ if func.__doc__:
++ __authenticated_call.__doc__ = func.__doc__ + \
++ "\nNote: Authentication is required."""
++ if perm:
++ __authenticated_call.__doc__ += ' this function requires ' \
++ + '"%s" permission.' % perm
++
++ return __authenticated_call
++
++ return _dec
+--- /dev/null
++++ django-xmlrpc-0.1/django_xmlrpc/templates/xmlrpc_get.html
+@@ -0,0 +1,38 @@
++{% extends "admin/base_site.html" %}
++
++{% block title %}XML-RPC Service{% endblock %}
++
++{% block extrahead %}
++<style type="text/css">
++<!--
++.function {
++ border-bottom: 2px solid;
++}
++.function_desc {
++ padding-left: 15px;
++ padding-right: 15px;
++}
++.function_doc {
++ padding: 2px;
++ background-color: #EEE;
++}
++-->
++</style>
++{% endblock %}
++
++{% block content %}
++<h1>XML-RPC Service</h1>
++<h2>You need to invoke this service using an XML-RPC Client.</h2>
++<h2>The following methods are available:</h2>
++{% for m in methods %}
++ <div class="function">
++ <h3>{{ m.0 }}</h3>
++ <div class="function_desc">
++ <strong>Types of Argument{{ m.1.args|length|pluralize }}: </strong> {{ m.1.args }} <br />
++ <strong>Type of Return: </strong> {{ m.1.returns }} <br />
++ <pre class="function_doc">{{ m.2 }}</pre>
++ </div>
++ </div>
++{% endfor %}
++{% endblock %}
++
Added: packages/django-xmlrpc/trunk/debian/pycompat
===================================================================
--- packages/django-xmlrpc/trunk/debian/pycompat (rev 0)
+++ packages/django-xmlrpc/trunk/debian/pycompat 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1 @@
+2
Added: packages/django-xmlrpc/trunk/debian/python-django-xmlrpc.install
===================================================================
--- packages/django-xmlrpc/trunk/debian/python-django-xmlrpc.install (rev 0)
+++ packages/django-xmlrpc/trunk/debian/python-django-xmlrpc.install 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1 @@
+/usr
Added: packages/django-xmlrpc/trunk/debian/rules
===================================================================
--- packages/django-xmlrpc/trunk/debian/rules (rev 0)
+++ packages/django-xmlrpc/trunk/debian/rules 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1,7 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+#DEB_PYTHON2_MODULE_PACKAGES := python-django-xmlrpc
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/python-distutils.mk
Property changes on: packages/django-xmlrpc/trunk/debian/rules
___________________________________________________________________
Added: svn:executable
+ *
Added: packages/django-xmlrpc/trunk/debian/source/format
===================================================================
--- packages/django-xmlrpc/trunk/debian/source/format (rev 0)
+++ packages/django-xmlrpc/trunk/debian/source/format 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1 @@
+3.0 (quilt)
Added: packages/django-xmlrpc/trunk/debian/source/options
===================================================================
--- packages/django-xmlrpc/trunk/debian/source/options (rev 0)
+++ packages/django-xmlrpc/trunk/debian/source/options 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1 @@
+extend-diff-ignore = "^(\.project|\.pydevproject)$"
Added: packages/django-xmlrpc/trunk/debian/watch
===================================================================
--- packages/django-xmlrpc/trunk/debian/watch (rev 0)
+++ packages/django-xmlrpc/trunk/debian/watch 2014-07-02 23:49:51 UTC (rev 29589)
@@ -0,0 +1,2 @@
+version=3
+https://pypi.python.org/packages/source/d/django-xmlrpc/django-xmlrpc-([\d\.]+)\.tar\.gz
More information about the Python-modules-commits
mailing list