From f942943b7312ca98f7e874982f00f497de0a83d5 Mon Sep 17 00:00:00 2001
From: Martijn Vermaat <martijn@vermaat.name>
Date: Mon, 16 Jul 2012 12:30:38 +0000
Subject: [PATCH] Move from rpclib to spyne

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/branches/spyne@576 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
---
 bin/mutalyzer-json-service.wsgi |  2 +-
 mutalyzer/models.py             | 20 ++++++++++----------
 mutalyzer/services/json.py      |  6 +++---
 mutalyzer/services/rpc.py       | 12 ++++++------
 mutalyzer/services/soap.py      |  8 ++++----
 mutalyzer/website.py            |  2 +-
 6 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/bin/mutalyzer-json-service.wsgi b/bin/mutalyzer-json-service.wsgi
index 052dbbb3..4e2f9802 100755
--- a/bin/mutalyzer-json-service.wsgi
+++ b/bin/mutalyzer-json-service.wsgi
@@ -23,7 +23,7 @@ To start the built-in HTTP server on port 8082:
 
 import sys
 from wsgiref.simple_server import make_server
-from rpclib.server.wsgi import WsgiApplication
+from spyne.server.wsgi import WsgiApplication
 from mutalyzer.services import json
 
 
diff --git a/mutalyzer/models.py b/mutalyzer/models.py
index 0dcc07ec..5f2c3422 100644
--- a/mutalyzer/models.py
+++ b/mutalyzer/models.py
@@ -1,13 +1,13 @@
 """
 Collection of serilizable objects used by the SOAP webservice. They extend
-from the rpclib ClassModel.
+from the spyne ClassModel.
 
-Default attributes for the rpclib ClassModel:
+Default attributes for the spyne ClassModel:
 - nillable = True
 - min_occurs = 0
 - max_occurs = 1
 
-Additional attributes values for the rpclib String model:
+Additional attributes values for the spyne String model:
 - min_len = 0
 - max_len = 'unbounded'
 - pattern = None
@@ -17,21 +17,21 @@ Additional attributes values for the rpclib String model:
 """
 
 
-from rpclib.model.primitive import String, Integer, Boolean, DateTime
-from rpclib.model.complex import ComplexModel, Array
+from spyne.model.primitive import String, Integer, Boolean, DateTime
+from spyne.model.complex import ComplexModel, Array
 
 from mutalyzer import SOAP_NAMESPACE
 
 
 class Mandatory(object):
     """
-    This is rpclib.model.primitive.Mandatory, but without min_length=1 for
+    This is spyne.model.primitive.Mandatory, but without min_length=1 for
     the String model.
     """
-    String = String(min_occurs=1, nillable=False)
-    Integer = Integer(min_occurs=1, nillable=False)
-    Boolean = Boolean(min_occurs=1, nillable=False)
-    DateTime = DateTime(min_occurs=1, nillable=False)
+    String = String(type_name='mandatory_string', min_occurs=1, nillable=False)
+    Integer = Integer(type_name='mandatory_integer', min_occurs=1, nillable=False)
+    Boolean = Boolean(type_name='mandatory_boolean', min_occurs=1, nillable=False)
+    DateTime = DateTime(type_name='mandatory_date_time', min_occurs=1, nillable=False)
 #Mandatory
 
 
diff --git a/mutalyzer/services/json.py b/mutalyzer/services/json.py
index b1f46c31..b4c95485 100644
--- a/mutalyzer/services/json.py
+++ b/mutalyzer/services/json.py
@@ -3,9 +3,9 @@ Mutalyzer webservice HTTP/RPC with JSON response payloads.
 """
 
 
-from rpclib.application import Application
-from rpclib.protocol.http import HttpRpc
-from rpclib.protocol.json import JsonObject
+from spyne.application import Application
+from spyne.protocol.http import HttpRpc
+from spyne.protocol.json import JsonObject
 
 import mutalyzer
 from mutalyzer.services import rpc
diff --git a/mutalyzer/services/rpc.py b/mutalyzer/services/rpc.py
index 4e4f8776..e8e05596 100644
--- a/mutalyzer/services/rpc.py
+++ b/mutalyzer/services/rpc.py
@@ -8,11 +8,11 @@ Mutalyzer RPC services.
 """
 
 
-from rpclib.decorator import srpc
-from rpclib.service import ServiceBase
-from rpclib.model.primitive import String, Integer, Boolean, DateTime
-from rpclib.model.complex import Array
-from rpclib.model.fault import Fault
+from spyne.decorator import srpc
+from spyne.service import ServiceBase
+from spyne.model.primitive import String, Integer, Boolean, DateTime
+from spyne.model.complex import Array
+from spyne.model.fault import Fault
 import os
 import socket
 from operator import itemgetter, attrgetter
@@ -677,7 +677,7 @@ class MutalyzerService(ServiceBase):
         result.molecule = O.getIndexedOutput('molecule', 0)
 
         # We force the results to strings here, because some results
-        # may be of type Bio.Seq.Seq which rpclib doesn't like.
+        # may be of type Bio.Seq.Seq which spyne doesn't like.
         #
         # todo: We might have to also do this elsewhere.
 
diff --git a/mutalyzer/services/soap.py b/mutalyzer/services/soap.py
index 31bb4e67..e442b9d0 100644
--- a/mutalyzer/services/soap.py
+++ b/mutalyzer/services/soap.py
@@ -3,9 +3,9 @@ Mutalyzer SOAP/1.1 webservice.
 """
 
 
-from rpclib.application import Application
-from rpclib.protocol.soap import Soap11
-from rpclib.server.wsgi import WsgiApplication
+from spyne.application import Application
+from spyne.protocol.soap import Soap11
+from spyne.server.wsgi import WsgiApplication
 
 import mutalyzer
 from mutalyzer.services import rpc
@@ -20,6 +20,6 @@ application = Application([rpc.MutalyzerService], tns=mutalyzer.SOAP_NAMESPACE,
 # Below we define WSGI applications for use with e.g. Apache/mod_wsgi.
 # Note: We would like to create the wsgi.Application instance only in the
 #     bin/mutalyzer-webservice.wsgi script, but unfortunately this breaks the
-#     get_interface_document method of rpclib which we use to generate API
+#     get_interface_document method of spyne which we use to generate API
 #     documentation in website.py.
 wsgi_application = WsgiApplication(application)
diff --git a/mutalyzer/website.py b/mutalyzer/website.py
index c738a673..4dc46040 100644
--- a/mutalyzer/website.py
+++ b/mutalyzer/website.py
@@ -29,7 +29,7 @@ from lxml import etree
 from cStringIO import StringIO
 from simpletal import simpleTALES
 from simpletal import simpleTAL
-from rpclib.interface.wsdl import Wsdl11
+from spyne.interface.wsdl import Wsdl11
 
 import mutalyzer
 from mutalyzer import util
-- 
GitLab