FreeBSD Bugzilla – Attachment 173098 Details for
Bug 211435
[NEW PORT] net/py-flask-xml-rpc: Adds support for creating XML-RPC APIs to Flask
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
net/py-flask-xml-rpc new port diff
py-flask-xml-rpc.diff (text/plain), 7.18 KB, created by
John W. O'Brien
on 2016-07-29 16:09:11 UTC
(
hide
)
Description:
net/py-flask-xml-rpc new port diff
Filename:
MIME Type:
Creator:
John W. O'Brien
Created:
2016-07-29 16:09:11 UTC
Size:
7.18 KB
patch
obsolete
>Index: net/py-flask-xml-rpc/Makefile >=================================================================== >--- net/py-flask-xml-rpc/Makefile (nonexistent) >+++ net/py-flask-xml-rpc/Makefile (working copy) >@@ -0,0 +1,20 @@ >+# $FreeBSD$ >+ >+PORTNAME= Flask-XML-RPC >+PORTVERSION= 0.1.2 >+CATEGORIES= net python >+MASTER_SITES= CHEESESHOP >+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} >+ >+MAINTAINER= john@saltant.com >+COMMENT= Simple framework for creating XML-RPC APIs with Flask >+ >+LICENSE= MIT >+ >+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Flask>0:www/py-flask >+ >+NO_ARCH= yes >+USES= python >+USE_PYTHON= autoplist distutils >+ >+.include <bsd.port.mk> > >Property changes on: net/py-flask-xml-rpc/Makefile >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:keywords >## -0,0 +1 ## >+FreeBSD=%H >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: net/py-flask-xml-rpc/distinfo >=================================================================== >--- net/py-flask-xml-rpc/distinfo (nonexistent) >+++ net/py-flask-xml-rpc/distinfo (working copy) >@@ -0,0 +1,2 @@ >+SHA256 (Flask-XML-RPC-0.1.2.tar.gz) = 4adc7482240a916e8c2205cba38b4bd6e648692d189419686a3116768fa48ab7 >+SIZE (Flask-XML-RPC-0.1.2.tar.gz) = 5756 > >Property changes on: net/py-flask-xml-rpc/distinfo >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: net/py-flask-xml-rpc/files/patch-flaskext_xmlrpc.py >=================================================================== >--- net/py-flask-xml-rpc/files/patch-flaskext_xmlrpc.py (nonexistent) >+++ net/py-flask-xml-rpc/files/patch-flaskext_xmlrpc.py (working copy) >@@ -0,0 +1,56 @@ >+Obtained-From: https://bitbucket.org/leafstorm/flask-xml-rpc/pull-requests/2/added-python3-support-alongside-python2/commits >+ >+# HG changeset patch >+# User Maxime "Pepe_" Buquet <pep+code@bouah.net> >+# Date 1425540278 -32400 >+# Node ID 9da0e2bcfe5e32a1db95b639f41f67d3e1a43b80 >+# Parent 06a6c81e3a98ecb647e729e239f5de11814901d3 >+Added Python3 support alongside Python2 >+ >+--- flaskext/xmlrpc.py.orig 2015-03-05 00:00:00 UTC >++++ flaskext/xmlrpc.py >+@@ -10,9 +10,16 @@ >+ """ >+ >+ from flask import request, current_app >+-from SimpleXMLRPCServer import SimpleXMLRPCDispatcher as Dispatcher >+ import sys >+-import xmlrpclib >++ >++if sys.version_info[0] == 2: >++ from SimpleXMLRPCServer import SimpleXMLRPCDispatcher as Dispatcher >++ import xmlrpclib >++ string_types = basestring >++else: >++ from xmlrpc.server import SimpleXMLRPCDispatcher as Dispatcher >++ import xmlrpc.client as xmlrpclib >++ string_types = str >+ >+ Fault = xmlrpclib.Fault >+ >+@@ -97,7 +104,7 @@ >+ If not given, the function's :obj:`__name__` attribute >+ will be used. >+ """ >+- if isinstance(function, basestring): >++ if isinstance(function, string_types): >+ return lambda fn: self.register_function(fn, function) >+ return Dispatcher.register_function(self, function, name) >+ >+@@ -198,7 +205,7 @@ >+ If not given, the function's :obj:`__name__` attribute >+ will be used. >+ """ >+- if isinstance(function, basestring): >++ if isinstance(function, string_types): >+ return lambda fn: self.register_function(fn, function) >+ if name is None: >+ name = function.__name__ >+@@ -249,7 +256,8 @@ >+ """ >+ try: >+ return xmlrpclib.loads(response)[0][0] >+- except Fault, fault: >++ except Fault: >++ _, fault = sys.exec_info()[:2] >+ return fault > >Property changes on: net/py-flask-xml-rpc/files/patch-flaskext_xmlrpc.py >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: net/py-flask-xml-rpc/files/patch-tests_test-xmlrpc.py >=================================================================== >--- net/py-flask-xml-rpc/files/patch-tests_test-xmlrpc.py (nonexistent) >+++ net/py-flask-xml-rpc/files/patch-tests_test-xmlrpc.py (working copy) >@@ -0,0 +1,45 @@ >+Obtained-From: https://bitbucket.org/leafstorm/flask-xml-rpc/pull-requests/2/added-python3-support-alongside-python2/commits >+ >+# HG changeset patch >+# User Maxime "Pepe_" Buquet <pep+code@bouah.net> >+# Date 1425540278 -32400 >+# Node ID 9da0e2bcfe5e32a1db95b639f41f67d3e1a43b80 >+# Parent 06a6c81e3a98ecb647e729e239f5de11814901d3 >+Added Python3 support alongside Python2 >+ >+--- tests/test-xmlrpc.py.orig 2015-03-05 00:00:00 UTC >++++ tests/test-xmlrpc.py >+@@ -7,12 +7,19 @@ >+ :copyright: (c) 2010 by Matthew "LeafStorm" Frazier. >+ :license: MIT, see LICENSE for more details. >+ """ >+-import xmlrpclib >+ from flask import Flask >+ from flaskext.xmlrpc import (XMLRPCHandler, XMLRPCNamespace, Fault, >+ dump_method_call, load_method_response, >+ test_xmlrpc_call, XMLRPCTester) >+ >++import sys >++PY2 = sys.version_info[0] == 2 >++ >++if PY2: >++ import xmlrpclib >++else: >++ import xmlrpc.client as xmlrpclib >++ >+ >+ def hello(name='world'): >+ if not name: >+@@ -39,7 +46,11 @@ >+ handler = XMLRPCHandler('api') >+ app = Flask(__name__) >+ handler.connect(app, '/api') >+- assert app.view_functions[handler.endpoint_name].im_self is handler >++ if PY2: >++ app_handler = app.view_functions[handler.endpoint_name].im_self >++ else: >++ app_handler = app.view_functions[handler.endpoint_name].__self__ >++ assert app_handler is handler >+ >+ def test_register(self): >+ handler = XMLRPCHandler('api') > >Property changes on: net/py-flask-xml-rpc/files/patch-tests_test-xmlrpc.py >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: net/py-flask-xml-rpc/pkg-descr >=================================================================== >--- net/py-flask-xml-rpc/pkg-descr (nonexistent) >+++ net/py-flask-xml-rpc/pkg-descr (working copy) >@@ -0,0 +1,6 @@ >+Flask-XML-RPC is an extension for Flask that makes it easy to create APIs >+based on the XML-RPC standard. It features easy registration of methods >+and namespacing, connects seamlessly to your Flask app, and includes >+plenty of testing helpers. >+ >+WWW: https://bitbucket.org/leafstorm/flask-xml-rpc/ > >Property changes on: net/py-flask-xml-rpc/pkg-descr >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 211435
:
173098
|
180117