Skip to content

Commit

Permalink
Remove dependency on cherrypy (now uses the reference WSGI server in …
Browse files Browse the repository at this point in the history
…Python 2.5 so that version is the lowest usable distrubution now).
  • Loading branch information
Jamie Kirkpatrick committed Apr 24, 2009
1 parent fc2abe4 commit 16ada4c
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 155 deletions.
7 changes: 3 additions & 4 deletions examples/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from soaplib.serializers.binary import Attachment
from soaplib.util import get_callback_info

from wsgiref.simple_server import make_server
from threading import Thread
from tempfile import mkstemp
import time
Expand Down Expand Up @@ -36,7 +37,5 @@ def woke_up(self,message):
pass

if __name__=='__main__':
try:from cherrypy.wsgiserver import CherryPyWSGIServer
except:from cherrypy._cpwsgiserver import CherryPyWSGIServer
server = CherryPyWSGIServer(('localhost',7789),SleepingService())
server.start()
server = make_server('localhost', 7789, SleepingService())
server.serve_forever()
7 changes: 3 additions & 4 deletions examples/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from soaplib.serializers.primitive import String, Integer, Array
from soaplib.serializers.binary import Attachment

from wsgiref.simple_server import make_server
from tempfile import mkstemp
import os

Expand Down Expand Up @@ -46,7 +47,5 @@ def make_client():
return client

if __name__=='__main__':
try:from cherrypy.wsgiserver import CherryPyWSGIServer
except:from cherrypy._cpwsgiserver import CherryPyWSGIServer
server = CherryPyWSGIServer(('localhost',7889),DocumentArchiver())
server.start()
server = make_server('localhost', 7889, DocumentArchiver())
server.serve_forever()
8 changes: 4 additions & 4 deletions examples/classserializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from soaplib.serializers.primitive import String, Integer, Array
from soaplib.serializers.clazz import ClassSerializer

from wsgiref.simple_server import make_server

'''
This example shows how to define and use complex structures
in soaplib. This example uses an extremely simple in-memory
Expand Down Expand Up @@ -59,7 +61,5 @@ def list_users(self):
return [v for k,v in user_database.items()]

if __name__=='__main__':
try:from cherrypy.wsgiserver import CherryPyWSGIServer
except:from cherrypy._cpwsgiserver import CherryPyWSGIServer
server = CherryPyWSGIServer(('localhost',7789),UserManager())
server.start()
server = make_server('localhost', 7789, UserManager())
server.serve_forever()
8 changes: 4 additions & 4 deletions examples/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from soaplib.service import soapmethod
from soaplib.serializers.primitive import String, Integer, Array

from wsgiref.simple_server import make_server

'''
This is a simple HelloWorld example to show the basics of writing
a webservice using soaplib, starting a server, and creating a service
Expand Down Expand Up @@ -30,7 +32,5 @@ def make_client():
return client

if __name__=='__main__':
try:from cherrypy.wsgiserver import CherryPyWSGIServer
except:from cherrypy._cpwsgiserver import CherryPyWSGIServer
server = CherryPyWSGIServer(('localhost',7889),HelloWorldService())
server.start()
server = make_server('localhost', 7889, HelloWorldService())
server.serve_forever()
9 changes: 4 additions & 5 deletions examples/helloworld_attach.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from soaplib.serializers.primitive import String, Integer, Array
from soaplib.serializers.binary import Attachment

from wsgiref.simple_server import make_server

class HelloWorldService(SimpleWSGISoapApp):

@soapmethod(Attachment,Integer,_returns=Array(String), _mtom=True)
Expand All @@ -15,8 +17,5 @@ def say_hello(self,name,times):
return results

if __name__=='__main__':
try:from cherrypy.wsgiserver import CherryPyWSGIServer
except:from cherrypy._cpwsgiserver import CherryPyWSGIServer
# this example uses CherryPy2.2, use cherrypy.wsgiserver.CherryPyWSGIServer for CherryPy 3.0
server = CherryPyWSGIServer(('localhost',7789),HelloWorldService())
server.start()
server = make_server('localhost', 7789, HelloWorldService())
server.serve_forever()
10 changes: 5 additions & 5 deletions examples/hooks.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from soaplib.wsgi_soap import SimpleWSGISoapApp
from soaplib.service import soapmethod
from soaplib.serializers.primitive import String, Integer, Array

from soaplib.wsgi_soap import request

from time import time
from wsgiref.simple_server import make_server


'''
This example is an enhanced version of the HelloWorld example that
Expand Down Expand Up @@ -62,7 +64,5 @@ def make_client():
return client

if __name__=='__main__':
try:from cherrypy.wsgiserver import CherryPyWSGIServer
except:from cherrypy._cpwsgiserver import CherryPyWSGIServer
server = CherryPyWSGIServer(('localhost',7889),HelloWorldService())
server.start()
server = make_server('localhost', 7889, HelloWorldService())
server.serve_forever()
8 changes: 4 additions & 4 deletions examples/override.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from soaplib.service import soapmethod
from soaplib.serializers.primitive import String, Integer, Array

from wsgiref.simple_server import make_server

'''
This example shows how to override the variable names for fun and profit.
This is very useful for situations that require the use of variable names
Expand All @@ -18,7 +20,5 @@ def sendEmail(self,_to,_from,message):
return 'sent!'

if __name__=='__main__':
try:from cherrypy.wsgiserver import CherryPyWSGIServer
except:from cherrypy._cpwsgiserver import CherryPyWSGIServer
server = CherryPyWSGIServer(('localhost',7989),EmailManager())
server.start()
server = make_server('localhost', 7989,EmailManager())
server.serve_forever()
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env python

from setuptools import setup, find_packages
import sys

if sys.hexversion < 0x2050000
raise RuntimeError("Python 2.5 or higher required)


VERSION = '0.7.2'
Expand Down Expand Up @@ -34,7 +38,7 @@
license='LGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
zip_safe=False,
install_requires=['pytz', 'cherrypy', 'lxml'],
install_requires=['pytz', 'lxml'],
test_suite='tests.test_suite',
entry_points="""
""",
Expand Down
Loading

0 comments on commit 16ada4c

Please sign in to comment.