From: <bov...@us...> - 2007-11-01 20:33:35
|
Revision: 1423 http://pywebsvcs.svn.sourceforge.net/pywebsvcs/?rev=1423&view=rev Author: boverhof Date: 2007-11-01 13:33:33 -0700 (Thu, 01 Nov 2007) Log Message: ----------- M RELEASE M setup.py M setup.cfg M doc/Makefile M ZSI/twisted/wsgi.py M ZSI/twisted/reverse.py M ZSI/twisted/__init__.py M ZSI/twisted/WSresource.py M ZSI/twisted/interfaces.py M CHANGES M MANIFEST.in --- release stuff, moving around for WSGI stuff Modified Paths: -------------- trunk/zsi/CHANGES trunk/zsi/MANIFEST.in trunk/zsi/RELEASE trunk/zsi/ZSI/twisted/WSresource.py trunk/zsi/ZSI/twisted/__init__.py trunk/zsi/ZSI/twisted/interfaces.py trunk/zsi/ZSI/twisted/reverse.py trunk/zsi/ZSI/twisted/wsgi.py trunk/zsi/doc/Makefile trunk/zsi/setup.cfg trunk/zsi/setup.py Modified: trunk/zsi/CHANGES =================================================================== --- trunk/zsi/CHANGES 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/CHANGES 2007-11-01 20:33:33 UTC (rev 1423) @@ -6,8 +6,9 @@ - Record facets (restrictions) in XMLSchema.py <vc...@da...> - Remove Send()'s kwargs out of _args list <ef...@bo...> -Change for 2.1.0 released xxx: +Change for 2.1.0_a1 released 31-Oct-2007: - No PyXML Dependency, use minidom by default (much faster) + - samples/WSGI, server and client examples using python wsgi and twisted.web2.wsgi Change for 2.0.0 released xxx: - no more wsdl2dispatch, wsdl2py does it all Modified: trunk/zsi/MANIFEST.in =================================================================== --- trunk/zsi/MANIFEST.in 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/MANIFEST.in 2007-11-01 20:33:33 UTC (rev 1423) @@ -1,7 +1,12 @@ include CHANGES recursive-include ZSI *.py recursive-include scripts * -recursive-include doc * -recursive-include samples * +recursive-include samples WSGI recursive-include test *.py README -recursive-include interop *.py README *.wsdl + +recursive-exclude doc *.tex +recursive-exclude samples poly.py +global-exclude *.pyc +exclude RELEASE newver.py MANIFEST.in +prune samples/Echo +prune interop Modified: trunk/zsi/RELEASE =================================================================== --- trunk/zsi/RELEASE 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/RELEASE 2007-11-01 20:33:33 UTC (rev 1423) @@ -127,7 +127,7 @@ symlink to the .../Doc/tools/mkhowto script in that. If not, then you only need to check out the Doc/ tree:: - svn co http://svn.python.org/projects/python/trunk/Doc python-Do + svn co http://svn.python.org/projects/python/tags/r25/Doc python-Doc The symlink can then be made to .../someplace/tools/mkhowto. Modified: trunk/zsi/ZSI/twisted/WSresource.py =================================================================== --- trunk/zsi/ZSI/twisted/WSresource.py 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/ZSI/twisted/WSresource.py 2007-11-01 20:33:33 UTC (rev 1423) @@ -25,9 +25,44 @@ from ZSI.ServiceContainer import WSActionException from interfaces import CheckInputArgs, HandlerChainInterface, CallbackChainInterface,\ - DataHandler, DefaultHandlerChain + DataHandler +class LoggingHandlerChain: + + @CheckInputArgs(CallbackChainInterface, HandlerChainInterface) + def __init__(self, cb, *handlers): + self.handlercb = cb + self.handlers = handlers + self.debug = len(log.theLogPublisher.observers) > 0 + + def processRequest(self, arg, **kw): + debug = self.debug + if debug: log.msg('--->PROCESS REQUEST: %s' %arg, debug=1) + + for h in self.handlers: + if debug: log.msg('\t%s handler: %s' %(arg, h), debug=1) + arg = h.processRequest(arg, **kw) + + return self.handlercb.processRequest(arg, **kw) + + def processResponse(self, arg, **kw): + debug = self.debug + if debug: log.msg('===>PROCESS RESPONSE: %s' %str(arg), debug=1) + + if arg is None: + return + + for h in self.handlers: + if debug: log.msg('\t%s handler: %s' %(arg, h), debug=1) + arg = h.processResponse(arg, **kw) + + s = str(arg) + if debug: log.msg(s, debug=1) + + return s + + # # Stability: Unstable # @@ -211,7 +246,7 @@ class DefaultHandlerChainFactory: - protocol = DefaultHandlerChain + protocol = LoggingHandlerChain @classmethod def newInstance(cls): @@ -287,3 +322,39 @@ + + +class DefaultHandlerChain: + + @CheckInputArgs(CallbackChainInterface, HandlerChainInterface) + def __init__(self, cb, *handlers): + self.handlercb = cb + self.handlers = handlers + self.debug = len(log.theLogPublisher.observers) > 0 + + def processRequest(self, arg, **kw): + debug = self.debug + if debug: log.msg('--->PROCESS REQUEST: %s' %arg, debug=1) + + for h in self.handlers: + if debug: log.msg('\t%s handler: %s' %(arg, h), debug=1) + arg = h.processRequest(arg, **kw) + + return self.handlercb.processRequest(arg, **kw) + + def processResponse(self, arg, **kw): + debug = self.debug + if debug: log.msg('===>PROCESS RESPONSE: %s' %str(arg), debug=1) + + if arg is None: + return + + for h in self.handlers: + if debug: log.msg('\t%s handler: %s' %(arg, h), debug=1) + arg = h.processResponse(arg, **kw) + + s = str(arg) + if debug: log.msg(s, debug=1) + + return s + Modified: trunk/zsi/ZSI/twisted/__init__.py =================================================================== --- trunk/zsi/ZSI/twisted/__init__.py 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/ZSI/twisted/__init__.py 2007-11-01 20:33:33 UTC (rev 1423) @@ -5,4 +5,4 @@ ########################################################################### __all__=['interfaces', 'client', 'WSresource', 'WSsecurity'] -import interfaces \ No newline at end of file +import interfaces Modified: trunk/zsi/ZSI/twisted/interfaces.py =================================================================== --- trunk/zsi/ZSI/twisted/interfaces.py 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/ZSI/twisted/interfaces.py 2007-11-01 20:33:33 UTC (rev 1423) @@ -1,14 +1,13 @@ ########################################################################### # Joshua R. Boverhof, LBNL # See Copyright for copyright notice! -# $Id: WSresource.py 1287 2006-10-30 23:04:17Z feanor420 $ +# $Id: $ ########################################################################### import sys, warnings # twisted & related imports from zope.interface import classProvides, implements, Interface -from twisted.python import log # ZSI imports from ZSI import EvaluateException, ParseException, ParsedSoap, SoapWriter @@ -94,31 +93,23 @@ def __init__(self, cb, *handlers): self.handlercb = cb self.handlers = handlers - self.debug = len(log.theLogPublisher.observers) > 0 def processRequest(self, arg, **kw): - debug = self.debug - if debug: log.msg('--->PROCESS REQUEST: %s' %arg, debug=1) for h in self.handlers: - if debug: log.msg('\t%s handler: %s' %(arg, h), debug=1) arg = h.processRequest(arg, **kw) return self.handlercb.processRequest(arg, **kw) def processResponse(self, arg, **kw): - debug = self.debug - if debug: log.msg('===>PROCESS RESPONSE: %s' %str(arg), debug=1) if arg is None: return for h in self.handlers: - if debug: log.msg('\t%s handler: %s' %(arg, h), debug=1) arg = h.processResponse(arg, **kw) s = str(arg) - if debug: log.msg(s, debug=1) return s Modified: trunk/zsi/ZSI/twisted/reverse.py =================================================================== --- trunk/zsi/ZSI/twisted/reverse.py 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/ZSI/twisted/reverse.py 2007-11-01 20:33:33 UTC (rev 1423) @@ -1,5 +1,10 @@ +########################################################################### +# Joshua R. Boverhof, LBNL +# See Copyright for copyright notice! +# $Id: $ +########################################################################### from ZSI import _get_element_nsuri_name, SoapWriter, ParsedSoap -from ZSI.twisted.interfaces import HandlerChainInterface +from interfaces import HandlerChainInterface from zope.interface import classProvides, implements, Interface Modified: trunk/zsi/ZSI/twisted/wsgi.py =================================================================== --- trunk/zsi/ZSI/twisted/wsgi.py 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/ZSI/twisted/wsgi.py 2007-11-01 20:33:33 UTC (rev 1423) @@ -1,7 +1,7 @@ ############################################################################ # Joshua R. Boverhof, LBNL # See Copyright for copyright notice! -# $Id: __init__.py 1132 2006-02-17 01:55:41Z boverhof $ +# $Id: $ ########################################################################### import os, sys, types, inspect from StringIO import StringIO @@ -16,46 +16,13 @@ HandlerChainInterface """ -WSGI Module -unstable +EXAMPLES: + See zsi/samples/WSGI -EXAMPLE APPLICATION: -# -from EchoServer_client import * -from ZSI.twisted.wsgi import SOAPApplication, soapmethod, SOAPHandlerChainFactory -class EchoService(SOAPApplication): - factory = SOAPHandlerChainFactory - wsdl_content = dict(name='', targetNamespace='', imports=(), portType='') - - @soapmethod(EchoRequest.typecode, EchoResponse.typecode, operation='Echo', soapaction='Echo') - def soap_Echo(self, request, response, **kw): - response.EchoResult = request.EchoIn - return request,response - - -def main(): - from wsgiref.simple_server import make_server, demo_app - from ZSI.twisted.wsgi import WSGIApplication - application = WSGIApplication() - httpd = make_server('', 8000, application) - application['echo'] = EchoService() - httpd.serve_forever() - -def main_twisted(): - from ZSI.twisted.wsgi import test, WSGIApplication - app = WSGIApplication() - app['echo'] = EchoService() - test(app) - -if __name__ == '__main__': - main_twisted() - """ - - def soapmethod(requesttypecode, responsetypecode, soapaction='', operation=None, **kw): """@soapmethod Modified: trunk/zsi/doc/Makefile =================================================================== --- trunk/zsi/doc/Makefile 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/doc/Makefile 2007-11-01 20:33:33 UTC (rev 1423) @@ -3,7 +3,7 @@ # put the path to where the Python source was untar'd here (not where it # is installed) PYSRCDIR= /Library/Frameworks/Python.framework/Versions/2.4 -MKHOWTO= PATH=$$PATH:$(HOME)/Desktop/Python/PythonDocTools/tools/ mkhowto +MKHOWTO= PATH=$$PATH mkhowto #PAPER= a4 PAPER= letter Modified: trunk/zsi/setup.cfg =================================================================== --- trunk/zsi/setup.cfg 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/setup.cfg 2007-11-01 20:33:33 UTC (rev 1423) @@ -7,9 +7,10 @@ major = 2 minor = 1 patchlevel = 0 -#candidate = 3 candidate = 0 +alpha = 1 +beta = 0 [egg_info] -tag_build = .dev -tag_svn_revision = 1 +tag_build = +tag_svn_revision = 0 Modified: trunk/zsi/setup.py =================================================================== --- trunk/zsi/setup.py 2007-10-31 23:09:04 UTC (rev 1422) +++ trunk/zsi/setup.py 2007-11-01 20:33:33 UTC (rev 1423) @@ -17,12 +17,18 @@ minor = cf.getint('version', 'minor') patchlevel = cf.getint('version', 'patchlevel') candidate = cf.getint('version', 'candidate') +alpha = cf.getint('version', 'alpha') +beta = cf.getint('version', 'beta') _version = "%d.%d" % ( major, minor ) if patchlevel: _version += '.%d' % patchlevel if candidate: _version += '_rc%d' % candidate +elif alpha: + _version += '_a%d' % alpha +elif beta: + _version += '_b%d' % beta try: open('ZSI/version.py', 'r').close() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |