[Python-modules-commits] r29593 - in packages/django-xmlrpc/trunk/debian/patches (6 files)

bam at users.alioth.debian.org bam at users.alioth.debian.org
Thu Jul 3 00:04:33 UTC 2014


    Date: Thursday, July 3, 2014 @ 00:04:31
  Author: bam
Revision: 29593

Remove unused patches.

These are obsolete and no longer needed.

Can't remember what wtf patch is, removing it until I remember why I had it.

Deleted:
  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/patches/wtf

Deleted: packages/django-xmlrpc/trunk/debian/patches/csrf
===================================================================
--- packages/django-xmlrpc/trunk/debian/patches/csrf	2014-07-02 23:55:19 UTC (rev 29592)
+++ packages/django-xmlrpc/trunk/debian/patches/csrf	2014-07-03 00:04:31 UTC (rev 29593)
@@ -1,41 +0,0 @@
-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
- 

Deleted: packages/django-xmlrpc/trunk/debian/patches/no_import_loop
===================================================================
--- packages/django-xmlrpc/trunk/debian/patches/no_import_loop	2014-07-02 23:55:19 UTC (rev 29592)
+++ packages/django-xmlrpc/trunk/debian/patches/no_import_loop	2014-07-03 00:04:31 UTC (rev 29593)
@@ -1,21 +0,0 @@
-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

Deleted: packages/django-xmlrpc/trunk/debian/patches/packaging
===================================================================
--- packages/django-xmlrpc/trunk/debian/patches/packaging	2014-07-02 23:55:19 UTC (rev 29592)
+++ packages/django-xmlrpc/trunk/debian/patches/packaging	2014-07-03 00:04:31 UTC (rev 29593)
@@ -1,150 +0,0 @@
-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

Deleted: packages/django-xmlrpc/trunk/debian/patches/series
===================================================================
Deleted: packages/django-xmlrpc/trunk/debian/patches/upstream
===================================================================
--- packages/django-xmlrpc/trunk/debian/patches/upstream	2014-07-02 23:55:19 UTC (rev 29592)
+++ packages/django-xmlrpc/trunk/debian/patches/upstream	2014-07-03 00:04:31 UTC (rev 29593)
@@ -1,522 +0,0 @@
-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 %}
-+

Deleted: packages/django-xmlrpc/trunk/debian/patches/wtf
===================================================================
--- packages/django-xmlrpc/trunk/debian/patches/wtf	2014-07-02 23:55:19 UTC (rev 29592)
+++ packages/django-xmlrpc/trunk/debian/patches/wtf	2014-07-03 00:04:31 UTC (rev 29593)
@@ -1,71 +0,0 @@
-Description: <short summary of the patch>
- TODO: Put a short summary on the line above and replace this paragraph
- with a longer explanation of this change. Complete the meta-information
- with other relevant fields (see below for details). To make it easier, the
- information below has been extracted from the changelog. Adjust it or drop
- it.
- .
- django-xmlrpc (0.1.5-3) unstable; urgency=low
- .
-   * Build python3 packages.
-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.5.orig/django_xmlrpc/templates/xmlrpc_get.html
-+++ django-xmlrpc-0.1.5/django_xmlrpc/templates/xmlrpc_get.html
-@@ -1,26 +1,28 @@
--{% extends "admin/base_site.html" %}
-+{% extends "main.html" %}
- {% load i18n %}
- 
- {% block title %}{% trans "XML-RPC Service" %}{% endblock %}
- 
- {% block content %}
--<h2>{% trans "XML-RPC Service" %}</h2>
-+<div id="content-main">
-+    <h2>{% trans "XML-RPC Service" %}</h2>
- 
--<p>{% trans "You need to invoke this service using an XML-RPC Client." %}</p>
-+    <p>{% trans "You need to invoke this service using an XML-RPC Client." %}</p>
- 
--<h3>{% trans "The following methods are available :" %}</h3>
-+    <h3>{% trans "The following methods are available :" %}</h3>
- 
--{% for m in methods %}
--<div class="functions">
--  <h4>{{ m.0 }}</h4>
--  <div class="function_desc">
--    <strong>{% trans "Types of argument" %}{{ m.1.args|length|pluralize }} :</strong> {{ m.1.args }}
--    <br />
--    <strong>{% trans "Type of return" %} :</strong> {{ m.1.returns }}
--    <br />
--    <pre class="function_doc">{{ m.2 }}</pre>
--  </div>
-+    {% for m in methods %}
-+    <div class="functions">
-+        <h4>{{ m.0 }}</h4>
-+        <div class="function_desc">
-+            <strong>{% trans "Types of argument" %}{{ m.1.args|length|pluralize }} :</strong> {{ m.1.args }}
-+            <br />
-+            <strong>{% trans "Type of return" %} :</strong> {{ m.1.returns }}
-+            <br />
-+            <pre class="function_doc">{{ m.2 }}</pre>
-+        </div>
-+    </div>
-+    {% endfor %}
- </div>
--{% endfor %}
- {% endblock %}
- 




More information about the Python-modules-commits mailing list