PK€¨58Ô›A°..ZSI/address.pyc;ò Z@Ec@s°dkZdkZdkZdklZlZlZdklZl Z l Z dk l Z l Z lZdklZdklZdefd„ƒYZedjo eGHndS( N(s _seqtypessEvaluateExceptionsWSActionException(s AnyElementsAnyTypesTypeCode(sGEDsGTDs_has_type_definition(s ComplexType(sWSA_LISTsAddresscBs§tZdZeeed„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zd„ZRS(sÎWS-Address Implemented is dependent on the default "wsdl2py" convention of generating aname, so the attributes representing element declaration names should be prefixed with an underscore. cCsV||_t|_||_t|_||_t|_ t|_ t|_ |i ƒdS(N( s wsAddressURIsselfsNones anonymousURIs addressTos _addressTos _messageIDsactions_actions_endPointReferences_replyTos _relatesTossetUp(sselfs addressTos wsAddressURIsaction((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys__init__s        cs¢t‡d†tƒ}d}x\|tD]G}ˆitj oˆi|ijpt |i|ƒt joPq&q&Wt d‚|iˆ_|i ˆ_ |i ˆ_dS(sLook for WS-Address cs|iˆijS(N(swsasADDRESSsselfs wsAddressURI(swsa(sself(s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys#ssEndpointReferenceTypes>enabling wsAddressing requires the inclusion of that namespaceN(sfiltersWSA_LISTstoplistseprsWSAsselfs wsAddressURIsNonesADDRESSs_has_type_definitionsTruesEvaluateExceptions ANONYMOUSs anonymousURIs_replyTo(sselfsWSAseprstoplist((sselfs/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pyssetUp s <    cCs[|tjo td‚n| otd|‚n||jotd||f‚ndS(stWS-Address Action action -- Action value expecting. value -- Action value server returned. s5User did not specify WSAddress Action value to expects&missing WSAddress Action, expecting %ss(wrong WSAddress Action(%s), expecting %sN(sactionsNonesWSActionExceptionsvalue(sselfsactionsvalue((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys _checkAction1s   cCsB|tjodSn|i}||ijoti|ƒ\} }} } }|i dƒ}ti|iƒ\} }} }}| | jo$| | jo| |jo ||jot|i dƒdg}|i dƒdg}|d|djo$ti|dƒti|dƒjodSq$ntd||if‚ndS(sŒWS-Address From, XXX currently not checking the hostname, not forwarding messages. pyobj -- From server returned. Ns:s80iis'wrong WS-Address From(%s), expecting %s(spyobjsNones_Addresssvaluesselfs _addressTosurlparsesurlsplitsschemesnetlocspathsquerysfragmentssplitshostportsschemeFsnetlocFspathFsqueryFs fragmentFssockets gethostbynamesWSActionException(sselfspyobjsqueryFsnetlocFshostportsfragmentsnetlocsvalues fragmentFspathFsschemeFsqueryspathsscheme((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys _checkFrom=s  !4< cCs.||ijotd||if‚ndS(s@WS-Address From value -- From server returned. s,wrong WS-Address RelatesTo(%s), expecting %sN(svaluesselfs _messageIDsWSActionException(sselfsvalue((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys_checkRelatesToQscCs.||ijotd||if‚ndS(sIWS-Address From value -- From server returned in wsa:To s*wrong WS-Address ReplyTo(%s), expecting %sN(svaluesselfs_replyTosWSActionException(sselfsvalue((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys _checkReplyToXscCs ||_dS(N(sactionsselfs_action(sselfsaction((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys setAction_scCs |iSdS(N(sselfs_action(sself((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys getActionbscCs |iSdS(N(sselfs _relatesTo(sself((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys getRelatesToescCs |iSdS(N(sselfs _messageID(sself((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys getMessageIDhscKs¢g}ylxe|iƒD]W\}}xH|D]@}t||ƒ}|tjot d|‚n|i |ƒq)WqWWn%t j o}t d|i‚nX|SdS(s@kw -- namespaceURI keys with sequence of element names. sMissing namespace, import "%s"s9To use ws-addressing register typecodes for namespace(%s)N(s typecodesskwsitemssnsuriselementsselsGEDstypecodesNonesWSActionExceptionsappendsEvaluateExceptionsexsselfs wsAddressURI(sselfskwselselementsstypecodesnsurisexs typecodes((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys_getWSAddressTypeCodesks  c Csß|i}h|dddddf<}|i|} |i| ƒ} | i |dfƒ}|i ||ƒ| i |dfƒ}|i|ƒ| i |dfƒ}|i|ƒ| i |dfƒ}|o|i|ƒndS(sL ps -- ParsedSoap action -- ws-action for response s MessageIDsActionsTosFroms RelatesToN(sselfs wsAddressURIs namespaceURIsds_getWSAddressTypeCodess typecodesspssParseHeaderElementsspyobjssgets got_actions _checkActionsactionsFroms _checkFroms RelatesTos_checkRelatesTosTos _checkReplyTo( sselfspssactionsTosFromsds got_actions RelatesTos namespaceURIs typecodesspyobjs((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys checkResponse~s   c Cs¶||_t|_g}|i} |i} dt i ƒ} |_ t | dƒ}|i|i| ƒƒt | dƒ}|i|i|ƒƒt | dƒ}|i|i| ƒƒt | dƒ}|iƒ}|i|_|i|ƒ|o¸t|dƒtjo td‚nt|it| dƒƒtjotd t| dƒ‚n|i}|ipg}x=|D]1}t|dƒ o td ‚n|i|ƒqjWnt|ƒ|_d S( sCall For Request suuid:%ss MessageIDsActionsTosFromstypecodes0endPointReference must have a typecode attributesEndpointReferenceTypes$endPointReference must be of type %ss2 element, instance missing typecode attributeN( sactionsselfs_actionsNones header_pyobjsspyobjss wsAddressURIs namespaceURIs _addressTos addressTostimes messageIDs _messageIDsGEDstypecodesappendspyclasssmihFroms anonymousURIs_AddresssendPointReferenceshasattrsFalsesEvaluateExceptions isinstancesGTDs_ReferencePropertiessReferencePropertiess_anysanysvstuple( sselfsendPointReferencesactionsmihFromspyobjsstypecodesvsReferencePropertiessanys namespaceURIs messageIDs addressTo((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys setRequest”s>           c Csí||_t|_g}|i}x‚|d|if|ddt i ƒf|d|i ƒf|d|i ffD]4\}} }t|| ƒ}|i|i|ƒƒqnWt|dƒ}|iƒ}|i|_|i|ƒt|ƒ|_dS(sxServer-side has to set these fields in response. address -- Address instance, representing a WS-Address sActions MessageIDsuuid:%ss RelatesTosTosFromN(slocalURLsselfsFromsNones header_pyobjsspyobjss wsAddressURIs namespaceURIs_actionstimesaddresss getMessageIDs anonymousURIsnsurisnamesvaluesGEDstypecodesappendspyclassspyobjs_Addressstuple( sselfsaddressslocalURLspyobjsstypecodesvalues namespaceURIsnsurispyobjsname((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pyssetResponseFromWSAddressÉs   M   cKsKxD|iD]9}t|dƒtjo td‚n|i||q WdS(sC sw -- SoapWriter instance, add WS-Address header. stypecodes0all header pyobjs must have a typecode attributeN( sselfs header_pyobjsspyobjshasattrsFalses RuntimeErrorsswsserialize_headerskw(sselfsswskwspyobj((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys serializeâs   cKsÂ|i}dddddf}h||<}|i|}|i|ƒ}|||df|_ |||df|_ |||df|_ |||d f|_ |||d f|_d S( s+ ps -- ParsedSoap instance s MessageIDsActionsTosFroms RelatesToiiiiiN(sselfs wsAddressURIs namespaceURIselementssds_getWSAddressTypeCodess typecodesspssParseHeaderElementsspyobjss _messageIDs_actions _addressTos_froms _relatesTo(sselfspsskwselementssds namespaceURIs typecodesspyobjs((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pysparseís (s__name__s __module__s__doc__sNones__init__ssetUps _checkActions _checkFroms_checkRelatesTos _checkReplyTos setActions getActions getRelatesTos getMessageIDs_getWSAddressTypeCodess checkResponses setRequestssetResponseFromWSAddresss serializesparse(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pysAddresss"            5  s__main__(stimesurlparsessocketsZSIs _seqtypessEvaluateExceptionsWSActionExceptionsTCs AnyElementsAnyTypesTypeCodesschemasGEDsGTDs_has_type_definitionsZSI.TCcompounds ComplexTypesZSI.wstools.NamespacessWSA_LISTsobjectsAddresss__name__s _copyright(s ComplexTypesGTDsEvaluateExceptions _seqtypessTypeCodes_has_type_definitionsWSActionExceptionsGEDsurlparsesWSA_LISTstimesAddresssAnyTypes AnyElementssocket((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys?s  ÿ; PK‹¨58+ì[[ZSI/resolvers.pyo;ò Z@Ec@s¨dZdklZlZlZlZdkZdkZdkZdk l Z dk Z d„Zd„Zdfd„ƒYZdfd „ƒYZed jo eGHndS( sSOAP messaging parsing. (s _copyrights_child_elementssEvaluateExceptionsTCN(s decodestringcKsuti||}|iƒiƒ}|dddgjo|iƒSnt i ƒ}t i |||ƒ|i ƒSdS(s6Resolve a URI and return its content as a string. s7bits8bitsbinaryN(surllibsurlopensuriskeywordsssourcesinfos getencodingsencsreadsStringIOsdatas mimetoolssdecodesgetvalue(suristcspsskeywordssencssourcesdata((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysOpaque s cKs—ti||}|iƒiƒ}|dddgjo |}n-t i ƒ}t i |||ƒ|i dƒ|iƒi|ƒ}t|ƒdSdS(s8Resolve a URI and return its content as an XML DOM. s7bits8bitsbinaryiN(surllibsurlopensuriskeywordsssourcesinfos getencodingsencsdatasStringIOs mimetoolssdecodesseekspss readerclasss fromStreamsdoms_child_elements(suristcspsskeywordssencsdomssourcesdata((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysXMLs   sNetworkResolvercBs>tZdZed„Zd„Zd„Zd„Zd„ZRS(s,A resolver that support string and XML. cCs|pg|_dS(N(sprefixsselfsallowed(sselfsprefix((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys__init__+scCs<x)|iD]}|i|ƒodSq q Wtdƒ‚dS(NsDisallowed URI prefix(sselfsallowedsasuris startswithsEvaluateException(sselfsurisa((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys_check_allowed.s   cKs$|i|ƒt||||SdS(N(sselfs_check_allowedsurisOpaquestcspsskeywords(sselfsuristcspsskeywords((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysOpaque3s cKs$|i|ƒt||||SdS(N(sselfs_check_allowedsurisXMLstcspsskeywords(sselfsuristcspsskeywords((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysXML7s cKsAt|tiƒot||||Snt||||SdS(N(s isinstancestcsTCsXMLsurispsskeywordssOpaque(sselfsuristcspsskeywords((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysResolve;s( s__name__s __module__s__doc__sNones__init__s_check_allowedsOpaquesXMLsResolve(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysNetworkResolver's     s MIMEResolvercBsVtZdZeddd„Zd„Zd„Zd„Zd„Zd„Z d „Z RS( s?Multi-part MIME resolver -- SOAP With Attachments, mostly. s thismessage:/icKsÌxv|idƒD]Y} | iƒ}|idƒo7|dddgjo|dd!}n |d}PqqWtdƒ‚hhgf\|_ |_ |_ ||_ ||_ti||ƒ} | i|ƒxð| i ƒoâti| ƒ}tiƒ} ti| | |iƒƒ| id ƒ|| f} |i i| ƒ|id ƒ} | oD| d d jo| dd jo| d d!} n| |i | iscontent-location("sctssplitsparamsstripsas startswithsboundarys ValueErrorsselfsid_dictsloc_dictspartssnextsuribasesbases multifiles MultiFilesfsseekablesmfspushs mimetoolssMessagesheadsStringIOsbodysdecodes getencodingsseekspartsappendsgetskeyspop(sselfsctsfsnextsuribasesseekableskwsasheadsmfsbodysparamspartskeysboundary((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys__init__Es>    !       "cCs*|id\}}ti|iƒƒSdS(s Get the SOAP body part. iN(sselfspartssheadspartsStringIOsgetvalue(sselfspartshead((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys GetSOAPPartiscCsƒ|idƒo.|i|d\}}ti|iƒƒSn|ii |ƒo*|i|\}}ti|iƒƒSnt SdS(s@Get the content for the bodypart identified by the uri. scid:iN( suris startswithsselfsid_dictsheadspartsStringIOsgetvaluesloc_dictshas_keysNone(sselfsurisheadspart((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysgetoscKs`|i|ƒ}|o|iƒSn|i otd|ƒ‚n|ii||||SdS(NsUnresolvable URI ( sselfsgetsuriscontentsgetvaluesnextsEvaluateExceptionsOpaquestcspsskeywords(sselfsuristcspsskeywordsscontent((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysOpaque{s  cKsy|i|ƒ}|o'|iƒi|ƒ}t|ƒdSn|i ot d|ƒ‚n|i i ||||SdS(NisUnresolvable URI (sselfsgetsuriscontentspss readerclasss fromStreamsdoms_child_elementssnextsEvaluateExceptionsXMLstcskeywords(sselfsuristcspsskeywordssdomscontent((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysXMLs cKsGt|tiƒo|i||||Sn|i||||SdS(N( s isinstancestcsTCsXMLsselfsurispsskeywordssOpaque(sselfsuristcspsskeywords((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysResolve‰scCs0|i|\}}ti|iƒƒ}|SdS(N(sselfsid_dictscidsheadsbodysStringIOsgetvaluesnewio(sselfscidsbodysheadsnewio((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys __getitem__Žs( s__name__s __module__s__doc__sNones__init__s GetSOAPPartsgetsOpaquesXMLsResolves __getitem__(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys MIMEResolverAs $    s__main__(s__doc__sZSIs _copyrights_child_elementssEvaluateExceptionsTCs multifiles mimetoolssurllibsbase64s decodestrings b64decodes cStringIOsStringIOsOpaquesXMLsNetworkResolvers MIMEResolvers__name__( s mimetoolssXMLs MIMEResolversNetworkResolversEvaluateExceptionsStringIOs_child_elementssOpaquesurllibs multifiles _copyrights b64decodesTC((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys?s   R PK/¤Y5^¹&H³2³2ZSI/ServiceProxy.py# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. from ZSI.wstools.Utility import SplitQName from ZSI.wstools.Namespaces import WSDL from ZSI import * from ZSI.client import * from ZSI.TC import Any from ZSI.typeinterpreter import BaseTypeInterpreter import wstools from wstools.Utility import DOM from urlparse import urlparse import weakref class ServiceProxy: """A ServiceProxy provides a convenient way to call a remote web service that is described with WSDL. The proxy exposes methods that reflect the methods of the remote web service.""" def __init__(self, wsdl, service=None, port=None, tracefile=None, nsdict=None, transdict=None): """ Parameters: wsdl -- WSDLTools.WSDL instance or URL of WSDL. service -- service name or index port -- port name or index tracefile -- nsdict -- key prefix to namespace mappings for serialization in SOAP Envelope. transdict -- arguments to pass into HTTPConnection constructor. """ self._tracefile = tracefile self._nsdict = nsdict or {} self._transdict = transdict self._wsdl = wsdl if isinstance(wsdl, basestring) is True: self._wsdl = wstools.WSDLTools.WSDLReader().loadFromURL(wsdl) assert isinstance(self._wsdl, wstools.WSDLTools.WSDL), 'expecting a WSDL instance' self._service = self._wsdl.services[service or 0] self.__doc__ = self._service.documentation self._port = self._service.ports[port or 0] self._name = self._service.name self._methods = {} binding = self._port.getBinding() portType = binding.getPortType() for port in self._service.ports: for item in port.getPortType().operations: callinfo = wstools.WSDLTools.callInfoFromWSDL(port, item.name) method = MethodProxy(self, callinfo) setattr(self, item.name, method) self._methods.setdefault(item.name, []).append(method) def _call(self, name, *args, **kwargs): """Call the named remote web service method.""" if len(args) and len(kwargs): raise TypeError( 'Use positional or keyword argument only.' ) callinfo = getattr(self, name).callinfo # go through the list of defined methods, and look for the one with # the same number of arguments as what was passed. this is a weak # check that should probably be improved in the future to check the # types of the arguments to allow for polymorphism for method in self._methods[name]: if len(method.callinfo.inparams) == len(kwargs): callinfo = method.callinfo soapAction = callinfo.soapAction url = callinfo.location (protocol, host, uri, query, fragment, identifier) = urlparse(url) port = None if host.find(':') >= 0: host, port = host.split(':') if protocol == 'http': transport = httplib.HTTPConnection elif protocol == 'https': transport = httplib.HTTPSConnection else: raise RuntimeError, 'Unknown protocol %s' %protocol binding = Binding(host=host, tracefile=self._tracefile, transport=transport,transdict=self._transdict, port=port, url=url, nsdict=self._nsdict, soapaction=soapAction,) request, response = self._getTypeCodes(callinfo) if len(kwargs): args = kwargs if request is None: request = Any(oname=name) binding.Send(url=url, opname=None, obj=args, nsdict=self._nsdict, soapaction=soapAction, requesttypecode=request) return binding.Receive(replytype=response) def _getTypeCodes(self, callinfo): """Returns typecodes representing input and output messages, if request and/or response fails to be generated return None for either or both. callinfo -- WSDLTools.SOAPCallInfo instance describing an operation. """ prefix = None self._resetPrefixDict() if callinfo.use == 'encoded': prefix = self._getPrefix(callinfo.namespace) try: requestTC = self._getTypeCode(parameters=callinfo.getInParameters(), literal=(callinfo.use=='literal')) except EvaluateException, ex: print "DEBUG: Request Failed to generate --", ex requestTC = None self._resetPrefixDict() try: replyTC = self._getTypeCode(parameters=callinfo.getOutParameters(), literal=(callinfo.use=='literal')) except EvaluateException, ex: print "DEBUG: Response Failed to generate --", ex replyTC = None request = response = None if callinfo.style == 'rpc': if requestTC: request = TC.Struct(pyclass=None, ofwhat=requestTC, pname=callinfo.methodName) if replyTC: response = TC.Struct(pyclass=None, ofwhat=replyTC, pname='%sResponse' %callinfo.methodName) else: if requestTC: request = requestTC[0] if replyTC: response = replyTC[0] #THIS IS FOR RPC/ENCODED, DOC/ENCODED Wrapper if request and prefix and callinfo.use == 'encoded': request.oname = '%(prefix)s:%(name)s xmlns:%(prefix)s="%(namespaceURI)s"' \ %{'prefix':prefix, 'name':request.aname, 'namespaceURI':callinfo.namespace} return request, response def _getTypeCode(self, parameters, literal=False): """Returns typecodes representing a parameter set parameters -- list of WSDLTools.ParameterInfo instances representing the parts of a WSDL Message. """ ofwhat = [] for part in parameters: namespaceURI,localName = part.type if part.element_type: #global element element = self._wsdl.types[namespaceURI].elements[localName] tc = self._getElement(element, literal=literal, local=False, namespaceURI=namespaceURI) else: #local element name = part.name typeClass = self._getTypeClass(namespaceURI, localName) if not typeClass: tp = self._wsdl.types[namespaceURI].types[localName] tc = self._getType(tp, name, literal, local=True, namespaceURI=namespaceURI) else: tc = typeClass(name) ofwhat.append(tc) return ofwhat def _globalElement(self, typeCode, namespaceURI, literal): """namespaces typecodes representing global elements with literal encoding. typeCode -- typecode representing an element. namespaceURI -- namespace literal -- True/False """ if literal: typeCode.oname = '%(prefix)s:%(name)s xmlns:%(prefix)s="%(namespaceURI)s"' \ %{'prefix':self._getPrefix(namespaceURI), 'name':typeCode.oname, 'namespaceURI':namespaceURI} def _getPrefix(self, namespaceURI): """Retrieves a prefix/namespace mapping. namespaceURI -- namespace """ prefixDict = self._getPrefixDict() if prefixDict.has_key(namespaceURI): prefix = prefixDict[namespaceURI] else: prefix = 'ns1' while prefix in prefixDict.values(): prefix = 'ns%d' %int(prefix[-1]) + 1 prefixDict[namespaceURI] = prefix return prefix def _getPrefixDict(self): """Used to hide the actual prefix dictionary. """ if not hasattr(self, '_prefixDict'): self.__prefixDict = {} return self.__prefixDict def _resetPrefixDict(self): """Clears the prefix dictionary, this needs to be done before creating a new typecode for a message (ie. before, and after creating a new message typecode) """ self._getPrefixDict().clear() def _getElement(self, element, literal=False, local=False, namespaceURI=None): """Returns a typecode instance representing the passed in element. element -- XMLSchema.ElementDeclaration instance literal -- literal encoding? local -- is locally defined? namespaceURI -- namespace """ if not element.isElement(): raise TypeError, 'Expecting an ElementDeclaration' tc = None elementName = element.getAttribute('name') tp = element.getTypeDefinition('type') typeObj = None if not (tp or element.content): nsuriType,localName = element.getAttribute('type') typeClass = self._getTypeClass(nsuriType,localName) typeObj = typeClass(elementName) elif not tp: tp = element.content if not typeObj: typeObj = self._getType(tp, elementName, literal, local, namespaceURI) minOccurs = int(element.getAttribute('minOccurs')) typeObj.optional = not minOccurs typeObj.minOccurs = minOccurs maxOccurs = element.getAttribute('maxOccurs') typeObj.repeatable = (maxOccurs == 'unbounded') or (int(maxOccurs) > 1) return typeObj def _getType(self, tp, name, literal, local, namespaceURI): """Returns a typecode instance representing the passed in type and name. tp -- XMLSchema.TypeDefinition instance name -- element name literal -- literal encoding? local -- is locally defined? namespaceURI -- namespace """ ofwhat = [] if not (tp.isDefinition() and tp.isComplex()): raise EvaluateException, 'only supporting complexType definition' elif tp.content.isComplex(): if hasattr(tp.content, 'derivation') and tp.content.derivation.isRestriction(): derived = tp.content.derivation typeClass = self._getTypeClass(*derived.getAttribute('base')) if typeClass == TC.Array: attrs = derived.attr_content[0].attributes[WSDL.BASE] prefix, localName = SplitQName(attrs['arrayType']) nsuri = derived.attr_content[0].getXMLNS(prefix=prefix) localName = localName.split('[')[0] simpleTypeClass = self._getTypeClass(namespaceURI=nsuri, localName=localName) if simpleTypeClass: ofwhat = simpleTypeClass() else: tp = self._wsdl.types[nsuri].types[localName] ofwhat = self._getType(tp=tp, name=None, literal=literal, local=True, namespaceURI=nsuri) else: raise EvaluateException, 'only support soapenc:Array restrictions' return typeClass(atype=name, ofwhat=ofwhat, pname=name, childNames='item') else: raise EvaluateException, 'complexContent only supported for soapenc:Array derivations' elif tp.content.isModelGroup(): modelGroup = tp.content for item in modelGroup.content: ofwhat.append(self._getElement(item, literal=literal, local=True)) tc = TC.Struct(pyclass=None, ofwhat=ofwhat, pname=name) if not local: self._globalElement(tc, namespaceURI=namespaceURI, literal=literal) return tc raise EvaluateException, 'only supporting complexType w/ model group, or soapenc:Array restriction' def _getTypeClass(self, namespaceURI, localName): """Returns a typecode class representing the type we are looking for. localName -- name of the type we are looking for. namespaceURI -- defining XMLSchema targetNamespace. """ bti = BaseTypeInterpreter() simpleTypeClass = bti.get_typeclass(localName, namespaceURI) return simpleTypeClass class MethodProxy: """ """ def __init__(self, parent, callinfo): self.__name__ = callinfo.methodName self.__doc__ = callinfo.documentation self.callinfo = callinfo self.parent = weakref.ref(parent) def __call__(self, *args, **kwargs): return self.parent()._call(self.__name__, *args, **kwargs) PK‚¨58,U³O// ZSI/TC.pyc;ò Z@Ec@s8dZdklZlZlZlZlZlZlZl Z l Z l Z l Z l Z lZlZlZlZlZlZlZlZlZlZlZdklZlZdklZdklZdk l!Z"dk#Z#dk$Z$dk%Z%dk&Z&dk'l(Z)l*Z+dk,l-Z.l/Z0d k1l2Z3l4Z5d „Z6d „Z7d „Z8e9Z:d Z;dfd„ƒYZ<de<fd„ƒYZ=de<fd„ƒYZ>de=fd„ƒYZ?de?fd„ƒYZ@de?fd„ƒYZAde?fd„ƒYZBde?fd„ƒYZCde?fd„ƒYZDd e?fd!„ƒYZEd"e?fd#„ƒYZFd$e?fd%„ƒYZGgZHd&e=fd'„ƒYZId(„ZJhZKy$eLd)ƒeKd)fd;„ƒYZUd<e>fd=„ƒYZVd>d?„ZWd@kXTd@kYTdAkZl[Z[l\Z\l]Z]d@k^Td@k_Te[e\e]f\Z`ZaZbdB„ZcedeceedC„efƒƒƒZgehdDjo eGHndS(EsGeneral typecodes. (s _copyrights _childrens_child_elementss _floattypess _stringtypess _seqtypess _find_attrs _find_attrNSs_find_attrNodeNSs_find_arraytypes_find_default_namespaces _find_hrefs_find_encstyles_resolve_prefixs_find_xsi_attrs _find_types_find_xmlns_prefixs_get_element_nsuri_names _get_idstrs_NodesEvaluateExceptions_valid_encodingsParseException(sSCHEMAsSOAP(s SplitQName(s Canonicalize(s getLoggerN(s decodestrings encodestring(sunquotesquote(s unhexlifyshexlifycCs"|titititigjS(N(snssSCHEMAsXSD3sSOAPsENCsXSD1sXSD2(sns((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysscCst|dƒp t|dƒS(Nsnullsnil(s_find_xsi_attrsE(sE((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysscCsst|dƒot|iƒtjo |iSn5t|dƒo t|dƒo|i|ifSnttfSdS(s=returns the xsi:type as a tuple, coupled with ZSI.schema stypesschemaN(shasattrspyclassstypes _seqtypessschemasNone(spyclass((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys _get_xsitypes &  s unboundedsTypeCodec BstZdZeZeefZeZeZe dƒZ eedde eeedd„ Z d„Z eed„Zd„Zd„Zd „Zd „Zd „Zd „Zd „Zd„Ze d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s¦The parent class for all parseable SOAP types. Class data: typechecks -- do init-time type checking if non-zero Class data subclasses may define: tag -- global element declaration type -- global type definition parselist -- list of valid SOAP types for this class, as (uri,name) tuples, where a uri of None means "all the XML Schema namespaces" errorlist -- parselist in a human-readable form; will be generated if/when needed seriallist -- list of Python types or user-defined classes that this typecode can serialize. logger -- logger instance for this class. sZSI.TC.TypeCodeis_attrsc Ksñt|ƒtjo|\|_|_nt|f\|_|_|io#t|iƒidƒd|_n|p|i|_||_ ||_ ||_ ||_ ||_ | |_||_| idƒ} | tj o| d|_ndS(smBaseclass initialization. Instance data (and usually keyword arg) pname -- the parameter name (localname). nspname -- the namespace for the parameter; None to ignore the namespace typed -- output xsi:type attribute unique -- data item is not aliased (no href/id needed) minOccurs -- min occurances maxOccurs -- max occurances nillable -- is item nillable? attrs_aname -- This is variable name to dictionary of attributes encoded -- encoded namespaceURI (specify if use is encoded) s:iÿÿÿÿsencodedN(stypespnames _seqtypessselfsnspnamesNonesstrssplitsanames minOccurss maxOccurssnillablestypedsuniques attrs_anamespyclassskwsgetsencoded( sselfspnamesanames minOccurss maxOccurssnillablestypedsuniquespyclasss attrs_anameskwsencoded((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__Ds" #        cCstd|i|ƒƒ‚dS(sv Parameters: elt -- the DOM element being parsed ps -- the ParsedSoap object. sUnimplemented evaluationN(sEvaluateExceptionspss Backtraceselt(sselfseltsps((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparsejscKstd|i|ƒƒ‚dS(s¢ Parameters: elt -- the current DOMWrapper element sw -- soapWriter object pyobj -- python object to serialize sUnimplemented evaluationN(sEvaluateExceptionssws Backtraceselt(sselfseltsswspyobjsnamesorigskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serializerscCstd|i|ƒƒ‚dS(sÀconvert text into typecode specific data. Parameters: text -- text content elt -- the DOM element being parsed ps -- the ParsedSoap object. sUnimplemented evaluationN(sEvaluateExceptionspss Backtraceselt(sselfstextseltsps((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data|scCs|itiddƒdS(sP Parameters: elt -- the current DOMWrapper element snils1N(seltssetAttributeNSsSCHEMAsXSI3(sselfselt((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysserialize_as_nil…scCs‚tt|ƒƒo|Snt|ƒ}| o<|idjotSntd|d|i |ƒƒ‚n|i ||dƒSdS(sÂSimple HREF for non-string and non-struct and non-array. Parameters: elt -- the DOM element being parsed ps -- the ParsedSoap object. tag -- isRequireds missingN( slens _childrenselts _find_hrefshrefsselfs minOccurssNonesEvaluateExceptionstagspss Backtraces FindLocalHREF(sselfseltspsstagshref((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys SimpleHREFŒs cCs¡|ii}|idƒ}|idƒ}|o| oZg}x4|D],}|d|jo|i|dƒqFqFWdi |ƒ}||d typecode specific data. N(sStrings text_to_datasselfstextseltspssvals urldecode(sselfstextseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data×scCs ti||ƒ}t|ƒSdS(stypecode data --> text N(sStringsget_formatted_contentsselfspyobjs urlencode(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentÝs( s__name__s __module__s__doc__sNonesSCHEMAsXSD3s parseliststypes _GetLoggersloggers text_to_datasget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysURIÐs   sQNamecBsktZdZedfgZeidfZedƒZ edd„Z d„Z d„Z d„Z d„ZRS( sA QName type sQNames ZSI.TC.QNameicKs#ti||||t|_dS(N(sStrings__init__sselfspnamesstripskwsNonesprefix(sselfspnamesstripskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__ìscCsa|}t|tƒo7|\}}|itj od|i|f}qMnt i ||ƒSdS(Ns%s:%s( spyobjsvalues isinstancestuples namespaceURIs localNamesselfsprefixsNonesStringsget_formatted_content(sselfspyobjsvalues namespaceURIs localName((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentðs  cCs6t|tƒo"|\}}|i|ƒ|_ndS(s·use this method to set the prefix of the QName, method looks in DOM to find prefix or set new prefix. This method must be called before get_formatted_content. N( s isinstancespyobjstuples namespaceURIs localNameselts getPrefixsselfsprefix(sselfseltspyobjs namespaceURIs localName((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys set_prefixøs c Cs˜t|ƒ\}}|i|ƒ} y| |}Wn1t j o%}t d||i |ƒƒ‚nX||f}|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. scannot resolve prefix(%s)N(s SplitQNamestextsprefixs localNamespssGetElementNSdictseltsnsdicts namespaceURIsKeyErrorsexsEvaluateExceptions BacktracesvsselfspyclasssNone( sselfstextseltspss namespaceURIsprefixsexsvs localNamesnsdict((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_datas  cCs*|i||ƒti||||ƒSdS(s+Serialize without an element node. N(sselfs set_prefixseltspyobjsStringsserialize_text_nodessw(sselfseltsswspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysserialize_text_nodes(s__name__s __module__s__doc__sNones parselistsSCHEMAsXSD3stypes _GetLoggersloggers__init__sget_formatted_contents set_prefixs text_to_datasserialize_text_node(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysQNameås    sTokencBs8tZdZedfgZeidfZedƒZ RS(san xsd:token type stokens ZSI.TC.Token( s__name__s __module__s__doc__sNones parselistsSCHEMAsXSD3stypes _GetLoggerslogger(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysTokens s Base64StringcBsVtZdZedfeidfgZeidfZedƒZ d„Z d„Z RS(sA Base64 encoded string. s base64Binarysbase64sZSI.TC.Base64StringcCsYt|iddƒiddƒiddƒƒ}|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. s ss s N(s b64decodestextsreplacesvalsselfspyclasssNone(sselfstextseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data's 0cCs$dt|ƒ}ti||ƒSdS(Ns (s b64encodespyobjsStringsget_formatted_contentsself(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_content/s( s__name__s __module__s__doc__sNonesSOAPsENCs parseliststypes _GetLoggersloggers text_to_datasget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys Base64String s   s Base64BinarycBsDtZedfgZeidfZedƒZd„Z d„Z RS(Ns base64BinarysZSI.TC.Base64BinarycCs5t|ƒ}|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. N(s b64decodestextsvalsselfspyclasssNone(sselfstextseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data9s  cCst|ƒiƒ}|SdS(N(s b64encodespyobjsstrip(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentAs( s__name__s __module__sNones parselistsSCHEMAsXSD3stypes _GetLoggersloggers text_to_datasget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys Base64Binary4s   sHexBinaryStringcBsJtZdZedfgZeidfZedƒZ d„Z d„Z RS(sHex-encoded binary (yuk). s hexBinarysZSI.TC.HexBinaryStringcCs5t|ƒ}|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. N(s hexdecodestextsvalsselfspyclasssNone(sselfstextseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_dataMs  cCs&t|ƒiƒ}ti||ƒSdS(N(s hexencodespyobjsuppersStringsget_formatted_contentsself(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentUs( s__name__s __module__s__doc__sNones parselistsSCHEMAsXSD3stypes _GetLoggersloggers text_to_datasget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysHexBinaryStringFs   s XMLStringcBs;tZdZedƒZeed„Zd„Zd„ZRS(s-A string that represents an XML document sZSI.TC.XMLStringcKs ti|||||_dS(N(sStrings__init__sselfspnameskws readerclass(sselfspnames readerclassskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init___scCsT|i odkl}|i|_nti|||ƒ}|iƒi |ƒSdS(N(sPyExpat( sselfs readerclasssxml.dom.ext.readersPyExpatsReadersStringsparseseltspssvs fromString(sselfseltspssvsPyExpat((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparsecs   cCs t|ƒ}ti||ƒSdS(N(s CanonicalizespyobjsStringsget_formatted_contentsself(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentjs ( s__name__s __module__s__doc__s _GetLoggersloggersNones__init__sparsesget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys XMLStringZs   s EnumerationcBs>tZdZedƒZed„Zd„Zeed„ZRS(s0A string type, limited to a set of choices. sZSI.TC.EnumerationcKsºti|||t|ƒ}|tjot |ƒ|_n%t i ot dt |ƒƒ‚nt i oIxF|iD]7}t|ƒtjot dt |ƒdƒ‚qwqwWndS(Ns2Enumeration choices must be list or sequence, not sEnumeration choice s is not a string(sStrings__init__sselfspnameskwstypeschoicessts _seqtypesstuplesTypeCodes typecheckss TypeErrorsstrscs _stringtypes(sselfschoicesspnameskwscst((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__ts     cCsIti|||ƒ}||ijotd|i|ƒƒ‚n|SdS(NsValue not in enumeration list( sStringsparsesselfseltspssvalschoicessEvaluateExceptions Backtrace(sselfseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparse‚s c KsU||ijotdti|ƒƒ‚nti||||d|d||dS(NsValue not in enumeration listsnamesorig( spyobjsselfschoicessEvaluateExceptionspss BacktraceseltsStrings serializesswsnamesorigskw(sselfseltsswspyobjsnamesorigskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serialize‰s( s__name__s __module__s__doc__s _GetLoggersloggersNones__init__sparses serialize(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys Enumerationos    sIntegercBsRtZdZhdddf<dddf<dddf<ddd f<d d d f<d ddf<dddf<dddf<dedf<dedf<ddef<ddef<deef true iff x is a NaN.f1.0if2.0N(sx(sx((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysisnanssDecimalcBsªtZdZedfedfedfgZeZeZhddddf<dddd f unsupported use of namespaces "%s"stypecodespnamesuniquesasliststypedsname(s _get_xsitypespyobjsnsuristypeNamesselfsalls namespacessEvaluateExceptionsgetattrsNoneswhatsAnysnspnamespnamesTruesFalseskws serializeseltssw(sselfseltsswspyobjskwswhatstypeNamesnsuri((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serialize s#   c Csvt|ƒ\}} ||ijp | |ijo2td|i|i|| f|i|ƒƒ‚ntt |ƒƒ\}}t ||ƒ} t| |ƒ}| oŸt| ƒo t}qAt| ƒiƒttiidƒiƒjo,t|ƒiƒttiidƒiƒjo ti}qAtƒi||ƒ}|Sn|d|i|ifƒ}|i||ƒ}|SdS(Ns+ instance is (%s,%s) found (%s,%s)iispname(s_get_element_nsuri_nameseltsnspnamespnamesselfsEvaluateExceptionspss Backtraces SplitQNames _find_typesprefixstypeNames_resolve_prefixs namespaceURIsGTDspyclasss_is_xsd_or_soap_nss _AnyStrictsstrslowersApachesMapstypesAnysparse_into_dict_or_listspyobjswhatsparse( sselfseltspsspyclassstypeNamesprefixswhatspyobjsnspnamespnames namespaceURI((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparse5s"   ^ (s__name__s __module__s__doc__sallsothersSCHEMAsXSD3stypes _GetLoggersloggersNones__init__sget_formatted_contents text_to_datas serializesparse(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysAnyTypeýs    s AnyElementcBsYtZdZeidfZedƒZdgeddddd„Z d„Z d„Z RS( s|XML Schema xsi:any element declaration wildCard. class variables: tag -- global element declaration sanysZSI.TC.AnyElements#allisstrictc Ksa|dddfjotdƒ‚n||_ti|d|d|d|d|d ||dS( Nslaxsskipsstricts0processContents(%s) must be lax, skip, or stricts namespacesspnames minOccurss maxOccurssstrip( sprocessContentss ValueErrorsselfsAnyTypes__init__s namespacesspnames minOccurss maxOccurssstripskw(sselfs namespacesspnames minOccurss maxOccurssstripsprocessContentsskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__Xs  cKs2t|tƒo td‚nt|dtƒ}|tj ot|ƒti joR|i }t i i|ƒ}| o+ti|i if}t i i|ƒ}q¤n|tjoN|idjotd|i|ifƒ}qÿtd|i|ifƒ}n|iid|i iƒ|i||||dS(sáMust provice typecode to AnyElement for serialization, else try to use TC.Any to serialize instance which will serialize based on the data type of pyobj w/o reference to XML schema instance. spyobj is a typecode instance.stypecodesstrictspnamesserialize with %sN(s isinstancespyobjsTypeCodes TypeErrorsgetattrsNoneswhatstypestypess InstanceTypes __class__stcsAnys serialmapsgets ClassTypes__name__sselfsprocessContentss _AnyStrictsnspnamespnames_AnyLaxsloggersdebugs serializeseltsswskw(sselfseltsswspyobjskwswhatstc((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serializecs  #  c Cs>|idj}t|ƒ\} } t| | ƒ}| o |t j oN|i ||ƒ} y || _ Wn$tj o}t| |ƒ} nX| Sntt|ƒƒ\}}| o|o˜t||pdƒ} t| |ƒpt}|d| | fƒ}|i ||ƒ} y || _ Wn$tj o}t| |ƒ} nXt|_| Sn|otd| | fdtƒ}n?|idjotd| | fƒ}ntd| | fƒ}y|i ||ƒ} Wngt j o[}|i!i"d|i|iƒt#d| | fdtƒ}t|i ||ƒ|ƒ} nX| SdS( s processContents -- 'lax' | 'skip' | 'strict', 'strict' 1) if 'skip' check namespaces, and return the DOM node. 2) if 'lax' look for declaration, or definition. If not found return DOM node. 3) if 'strict' get declaration, or raise. sskipsxmlnsspnameswrappedslaxs"Give up, parse (%s,%s) as a StringstypedN($sselfsprocessContentssskips_get_element_nsuri_nameseltsnspnamespnamesGEDswhatsNonesparsespsspyobjstypecodesAttributeErrorsexs WrapImmutables SplitQNames _find_typesprefixstypeNames_resolve_prefixs namespaceURIsGTDsAnyspyclasssTruestypedsXMLsFalses_AnyLaxs _AnyStrictsEvaluateExceptionsloggerserrorsString( sselfseltspsspyclasssskipstypeNamesprefixsexswhatspyobjsnspnamespnames namespaceURI((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparsesH     ( s__name__s __module__s__doc__sSCHEMAsXSD3stags _GetLoggersloggersNones__init__s serializesparse(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys AnyElementPs   sUnioncBsMtZdZeZedƒZeddd„Zd„Zd„Z d„Z RS(s‡simpleType Union class variables: memberTypes -- list [(namespace,name),] tuples, each representing a type defintion. s ZSI.TC.Unionic Ks/ti|d|d|d||g|_dS(Nspnames minOccurss maxOccurs(s SimpleTypes__init__sselfspnames minOccurss maxOccursskwsmemberTypeCodes(sselfspnames minOccurss maxOccursskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__Ás"cCs+t|iƒdjodSn|iitjo td‚nxæ|iiD]Ø\}}t ||ƒ}|tjo:t i i ||fƒ}|id|i|ifƒ}n|d|i|ifƒ}|tjotd||f‚nt|tƒotd||f‚n|ii|ƒqKWdS(Nis<uninitialized class variable memberTypes [(namespace,name),]spnames6Typecode class for Union memberType (%s,%s) is missings0Illegal: Union memberType (%s,%s) is complexType(slensselfsmemberTypeCodess __class__s memberTypessNonesEvaluateExceptionsnsurisnamesGTDstcclasssAnysparsemapsgetstcsnspnamespnamestypecodes isinstancesStructsappend(sselfsnamestypecodesnsuristcclassstc((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pyssetMemberTypeCodesÅs    " c Ks×|iƒ|i||ƒ\}}xªtt|i ƒƒD]}|i |}y|i ||ƒ}Wn/tj o } q8ntj o } q8nX|djo'|i i|ƒ|i id|ƒnPq8W‚|SdS(sÌattempt to parse sequentially. No way to know ahead of time what this instance represents. Must be simple type so it can not have attributes nor children, so this isn't too bad. iN(sselfssetMemberTypeCodess checknameseltspssnsuristypeNamesrangeslensmemberTypeCodessindxstypecodesparsespyobjsParseExceptionsexs Exceptionsremovesinsert( sselfseltspsskwstypecodesindxstypeNamespyobjsnsurisex((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparseÚs$   cKs«|iƒx–tt|iƒƒD]|}|i|}y|iti|ƒƒ}PWnt j o }nX|djo'|ii |ƒ|iid|ƒq q W‚|SdS(Ni(sselfssetMemberTypeCodessrangeslensmemberTypeCodessindxstypecodesget_formatted_contentscopyspyobjscontentsParseExceptionsexsremovesinsert(sselfspyobjskwstypecodesindxscontentsex((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentús   ( s__name__s __module__s__doc__sNones memberTypess _GetLoggersloggers__init__ssetMemberTypeCodessparsesget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysUnion¸s    sListcBsPtZdZeZedƒZeed„Zd„Zd„Z eed„Z RS(s™simpleType List Class data: itemType -- sequence (namespaceURI,name) or a TypeCode instance representing the type definition s ZSI.TC.ListcKsx|iddƒdjp td‚ti|d|||p|i|_|i|_t }t |iƒt jo|i\}}yt|iŒt ƒ}Wnžt|ƒtjo‚nxVtD]N}|i |ijo|t ƒ}PqÃ|i d|jo|t ƒ}qÃqÃW|t jotd|iƒ‚q=nXt|dƒtjotd|ƒ‚n||_ndS( shCurrently need to require maxOccurs=1, so list is interpreted as a single unit of data. s maxOccursis<Currently only supporting SimpleType Lists with maxOccurs=1spnamesFiled to locate %ss text_to_datas-TypeCode class %s missing text_to_data methodN(skwsgetsAssertionErrors SimpleTypes__init__sselfspnamesitemTypes itemTypeCodesNonestypes _seqtypess namespaceURIsnamesGTDs_is_xsd_or_soap_nssFalsesTYPESspyclasssEvaluateExceptionshasattr(sselfspnamesitemTypeskwspyclasss itemTypeCodes namespaceURIsname((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__s2#   cCshg}x6|idƒD]%}|i|ii|||ƒƒqW|i t j o|i |ƒSn|SdS(s^convert text into typecode specific data. items in list are space separated. s N( svstextssplitsitemsappendsselfs itemTypeCodes text_to_dataseltspsspyclasssNone(sselfstextseltspssitemsv((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data:s#cCsB|i||ƒtt|ƒƒdjo´t|ƒ}| oU|i||ƒt jodSn|i t jot Snt d|i|ƒƒ‚n|ddjo|i||ƒSn|i||ƒ}|i||ƒn|i||ƒot Sntt|ƒƒdjodSn|i||ƒ}|i|||ƒSdS(sQelt -- the DOM element being parsed ps -- the ParsedSoap object. issRequired string missings#N(sselfs checknameseltspsslens _childrens _find_hrefshrefsnilledsFalsesnillablesTruesNilledsEvaluateExceptions Backtraces ResolveHREFs FindLocalHREFs checktypes simple_valuesvs text_to_data(sselfseltspsshrefsv((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparseFs* cKsßt|ƒtjo td‚nt|ƒ} |i|| ƒ\}} |i || ƒ}|itjo |tjo|i|ƒtSn|i} tƒ} x1|D])} | i| i| ƒƒ| idƒq¡W|itƒdS(selt -- the current DOMWrapper element sw -- soapWriter object pyobj -- python object to serialize sexpecting a lists N(stypespyobjs _seqtypessEvaluateExceptions _get_idstrsobjidsselfsget_namesnamesnssnseltscreateAppendElementselsnillablesTruesNonesserialize_as_nils itemTypeCodestcsStringIOsssitemswritesget_formatted_contentscreateAppendTextNodestextNode(sselfseltsswspyobjsnamesorigskwselsnsstcsobjidsnsitemss((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serializeas      ( s__name__s __module__s__doc__sNonesitemTypes _GetLoggersloggers__init__s text_to_datasparses serialize(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysLists  # s _AnyStrictcBs5tZdZedƒZeed„Zed„ZRS(sj Handles an unspecified types when using a concrete schemas and processContents = "strict". sZSI.TC._AnyStrictcKs,ti|d||||_t|_dS(Nspname(sTypeCodes__init__sselfspnameskwsaslistsTruesunique(sselfspnamesaslistskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__€s c Ks_t|ƒtjo|i o,ti|d|d|d|d||nt ddƒ‚dS(NseltsswspyobjsnamesGSerializing dictionaries not implemented when processContents="strict".s+Try as a list or use processContents="lax".( stypespyobjsdictsselfsaslistsAnys serializeseltsswsnameskwsEvaluateException(sselfseltsswspyobjsnameskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serialize…s,( s__name__s __module__s__doc__s _GetLoggersloggersNonesFalses__init__s serialize(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys _AnyStrictys  s_AnyLaxcBs;tZdZedƒZeed„Zd„Zd„Z RS(sd Handles unspecified types when using a concrete schemas and processContents = "lax". sZSI.TC._AnyLaxcKs,ti|d||||_t|_dS(Nspname(sTypeCodes__init__sselfspnameskwsaslistsTruesunique(sselfspnamesaslistskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__•s cCskt|ƒ}t|ƒ}g} |djoxt|ƒ} | ohSn|i | |ƒ}|i ||ƒt|ƒ}t|ƒ}|djo|i gƒSq£n|i ||ƒotSng} d} t}xnt|ƒD]`} | i}|| jo1|tjo| i| |fƒntƒ}n|i| ƒ|} qÝW|tjo| i| |fƒnt| ƒdjotSn<t| ƒdjot| ddƒdjo t|_nxœ| D]”\}}g}x'|D]}|i|i||ƒƒqÛWt|ƒdjo| i||fƒqÂt|ƒdjo| i||dfƒqÂqÂW|i | ƒSdS(Nisi(s_child_elementsseltscslenscountsvs _find_hrefshrefspss FindLocalHREFsselfs checktypeslistifysnilledsNilledsgroupedElementss previousNamesNonescurrentElementListsces localNamesnamesappendslistsFalsesaslistseltListslstsparse(sselfseltspsscountscsnamescurrentElementListslstseltListsceshrefs previousNamesgroupedElementssv((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparse_into_dict_or_listšsX               .  cCsì|iƒ\}}t|ƒ\}}|ti joa|o#t |f|jo||f|jo&t d||f|i |ƒƒ‚n||fSn|io ||ijo)t d||if|i |ƒƒ‚n|i||ƒSdS(sµSee if the name and type of the "elt" element is what we're looking for. Return the element's type. Since this is _AnyLax, it's ok if names don't resolve. s=Element mismatch (got %s wanted %s) (SOAP encoding namespace)s&Element NS mismatch (got %s wanted %s)N(sselfsget_parse_and_errorlists parselists errorlists_get_element_nsuri_nameseltsnssnamesSOAPsENCsNonesEvaluateExceptionspss Backtracesnspnames checktype(sselfseltspssnames errorlists parselistsns((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys checknameÎs-( s__name__s __module__s__doc__s _GetLoggersloggersNonesFalses__init__sparse_into_dict_or_lists checkname(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys_AnyLaxs   4ic Os•t|||ƒ}xŠ|iidgƒD]s}ti i|ƒ}|oG|i |joq(n| o$t t|ƒdt|ƒƒ‚qŽn|ti | scCs t|ƒS(N(sevalsy(sy((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys ss__main__(is__doc__sZSIs _copyrights _childrens_child_elementss _floattypess _stringtypess _seqtypess _find_attrs _find_attrNSs_find_attrNodeNSs_find_arraytypes_find_default_namespaces _find_hrefs_find_encstyles_resolve_prefixs_find_xsi_attrs _find_types_find_xmlns_prefixs_get_element_nsuri_names _get_idstrs_NodesEvaluateExceptions_valid_encodingsParseExceptionsZSI.wstools.NamespacessSCHEMAsSOAPsZSI.wstools.Utilitys SplitQNamesZSI.wstools.c14ns CanonicalizesZSI.wstools.loggings getLoggers _GetLoggersrestypesstimescopysbase64s decodestrings b64decodes encodestrings b64encodesurllibsunquotes urldecodesquotes urlencodesbinasciis unhexlifys hexdecodeshexlifys hexencodes_is_xsd_or_soap_nss _find_nils _get_xsitypesNonesNilleds UNBOUNDEDsTypeCodes SimpleTypesAnysStringsURIsQNamesTokens Base64Strings Base64BinarysHexBinaryStrings XMLStrings Enumerations_ignoredsIntegers _make_infs _magicnumssfloatsisnansDecimalsBooleansXMLsAnyTypes AnyElementsUnionsLists _AnyStricts_AnyLaxs RegisterTypes TCnumberssTCtimessschemasGTDsGEDs WrapImmutables TCcompoundsTCapaches_get_type_definitions_get_global_element_declarationsWrapsfsfiltersmapsdirsTYPESs__name__(Ns urlencodesEvaluateExceptions _childrensUnions _get_xsitypes Base64Strings_get_type_definitions Enumerations _GetLoggers_Nodes b64encodes hexdecodes_get_global_element_declarations _copyrightsAnyTypes_is_xsd_or_soap_nss _floattypess_find_xsi_attrs _get_idstrs b64decodes SimpleTypesStringsNilleds urldecodes UNBOUNDEDsTypeCodes_AnyLaxs _find_typesresBooleans _find_hrefs_find_attrNodeNSsGEDsIntegers_find_default_namespaces AnyElementsTYPESsSCHEMAsXMLsGTDsfs _AnyStricts _stringtypess RegisterTypesDecimals_ignoredsListsURIs_valid_encodings Base64BinarysHexBinaryStringsTokens _find_nilsParseExceptions_resolve_prefixs_find_encstyles _find_attrscopystypess XMLStringsWraps WrapImmutables _find_attrNSs _seqtypessisnans _make_infs_child_elementss_find_arraytypes hexencodesQNamesAnys SplitQNames _magicnumsstimes Canonicalizes_get_element_nsuri_namesSOAPs_find_xmlns_prefix((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys?st‘   $   ÿ_mº3#L   W8MShVkW   PKŒ¨58SÆu´Ó7Ó7 ZSI/fault.pyo;ò Z@Ec @sñdZdklZlZlZlZlZlZlZl Z l Z dk l Z dk lZlZlZlZlZlZdklZlZdklZdk lZdkZdkZdfd „ƒYZe eed d d d ddƒgddd d ƒe_dfd„ƒYZe eeddƒeddƒedei dfd d ƒeied d d d deƒgdei dfde!dd ƒe_dfd„ƒYZ"e e"ed d d d deƒgdedfƒe"_dee fd„ƒYZ#dfd„ƒYZ$e#ƒe$_d ee fd!„ƒYZ%d"fd#„ƒYZ&e%ƒe&_d$ee fd%„ƒYZ'd&fd'„ƒYZ(e'ƒe(_de fd(„ƒYZ)e*d)„Z+e*d*„Z,e*d+„Z-e*e*d,„Z.d-„Z/e0d.jo eGHndS(/sFaults. ( s _copyrights _childrens_child_elementss _get_idstrs _stringtypess _seqtypess_Nodes SoapWriters ZSIException(sStruct(sQNamesURIsStrings XMLStrings AnyElements UNBOUNDED(sSOAPsZSI_SCHEMA_URI(s Canonicalize(sElementDeclarationNsDetailcBstZed„ZRS(NcCs ||_dS(N(sanysself(sselfsany((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__s(s__name__s __module__sNones__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysDetailssanamesanys minOccursis maxOccurss unboundedspnamesdetails FaultTypecBstZeeeed„ZRS(NcCs(||_||_||_||_dS(N(s faultcodesselfs faultstrings faultactorsdetail(sselfs faultcodes faultstrings faultactorsdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__s   (s__name__s __module__sNones__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys FaultTypess faultcodes faultstrings faultactorsFaultsinlines hasextrassZSIHeaderDetailcBstZd„ZRS(NcCs ||_dS(N(sdetailsselfsany(sselfsdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__.s(s__name__s __module__s__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysZSIHeaderDetail-ssZSIFaultDetailTypeCodecBs#tZdZeZdZd„ZRS(s| %s %s s FaultDetailc KsPti|ttdtdfƒtdtdfddƒgdtdf|dS(Nspnamesstringstraces minOccursis FaultDetail(sStructs__init__sselfsZSIFaultDetailsStringsZSI_SCHEMA_URIskw(sselfskw((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__?s9(s__name__s __module__s__doc__sZSI_SCHEMA_URIsschemasliterals__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysZSIFaultDetailTypeCode7s sZSIFaultDetailcBs)tZeed„Zd„Zd„ZRS(NcCs||_||_dS(N(sstringsselfstrace(sselfsstringstrace((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__Fs cCs/|io|id|idSn|iSdS(Ns [trace: s](sselfstracesstring(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__str__Js cCsdtt|ƒfSdS(Ns<%s.ZSIFaultDetail %s>(s__name__s _get_idstrsself(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__repr__Os(s__name__s __module__sNones__init__s__str__s__repr__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysZSIFaultDetailEs sURIFaultDetailTypeCodecBs#tZdZeZdZd„ZRS(sˆ uri localname sURIFaultDetailcKsJti|ttdtdfƒtdtdfƒgdtdf|dS(NspnamesURIs localnamesURIFaultDetail(sStructs__init__sselfsURIFaultDetailsStringsZSI_SCHEMA_URIskw(sselfskw((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__]s '(s__name__s __module__s__doc__sZSI_SCHEMA_URIsschemasliterals__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysURIFaultDetailTypeCodeTs sURIFaultDetailcBstZeed„ZRS(NcCs||_||_dS(N(surisselfsURIs localname(sselfsuris localname((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__ds (s__name__s __module__sNones__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysURIFaultDetailcssActorFaultDetailTypeCodecBs#tZdZeZdZd„ZRS(sZ %s sActorFaultDetailcKs8ti|ttdtdfƒgdtdf|dS(NspnamesURIsActorFaultDetail(sStructs__init__sselfsActorFaultDetailsStringsZSI_SCHEMA_URIskw(sselfskw((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__rs!(s__name__s __module__s__doc__sZSI_SCHEMA_URIsschemasliterals__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysActorFaultDetailTypeCodejs sActorFaultDetailcBstZed„ZRS(NcCs ||_dS(N(surisselfsURI(sselfsuri((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__xs(s__name__s __module__sNones__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysActorFaultDetailwscBsetZdZdZdZdZeeed„Zd„Zd„Z d„Z d„Z d „Z e Z RS( sSOAP Faults. sSOAP-ENV:ClientsSOAP-ENV:ServersSOAP-ENV:MustUnderstandcCs­|tj ot|ƒtjo |f}n|tj ot|ƒtjo |f}n|||||f\|_|_|_|_|_t i ||||||ƒdS(N( sdetailsNonestypes _seqtypess headerdetailscodesstringsactorsselfs ZSIExceptions__init__(sselfscodesstringsactorsdetails headerdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__…s     3cCs$|i otSnt|iƒSdS(N(sselfs headerdetailsNonesZSIHeaderDetail(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysDataForSOAPHeaders cCsdt}|itj otƒ}|i|_nt|i|i|i|ƒ}|i |dt ƒdS(sSerialize the object.stypedN( sNonesdetailsselfsDetailsanys FaultTypescodesstringsactorspyobjssws serializesFalse(sselfsswsdetailspyobj((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys serialize”s cKs]|iƒ}t|}|i|ƒ|tj o|i||i dt ƒnt |ƒSdS(Nstyped( sselfsDataForSOAPHeadersheaders SoapWriterskwssws serializesNonesserialize_headerstypecodesFalsesstr(sselfskwsswsheader((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysAsSOAPžs     cCs}t|iƒd}t|dƒoRt|idƒo(x8|iD]}|t|ƒ7}q@Wqu|t|iƒ7}n|SdS(Ns sdetails__len__(sstrsselfsstringsstrngshasattrsdetailsd(sselfsstrngsd((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__str__§s cCsdtt|ƒfSdS(Ns<%s.Fault at %s>(s__name__s _get_idstrsself(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__repr__±s(s__name__s __module__s__doc__sClientsServersMUsNones__init__sDataForSOAPHeaders serializesAsSOAPs__str__s__repr__sAsSoap(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFault}s   cCs8tt||ƒf\}}ttid|||ƒSdS(Ns"SOAP mustUnderstand not understood( sNonesURIFaultDetailsuris localnamesdetails headerdetailsFaultsMUsactor(suris localnamesactorsdetails headerdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromNotUnderstood·s cCs5tt|ƒf\}}ttid|||ƒSdS(NsCannot process specified actor(sNonesActorFaultDetailsurisdetails headerdetailsFaultsClientsactor(surisactorsdetails headerdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromActor½s cCs™t|dtƒp t|ƒ}t|ddƒ}d||f}t|ddƒot|f\}}n|tf\}}t t i d|||ƒSdS( s?Return a Fault object created from a ZSI exception object. sstrstracesse %s %s sinheaderisUnparseable messageN( sgetattrsexsNonesstrsmystrsmytraceseltsdetails headerdetailsFaultsClientsactor(sexsactorsmytracesdetails headerdetailsmystrselt((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromZSIExceptionÃs cCst} |ojyVdigi} ti|ƒD])\}} } }| d|| | fƒq-~ ƒ}WnqwX|} nd} y"di|i|iigƒ} WnnXtd| dt|ƒd| ƒ}|ot|f\}}n|tf\}}ttid|||ƒSdS( sbReturn a Fault object created from a Python exception. SOAP-ENV:Server Processing Failure s s%s:%d:%sss:sstringstracesProcessing FailureN(sNones tracetextstbsjoinsappends_[1]s tracebacks extract_tbsnameslinesfuncstextsliness exceptionNamesexs __module__s __class__s__name__sZSIFaultDetailsstrseltsinheadersdetails headerdetailsFaultsServersactor(sexsinheaderstbsactors headerdetailsnamestextslinessdetails_[1]s exceptionNamesfuncs tracetextslineselt((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromExceptionÕs& V "# cCsX|itiƒ}|itjo t}n |ii}t |i |i |i |ƒSdS(s"Parse the message as a fault. N( spssParses FaultTypestypecodespyobjsdetailsNones detailanysanysFaults faultcodes faultstrings faultactor(spsspyobjs detailany((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromFaultMessageús  s__main__(1s__doc__sZSIs _copyrights _childrens_child_elementss _get_idstrs _stringtypess _seqtypess_Nodes SoapWriters ZSIExceptionsZSI.TCcompoundsStructsZSI.TCsQNamesURIsStrings XMLStrings AnyElements UNBOUNDEDsZSI.wstools.NamespacessSOAPsZSI_SCHEMA_URIsZSI.wstools.c14ns CanonicalizesElementDeclarations tracebacks cStringIOsStringIOsDetailstypecodes FaultTypesENVsTruesZSIHeaderDetailsZSIFaultDetailTypeCodesZSIFaultDetailsURIFaultDetailTypeCodesURIFaultDetailsActorFaultDetailTypeCodesActorFaultDetailsFaultsNonesFaultFromNotUnderstoodsFaultFromActorsFaultFromZSIExceptionsFaultFromExceptionsFaultFromFaultMessages__name__(%sZSIFaultDetailsFaultFromExceptionsStructs _childrensDetails_Nodes _copyrightsFaultFromActors FaultTypesFaultFromFaultMessages _get_idstrsStrings SoapWritersActorFaultDetails UNBOUNDEDsActorFaultDetailTypeCodesFaultFromZSIExceptions AnyElementsElementDeclarations _stringtypessFaultsFaultFromNotUnderstoods ZSIExceptionsURIsZSI_SCHEMA_URIsURIFaultDetailTypeCodes XMLStrings _seqtypessStringIOs_child_elementss tracebacksZSIFaultDetailTypeCodesQNamesURIFaultDetails CanonicalizesZSIHeaderDetailsSOAP((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys?sH= +  6T    :   % PK‚¨58+ì[[ZSI/resolvers.pyc;ò Z@Ec@s¨dZdklZlZlZlZdkZdkZdkZdk l Z dk Z d„Zd„Zdfd„ƒYZdfd „ƒYZed jo eGHndS( sSOAP messaging parsing. (s _copyrights_child_elementssEvaluateExceptionsTCN(s decodestringcKsuti||}|iƒiƒ}|dddgjo|iƒSnt i ƒ}t i |||ƒ|i ƒSdS(s6Resolve a URI and return its content as a string. s7bits8bitsbinaryN(surllibsurlopensuriskeywordsssourcesinfos getencodingsencsreadsStringIOsdatas mimetoolssdecodesgetvalue(suristcspsskeywordssencssourcesdata((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysOpaque s cKs—ti||}|iƒiƒ}|dddgjo |}n-t i ƒ}t i |||ƒ|i dƒ|iƒi|ƒ}t|ƒdSdS(s8Resolve a URI and return its content as an XML DOM. s7bits8bitsbinaryiN(surllibsurlopensuriskeywordsssourcesinfos getencodingsencsdatasStringIOs mimetoolssdecodesseekspss readerclasss fromStreamsdoms_child_elements(suristcspsskeywordssencsdomssourcesdata((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysXMLs   sNetworkResolvercBs>tZdZed„Zd„Zd„Zd„Zd„ZRS(s,A resolver that support string and XML. cCs|pg|_dS(N(sprefixsselfsallowed(sselfsprefix((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys__init__+scCs<x)|iD]}|i|ƒodSq q Wtdƒ‚dS(NsDisallowed URI prefix(sselfsallowedsasuris startswithsEvaluateException(sselfsurisa((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys_check_allowed.s   cKs$|i|ƒt||||SdS(N(sselfs_check_allowedsurisOpaquestcspsskeywords(sselfsuristcspsskeywords((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysOpaque3s cKs$|i|ƒt||||SdS(N(sselfs_check_allowedsurisXMLstcspsskeywords(sselfsuristcspsskeywords((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysXML7s cKsAt|tiƒot||||Snt||||SdS(N(s isinstancestcsTCsXMLsurispsskeywordssOpaque(sselfsuristcspsskeywords((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysResolve;s( s__name__s __module__s__doc__sNones__init__s_check_allowedsOpaquesXMLsResolve(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysNetworkResolver's     s MIMEResolvercBsVtZdZeddd„Zd„Zd„Zd„Zd„Zd„Z d „Z RS( s?Multi-part MIME resolver -- SOAP With Attachments, mostly. s thismessage:/icKsÌxv|idƒD]Y} | iƒ}|idƒo7|dddgjo|dd!}n |d}PqqWtdƒ‚hhgf\|_ |_ |_ ||_ ||_ti||ƒ} | i|ƒxð| i ƒoâti| ƒ}tiƒ} ti| | |iƒƒ| id ƒ|| f} |i i| ƒ|id ƒ} | oD| d d jo| dd jo| d d!} n| |i | iscontent-location("sctssplitsparamsstripsas startswithsboundarys ValueErrorsselfsid_dictsloc_dictspartssnextsuribasesbases multifiles MultiFilesfsseekablesmfspushs mimetoolssMessagesheadsStringIOsbodysdecodes getencodingsseekspartsappendsgetskeyspop(sselfsctsfsnextsuribasesseekableskwsasheadsmfsbodysparamspartskeysboundary((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys__init__Es>    !       "cCs*|id\}}ti|iƒƒSdS(s Get the SOAP body part. iN(sselfspartssheadspartsStringIOsgetvalue(sselfspartshead((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys GetSOAPPartiscCsƒ|idƒo.|i|d\}}ti|iƒƒSn|ii |ƒo*|i|\}}ti|iƒƒSnt SdS(s@Get the content for the bodypart identified by the uri. scid:iN( suris startswithsselfsid_dictsheadspartsStringIOsgetvaluesloc_dictshas_keysNone(sselfsurisheadspart((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysgetoscKs`|i|ƒ}|o|iƒSn|i otd|ƒ‚n|ii||||SdS(NsUnresolvable URI ( sselfsgetsuriscontentsgetvaluesnextsEvaluateExceptionsOpaquestcspsskeywords(sselfsuristcspsskeywordsscontent((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysOpaque{s  cKsy|i|ƒ}|o'|iƒi|ƒ}t|ƒdSn|i ot d|ƒ‚n|i i ||||SdS(NisUnresolvable URI (sselfsgetsuriscontentspss readerclasss fromStreamsdoms_child_elementssnextsEvaluateExceptionsXMLstcskeywords(sselfsuristcspsskeywordssdomscontent((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysXMLs cKsGt|tiƒo|i||||Sn|i||||SdS(N( s isinstancestcsTCsXMLsselfsurispsskeywordssOpaque(sselfsuristcspsskeywords((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pysResolve‰scCs0|i|\}}ti|iƒƒ}|SdS(N(sselfsid_dictscidsheadsbodysStringIOsgetvaluesnewio(sselfscidsbodysheadsnewio((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys __getitem__Žs( s__name__s __module__s__doc__sNones__init__s GetSOAPPartsgetsOpaquesXMLsResolves __getitem__(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys MIMEResolverAs $    s__main__(s__doc__sZSIs _copyrights_child_elementssEvaluateExceptionsTCs multifiles mimetoolssurllibsbase64s decodestrings b64decodes cStringIOsStringIOsOpaquesXMLsNetworkResolvers MIMEResolvers__name__( s mimetoolssXMLs MIMEResolversNetworkResolversEvaluateExceptionsStringIOs_child_elementssOpaquesurllibs multifiles _copyrights b64decodesTC((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/resolvers.pys?s   R PK/¤Y5£fh‘€€ZSI/typeinterpreter.py########################################################################### # Joshua R. Boverhof, LBNL # See LBNLCopyright for copyright notice! ########################################################################### import ZSI from ZSI import TC, TCtimes, TCcompound from ZSI.TC import TypeCode from ZSI import _copyright, EvaluateException from ZSI.wstools.Utility import SplitQName from ZSI.wstools.Namespaces import SOAP, SCHEMA ########################################################################### # Module Classes: BaseTypeInterpreter ########################################################################### class NamespaceException(Exception): pass class BaseTypeInterpreter: """Example mapping of xsd/soapenc types to zsi python types. Checks against all available classes in ZSI.TC. Used in wsdl2python, wsdlInterpreter, and ServiceProxy. """ def __init__(self): self._type_list = [TC.Iinteger, TC.IunsignedShort, TC.gYearMonth, \ TC.InonNegativeInteger, TC.Iint, TC.String, \ TC.gDateTime, TC.IunsignedInt, TC.Duration,\ TC.IpositiveInteger, TC.FPfloat, TC.gDay, TC.gMonth, \ TC.InegativeInteger, TC.gDate, TC.URI, \ TC.HexBinaryString, TC.IunsignedByte, \ TC.gMonthDay, TC.InonPositiveInteger, \ TC.Ibyte, TC.FPdouble, TC.gTime, TC.gYear, \ TC.Ilong, TC.IunsignedLong, TC.Ishort, \ TC.Token, TC.QName] self._tc_to_int = [ ZSI.TCnumbers.IEnumeration, ZSI.TCnumbers.Iint, ZSI.TCnumbers.Iinteger, ZSI.TCnumbers.Ilong, ZSI.TCnumbers.InegativeInteger, ZSI.TCnumbers.InonNegativeInteger, ZSI.TCnumbers.InonPositiveInteger, ZSI.TC.Integer, ZSI.TCnumbers.IpositiveInteger, ZSI.TCnumbers.Ishort] self._tc_to_float = [ ZSI.TC.Decimal, ZSI.TCnumbers.FPEnumeration, ZSI.TCnumbers.FPdouble, ZSI.TCnumbers.FPfloat] self._tc_to_string = [ ZSI.TC.Base64String, ZSI.TC.Enumeration, ZSI.TC.HexBinaryString, ZSI.TCnumbers.Ibyte, ZSI.TCnumbers.IunsignedByte, ZSI.TCnumbers.IunsignedInt, ZSI.TCnumbers.IunsignedLong, ZSI.TCnumbers.IunsignedShort, ZSI.TC.String, ZSI.TC.URI, ZSI.TC.XMLString, ZSI.TC.Token] self._tc_to_tuple = [ ZSI.TC.Duration, ZSI.TC.QName, ZSI.TCtimes.gDate, ZSI.TCtimes.gDateTime, ZSI.TCtimes.gDay, ZSI.TCtimes.gMonthDay, ZSI.TCtimes.gTime, ZSI.TCtimes.gYear, ZSI.TCtimes.gMonth, ZSI.TCtimes.gYearMonth] return def _get_xsd_typecode(self, msg_type): untaged_xsd_types = {'boolean':TC.Boolean, 'decimal':TC.Decimal, 'base64Binary':TC.Base64String} if untaged_xsd_types.has_key(msg_type): return untaged_xsd_types[msg_type] for tc in self._type_list: if tc.type == (SCHEMA.XSD3,msg_type): break else: tc = TC.AnyType return tc def _get_soapenc_typecode(self, msg_type): if msg_type == 'Array': return TCcompound.Array if msg_type == 'Struct': return TCcompound.Struct return self._get_xsd_typecode(msg_type) def get_typeclass(self, msg_type, targetNamespace): prefix, name = SplitQName(msg_type) if targetNamespace in SCHEMA.XSD_LIST: return self._get_xsd_typecode(name) elif targetNamespace in [SOAP.ENC]: return self._get_soapenc_typecode(name) return None def get_pythontype(self, msg_type, targetNamespace, typeclass=None): if not typeclass: tc = self.get_typeclass(msg_type, targetNamespace) else: tc = typeclass if tc in self._tc_to_int: return 'int' elif tc in self._tc_to_float: return 'float' elif tc in self._tc_to_string: return 'str' elif tc in self._tc_to_tuple: return 'tuple' elif tc in [TCcompound.Array]: return 'list' elif tc in [TC.Boolean]: return 'bool' elif isinstance(tc, TypeCode): raise EvaluateException,\ 'failed to map zsi typecode to a python type' return None PKƒ¨58®^R³ÏgÏgZSI/client.pyc;ò Z@Ec@sèdklZlZlZlZlZlZlZlZl Z l Z l Z l Z l Z lZlZlZdklZdklZlZlZlZlZlZdklZdkZdkZdkZdkZdk Z dk!Z!dk"l#Z#dk$l%Z&ei'Z(dfd„ƒYZ)ee)d eed fd e*ƒeed fd e*ƒfd edfd e*ƒe)_+dfd„ƒYZ,dfd„ƒYZ-dfd„ƒYZ.de.fd„ƒYZ/de/fd„ƒYZ0e1djo eGHndS((s _copyrights _seqtypess ParsedSoaps SoapWritersTCsZSI_SCHEMA_URIsEvaluateExceptionsFaultFromFaultMessages_child_elementss_attrss_find_arraytypes _find_types _get_idstrs_get_postvalue_from_absoluteURIsFaultExceptionsWSActionException(sAUTH(s AnyElementsAnyTypesStringsTypeCodes_get_global_element_declarations_get_type_definition(sStructN(sAddress(s getLoggers _AuthHeadercBstZdZeed„ZRS(sm %s%s cCs||_||_dS(N(snamesselfsNamespasswordsPassword(sselfsnamespassword((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__s (s__name__s __module__s__doc__sNones__init__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys _AuthHeaders sofwhatsNamestypedsPasswordspnames BasicAuths_CallercBs tZdZd„Zd„ZRS(szInternal class used to give the user a callable object that calls back to the Binding object to make an RPC call. cCs||f\|_|_dS(N(sbindingsnamesself(sselfsbindingsname((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__$sc Gs9|iit|i|dddti|idƒƒSdS(Ns encodingStyles)http://schemas.xmlsoap.org/soap/encoding/s replytypesResponse(sselfsbindingsRPCsNonesnamesargssTCsAny(sselfsargs((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__call__'s(s__name__s __module__s__doc__s__init__s__call__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys_Callers  s_NamedParamCallercBs tZdZd„Zd„ZRS(sSSimilar to _Caller, expect that there are named parameters not positional. cCs||f\|_|_dS(N(sbindingsnamesself(sselfsbindingsname((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__2sc Ks‘h}x@dddgD]/}|i|ƒo||||<||=qqW|iit|itddd|dt i |idd t ƒ|SdS( Ns auth_headersnsdictsrequesttypecodesoapactions encodingStyles)http://schemas.xmlsoap.org/soap/encoding/s_argss replytypesResponsesaslist( skwskeysparamsshas_keysselfsbindingsRPCsNonesnamesTCsAnysFalse(sselfsparamsskwskey((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__call__5s(s__name__s __module__s__doc__s__init__s__call__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys_NamedParamCaller-s  s_Bindingc BstZdZeiZeiZedƒZ e e e e e e de e e d„ Z e e d„Z d„Z d„Zd„Zd„Zd „Ze d „Zhe e e d „Zhd „Zd „Zd„Zd„Ze d„Zd„Zd„Zd„Zd„ZRS(s¬Object that represents a binding (connection) to a SOAP server. Once the binding is created, various ways of sending and receiving SOAP messages are available. sZSI.client.Bindingsc Ksòt|_t|_g|_|ph|_||_| ph|_||_||_ ||_ ||_ ||_ ||_| |_t|_| idtƒ|_tiƒ|_h|_| idƒo|i| dŒn|itiƒdS(sPInitialize. Keyword arguments include: transport -- default use HTTPConnection. transdict -- dict of values to pass to transport. url -- URL of resource, POST is path soapaction -- value of SOAPAction header auth -- (type, name, password) triplet; default is unauth nsdict -- namespace entries to add tracefile -- file to dump packet traces cert_file, key_file -- SSL data (q.v.) readerclass -- DOM reader class writerclass -- DOM writer class, implements MessageInterface wsAddressURI -- namespaceURI of WS-Address to use. By default it's not used. sig_handler -- XML Signature handler, must sign and verify. endPointReference -- optional Endpoint Reference. sendPointReferencesauthN(sNonesselfsdataspss user_headerssnsdicts transports transdictsurls tracefilestraces readerclasss writerclasss soapactions wsAddressURIs sig_handlersaddressskwsgetsendPointReferencesCookies SimpleCookiescookiesshttp_callbacksshas_keysSetAuthsAUTHsnone( sselfsnsdicts transportsurls tracefiles readerclasss writerclasss soapactions wsAddressURIs sig_handlers transdictskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__Ls*             cCs)|||f\|_|_|_|SdS(s2Change auth style, return object to user. N(sstylesuserspasswordsselfs auth_styles auth_users auth_pass(sselfsstylesuserspassword((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysSetAuthws!cCs||_|SdS(s Set the URL we post to. N(surlsself(sselfsurl((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysSetURL~s cCsg|_|SdS(s.Empty the list of additional headers. N(sselfs user_headers(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys ResetHeaders„s cCstiƒ|_dS(s#Empty the list of cookies. N(sCookies SimpleCookiesselfscookies(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys ResetCookiesŠscCs|ii||fƒ|SdS(sAdd a header to send. N(sselfs user_headerssappendsheadersvalue(sselfsheadersvalue((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys AddHeaderscCs÷xð|iiƒD]ß\}}g}|iddƒ}|djo |djo|id|ƒn|id||i fƒ|idƒ}|o|id|ƒn|idƒ}|o|id |ƒn|i i d d i |ƒƒqWd S( s;Add cookies from self.cookies to request in self.h sversionss0s $Version=%ss%s=%sspaths$Path=%ssdomains $Domain=%ssCookies; N( sselfscookiessitemsscnamesmorselsattrssgetsvaluesappends coded_valueshs putheadersjoin(sselfscnamesmorselsattrssvalue((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys __addcookies•s cKs*|i|||||i||SdS(sdSend a request, return the reply. See Send() and Recieve() docstrings for details. N(sselfsSendsurlsopnamesobjskwsReceives replytype(sselfsurlsopnamesobjs replytypeskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysRPC¦sc Ksp|p|i}|p|i}h}|i|iƒ|i|ƒtd|dtd|id|i dƒƒ}|i dƒ} |i dƒo7| ptid|dtƒ}|i|d|ƒnÑ| o¸t|d tƒptid|dtƒ}y3t|ƒtjottd „|ƒƒ}nWn+tj otid|dtƒ}nXtid|dtƒ}|i||ƒn|i|| ƒ|iti@o&|it |i!|i"ƒt i#ƒn|i$tj oy|i%o|i'd ƒ|i%jot(d |i%|f‚nt)||i$ƒ|_*|i*i+||ƒ|i*i|ƒn|i,tj o|i,i-|ƒnt.i.|ƒ\} }} }}}|i3} | tjo |tj oA| d jo |i4} qÿ| djo |i5} qÿt6d‚nt7| t8i9ƒtjo t:d‚nt;|ƒ} | |t|i=|_>|i>i?ƒ|i@| |||dS(s‚Send a message. If url is None, use the value from the constructor (else error). obj is the object (data) to send. Data may be described with a requesttypecode keyword, the default is the class's typecode (if there is one), else Any. Try to serialize as a Struct, if this is not possible serialize an Array. If data is a sequence of built-in python data types, it will be serialized as an Array, unless requesttypecode is specified. arguments: url -- opname -- struct wrapper obj -- python instance key word arguments: nsdict -- soapaction -- wsaction -- WS-Address Action, goes in SOAP Header. endPointReference -- set by calling party, must be an EndPointReference type instance. requesttypecode -- snsdictsheaders outputclasss encodingStylesrequesttypecodes_argsspnamesasliststypecodecCs|ii|fS(N(sistypecodespname(si((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysÙss'"s+soapAction(%s) and WS-Action(%s) must matchshttpsshttps3must specify transport or url startswith https/https"transport must be a HTTPConnectionN(AsurlsselfsendPointReferencesdsupdatesnsdicts SoapWritersTrues writerclassskwsgetsswsrequesttypecodeshas_keysTCsAnysopnamesFalsestcs serializesgetattrsobjsNonestypes _seqtypessdictsmapsAttributeErrors auth_stylesAUTHszsibasicsserialize_headers _AuthHeaders auth_users auth_passstypecodes wsAddressURIs soapactionswsactionsstripsWSActionExceptionsAddresssaddresss setRequests sig_handlerssignsurlparsesschemesnetlocspathsnils transportsdefaultHttpsTransportsdefaultHttpTransports RuntimeErrors issubclassshttplibsHTTPConnections TypeErrorsstrssoapdatas transdictshsconnects SendSOAPData(sselfsurlsopnamesobjsnsdicts soapactionswsactionsendPointReferenceskwsrequesttypecodespathssoapdatas transportsschemesnilsnetlocsdsswstc((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysSend­s^ + #!         c s ˆio=ˆiddItitiƒƒIdIJˆiˆIJntˆƒ} ˆii d| ƒˆii ddt ˆƒƒˆii ddƒˆi ƒx-|iƒD]\}} ˆii || ƒq­Wd ˆpˆi} ˆii d | ƒˆiti@oAtˆid ˆiƒid d ƒ}ˆii dd|ƒn_ˆitijo|idƒ o|idƒ o)‡‡‡‡‡d†}|ˆid(sselfs __class__s__name__s _get_idstr(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__repr__¹s(s__name__s __module__s__doc__shttplibsHTTPConnectionsdefaultHttpTransportsHTTPSConnectionsdefaultHttpsTransports _GetLoggersloggersNones__init__sSetAuthsSetURLs ResetHeaderss ResetCookiess AddHeaders_Binding__addcookiessRPCsSends SendSOAPDatasSendSOAPDataHTTPDigestAuths ReceiveRawsIsSOAPs ReceiveSOAPsIsAFaults ReceiveFaultsReceives__repr__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys_BindingCs,    '+      ` % $ %    sBindingcBsPtZdZed„ƒZedƒZed„Zd„Z d„Z d„Z RS(sObject that represents a binding (connection) to a SOAP server. Can be used in the "name overloading" style. class attr: gettypecode -- funcion that returns typecode from typesmodule, can be set so can use whatever mapping you desire. cCst|t|iƒƒiS(N(sgetattrsmodsstrses localNamestypecode(smodse((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysÅssZSI.client.BindingcKs||_ti||dS(N(s typesmodulesselfs_Bindings__init__skw(sselfs typesmoduleskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__Ès cCs{|d djo!t|ƒdjo|ddjo5t||ƒot||ƒSnt|i|ƒSnt||ƒSdS(saReturn a callable object that will invoke the RPC method named by the attribute. is__iiþÿÿÿN(snameslenshasattrsselfsgetattrs __class__s_Caller(sselfsname((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys __getattr__Ìs 5cCsày|i|i|ƒ}WnH|iid|i|iƒti ddƒ}|i ||i ƒSnX|iid|ƒy|i ||i ƒSWn&t j o|iid|ƒnXti ddƒ}|i ||i ƒSdS(sFfor rpc-style map each message part to a class in typesmodule s/didnt find typecode for "%s" in typesmodule: %ssaslistisparse child with typecode : %ssparse failed try Any : %sN( sselfs gettypecodes typesmodulesnodestcsloggersdebugs localNamesTCsAnysparsespss Exception(sselfsnodestc((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys __parse_childÕs c KsR|i||i}t|iƒ}t|ƒtt fjo|ddjp t |iƒ} |i t jp| oti|||Sn|iƒot|ƒ}t|ƒ‚n|}t|dƒo |i}nh}x9t|iƒD](}t|iƒ} |i|ƒ|| assumed maxOccurs unbounded' for v in any: if not hasattr(v,'typecode'): raise EvaluateException, ' element, instance missing typecode attribute' pyobjs.append(v) #pyobjs.append(v) self.header_pyobjs = tuple(pyobjs) def setResponseFromWSAddress(self, address, localURL): '''Server-side has to set these fields in response. address -- Address instance, representing a WS-Address ''' self.From = localURL self.header_pyobjs = None pyobjs = [] namespaceURI = self.wsAddressURI for nsuri,name,value in (\ (namespaceURI, "Action", self._action), (namespaceURI, "MessageID","uuid:%s" %time.time()), (namespaceURI, "RelatesTo", address.getMessageID()), (namespaceURI, "To", self.anonymousURI),): typecode = GED(nsuri, name) pyobjs.append(typecode.pyclass(value)) typecode = GED(nsuri, "From") pyobj = typecode.pyclass() pyobj._Address = self.From pyobjs.append(pyobj) self.header_pyobjs = tuple(pyobjs) def serialize(self, sw, **kw): ''' sw -- SoapWriter instance, add WS-Address header. ''' for pyobj in self.header_pyobjs: if hasattr(pyobj, 'typecode') is False: raise RuntimeError, 'all header pyobjs must have a typecode attribute' sw.serialize_header(pyobj, **kw) def parse(self, ps, **kw): ''' ps -- ParsedSoap instance ''' namespaceURI = self.wsAddressURI elements = ("MessageID","Action","To","From","RelatesTo") d = {namespaceURI:elements} typecodes = self._getWSAddressTypeCodes(**d) pyobjs = ps.ParseHeaderElements(typecodes) self._messageID = pyobjs[(namespaceURI,elements[0])] self._action = pyobjs[(namespaceURI,elements[1])] self._addressTo = pyobjs[(namespaceURI,elements[2])] self._from = pyobjs[(namespaceURI,elements[3])] self._relatesTo = pyobjs[(namespaceURI,elements[4])] # TODO: Remove MessageContainer. Hopefully the new functionality # makes this irrelevant. But could create an Interop problem. """ class MessageContainer: '''Automatically wraps all primitive types so attributes can be specified. ''' class IntHolder(int): pass class StrHolder(str): pass class UnicodeHolder(unicode): pass class LongHolder(long): pass class FloatHolder(float): pass class BoolHolder(int): pass #class TupleHolder(tuple): pass #class ListHolder(list): pass typecode = None pyclass_list = [IntHolder,StrHolder,UnicodeHolder,LongHolder, FloatHolder,BoolHolder,] def __setattr__(self, key, value): '''wrap all primitives with Holders if present. ''' if type(value) in _seqtypes: value = list(value) for indx in range(len(value)): try: item = self._wrap(value[indx]) except TypeError, ex: pass else: value[indx] = item elif type(value) is bool: value = BoolHolder(value) else: try: value = self._wrap(value) except TypeError, ex: pass self.__dict__[key] = value def _wrap(self, value): '''wrap primitive, return None ''' if value is None: return value for pyclass in self.pyclass_list: if issubclass(value.__class__, pyclass): break else: raise TypeError, 'MessageContainer does not know about type %s' %(type(value)) return pyclass(value) def setUp(self, typecode=None, pyclass=None): '''set up all attribute names (aname) in this python instance. If what is a ComplexType or a simpleType w/attributes instantiate a new MessageContainer, else set attribute aname to None. ''' if typecode is None: typecode = self.typecode else: self.typecode = typecode if not isinstance(typecode, TypeCode): raise TypeError, 'typecode must be a TypeCode class instance' if isinstance(typecode, ComplexType): if typecode.has_attributes() is True: setattr(self, typecode.attrs_aname, {}) if typecode.mixed is True: setattr(self, typecode.mixed_aname, None) for what in typecode.ofwhat: setattr(self, what.aname, None) if isinstance(what, ComplexType): setattr(self, what.aname, MessageContainer()) getattr(self, what.aname).setUp(typecode=what) else: raise TypeError, 'Primitive type' """ if __name__ == '__main__': print _copyright PKŒ¨58[­Á»%%ZSI/digest_auth.pyo;ò Z@Ec@s¼dZdklZdkZdkZdkZeieeiƒdƒƒd„Zd„Ze e d„Z d„Z e d„Z d e d „Z d „Zd „Zed jo eGHndS(s)Utilities for HTTP Digest Authentication (smd5Ni cCst|ƒiƒSdS(N(smd5svals hexdigest(sval((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pysH scCstd||fƒSdS(Ns%s:%s(sHssecretsdata(ssecretsdata((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pysKDscCs>|o|od|||||fSnd|||fSdS(Ns%s:%s:%s:%s:%ss%s:%s:%s(snoncescnoncesusernamesrealmspasswd(susernamesrealmspasswdsnoncescnonce((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pysA1scCsd||fSdS(Ns%s:%s(smethodsuri(smethodsuri((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pysA2scCs$|i|ƒo ||Sn|SdS(N(sdshas_keysksdefval(sdsksdefval((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pys dict_fetchs sGETcCs¡h} t|dƒ}t|dƒ}t|dƒ}t|dƒ}t|ddƒ}t|ddƒ} t|dƒ} d } | o&t t tid d ƒƒƒd }n|iƒd jot|| |||ƒ}nt|| |ƒ}t||ƒ}t |ƒ} d|| ||t |ƒf}d|| d _get_postvalue_from_absoluteURI.MAXLEN:cache.clear() cache[url] = path return path _get_postvalue_from_absoluteURI.cache = {} _get_postvalue_from_absoluteURI.MAXLEN = 20 ## ## Exception classes. class ZSIException(Exception): '''Base class for all ZSI exceptions. ''' pass class ParseException(ZSIException): '''Exception raised during parsing. ''' def __init__(self, str, inheader, elt=None, dom=None): Exception.__init__(self) self.str, self.inheader, self.trace = str, inheader, None if elt and dom: self.trace = _backtrace(elt, dom) def __str__(self): if self.trace: return self.str + '\n[Element trace: ' + self.trace + ']' return self.str def __repr__(self): return "<%s.ParseException %s>" % (__name__, _get_idstr(self)) class EvaluateException(ZSIException): '''Exception raised during data evaluation (serialization). ''' def __init__(self, str, trace=None): Exception.__init__(self) self.str, self.trace = str, trace def __str__(self): if self.trace: return self.str + '\n[Element trace: ' + self.trace + ']' return self.str def __repr__(self): return "<%s.EvaluateException %s>" % (__name__, _get_idstr(self)) class FaultException(ZSIException): '''Exception raised when a fault is received. ''' def __init__(self, fault): self.fault = fault def __str__(self): return str(self.fault) def __repr__(self): return "<%s.FaultException %s>" % (__name__, _get_idstr(self)) class WSActionException(ZSIException): '''Exception raised when WS-Address Action Header is incorrectly specified when received by client or server. ''' pass ## ## Importing the rest of ZSI. import version def Version(): return version.Version from writer import SoapWriter from parse import ParsedSoap from fault import Fault, \ FaultFromActor, FaultFromException, FaultFromFaultMessage, \ FaultFromNotUnderstood, FaultFromZSIException import TC TC.RegisterType(TC.String, minOccurs=0, nillable=False) TC.RegisterType(TC.URI, minOccurs=0, nillable=False) TC.RegisterType(TC.Base64String, minOccurs=0, nillable=False) TC.RegisterType(TC.HexBinaryString, minOccurs=0, nillable=False) #TC.RegisterType(TC.Integer) #TC.RegisterType(TC.Decimal) for pyclass in (TC.IunsignedByte, TC.IunsignedShort, TC.IunsignedInt, TC.IunsignedLong, TC.Ibyte, TC.Ishort, TC.Iint, TC.Ilong, TC.InegativeInteger, TC.InonPositiveInteger, TC.InonNegativeInteger, TC.IpositiveInteger, TC.Iinteger, TC.FPfloat, TC.FPdouble, ): TC.RegisterType(pyclass, minOccurs=0, nillable=False) TC.RegisterType(TC.Boolean, minOccurs=0, nillable=False) TC.RegisterType(TC.Duration, minOccurs=0, nillable=False) TC.RegisterType(TC.gDateTime, minOccurs=0, nillable=False) TC.RegisterType(TC.gDate, minOccurs=0, nillable=False) TC.RegisterType(TC.gYearMonth, minOccurs=0, nillable=False) TC.RegisterType(TC.gYear, minOccurs=0, nillable=False) TC.RegisterType(TC.gMonthDay, minOccurs=0, nillable=False) TC.RegisterType(TC.gDay, minOccurs=0, nillable=False) TC.RegisterType(TC.gTime, minOccurs=0, nillable=False) TC.RegisterType(TC.Apache.Map, minOccurs=0, nillable=False) ## ## Register Wrappers for builtin types. ## TC.AnyElement wraps builtins so element name information can be saved ## import schema for i in [int,float,str,tuple,list,unicode]: schema._GetPyobjWrapper.RegisterBuiltin(i) ## Load up Wrappers for builtin types schema.RegisterAnyElement() #try: # from ServiceProxy import * #except: # pass if __name__ == '__main__': print _copyright PKЍ58Ô›A°..ZSI/address.pyo;ò Z@Ec@s°dkZdkZdkZdklZlZlZdklZl Z l Z dk l Z l Z lZdklZdklZdefd„ƒYZedjo eGHndS( N(s _seqtypessEvaluateExceptionsWSActionException(s AnyElementsAnyTypesTypeCode(sGEDsGTDs_has_type_definition(s ComplexType(sWSA_LISTsAddresscBs§tZdZeeed„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zd„ZRS(sÎWS-Address Implemented is dependent on the default "wsdl2py" convention of generating aname, so the attributes representing element declaration names should be prefixed with an underscore. cCsV||_t|_||_t|_||_t|_ t|_ t|_ |i ƒdS(N( s wsAddressURIsselfsNones anonymousURIs addressTos _addressTos _messageIDsactions_actions_endPointReferences_replyTos _relatesTossetUp(sselfs addressTos wsAddressURIsaction((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys__init__s        cs¢t‡d†tƒ}d}x\|tD]G}ˆitj oˆi|ijpt |i|ƒt joPq&q&Wt d‚|iˆ_|i ˆ_ |i ˆ_dS(sLook for WS-Address cs|iˆijS(N(swsasADDRESSsselfs wsAddressURI(swsa(sself(s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys#ssEndpointReferenceTypes>enabling wsAddressing requires the inclusion of that namespaceN(sfiltersWSA_LISTstoplistseprsWSAsselfs wsAddressURIsNonesADDRESSs_has_type_definitionsTruesEvaluateExceptions ANONYMOUSs anonymousURIs_replyTo(sselfsWSAseprstoplist((sselfs/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pyssetUp s <    cCs[|tjo td‚n| otd|‚n||jotd||f‚ndS(stWS-Address Action action -- Action value expecting. value -- Action value server returned. s5User did not specify WSAddress Action value to expects&missing WSAddress Action, expecting %ss(wrong WSAddress Action(%s), expecting %sN(sactionsNonesWSActionExceptionsvalue(sselfsactionsvalue((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys _checkAction1s   cCsB|tjodSn|i}||ijoti|ƒ\} }} } }|i dƒ}ti|iƒ\} }} }}| | jo$| | jo| |jo ||jot|i dƒdg}|i dƒdg}|d|djo$ti|dƒti|dƒjodSq$ntd||if‚ndS(sŒWS-Address From, XXX currently not checking the hostname, not forwarding messages. pyobj -- From server returned. Ns:s80iis'wrong WS-Address From(%s), expecting %s(spyobjsNones_Addresssvaluesselfs _addressTosurlparsesurlsplitsschemesnetlocspathsquerysfragmentssplitshostportsschemeFsnetlocFspathFsqueryFs fragmentFssockets gethostbynamesWSActionException(sselfspyobjsqueryFsnetlocFshostportsfragmentsnetlocsvalues fragmentFspathFsschemeFsqueryspathsscheme((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys _checkFrom=s  !4< cCs.||ijotd||if‚ndS(s@WS-Address From value -- From server returned. s,wrong WS-Address RelatesTo(%s), expecting %sN(svaluesselfs _messageIDsWSActionException(sselfsvalue((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys_checkRelatesToQscCs.||ijotd||if‚ndS(sIWS-Address From value -- From server returned in wsa:To s*wrong WS-Address ReplyTo(%s), expecting %sN(svaluesselfs_replyTosWSActionException(sselfsvalue((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys _checkReplyToXscCs ||_dS(N(sactionsselfs_action(sselfsaction((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys setAction_scCs |iSdS(N(sselfs_action(sself((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys getActionbscCs |iSdS(N(sselfs _relatesTo(sself((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys getRelatesToescCs |iSdS(N(sselfs _messageID(sself((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys getMessageIDhscKs¢g}ylxe|iƒD]W\}}xH|D]@}t||ƒ}|tjot d|‚n|i |ƒq)WqWWn%t j o}t d|i‚nX|SdS(s@kw -- namespaceURI keys with sequence of element names. sMissing namespace, import "%s"s9To use ws-addressing register typecodes for namespace(%s)N(s typecodesskwsitemssnsuriselementsselsGEDstypecodesNonesWSActionExceptionsappendsEvaluateExceptionsexsselfs wsAddressURI(sselfskwselselementsstypecodesnsurisexs typecodes((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys_getWSAddressTypeCodesks  c Csß|i}h|dddddf<}|i|} |i| ƒ} | i |dfƒ}|i ||ƒ| i |dfƒ}|i|ƒ| i |dfƒ}|i|ƒ| i |dfƒ}|o|i|ƒndS(sL ps -- ParsedSoap action -- ws-action for response s MessageIDsActionsTosFroms RelatesToN(sselfs wsAddressURIs namespaceURIsds_getWSAddressTypeCodess typecodesspssParseHeaderElementsspyobjssgets got_actions _checkActionsactionsFroms _checkFroms RelatesTos_checkRelatesTosTos _checkReplyTo( sselfspssactionsTosFromsds got_actions RelatesTos namespaceURIs typecodesspyobjs((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys checkResponse~s   c Cs¶||_t|_g}|i} |i} dt i ƒ} |_ t | dƒ}|i|i| ƒƒt | dƒ}|i|i|ƒƒt | dƒ}|i|i| ƒƒt | dƒ}|iƒ}|i|_|i|ƒ|o¸t|dƒtjo td‚nt|it| dƒƒtjotd t| dƒ‚n|i}|ipg}x=|D]1}t|dƒ o td ‚n|i|ƒqjWnt|ƒ|_d S( sCall For Request suuid:%ss MessageIDsActionsTosFromstypecodes0endPointReference must have a typecode attributesEndpointReferenceTypes$endPointReference must be of type %ss2 element, instance missing typecode attributeN( sactionsselfs_actionsNones header_pyobjsspyobjss wsAddressURIs namespaceURIs _addressTos addressTostimes messageIDs _messageIDsGEDstypecodesappendspyclasssmihFroms anonymousURIs_AddresssendPointReferenceshasattrsFalsesEvaluateExceptions isinstancesGTDs_ReferencePropertiessReferencePropertiess_anysanysvstuple( sselfsendPointReferencesactionsmihFromspyobjsstypecodesvsReferencePropertiessanys namespaceURIs messageIDs addressTo((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys setRequest”s>           c Csí||_t|_g}|i}x‚|d|if|ddt i ƒf|d|i ƒf|d|i ffD]4\}} }t|| ƒ}|i|i|ƒƒqnWt|dƒ}|iƒ}|i|_|i|ƒt|ƒ|_dS(sxServer-side has to set these fields in response. address -- Address instance, representing a WS-Address sActions MessageIDsuuid:%ss RelatesTosTosFromN(slocalURLsselfsFromsNones header_pyobjsspyobjss wsAddressURIs namespaceURIs_actionstimesaddresss getMessageIDs anonymousURIsnsurisnamesvaluesGEDstypecodesappendspyclassspyobjs_Addressstuple( sselfsaddressslocalURLspyobjsstypecodesvalues namespaceURIsnsurispyobjsname((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pyssetResponseFromWSAddressÉs   M   cKsKxD|iD]9}t|dƒtjo td‚n|i||q WdS(sC sw -- SoapWriter instance, add WS-Address header. stypecodes0all header pyobjs must have a typecode attributeN( sselfs header_pyobjsspyobjshasattrsFalses RuntimeErrorsswsserialize_headerskw(sselfsswskwspyobj((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys serializeâs   cKsÂ|i}dddddf}h||<}|i|}|i|ƒ}|||df|_ |||df|_ |||df|_ |||d f|_ |||d f|_d S( s+ ps -- ParsedSoap instance s MessageIDsActionsTosFroms RelatesToiiiiiN(sselfs wsAddressURIs namespaceURIselementssds_getWSAddressTypeCodess typecodesspssParseHeaderElementsspyobjss _messageIDs_actions _addressTos_froms _relatesTo(sselfspsskwselementssds namespaceURIs typecodesspyobjs((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pysparseís (s__name__s __module__s__doc__sNones__init__ssetUps _checkActions _checkFroms_checkRelatesTos _checkReplyTos setActions getActions getRelatesTos getMessageIDs_getWSAddressTypeCodess checkResponses setRequestssetResponseFromWSAddresss serializesparse(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pysAddresss"            5  s__main__(stimesurlparsessocketsZSIs _seqtypessEvaluateExceptionsWSActionExceptionsTCs AnyElementsAnyTypesTypeCodesschemasGEDsGTDs_has_type_definitionsZSI.TCcompounds ComplexTypesZSI.wstools.NamespacessWSA_LISTsobjectsAddresss__name__s _copyright(s ComplexTypesGTDsEvaluateExceptions _seqtypessTypeCodes_has_type_definitionsWSActionExceptionsGEDsurlparsesWSA_LISTstimesAddresssAnyTypes AnyElementssocket((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/address.pys?s  ÿ; PK/¤Y5¥ÏC¤%% ZSI/writer.py#! /usr/bin/env python # $Id: writer.py 1270 2006-10-19 22:31:07Z boverhof $ '''SOAP message serialization. ''' from ZSI import _copyright, _get_idstr, ZSI_SCHEMA_URI from ZSI import _backtrace, _stringtypes, _seqtypes from ZSI.wstools.Utility import MessageInterface, ElementProxy from ZSI.wstools.Namespaces import XMLNS, SOAP, SCHEMA from ZSI.wstools.c14n import Canonicalize import types _standard_ns = [ ('xml', XMLNS.XML), ('xmlns', XMLNS.BASE) ] _reserved_ns = { 'SOAP-ENV': SOAP.ENV, 'SOAP-ENC': SOAP.ENC, 'ZSI': ZSI_SCHEMA_URI, 'xsd': SCHEMA.BASE, 'xsi': SCHEMA.BASE + '-instance', } class SoapWriter: '''SOAP output formatter. Instance Data: memo -- memory for id/href envelope -- add Envelope? encodingStyle -- header -- add SOAP Header? outputclass -- ElementProxy class. ''' def __init__(self, envelope=True, encodingStyle=None, header=True, nsdict={}, outputclass=None, **kw): '''Initialize. ''' outputclass = outputclass or ElementProxy if not issubclass(outputclass, MessageInterface): raise TypeError, 'outputclass must subclass MessageInterface' self.dom, self.memo, self.nsdict= \ outputclass(self), [], nsdict self.envelope = envelope self.encodingStyle = encodingStyle self.header = header self.body = None self.callbacks = [] self.closed = False def __str__(self): self.close() return str(self.dom) def getSOAPHeader(self): if self.header in (True, False): return None return self.header def serialize_header(self, pyobj, typecode=None, **kw): '''Serialize a Python object in SOAP-ENV:Header, make sure everything in Header unique (no #href). Must call serialize first to create a document. Parameters: pyobjs -- instances to serialize in SOAP Header typecode -- default typecode ''' kw['unique'] = True soap_env = _reserved_ns['SOAP-ENV'] #header = self.dom.getElement(soap_env, 'Header') header = self._header if header is None: header = self._header = self.dom.createAppendElement(soap_env, 'Header') typecode = getattr(pyobj, 'typecode', typecode) if typecode is None: raise RuntimeError( 'typecode is required to serialize pyobj in header') helt = typecode.serialize(header, self, pyobj, **kw) def serialize(self, pyobj, typecode=None, root=None, header_pyobjs=(), **kw): '''Serialize a Python object to the output stream. pyobj -- python instance to serialize in body. typecode -- typecode describing body root -- SOAP-ENC:root header_pyobjs -- list of pyobj for soap header inclusion, each instance must specify the typecode attribute. ''' self.body = None if self.envelope: soap_env = _reserved_ns['SOAP-ENV'] self.dom.createDocument(soap_env, 'Envelope') for prefix, nsuri in _reserved_ns.items(): self.dom.setNamespaceAttribute(prefix, nsuri) self.writeNSdict(self.nsdict) if self.encodingStyle: self.dom.setAttributeNS(soap_env, 'encodingStyle', self.encodingStyle) if self.header: self._header = self.dom.createAppendElement(soap_env, 'Header') for h in header_pyobjs: self.serialize_header(h, **kw) self.body = self.dom.createAppendElement(soap_env, 'Body') else: self.dom.createDocument(None,None) if typecode is None: typecode = pyobj.__class__.typecode kw = kw.copy() if self.body is None: elt = typecode.serialize(self.dom, self, pyobj, **kw) else: elt = typecode.serialize(self.body, self, pyobj, **kw) if root is not None: if root not in [ 0, 1 ]: raise ValueError, "SOAP-ENC root attribute not in [0,1]" elt.setAttributeNS(SOAP.ENC, 'root', root) return self def writeNSdict(self, nsdict): '''Write a namespace dictionary, taking care to not clobber the standard (or reserved by us) prefixes. ''' for k,v in nsdict.items(): if (k,v) in _standard_ns: continue rv = _reserved_ns.get(k) if rv: if rv != v: raise KeyError("Reserved namespace " + str((k,v)) + " used") continue if k: self.dom.setNamespaceAttribute(k, v) else: self.dom.setNamespaceAttribute('xmlns', v) def ReservedNS(self, prefix, uri): '''Is this namespace (prefix,uri) reserved by us? ''' return _reserved_ns.get(prefix, uri) != uri def AddCallback(self, func, *arglist): '''Add a callback function and argument list to be invoked before closing off the SOAP Body. ''' self.callbacks.append((func, arglist)) def Known(self, obj): '''Seen this object (known by its id()? Return 1 if so, otherwise add it to our memory and return 0. ''' obj = _get_idstr(obj) if obj in self.memo: return 1 self.memo.append(obj) return 0 def Forget(self, obj): '''Forget we've seen this object. ''' obj = _get_idstr(obj) try: self.memo.remove(obj) except ValueError: pass def Backtrace(self, elt): '''Return a human-readable "backtrace" from the document root to the specified element. ''' return _backtrace(elt._getNode(), self.dom._getNode()) def close(self): '''Invoke all the callbacks, and close off the SOAP message. ''' if self.closed: return for func,arglist in self.callbacks: apply(func, arglist) self.closed = True def __del__(self): if not self.closed: self.close() if __name__ == '__main__': print _copyright PKŒ¨58_ u¥3¥3ZSI/dispatch.pyo;ò Z@Ec@sodZdkZdkZdkZdklZlZdkTdklZl Z l Z l Z l Z l Z dklZlZlZead„Zd„Zheeeed„Zd d „Zd „Zd „Zd d „Zd d„Zd„Zdefd„ƒYZdeeheedd„Zheeed„Z eed„Z!eed„Z"e#djo e GHndS(sSimple CGI dispatching. N(sBaseHTTPRequestHandlers HTTPServer(s*(s_child_elementss _copyrights _seqtypess_find_arraytypes _find_types resolvers(s_auth_tcsAUTHs ClientBindingcCstSdS(s&Return the client binding object. N(s_client_binding(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/dispatch.pysGetClientBindingscCst|t|iƒƒiS(N(sgetattrsmodsstrses localNamestypecode(smodse((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/dispatch.pyssc Ksy¤t|iiƒ}|tjotidf}ngi}|D]-} t | |ƒo|t | |ƒƒqDqD~}t|ƒdjotd|ƒ‚ngi}|D]!}t|ƒo||ƒq¯q¯~}t|ƒdjotd|ƒ‚nt|ƒdjotd| ƒ‚n|d}t|ƒa|o/||iƒ} tiddd|d ƒ}nþ| o÷y|||iƒ}Wntj otiƒ}nXy|i|i|ƒ} Wn,t!j o }|t$|ƒ| d SnXy|| Œ} Wn(tj o}|t$|ƒ| nXy | i&}Wqqt'j o}|t$|ƒ| qqXnÿ|tj oLh}xžt)|iƒD]}y|||ƒ}Wntj otiƒ}nXy#|i||ƒ|t|iƒ 0 class SimpleType(TypeCode): '''SimpleType -- consist exclusively of a tag, attributes, and a value class attributes: empty_content -- value representing an empty element. ''' empty_content = None logger = _GetLogger('ZSI.TC.SimpleType') def parse(self, elt, ps): self.checkname(elt, ps) if len(_children(elt)) == 0: href = _find_href(elt) if not href: if self.nilled(elt, ps) is False: # No content, no HREF, not NIL: empty string return self.text_to_data(self.empty_content, elt, ps) # No content, no HREF, and is NIL... if self.nillable is True: return Nilled raise EvaluateException('Requiredstring missing', ps.Backtrace(elt)) if href[0] != '#': return ps.ResolveHREF(href, self) elt = ps.FindLocalHREF(href, elt) self.checktype(elt, ps) if self.nilled(elt, ps): return Nilled if len(_children(elt)) == 0: v = self.empty_content else: v = self.simple_value(elt, ps) else: v = self.simple_value(elt, ps) pyobj = self.text_to_data(v, elt, ps) # parse all attributes contained in attribute_typecode_dict # (user-defined attributes), the values (if not None) will # be keyed in self.attributes dictionary. if self.attribute_typecode_dict is not None: attributes = self.parse_attributes(elt, ps) if attributes: setattr(pyobj, self.attrs_aname, attributes) return pyobj def get_formatted_content(self, pyobj): raise NotImplementedError, 'method get_formatted_content is not implemented' def serialize_text_node(self, elt, sw, pyobj): '''Serialize without an element node. ''' textNode = None if pyobj is not None: text = self.get_formatted_content(pyobj) if type(text) not in _stringtypes: raise TypeError, 'pyobj must be a formatted string' textNode = elt.createAppendTextNode(text) return textNode def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw): '''Handles the start and end tags, and attributes. callout to get_formatted_content to get the textNode value. Parameters: elt -- ElementProxy/DOM element sw -- SoapWriter instance pyobj -- processed content KeyWord Parameters: name -- substitute name, (nspname,name) or name orig -- ''' objid = _get_idstr(pyobj) ns,n = self.get_name(name, objid) # nillable el = elt.createAppendElement(ns, n) if self.nillable is True and pyobj is Nilled: self.serialize_as_nil(el) return None # other attributes self.set_attributes(el, pyobj) # soap href attribute unique = self.unique or kw.get('unique', False) if unique is False and sw.Known(orig or pyobj): self.set_attribute_href(el, objid) return None # xsi:type attribute if kw.get('typed', self.typed) is True: self.set_attribute_xsi_type(el, **kw) # soap id attribute if self.unique is False: self.set_attribute_id(el, objid) #Content, c self.serialize_text_node(el, sw, pyobj) return el class Any(TypeCode): '''When the type isn't defined in the schema, but must be specified in the incoming operation. parsemap -- a type to class mapping (updated by descendants), for parsing serialmap -- same, for (outgoing) serialization ''' logger = _GetLogger('ZSI.TC.Any') parsemap, serialmap = {}, {} def __init__(self, pname=None, aslist=False, minOccurs=0, **kw): TypeCode.__init__(self, pname, minOccurs=minOccurs, **kw) self.aslist = aslist self.kwargs = {'aslist':aslist} self.kwargs.update(kw) self.unique = False # input arg v should be a list of tuples (name, value). def listify(self, v): if self.aslist: return [ k for j,k in v ] return dict(v) def parse_into_dict_or_list(self, elt, ps): c = _child_elements(elt) count = len(c) v = [] if count == 0: href = _find_href(elt) if not href: return v elt = ps.FindLocalHREF(href, elt) self.checktype(elt, ps) c = _child_elements(elt) count = len(c) if count == 0: return self.listify(v) if self.nilled(elt, ps): return Nilled for c_elt in c: v.append((str(c_elt.localName), self.__class__(**self.kwargs).parse(c_elt, ps))) return self.listify(v) def parse(self, elt, ps): (ns,type) = self.checkname(elt, ps) if not type and self.nilled(elt, ps): return Nilled if len(_children(elt)) == 0: href = _find_href(elt) if not href: if self.minOccurs < 1: if _is_xsd_or_soap_ns(ns): parser = Any.parsemap.get((None,type)) if parser: return parser.parse(elt, ps) if ((ns,type) == (SOAP.ENC,'Array') or (_find_arraytype(elt) or '').endswith('[0]')): return [] return None raise EvaluateException('Required Any missing', ps.Backtrace(elt)) elt = ps.FindLocalHREF(href, elt) (ns,type) = self.checktype(elt, ps) if not type and elt.namespaceURI == SOAP.ENC: ns,type = SOAP.ENC, elt.localName if not type or (ns,type) == (SOAP.ENC,'Array'): if self.aslist or _find_arraytype(elt): return [ self.__class__(**self.kwargs).parse(e, ps) for e in _child_elements(elt) ] if len(_child_elements(elt)) == 0: raise EvaluateException("Any cannot parse untyped element", ps.Backtrace(elt)) return self.parse_into_dict_or_list(elt, ps) parser = Any.parsemap.get((ns,type)) if not parser and _is_xsd_or_soap_ns(ns): parser = Any.parsemap.get((None,type)) if not parser: raise EvaluateException('''Any can't parse element''', ps.Backtrace(elt)) return parser.parse(elt, ps) def get_formatted_content(self, pyobj): tc = type(pyobj) if tc == types.InstanceType: tc = pyobj.__class__ if hasattr(pyobj, 'typecode'): #serializer = pyobj.typecode.serialmap.get(tc) serializer = pyobj.typecode else: serializer = Any.serialmap.get(tc) if not serializer: tc = (types.ClassType, pyobj.__class__.__name__) serializer = Any.serialmap.get(tc) else: serializer = Any.serialmap.get(tc) if not serializer and isinstance(pyobj, time.struct_time): from ZSI.TCtimes import gDateTime serializer = gDateTime() if serializer: return serializer.get_formatted_content(pyobj) raise EvaluateException, 'Failed to find serializer for pyobj %s' %pyobj def serialize(self, elt, sw, pyobj, name=None, **kw): if hasattr(pyobj, 'typecode') and pyobj.typecode is not self: pyobj.typecode.serialize(elt, sw, pyobj, **kw) return objid = _get_idstr(pyobj) ns,n = self.get_name(name, objid) kw.setdefault('typed', self.typed) tc = type(pyobj) self.logger.debug('Any serialize -- %s', tc) if tc in _seqtypes: if self.aslist: array = elt.createAppendElement(ns, n) array.setAttributeType(SOAP.ENC, "Array") array.setAttributeNS(self.nspname, 'SOAP-ENC:arrayType', "xsd:anyType[" + str(len(pyobj)) + "]" ) for o in pyobj: #TODO maybe this should take **self.kwargs... serializer = getattr(o, 'typecode', self.__class__()) # also used by _AnyLax() serializer.serialize(array, sw, o, name='element', **kw) else: struct = elt.createAppendElement(ns, n) for o in pyobj: #TODO maybe this should take **self.kwargs... serializer = getattr(o, 'typecode', self.__class__()) # also used by _AnyLax() serializer.serialize(struct, sw, o, **kw) return kw['name'] = (ns,n) if tc == types.DictType: el = elt.createAppendElement(ns, n) parentNspname = self.nspname # temporarily clear nspname for dict elements self.nspname = None for o,m in pyobj.items(): if type(o) != types.StringType and type(o) != types.UnicodeType: raise Exception, 'Dictionary implementation requires keys to be of type string (or unicode).' %pyobj kw['name'] = o kw.setdefault('typed', True) self.serialize(el, sw, m, **kw) # restore nspname self.nspname = parentNspname return if tc == types.InstanceType: tc = pyobj.__class__ if hasattr(pyobj, 'typecode'): #serializer = pyobj.typecode.serialmap.get(tc) serializer = pyobj.typecode else: serializer = Any.serialmap.get(tc) if not serializer: tc = (types.ClassType, pyobj.__class__.__name__) serializer = Any.serialmap.get(tc) else: serializer = Any.serialmap.get(tc) if not serializer and isinstance(pyobj, time.struct_time): from ZSI.TCtimes import gDateTime serializer = gDateTime() if not serializer: # Last-chance; serialize instances as dictionary if pyobj is None: self.serialize_as_nil(elt.createAppendElement(ns, n)) elif type(pyobj) != types.InstanceType: raise EvaluateException('''Any can't serialize ''' + \ repr(pyobj)) else: self.serialize(elt, sw, pyobj.__dict__, **kw) else: # Try to make the element name self-describing tag = getattr(serializer, 'tag', None) if self.pname is not None: #serializer.nspname = self.nspname #serializer.pname = self.pname if "typed" not in kw: kw['typed'] = False elif tag: if tag.find(':') == -1: tag = 'SOAP-ENC:' + tag kw['name'] = tag kw['typed'] = False serializer.unique = self.unique serializer.serialize(elt, sw, pyobj, **kw) # Reset TypeCode #serializer.nspname = None #serializer.pname = None class String(SimpleType): '''A string type. ''' empty_content = '' parselist = [ (None,'string') ] seriallist = [ types.StringType, types.UnicodeType ] type = (SCHEMA.XSD3, 'string') logger = _GetLogger('ZSI.TC.String') def __init__(self, pname=None, strip=True, **kw): TypeCode.__init__(self, pname, **kw) if kw.has_key('resolver'): self.resolver = kw['resolver'] self.strip = strip def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' if self.strip: text = text.strip() if self.pyclass is not None: return self.pyclass(text) return text def get_formatted_content(self, pyobj): if type(pyobj) not in _stringtypes: pyobj = str(pyobj) if type(pyobj) == types.UnicodeType: pyobj = pyobj.encode('utf-8') return pyobj class URI(String): '''A URI. ''' parselist = [ (None,'anyURI'),(SCHEMA.XSD3, 'anyURI')] type = (SCHEMA.XSD3, 'anyURI') logger = _GetLogger('ZSI.TC.URI') def text_to_data(self, text, elt, ps): '''text --> typecode specific data. ''' val = String.text_to_data(self, text, elt, ps) return urldecode(val) def get_formatted_content(self, pyobj): '''typecode data --> text ''' pyobj = String.get_formatted_content(self, pyobj) return urlencode(pyobj) class QName(String): '''A QName type ''' parselist = [ (None,'QName') ] type = (SCHEMA.XSD3, 'QName') logger = _GetLogger('ZSI.TC.QName') def __init__(self, pname=None, strip=1, **kw): String.__init__(self, pname, strip, **kw) self.prefix = None def get_formatted_content(self, pyobj): value = pyobj if isinstance(pyobj, tuple): namespaceURI,localName = pyobj if self.prefix is not None: value = "%s:%s" %(self.prefix,localName) return String.get_formatted_content(self, value) def set_prefix(self, elt, pyobj): '''use this method to set the prefix of the QName, method looks in DOM to find prefix or set new prefix. This method must be called before get_formatted_content. ''' if isinstance(pyobj, tuple): namespaceURI,localName = pyobj self.prefix = elt.getPrefix(namespaceURI) def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' prefix,localName = SplitQName(text) nsdict = ps.GetElementNSdict(elt) try: namespaceURI = nsdict[prefix] except KeyError, ex: raise EvaluateException('cannot resolve prefix(%s)'%prefix, ps.Backtrace(elt)) v = (namespaceURI,localName) if self.pyclass is not None: return self.pyclass(v) return v def serialize_text_node(self, elt, sw, pyobj): '''Serialize without an element node. ''' self.set_prefix(elt, pyobj) return String.serialize_text_node(self, elt, sw, pyobj) class Token(String): '''an xsd:token type ''' parselist = [ (None, 'token') ] type = (SCHEMA.XSD3, 'token') logger = _GetLogger('ZSI.TC.Token') class Base64String(String): '''A Base64 encoded string. ''' parselist = [ (None,'base64Binary'), (SOAP.ENC, 'base64') ] type = (SOAP.ENC, 'base64') logger = _GetLogger('ZSI.TC.Base64String') def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' val = b64decode(text.replace(' ', '').replace('\n','').replace('\r','')) if self.pyclass is not None: return self.pyclass(val) return val def get_formatted_content(self, pyobj): pyobj = '\n' + b64encode(pyobj) return String.get_formatted_content(self, pyobj) class Base64Binary(String): parselist = [ (None,'base64Binary'), ] type = (SCHEMA.XSD3, 'base64Binary') logger = _GetLogger('ZSI.TC.Base64Binary') def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' val = b64decode(text) if self.pyclass is not None: return self.pyclass(val) return val def get_formatted_content(self, pyobj): pyobj = b64encode(pyobj).strip() return pyobj class HexBinaryString(String): '''Hex-encoded binary (yuk). ''' parselist = [ (None,'hexBinary') ] type = (SCHEMA.XSD3, 'hexBinary') logger = _GetLogger('ZSI.TC.HexBinaryString') def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' val = hexdecode(text) if self.pyclass is not None: return self.pyclass(val) return val def get_formatted_content(self, pyobj): pyobj = hexencode(pyobj).upper() return String.get_formatted_content(self, pyobj) class XMLString(String): '''A string that represents an XML document ''' logger = _GetLogger('ZSI.TC.XMLString') def __init__(self, pname=None, readerclass=None, **kw): String.__init__(self, pname, **kw) self.readerclass = readerclass def parse(self, elt, ps): if not self.readerclass: from xml.dom.ext.reader import PyExpat self.readerclass = PyExpat.Reader v = String.parse(self, elt, ps) return self.readerclass().fromString(v) def get_formatted_content(self, pyobj): pyobj = Canonicalize(pyobj) return String.get_formatted_content(self, pyobj) class Enumeration(String): '''A string type, limited to a set of choices. ''' logger = _GetLogger('ZSI.TC.Enumeration') def __init__(self, choices, pname=None, **kw): String.__init__(self, pname, **kw) t = type(choices) if t in _seqtypes: self.choices = tuple(choices) elif TypeCode.typechecks: raise TypeError( 'Enumeration choices must be list or sequence, not ' + str(t)) if TypeCode.typechecks: for c in self.choices: if type(c) not in _stringtypes: raise TypeError( 'Enumeration choice ' + str(c) + ' is not a string') def parse(self, elt, ps): val = String.parse(self, elt, ps) if val not in self.choices: raise EvaluateException('Value not in enumeration list', ps.Backtrace(elt)) return val def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw): if pyobj not in self.choices: raise EvaluateException('Value not in enumeration list', ps.Backtrace(elt)) String.serialize(self, elt, sw, pyobj, name=name, orig=orig, **kw) # This is outside the Integer class purely for code esthetics. _ignored = [] class Integer(SimpleType): '''Common handling for all integers. ''' ranges = { 'unsignedByte': (0, 255), 'unsignedShort': (0, 65535), 'unsignedInt': (0, 4294967295L), 'unsignedLong': (0, 18446744073709551615L), 'byte': (-128, 127), 'short': (-32768, 32767), 'int': (-2147483648L, 2147483647), 'long': (-9223372036854775808L, 9223372036854775807L), 'negativeInteger': (_ignored, -1), 'nonPositiveInteger': (_ignored, 0), 'nonNegativeInteger': (0, _ignored), 'positiveInteger': (1, _ignored), 'integer': (_ignored, _ignored) } parselist = [ (None,k) for k in ranges.keys() ] seriallist = [ types.IntType, types.LongType ] logger = _GetLogger('ZSI.TC.Integer') def __init__(self, pname=None, format='%d', **kw): TypeCode.__init__(self, pname, **kw) self.format = format def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' if self.pyclass is not None: v = self.pyclass(text) else: try: v = int(text) except: try: v = long(text) except: raise EvaluateException('Unparseable integer', ps.Backtrace(elt)) return v def parse(self, elt, ps): (ns,type) = self.checkname(elt, ps) if self.nilled(elt, ps): return Nilled elt = self.SimpleHREF(elt, ps, 'integer') if not elt: return None if type is None: type = self.type[1] elif self.type[1] is not None and type != self.type[1]: raise EvaluateException('Integer type mismatch; ' \ 'got %s wanted %s' % (type,self.type[1]), ps.Backtrace(elt)) v = self.simple_value(elt, ps) v = self.text_to_data(v, elt, ps) (rmin, rmax) = Integer.ranges.get(type, (_ignored, _ignored)) if rmin != _ignored and v < rmin: raise EvaluateException('Underflow, less than ' + repr(rmin), ps.Backtrace(elt)) if rmax != _ignored and v > rmax: raise EvaluateException('Overflow, greater than ' + repr(rmax), ps.Backtrace(elt)) return v def get_formatted_content(self, pyobj): return self.format %pyobj # See credits, below. def _make_inf(): x = 2.0 x2 = x * x i = 0 while i < 100 and x != x2: x = x2 x2 = x * x i = i + 1 if x != x2: raise ValueError("This machine's floats go on forever!") return x # This is outside the Decimal class purely for code esthetics. _magicnums = { } try: _magicnums['INF'] = float('INF') _magicnums['-INF'] = float('-INF') except: _magicnums['INF'] = _make_inf() _magicnums['-INF'] = -_magicnums['INF'] # The following comment and code was written by Tim Peters in # article <001401be92d2$09dcb800$5fa02299@tim> in comp.lang.python, # also available at the following URL: # http://groups.google.com/groups?selm=001401be92d2%2409dcb800%245fa02299%40tim # Thanks, Tim! # NaN-testing. # # The usual method (x != x) doesn't work. # Python forces all comparisons thru a 3-outcome cmp protocol; unordered # isn't a possible outcome. The float cmp outcome is essentially defined # by this C expression (combining some cross-module implementation # details, and where px and py are pointers to C double): # px == py ? 0 : *px < *py ? -1 : *px > *py ? 1 : 0 # Comparing x to itself thus always yields 0 by the first clause, and so # x != x is never true. # If px and py point to distinct NaN objects, a strange thing happens: # 1. On scrupulous 754 implementations, *px < *py returns false, and so # does *px > *py. Python therefore returns 0, i.e. "equal"! # 2. On Pentium HW, an unordered outcome sets an otherwise-impossible # combination of condition codes, including both the "less than" and # "equal to" flags. Microsoft C generates naive code that accepts # the "less than" flag at face value, and so the *px < *py clause # returns true, and Python returns -1, i.e. "not equal". # So with a proper C 754 implementation Python returns the wrong result, # and under MS's improper 754 implementation Python yields the right # result -- both by accident. It's unclear who should be shot . # # Anyway, the point of all that was to convince you it's tricky getting # the right answer in a portable way! def isnan(x): """x -> true iff x is a NaN.""" # multiply by 1.0 to create a distinct object (x < x *always* # false in Python, due to object identity forcing equality) if x * 1.0 < x: # it's a NaN and this is MS C on a Pentium return 1 # Else it's non-NaN, or NaN on a non-MS+Pentium combo. # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true, # so we return false. If it is NaN, then assuming a good 754 C # implementation Python maps both unordered outcomes to true. return 1.0 == x and x == 2.0 class Decimal(SimpleType): '''Parent class for floating-point numbers. ''' parselist = [ (None,'decimal'), (None,'float'), (None,'double') ] seriallist = _floattypes type = None ranges = { 'float': ( 7.0064923216240861E-46, -3.4028234663852886E+38, 3.4028234663852886E+38 ), 'double': ( 2.4703282292062327E-324, -1.7976931348623158E+308, 1.7976931348623157E+308), } zeropat = re.compile('[1-9]') logger = _GetLogger('ZSI.TC.Decimal') def __init__(self, pname=None, format='%f', **kw): TypeCode.__init__(self, pname, **kw) self.format = format def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' v = text if self.pyclass is not None: return self.pyclass(v) m = _magicnums.get(v) if m: return m try: return float(v) except: raise EvaluateException('Unparseable floating point number', ps.Backtrace(elt)) def parse(self, elt, ps): (ns,type) = self.checkname(elt, ps) elt = self.SimpleHREF(elt, ps, 'floating-point') if not elt: return None tag = getattr(self.__class__, 'type') if tag: if type is None: type = tag elif tag != (ns,type): raise EvaluateException('Floating point type mismatch; ' \ 'got (%s,%s) wanted %s' % (ns,type,tag), ps.Backtrace(elt)) # Special value? if self.nilled(elt, ps): return Nilled v = self.simple_value(elt, ps) try: fp = self.text_to_data(v, elt, ps) except EvaluateException, ex: ex.args.append(ps.Backtrace(elt)) raise ex m = _magicnums.get(v) if m: return m if str(fp).lower() in [ 'inf', '-inf', 'nan', '-nan' ]: raise EvaluateException('Floating point number parsed as "' + \ str(fp) + '"', ps.Backtrace(elt)) if fp == 0 and Decimal.zeropat.search(v): raise EvaluateException('Floating point number parsed as zero', ps.Backtrace(elt)) (rtiny, rneg, rpos) = Decimal.ranges.get(type, (None, None, None)) if rneg and fp < 0 and fp < rneg: raise EvaluateException('Negative underflow', ps.Backtrace(elt)) if rtiny and fp > 0 and fp < rtiny: raise EvaluateException('Positive underflow', ps.Backtrace(elt)) if rpos and fp > 0 and fp > rpos: raise EvaluateException('Overflow', ps.Backtrace(elt)) return fp def get_formatted_content(self, pyobj): if pyobj == _magicnums['INF']: return 'INF' elif pyobj == _magicnums['-INF']: return '-INF' elif isnan(pyobj): return 'NaN' else: return self.format %pyobj class Boolean(SimpleType): '''A boolean. ''' parselist = [ (None,'boolean') ] seriallist = [ bool ] type = (SCHEMA.XSD3, 'boolean') logger = _GetLogger('ZSI.TC.Boolean') def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' v = text if v == 'false': if self.pyclass is None: return False return self.pyclass(False) if v == 'true': if self.pyclass is None: return True return self.pyclass(True) try: v = int(v) except: try: v = long(v) except: raise EvaluateException('Unparseable boolean', ps.Backtrace(elt)) if v: if self.pyclass is None: return True return self.pyclass(True) if self.pyclass is None: return False return self.pyclass(False) def parse(self, elt, ps): self.checkname(elt, ps) elt = self.SimpleHREF(elt, ps, 'boolean') if not elt: return None if self.nilled(elt, ps): return Nilled v = self.simple_value(elt, ps).lower() return self.text_to_data(v, elt, ps) def get_formatted_content(self, pyobj): if pyobj: return 'true' return 'false' #XXX NOT FIXED YET class XML(TypeCode): '''Opaque XML which shouldn't be parsed. comments -- preserve comments inline -- don't href/id when serializing resolver -- object to resolve href's wrapped -- put a wrapper element around it ''' # Clone returned data? copyit = 0 logger = _GetLogger('ZSI.TC.XML') def __init__(self, pname=None, comments=0, inline=0, wrapped=True, **kw): TypeCode.__init__(self, pname, **kw) self.comments = comments self.inline = inline if kw.has_key('resolver'): self.resolver = kw['resolver'] self.wrapped = wrapped self.copyit = kw.get('copyit', XML.copyit) def parse(self, elt, ps): if self.wrapped is False: return elt c = _child_elements(elt) if not c: href = _find_href(elt) if not href: if self.minOccurs == 0: return None raise EvaluateException('Embedded XML document missing', ps.Backtrace(elt)) if href[0] != '#': return ps.ResolveHREF(href, self) elt = ps.FindLocalHREF(href, elt) c = _child_elements(elt) if _find_encstyle(elt) != "": #raise EvaluateException('Embedded XML has unknown encodingStyle', # ps.Backtrace(elt) pass if len(c) != 1: raise EvaluateException('Embedded XML has more than one child', ps.Backtrace(elt)) if self.copyit: return c[0].cloneNode(1) return c[0] def serialize(self, elt, sw, pyobj, name=None, unsuppressedPrefixes=[], **kw): if self.wrapped is False: Canonicalize(pyobj, sw, unsuppressedPrefixes=unsuppressedPrefixes, comments=self.comments) return objid = _get_idstr(pyobj) ns,n = self.get_name(name, objid) xmlelt = elt.createAppendElement(ns, n) if type(pyobj) in _stringtypes: self.set_attributes(xmlelt, pyobj) self.set_attribute_href(xmlelt, objid) elif kw.get('inline', self.inline): self.cb(xmlelt, sw, pyobj, unsuppressedPrefixes) else: self.set_attributes(xmlelt, pyobj) self.set_attribute_href(xmlelt, objid) sw.AddCallback(self.cb, pyobj, unsuppressedPrefixes) def cb(self, elt, sw, pyobj, unsuppressedPrefixes=[]): if sw.Known(pyobj): return objid = _get_idstr(pyobj) ns,n = self.get_name(name, objid) xmlelt = elt.createAppendElement(ns, n) self.set_attribute_id(xmlelt, objid) xmlelt.setAttributeNS(SOAP.ENC, 'encodingStyle', '""') Canonicalize(pyobj, sw, unsuppressedPrefixes=unsuppressedPrefixes, comments=self.comments) class AnyType(TypeCode): """XML Schema xsi:anyType type definition wildCard. class variables: all -- specifies use of all namespaces. other -- specifies use of other namespaces type -- """ all = '#all' other = '#other' type = (SCHEMA.XSD3, 'anyType') logger = _GetLogger('ZSI.TC.AnyType') def __init__(self, pname=None, namespaces=['#all'], minOccurs=1, maxOccurs=1, strip=1, **kw): TypeCode.__init__(self, pname=pname, minOccurs=minOccurs, maxOccurs=maxOccurs, **kw) self.namespaces = namespaces def get_formatted_content(self, pyobj): # TODO: not sure this makes sense, # parse side will be clueless, but oh well.. what = getattr(pyobj, 'typecode', Any()) return what.get_formatted_content(pyobj) def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. Used only with attributes so will not know anything about this content so why guess? Parameters: text -- text content elt -- the DOM element being parsed ps -- the ParsedSoap object. ''' return text def serialize(self, elt, sw, pyobj, **kw): nsuri,typeName = _get_xsitype(pyobj) if self.all not in self.namespaces and nsuri not in self.namespaces: raise EvaluateException( ' unsupported use of namespaces "%s"' %self.namespaces) what = getattr(pyobj, 'typecode', None) if what is None: # TODO: resolve this, "strict" processing but no # concrete schema makes little sense. #what = _AnyStrict(pname=(self.nspname,self.pname)) what = Any(pname=(self.nspname,self.pname), unique=True, aslist=False) kw['typed'] = True what.serialize(elt, sw, pyobj, **kw) return # Namespace if element AnyType was namespaced. what.serialize(elt, sw, pyobj, name=(self.nspname or what.nspname, self.pname or what.pname), **kw) def parse(self, elt, ps): #element name must be declared .. nspname,pname = _get_element_nsuri_name(elt) if nspname != self.nspname or pname != self.pname: raise EvaluateException(' instance is (%s,%s) found (%s,%s)' %( self.nspname,self.pname,nspname,pname), ps.Backtrace(elt)) #locate xsi:type prefix, typeName = SplitQName(_find_type(elt)) namespaceURI = _resolve_prefix(elt, prefix) pyclass = GTD(namespaceURI, typeName) if not pyclass: if _is_xsd_or_soap_ns(namespaceURI): pyclass = _AnyStrict elif (str(namespaceURI).lower()==str(Apache.Map.type[0]).lower())\ and (str(typeName).lower() ==str(Apache.Map.type[1]).lower()): pyclass = Apache.Map else: # Unknown type, so parse into a dictionary pyobj = Any().parse_into_dict_or_list(elt, ps) return pyobj what = pyclass(pname=(self.nspname,self.pname)) pyobj = what.parse(elt, ps) return pyobj class AnyElement(AnyType): """XML Schema xsi:any element declaration wildCard. class variables: tag -- global element declaration """ tag = (SCHEMA.XSD3, 'any') logger = _GetLogger('ZSI.TC.AnyElement') def __init__(self, namespaces=['#all'],pname=None, minOccurs=1, maxOccurs=1, strip=1, processContents='strict', **kw): if processContents not in ('lax', 'skip', 'strict'): raise ValueError('processContents(%s) must be lax, skip, or strict') self.processContents = processContents AnyType.__init__(self, namespaces=namespaces,pname=pname, minOccurs=minOccurs, maxOccurs=maxOccurs, strip=strip, **kw) def serialize(self, elt, sw, pyobj, **kw): '''Must provice typecode to AnyElement for serialization, else try to use TC.Any to serialize instance which will serialize based on the data type of pyobj w/o reference to XML schema instance. ''' if isinstance(pyobj, TypeCode): raise TypeError, 'pyobj is a typecode instance.' what = getattr(pyobj, 'typecode', None) if what is not None and type(pyobj) is types.InstanceType: tc = pyobj.__class__ what = Any.serialmap.get(tc) if not what: tc = (types.ClassType, pyobj.__class__.__name__) what = Any.serialmap.get(tc) # failed to find a registered type for class if what is None: #TODO: seems incomplete. what about facets. if self.processContents == 'strict': what = _AnyStrict(pname=(self.nspname,self.pname)) else: what = _AnyLax(pname=(self.nspname,self.pname)) self.logger.debug('serialize with %s', what.__class__.__name__) what.serialize(elt, sw, pyobj, **kw) def parse(self, elt, ps): ''' processContents -- 'lax' | 'skip' | 'strict', 'strict' 1) if 'skip' check namespaces, and return the DOM node. 2) if 'lax' look for declaration, or definition. If not found return DOM node. 3) if 'strict' get declaration, or raise. ''' skip = self.processContents == 'skip' nspname,pname = _get_element_nsuri_name(elt) what = GED(nspname, pname) if not skip and what is not None: pyobj = what.parse(elt, ps) try: pyobj.typecode = what except AttributeError, ex: # Assume this means builtin type. pyobj = WrapImmutable(pyobj, what) return pyobj # Allow use of "" element declarations w/ local # element declarations prefix, typeName = SplitQName(_find_type(elt)) if not skip and typeName: namespaceURI = _resolve_prefix(elt, prefix or 'xmlns') # First look thru user defined namespaces, if don't find # look for 'primitives'. pyclass = GTD(namespaceURI, typeName) or Any what = pyclass(pname=(nspname,pname)) pyobj = what.parse(elt, ps) try: pyobj.typecode = what except AttributeError, ex: # Assume this means builtin type. pyobj = WrapImmutable(pyobj, what) what.typed = True return pyobj if skip: what = XML(pname=(nspname,pname), wrapped=False) elif self.processContents == 'lax': what = _AnyLax(pname=(nspname,pname)) else: what = _AnyStrict(pname=(nspname,pname)) try: pyobj = what.parse(elt, ps) except EvaluateException, ex: self.logger.error("Give up, parse (%s,%s) as a String", what.nspname, what.pname) what = String(pname=(nspname,pname), typed=False) pyobj = WrapImmutable(what.parse(elt, ps), what) return pyobj class Union(SimpleType): '''simpleType Union class variables: memberTypes -- list [(namespace,name),] tuples, each representing a type defintion. ''' memberTypes = None logger = _GetLogger('ZSI.TC.Union') def __init__(self, pname=None, minOccurs=1, maxOccurs=1, **kw): SimpleType.__init__(self, pname=pname, minOccurs=minOccurs, maxOccurs=maxOccurs, **kw) self.memberTypeCodes = [] def setMemberTypeCodes(self): if len(self.memberTypeCodes) > 0: return if self.__class__.memberTypes is None: raise EvaluateException, 'uninitialized class variable memberTypes [(namespace,name),]' for nsuri,name in self.__class__.memberTypes: tcclass = GTD(nsuri,name) if tcclass is None: tc = Any.parsemap.get((nsuri,name)) typecode = tc.__class__(pname=(self.nspname,self.pname)) else: typecode = tcclass(pname=(self.nspname,self.pname)) if typecode is None: raise EvaluateException, \ 'Typecode class for Union memberType (%s,%s) is missing' %(nsuri,name) if isinstance(typecode, Struct): raise EvaluateException, \ 'Illegal: Union memberType (%s,%s) is complexType' %(nsuri,name) self.memberTypeCodes.append(typecode) def parse(self, elt, ps, **kw): '''attempt to parse sequentially. No way to know ahead of time what this instance represents. Must be simple type so it can not have attributes nor children, so this isn't too bad. ''' self.setMemberTypeCodes() (nsuri,typeName) = self.checkname(elt, ps) #if (nsuri,typeName) not in self.memberTypes: # raise EvaluateException( # 'Union Type mismatch got (%s,%s) not in %s' % \ # (nsuri, typeName, self.memberTypes), ps.Backtrace(elt)) for indx in range(len(self.memberTypeCodes)): typecode = self.memberTypeCodes[indx] try: pyobj = typecode.parse(elt, ps) except ParseException, ex: continue except Exception, ex: continue if indx > 0: self.memberTypeCodes.remove(typecode) self.memberTypeCodes.insert(0, typecode) break else: raise return pyobj def get_formatted_content(self, pyobj, **kw): self.setMemberTypeCodes() for indx in range(len(self.memberTypeCodes)): typecode = self.memberTypeCodes[indx] try: content = typecode.get_formatted_content(copy.copy(pyobj)) break except ParseException, ex: pass if indx > 0: self.memberTypeCodes.remove(typecode) self.memberTypeCodes.insert(0, typecode) else: raise return content class List(SimpleType): '''simpleType List Class data: itemType -- sequence (namespaceURI,name) or a TypeCode instance representing the type definition ''' itemType = None logger = _GetLogger('ZSI.TC.List') def __init__(self, pname=None, itemType=None, **kw): '''Currently need to require maxOccurs=1, so list is interpreted as a single unit of data. ''' assert kw.get('maxOccurs',1) == 1, \ 'Currently only supporting SimpleType Lists with maxOccurs=1' SimpleType.__init__(self, pname=pname, **kw) self.itemType = itemType or self.itemType self.itemTypeCode = self.itemType itemTypeCode = None if type(self.itemTypeCode) in _seqtypes: namespaceURI,name = self.itemTypeCode try: itemTypeCode = GTD(*self.itemType)(None) except: if _is_xsd_or_soap_ns(namespaceURI) is False: raise for pyclass in TYPES: if pyclass.type == self.itemTypeCode: itemTypeCode = pyclass(None) break elif pyclass.type[1] == name: itemTypeCode = pyclass(None) if itemTypeCode is None: raise EvaluateException('Filed to locate %s' %self.itemTypeCode) if hasattr(itemTypeCode, 'text_to_data') is False: raise EvaluateException('TypeCode class %s missing text_to_data method' %itemTypeCode) self.itemTypeCode = itemTypeCode def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. items in list are space separated. ''' v = [] for item in text.split(' '): v.append(self.itemTypeCode.text_to_data(item, elt, ps)) if self.pyclass is not None: return self.pyclass(v) return v def parse(self, elt, ps): '''elt -- the DOM element being parsed ps -- the ParsedSoap object. ''' self.checkname(elt, ps) if len(_children(elt)) == 0: href = _find_href(elt) if not href: if self.nilled(elt, ps) is False: # No content, no HREF, not NIL: empty string return "" # No content, no HREF, and is NIL... if self.nillable is True: return Nilled raise EvaluateException('Required string missing', ps.Backtrace(elt)) if href[0] != '#': return ps.ResolveHREF(href, self) elt = ps.FindLocalHREF(href, elt) self.checktype(elt, ps) if self.nilled(elt, ps): return Nilled if len(_children(elt)) == 0: return '' v = self.simple_value(elt, ps) return self.text_to_data(v, elt, ps) def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw): '''elt -- the current DOMWrapper element sw -- soapWriter object pyobj -- python object to serialize ''' if type(pyobj) not in _seqtypes: raise EvaluateException, 'expecting a list' objid = _get_idstr(pyobj) ns,n = self.get_name(name, objid) el = elt.createAppendElement(ns, n) if self.nillable is True and pyobj is None: self.serialize_as_nil(el) return None tc = self.itemTypeCode s = StringIO() for item in pyobj: s.write(tc.get_formatted_content(item)) s.write(' ') el.createAppendTextNode(textNode) class _AnyStrict(Any): ''' Handles an unspecified types when using a concrete schemas and processContents = "strict". ''' #WARNING: unstable logger = _GetLogger('ZSI.TC._AnyStrict') def __init__(self, pname=None, aslist=False, **kw): TypeCode.__init__(self, pname=pname, **kw) self.aslist = aslist self.unique = True def serialize(self, elt, sw, pyobj, name=None, **kw): if not (type(pyobj) is dict and not self.aslist): Any.serialize(self, elt=elt,sw=sw,pyobj=pyobj,name=name, **kw) raise EvaluateException( 'Serializing dictionaries not implemented when processContents=\"strict\".' + 'Try as a list or use processContents=\"lax\".' ) class _AnyLax(Any): ''' Handles unspecified types when using a concrete schemas and processContents = "lax". ''' logger = _GetLogger('ZSI.TC._AnyLax') def __init__(self, pname=None, aslist=False, **kw): TypeCode.__init__(self, pname=pname, **kw) self.aslist = aslist self.unique = True def parse_into_dict_or_list(self, elt, ps): c = _child_elements(elt) count = len(c) v = [] if count == 0: href = _find_href(elt) if not href: return {} elt = ps.FindLocalHREF(href, elt) self.checktype(elt, ps) c = _child_elements(elt) count = len(c) if count == 0: return self.listify([]) if self.nilled(elt, ps): return Nilled # group consecutive elements with the same name together # We treat consecutive elements with the same name as lists. groupedElements = [] # tuples of (name, elementList) previousName = "" currentElementList = None for ce in _child_elements(elt): name = ce.localName if (name != previousName): # new name, so new group if currentElementList != None: # store previous group if there is one groupedElements.append( (previousName, currentElementList) ) currentElementList = list() currentElementList.append(ce) # append to list previousName = name # add the last group if necessary if currentElementList != None: # store previous group if there is one groupedElements.append( (previousName, currentElementList) ) # parse the groups of names if len(groupedElements) < 1: # should return earlier return None # return a list if there is one name and multiple data elif (len(groupedElements) == 1) and (len(groupedElements[0][0]) > 1): self.aslist = False # else return a dictionary for name,eltList in groupedElements: lst = [] for elt in eltList: #aslist = self.aslist lst.append( self.parse(elt, ps) ) #self.aslist = aslist # restore the aslist setting if len(lst) > 1: # consecutive elements with the same name means a list v.append( (name, lst) ) elif len(lst) == 1: v.append( (name, lst[0]) ) return self.listify(v) def checkname(self, elt, ps): '''See if the name and type of the "elt" element is what we're looking for. Return the element's type. Since this is _AnyLax, it's ok if names don't resolve. ''' parselist,errorlist = self.get_parse_and_errorlist() ns, name = _get_element_nsuri_name(elt) if ns == SOAP.ENC: if parselist and \ (None, name) not in parselist and (ns, name) not in parselist: raise EvaluateException( 'Element mismatch (got %s wanted %s) (SOAP encoding namespace)' % \ (name, errorlist), ps.Backtrace(elt)) return (ns, name) # Not a type, check name matches. if self.nspname and ns != self.nspname: raise EvaluateException('Element NS mismatch (got %s wanted %s)' % \ (ns, self.nspname), ps.Backtrace(elt)) return self.checktype(elt, ps) def RegisterType(C, clobber=0, *args, **keywords): instance = apply(C, args, keywords) for t in C.__dict__.get('parselist', []): prev = Any.parsemap.get(t) if prev: if prev.__class__ == C: continue if not clobber: raise TypeError( str(C) + ' duplicating parse registration for ' + str(t)) Any.parsemap[t] = instance for t in C.__dict__.get('seriallist', []): ti = type(t) if ti in [ types.TypeType, types.ClassType]: key = t elif ti in _stringtypes: key = (types.ClassType, t) else: raise TypeError(str(t) + ' is not a class name') prev = Any.serialmap.get(key) if prev: if prev.__class__ == C: continue if not clobber: raise TypeError( str(C) + ' duplicating serial registration for ' + str(t)) Any.serialmap[key] = instance from TCnumbers import * from TCtimes import * from schema import GTD, GED, WrapImmutable from TCcompound import * from TCapache import * # aliases backwards compatiblity _get_type_definition, _get_global_element_declaration, Wrap = GTD, GED, WrapImmutable f = lambda x: type(x) == types.ClassType and issubclass(x, TypeCode) and getattr(x, 'type', None) is not None TYPES = filter(f, map(lambda y:eval(y),dir())) if __name__ == '__main__': print _copyright PK‹¨58ÿfûŠ?Š?ZSI/schema.pyo;ò Z@Ec@s2dZdklZlZlZlZdklZlZdk l Z d„Z d„Z d„Z d„Ze Ze Zd„Zd „Zd „Zd efd „ƒYZd fd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdklZlZedjo eGHndS(sXML Schema support (s _copyrights _seqtypess _find_typesEvaluateException(sSCHEMAsSOAP(s SplitQNamecKsti|||SdS(N(sSchemaInstanceTypesgetTypeDefinitions namespaceURIsnameskw(s namespaceURIsnameskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_get_type_definition scKsti|||SdS(N(sSchemaInstanceTypesgetElementDeclarations namespaceURIsnameskw(s namespaceURIsnameskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_get_global_element_declarationscCs td‚dS(NsNot implemented(sNotImplementedError(seltswhat((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_get_substitute_elementscCsti||ƒtj SdS(N(sSchemaInstanceTypesgetTypeDefinitions namespaceURIsnamesNone(s namespaceURIsname((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_has_type_definitionscCsti||ƒSdS(sfWrap immutable instance so a typecode can be set, making it self-describing ie. serializable. N(s_GetPyobjWrappers WrapImmutablespyobjswhat(spyobjswhat((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys WrapImmutable scCsti|ƒtiƒdS(sOAdd a builtin to be registered, and register it with the Any typecode. N(s_GetPyobjWrappersRegisterBuiltinsargsRegisterAnyElement(sarg((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pysRegisterBuiltin&s cCstiƒSdS(sÚregister all Wrapper classes with the Any typecode. This allows instances returned by Any to be self-describing. ie. serializable. AnyElement falls back on Any to parse anything it doesn't understand. N(s_GetPyobjWrappersRegisterAnyElement(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pysRegisterAnyElement-ssSchemaInstanceTypecBs\tZdZhZhZhZd„Zed„Ze eƒZeed„Z e e ƒZ RS(sRegister all types/elements, when hit already defined class dont create a new one just give back reference. Thus import order determines which class is loaded. class variables: types -- dict of typecode classes definitions representing global type definitions. elements -- dict of typecode classes representing global element declarations. element_typecode_cache -- dict of typecode instances representing global element declarations. cCsŽ|dddgjoti||||ƒSnt|jo˜|idƒtjp|idƒtjo t d‚n|d|df}t i i|ƒtjo#ti||||ƒt i |d}t|itƒo d}n|t|ƒ|ifSdS(Ns s(smsgs issubclasssselfsklasssElementDeclarationsid(sselfsmsg((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys__str__Ús iicKsš|i|_t|_||_|||f\|_|_|_ t ||f\|_ |_ |_ t|i ƒttfjo|\|_ |_ n|SdS(N(sselfs _reveal_types__call__sTrues_Mirage__revealskws _Mirage__kws minOccurss maxOccurssnillablesNonespnamesanamesnspnamestypestupleslist(sselfspnamesanames minOccurss maxOccurssnillableskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys _hide_typeàs   !!cKse|i|_t|_||_|ii|_ |ii |_ |||f\|_ |_ |_|SdS(N(sselfs_reveal_elements__call__sTrues_Mirage__revealskws _Mirage__kwsklasssschemasnspnamesliteralspnames minOccurss maxOccurssnillable(sselfs minOccurss maxOccurssnillableskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys _hide_elementîs   !c Csa|itjoF|id|id|id|id|id|i|i |_n|iSdS(Nspnamesanames minOccurss maxOccurssnillable( sselfs_Mirage__cachesNonesklassspnamesanames minOccurss maxOccurssnillables _Mirage__kw(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys _reveal_typeüs %cCsO|itjo4|id|id|id|i|i|_n|iSdS(Ns minOccurss maxOccurssnillable(sselfs_Mirage__cachesNonesklasss minOccurss maxOccurssnillables _Mirage__kw(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_reveal_elements%( s__name__s __module__s__doc__s__init__s__str__sFalses _hide_types _hide_elements _reveal_types_reveal_elements__call__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_MirageËs     s_GetPyobjWrappercBsStZdZhZd„ZeeƒZd„ZeeƒZd„ZeeƒZRS(sÛGet a python object that wraps data and typecode. Used by parse routine, so that typecode information discovered during parsing is retained in the pyobj representation and thus can be serialized. cs^ˆˆijotdˆ‚ndˆf‡‡d†ƒY}dˆi|_|ˆiˆtZdZd„Zd„Zd„Zd„Zed„ZRS(s°Example mapping of xsd/soapenc types to zsi python types. Checks against all available classes in ZSI.TC. Used in wsdl2python, wsdlInterpreter, and ServiceProxy. cCs'tititititititititi ti ti ti ti titititititititititititititititig|_t i!i"t i!it i!it i!it i!it i!it i!it ii#t i!i t i!ig |_$t ii%t i!i&t i!it i!i g|_'t ii(t ii)t iit i!it i!it i!it i!it i!it iit iit ii*t iig |_+t ii t iit i,it i,it i,i t i,it i,it i,it i,i t i,ig |_-dSdS(N(.sTCsIintegersIunsignedShorts gYearMonthsInonNegativeIntegersIintsStrings gDateTimes IunsignedIntsDurationsIpositiveIntegersFPfloatsgDaysgMonthsInegativeIntegersgDatesURIsHexBinaryStrings IunsignedBytes gMonthDaysInonPositiveIntegersIbytesFPdoublesgTimesgYearsIlongs IunsignedLongsIshortsTokensQNamesselfs _type_listsZSIs TCnumberss IEnumerationsIntegers _tc_to_intsDecimals FPEnumerations _tc_to_floats Base64Strings Enumerations XMLStrings _tc_to_stringsTCtimess _tc_to_tuple(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys__init__s · c -uc cCs‰hdti<dti<dti<}|i|ƒo ||Snx8|iD]$}|i t i |fjoPqPqPWti }|SdS(Nsbooleansdecimals base64Binary(sTCsBooleansDecimals Base64Stringsuntaged_xsd_typesshas_keysmsg_typesselfs _type_liststcstypesSCHEMAsXSD3sAnyType(sselfsmsg_typesuntaged_xsd_typesstc((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys_get_xsd_typecodeRs*    cCsA|djo tiSn|djo tiSn|i|ƒSdS(NsArraysStruct(smsg_types TCcompoundsArraysStructsselfs_get_xsd_typecode(sselfsmsg_type((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys_get_soapenc_typecode_s     cCs_t|ƒ\}}|tijo|i|ƒSn%|t i gjo|i |ƒSnt SdS(N( s SplitQNamesmsg_typesprefixsnamestargetNamespacesSCHEMAsXSD_LISTsselfs_get_xsd_typecodesSOAPsENCs_get_soapenc_typecodesNone(sselfsmsg_typestargetNamespacesnamesprefix((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys get_typeclassgs cCsß| o|i||ƒ}n|}||ijodSnœ||ijodSn„||ijodSnl||i jodSnT|t i gjodSn9|t i gjodSnt|tƒo td‚ntSdS(Nsintsfloatsstrstupleslistsbools+failed to map zsi typecode to a python type(s typeclasssselfs get_typeclasssmsg_typestargetNamespacestcs _tc_to_ints _tc_to_floats _tc_to_strings _tc_to_tuples TCcompoundsArraysTCsBooleans isinstancesTypeCodesEvaluateExceptionsNone(sselfsmsg_typestargetNamespaces typeclassstc((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pysget_pythontypeos$ ( s__name__s __module__s__doc__s__init__s_get_xsd_typecodes_get_soapenc_typecodes get_typeclasssNonesget_pythontype(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pysBaseTypeInterpreters  :  (sZSIsTCsTCtimess TCcompoundsZSI.TCsTypeCodes _copyrightsEvaluateExceptionsZSI.wstools.Utilitys SplitQNamesZSI.wstools.NamespacessSOAPsSCHEMAs ExceptionsNamespaceExceptionsBaseTypeInterpreter( sBaseTypeInterpretersEvaluateExceptionsTypeCodesTCtimessSOAPsTCs SplitQNames TCcompounds _copyrightsNamespaceExceptionsZSIsSCHEMA((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys?s   PK¨58å$öD@D@ ZSI/parse.pyo;ò Z@Ec@sÜdZdklZlZlZlZlZlZlZl Z l Z l Z l Z l Z dklZdkZdklZlZdklZd„Zd„Zd„Zd „Zd fd „ƒYZed jo eGHndS( sSOAP messaging parsing. ( s _copyrights _childrens_attrss_child_elementss _stringtypess _backtracesEvaluateExceptionsParseExceptions_valid_encodings_Nodes _find_attrs_resolve_prefix(s AnyElementN(sSOAPsXMLNS(s SplitQNamecCs|itidƒptS(Nsactor(sEsgetAttributeNSsSOAPsENVsNone(sE((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysscCs|itidƒS(NsmustUnderstand(sEsgetAttributeNSsSOAPsENV(sE((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysscCs|itidƒS(Nsroot(sEsgetAttributeNSsSOAPsENC(sE((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysscCs t|dƒS(Nsid(s _find_attrsE(sE((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysss ParsedSoapcBs³tZdZeZeeeeed„Zd„Zdd„Z d„Z d„Z dd„Z d„Z ed „Zd „Zd „Zd „Zd „Zd„Zd„Zd„ZRS(sÄA Parsed SOAP object. Convert the text to a DOM tree and parse SOAP elements. Instance data: reader -- the DOM reader dom -- the DOM object ns_cache -- dictionary (by id(node)) of namespace dictionaries id_cache -- dictionary (by XML ID attr) of elements envelope -- the node holding the SOAP Envelope header -- the node holding the SOAP Header (or None) body -- the node holding the SOAP Body body_root -- the serialization root in the SOAP Body data_elements -- list of non-root elements in the SOAP Body trailer_elements -- list of elements following the SOAP body cKs||_||_|i o=|itjo|i|_qZdkl} | i|_nyT|iƒ|_t |ƒt jo|ii |ƒ|_ n|ii|ƒ|_ Wntj o }‚nXht|i ƒhdti<dti<dd<<|_||hf\|_|_|_gi}t|i ƒD]'} | itijo|| ƒq=q=~}t!|ƒdjot"ddƒ‚nt!|ƒdjot"ddƒ‚n|t$jo|d|_%d Sn|d} | i'd jp| i(t)i*jot"d | i'd dƒ‚n|i+d | ƒxat,| ƒD]S} | i.}|i0d ƒdjo|ddgjot"d|ddƒ‚qCqCW| |_#t1|i#ƒ ot"ddƒ‚ngi}t|i#ƒD]'} | itijo|| ƒqÞqÞ~}t!|ƒdjot"ddƒ‚n|d} | i'djo| i(t)i*joN|i+d| ƒ|i2t| ƒdƒ|i3dƒ|_4t5|i4ƒ|_6ntgf\|_4|_6t!|ƒdjot"ddƒ‚n|i3dƒ} | i'djp| i(t)i*joX|i4o't"d| i'dd| |i ƒ‚qwt"d | i'dd| |i ƒ‚n|i+d| dƒ|i2t| ƒdƒ| |_7t1|i7ƒ ot"ddƒ‚n|i o-t!|ƒot"dd| |i ƒ‚qInE||_8x8|i8D]-} | i( ot"dd| |i ƒ‚qqWtggf\|_%} }x²t5|i7ƒD]¡} t;| ƒ}|djo3|i%ot"dd| |i ƒ‚n| |_%qt|djo| i| ƒqt| o|i| ƒqtt"dd| |i ƒ‚qtW|i%tjo=t!|ƒo|d|_%qft"d d|i7|i ƒ‚nt1|i%ƒ ot"d!d| |i ƒ‚nt|i%ƒ}gi}t5|i7ƒD]'} t| ƒ|jo|| ƒq¹q¹~|_>|i2|i>dƒd S("sLInitialize. Keyword arguments: trailers -- allow trailer elments (default is zero) resolver -- function (bound method) to resolve URI's readerclass -- factory class to create a reader keepdom -- do not release the DOM envelope -- look for a SOAP envelope. (sPyExpatsxmlsxmlnssisDocument has no Envelopeis!Document has extra child elementsNsEnvelopesDocument has "s" element, not Envelopes:iÿÿÿÿsidsUnqualified attribute "s " in EnvelopesEnvelope has invalid encodingsEnvelope is empty (no Body)sHeadersEnvelope has header but no BodysBodysHeader followed by "s" element, not BodysBody has invalid encodingsElement found after BodysUnqualified trailer elements1s!Multiple seralization roots founds0s Illegal value for root attributesNo serialization root foundsInvalid encoding(?s readerclasssselfskeepdomsdefaultReaderClasssNonesxml.dom.ext.readersPyExpatsReadersreaderstypesinputs _stringtypess fromStringsdoms fromStreams ExceptionsesidsXMLNSsXMLsBASEsns_cachestrailerssresolversid_cachesappends_[1]s _childrensEsnodeTypes_Nodes ELEMENT_NODEscslensParseExceptionsenvelopesFalses body_rootselts localNames namespaceURIsSOAPsENVs_check_for_legal_childrens_attrssasnodeNamesnamesfinds_valid_encodings_check_for_pi_nodesspopsheaders_child_elementssheader_elementssbodystrailer_elementssnosmaybes _find_rootsrootsrootids data_elements(sselfsinputs readerclassskeepdomstrailerssresolversenvelopeskwsrootidsnoseltsEsPyExpatsascsesnamesmaybes_[1]sroot((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys__init__%sÆ     <!G   #   ) G ##              JcCs4y&|i o|ii|iƒnWnnXdS(N(sselfskeepdomsreaders releaseNodesdom(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys__del__Às  icCsá|dj}xÎt|ƒD]À}|i}|tijoqn|ti joM|ti jo|i i ƒdjoqnt d||||iƒ‚n|o|i o+t d|id||||iƒ‚qqWdS(s_Check if all children of this node are elements or whitespace-only text nodes. sHeaderssNon-element child in sUnqualified element "s" in N(snamesinheaders _childrenseltsnsnodeTypests_Nodes COMMENT_NODEs ELEMENT_NODEs TEXT_NODEs nodeValuesstripsParseExceptionsselfsdoms mustqualifys namespaceURIsnodeName(sselfsnameselts mustqualifysnstsinheader((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys_check_for_legal_childrenÇs   & cCs¨|}xš|o’|iƒ}|i}|tijo*td|id||i |i ƒ‚n0|ti jotd||i |i ƒ‚n|t|ƒ7}q WdS(sHRaise an exception if any of the list descendants are PI nodes. s Found processing instruction ""s Found DTDN(slistspopseltsnodeTypests_NodesPROCESSING_INSTRUCTION_NODEsParseExceptionsnodeNamesinheaders parentNodesselfsdomsDOCUMENT_TYPE_NODEs _children(sselfslistsinheaderstselt((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys_check_for_pi_nodesØs   cCst||iƒSdS(seReturn a human-readable "backtrace" from the document root to the specified element. N(s _backtraceseltsselfsdom(sselfselt((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys BacktraceèscCs&|ddjo td||i|ƒƒ‚n|d}|ii|ƒ}|o|Sn|i |i g}|o|i |iƒnxx|op|iƒ}|itijo=t|ƒ}|o&||i|<||jo|Sqíqñn|t|ƒ7}qŽWtd||i|ƒƒ‚dS(s0Find a local HREF in the data elements. is#s$Absolute HREF ("%s") not implementedisCan't find node for HREF "%s"N(shrefsEvaluateExceptionsselfs Backtraceseltsfragsid_cachesgetses data_elementss body_rootslistsheaderssextendsheader_elementsspopsnodeTypes_Nodes ELEMENT_NODEs_find_idsnodeids _children(sselfshrefseltsheaderssfragseslistsnodeid((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys FindLocalHREFîs.       cKsÃt|d|iƒ}| otd|dƒ‚ny?t|ƒti jot |ƒ}n|||||}WnDt j o8}td|dt |iƒdt |ƒƒ‚nX|SdS(NsresolversNo resolver for "s"sCan't resolve "s" (s): (sgetattrstcsselfsresolversrsEvaluateExceptionsuristypestypess UnicodeTypesstrskeywordssretvals Exceptionses __class__(sselfsuristcskeywordssesretvalsr((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys ResolveHREFs4cCs||tjottig}nt|ƒttig}gi}|iD]'}t |ƒ|jo||ƒqJqJ~SdS(sCReturn a list of all elements intended for these actor(s). N( s actorlistsNonesSOAPs ACTOR_NEXTslistsappends_[1]sselfsheader_elementssEs _find_actor(sselfs actorlistsEs_[1]((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysGetMyHeaderElementss  cCsÊ|iit|ƒƒ}| oœ||ijo|i|iƒ}nx\t |ƒD]N}|i t i jo5|idjo|i|d as child of SOAP-ENC:Headeris7number of occurances(%d) doesnt fit constraints (%d,%s)iN("sdslensofwhats lenofwhatsselfsheader_elementssrangescscrangesappends_[1]siswhats isinstances AnyElementsEvaluateExceptionsvsoccurssnspnamespnames namespaceURIstagNamesjsc_elts SplitQNamesprefixsnames_resolve_prefixsnsurisparsespyobjsNones minOccurss maxOccurs(sselfsofwhatsprefixsnsuristagNames lenofwhatswhatscrangespyobjsoccurssc_eltsnamescsdsisjs_[1]s namespaceURIsv((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysParseHeaderElementsVs8 %8  A  *& (s__name__s __module__s__doc__sNonesdefaultReaderClasssFalsesTrues__init__s__del__s_check_for_legal_childrens_check_for_pi_nodess Backtraces FindLocalHREFs ResolveHREFsGetMyHeaderElementssGetElementNSdictsGetDomAndReadersIsAFaultsParsesWhatMustIUnderstandsWhatActorsArePresentsParseHeaderElements(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys ParsedSoaps" ›          s__main__(s__doc__sZSIs _copyrights _childrens_attrss_child_elementss _stringtypess _backtracesEvaluateExceptionsParseExceptions_valid_encodings_Nodes _find_attrs_resolve_prefixsZSI.TCs AnyElementstypessZSI.wstools.NamespacessSOAPsXMLNSsZSI.wstools.Utilitys SplitQNames _find_actors_find_mus _find_roots_find_ids ParsedSoaps__name__(sEvaluateExceptions _childrens_Nodes_find_mus ParsedSoaps_find_ids _backtraces _copyrights AnyElements_attrssXMLNSs _stringtypess_valid_encodingsParseExceptions_resolve_prefixs _find_attrstypess _find_actors_child_elementss SplitQNames _find_rootsSOAP((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys?sO       ÿd PKЍ58fÌÂTnTnTZSI/__init__.pyo;ò Z@Ec@s½dZdZdklZdkZdklZei ei gZ ei gZ eieigZeieigZd„Zd„Zd„ZdklZlZlZd „Zd „Zyd klZegZ Wne!d gZ nXd „Z"d„Z#d„Z$d„Z%d„Z&d„Z'd„Z(d„Z)d„Z*d„Z+d„Z,d„Z-d„Z.d„Z/d„Z0he0_1de0_2de3fd„ƒYZ4de4fd „ƒYZ5d!e4fd"„ƒYZ6d#e4fd$„ƒYZ7d%e4fd&„ƒYZ8dk9Z9d'„Z:d(k;l<Z<d)k=l>Z>d*k?l@Z@lAZAlBZBlCZClDZDlEZEdkFZFeFiGeFiHd+d,d-eIƒeFiGeFiJd+d,d-eIƒeFiGeFiKd+d,d-eIƒeFiGeFiLd+d,d-eIƒxeFiMeFiNeFiOeFiPeFiQeFiReFiSeFiTeFiUeFiVeFiWeFiXeFiYeFiZeFi[fD]Z\eFiGe\d+d,d-eIƒqWeFiGeFi]d+d,d-eIƒeFiGeFi^d+d,d-eIƒeFiGeFi_d+d,d-eIƒeFiGeFi`d+d,d-eIƒeFiGeFiad+d,d-eIƒeFiGeFibd+d,d-eIƒeFiGeFicd+d,d-eIƒeFiGeFidd+d,d-eIƒeFiGeFied+d,d-eIƒeFiGeFifigd+d,d-eIƒdkhZhx0eiejekelemengD]ZoehipiqeoƒqWehirƒesd.jo eGHndS(/s^ZSI: Zolera Soap Infrastructure. Copyright 2001, Zolera Systems, Inc. All Rights Reserved. sãZSI: Zolera Soap Infrastructure. Copyright 2001, Zolera Systems, Inc. All Rights Reserved. Copyright 2002-2003, Rich Salz. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. Portions are also: Copyright (c) 2003, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. (2) 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. (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory, U.S. Dept. of Energy 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. You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to Lawrence Berkeley National Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such Enhancements or derivative works thereof, in binary and source code form. For wstools also: Zope Public License (ZPL) Version 2.0 ----------------------------------------------- This software is Copyright (c) Zope Corporation (tm) and Contributors. All rights reserved. This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF). Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions in source code must retain the above copyright notice, this list of conditions, and the following disclaimer. 2. 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. 3. The name Zope Corporation (tm) must not be used to endorse or promote products derived from this software without prior written permission from Zope Corporation. 4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of Zope Corporation. Use of them is covered in a separate agreement (see http://www.zope.com/Marks). 5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. Disclaimer THIS SOFTWARE IS PROVIDED BY ZOPE CORPORATION ``AS IS'' AND ANY EXPRESSED 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 ZOPE CORPORATION OR ITS 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. This software consists of contributions made by Zope Corporation and many individuals on behalf of Zope Corporation. Specific attributions are listed in the accompanying credits file. (sNodeN(sZSI_SCHEMA_URIcCs|io |iiƒpgS(N(sEs attributessvalues(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys¤scCs|ipgS(N(sEs childNodes(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys¥scCsFgi}|ipgD]'}|itijo||ƒqq~S(N(sappends_[1]sEs childNodessnsnodeTypes_Nodes ELEMENT_NODE(sEs_[1]sn((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys¦s(sSOAPsSCHEMAsXMLNScCs|itidƒS(Ns arrayType(sEsgetAttributeNSs_SOAPsENC(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys¯scCs|itidƒS(Ns encodingStyle(sEsgetAttributeNSs_SOAPsENV(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys°s(sEMPTY_NAMESPACEscCsHx=tD]5}y%|i||ƒ}|o|SnWqqXqWtSdS(N(s_empty_nsuri_listsnsurisEsgetAttributeNSsattrsvsNone(sEsattrsnsurisv((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys _find_attr¸s cCs7y%|i||ƒ}|o|SnWnnXtSdS(s"namespaceURI localName N(sEsgetAttributeNSs namespaceURIs localNamesvsNone(sEs namespaceURIs localNamesv((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys _find_attrNSÀs cCsP|i||ƒ}|tjotSny |iSWnnX|i||ƒSdS(s¡Must grab the attribute Node to distinquish between an unspecified attribute(None) and one set to empty string(""). namespaceURI localName N(sEsgetAttributeNodeNSs namespaceURIs localNamesattrsNonesvaluesgetAttributeNS(sEs namespaceURIs localNamesattr((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys_find_attrNodeNSËs  cCs t|dƒS(Nshref(s _find_attrsE(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysÛscCs?|iti|ƒp)|iti|ƒp|iti|ƒS(N(sEsgetAttributeNSs_SCHEMAsXSI3sattrsXSI1sXSI2(sEsattr((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysÜscCs t|dƒS(Nstype(s_find_xsi_attrsE(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysàscCs|iti|ƒS(N(sEsgetAttributeNSs_XMLNSsBASEsattr(sEsattr((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysâscCs|ititƒS(N(sEsgetAttributeNSs_XMLNSsBASEsNone(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysãscCs|i|ifS(N(sEs namespaceURIs localName(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysçscCs|itijS(N(sEsnodeTypes_Nodes ELEMENT_NODE(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pyséscCsvt}xet|ƒo?|ot||ƒ}n t|ƒ}|oPn|i}q W|ot d|‚n|SdS(sÃresolve prefix to a namespaceURI. If None or empty str, return default namespace or None. Parameters: celt -- element node prefix -- xmlns:prefix, or empty str or None scant resolve xmlns:%sN( sNones namespaces _is_elementsceltsprefixs_find_xmlns_prefixs namespaceURIs_find_default_namespaces parentNodesEvaluateException(sceltsprefixs namespaces namespaceURI((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys_resolve_prefixës  cCsft|ƒ}| p |tijodSnx/|iƒD]!}|itiƒodSq9q9WdSdS(s*Does this node have a valid encoding? iiN(s_find_encstyleseltsencs_SOAPsENCssplitses startswith(seltsencse((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys_valid_encodings   c Csàd}xÏ||joÁ|i|if\}}|tjoPngi}t |ƒD]$}|i|jo||ƒqTqT~}t |ƒdjod||}n(|i|ƒd}d||f|}|}q W|SdS(sVReturn a "backtrace" from the given element to the DOM root, in XPath syntax. sis/s/%s[%d]N(ssseltsdomsnodeNames parentNodesnamesparentsNonesappends_[1]s_child_elementsscsmatchesslensindexsi( seltsdomsnamesparentsmatchesscs_[1]siss((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys _backtraces  A cCs7t|ƒ}|djodt|ƒSnd|SdS(s¢Python 2.3.x generates a FutureWarning for negative IDs, so we use a different prefix character to ensure uniqueness, and call abs() to avoid the warning.isx%xso%xN(sidspyobjsxsabs(spyobjsx((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys _get_idstr s   cCs©ti}|i|dƒ}| o~|idƒ\}}|iddƒ}t |ƒdjod|d}nt |ƒti jo|i ƒn|||(s__name__s _get_idstrsself(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__repr__Ts(s__name__s __module__s__doc__sNones__init__s__str__s__repr__(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysParseExceptionEs  sEvaluateExceptioncBs,tZdZed„Zd„Zd„ZRS(s=Exception raised during data evaluation (serialization). cCs)ti|ƒ||f\|_|_dS(N(s Exceptions__init__sselfsstrstrace(sselfsstrstrace((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__init__\s cCs/|io|id|idSn|iSdS(Ns [Element trace: s](sselfstracesstr(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__str__`s cCsdtt|ƒfSdS(Ns<%s.EvaluateException %s>(s__name__s _get_idstrsself(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__repr__es(s__name__s __module__s__doc__sNones__init__s__str__s__repr__(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysEvaluateExceptionXs   sFaultExceptioncBs)tZdZd„Zd„Zd„ZRS(s/Exception raised when a fault is received. cCs ||_dS(N(sfaultsself(sselfsfault((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__init__lscCst|iƒSdS(N(sstrsselfsfault(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__str__oscCsdtt|ƒfSdS(Ns<%s.FaultException %s>(s__name__s _get_idstrsself(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__repr__rs(s__name__s __module__s__doc__s__init__s__str__s__repr__(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysFaultExceptionhs   sWSActionExceptioncBstZdZRS(ssException raised when WS-Address Action Header is incorrectly specified when received by client or server. (s__name__s __module__s__doc__(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysWSActionExceptionus cCs tiSdS(N(sversionsVersion(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysVersion~s(s SoapWriter(s ParsedSoap(sFaultsFaultFromActorsFaultFromExceptionsFaultFromFaultMessagesFaultFromNotUnderstoodsFaultFromZSIExceptions minOccursisnillables__main__(ts__doc__s _copyrightsxml.domsNodes_Nodestypess_typessZSI.wstools.NamespacessZSI_SCHEMA_URIsIntTypesLongTypes _inttypess FloatTypes _floattypess TupleTypesListTypes _seqtypess StringTypes UnicodeTypes _stringtypess_attrss _childrens_child_elementssSOAPs_SOAPsSCHEMAs_SCHEMAsXMLNSs_XMLNSs_find_arraytypes_find_encstylesEMPTY_NAMESPACEs_empty_nsuri_listsNones _find_attrs _find_attrNSs_find_attrNodeNSs _find_hrefs_find_xsi_attrs _find_types_find_xmlns_prefixs_find_default_namespaces_get_element_nsuri_names _is_elements_resolve_prefixs_valid_encodings _backtraces _get_idstrs_get_postvalue_from_absoluteURIscachesMAXLENs Exceptions ZSIExceptionsParseExceptionsEvaluateExceptionsFaultExceptionsWSActionExceptionsversionsVersionswriters SoapWritersparses ParsedSoapsfaultsFaultsFaultFromActorsFaultFromExceptionsFaultFromFaultMessagesFaultFromNotUnderstoodsFaultFromZSIExceptionsTCs RegisterTypesStringsFalsesURIs Base64StringsHexBinaryStrings IunsignedBytesIunsignedShorts IunsignedInts IunsignedLongsIbytesIshortsIintsIlongsInegativeIntegersInonPositiveIntegersInonNegativeIntegersIpositiveIntegersIintegersFPfloatsFPdoublespyclasssBooleansDurations gDateTimesgDates gYearMonthsgYears gMonthDaysgDaysgTimesApachesMapsschemasintsfloatsstrstupleslistsunicodesis_GetPyobjWrappersRegisterBuiltinsRegisterAnyElements__name__(4s_get_postvalue_from_absoluteURIsEvaluateExceptions_find_xsi_attrs _childrens_empty_nsuri_listsFaultExceptions_NodesVersionsEMPTY_NAMESPACEs _backtraces _copyrightsFaultFromActors _floattypess_find_default_namespacesFaultFromFaultMessages _get_idstrs SoapWriters _find_typespyclasssversions _find_hrefs_find_attrNodeNSsFaultFromZSIExceptions_SOAPsTCs_attrss _stringtypessFaultsFaultFromNotUnderstoods_SCHEMAs_valid_encodings ZSIExceptionsParseExceptions_resolve_prefixs_find_encstylesZSI_SCHEMA_URIs _find_attrs _find_attrNSs_typess _is_elements_XMLNSs _seqtypessis_child_elementss_find_arraytypes _inttypessFaultFromExceptions ParsedSoapsschemas_get_element_nsuri_namesWSActionExceptions_find_xmlns_prefix((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys?sŽ‹                               + a   PK‚¨58ÿfûŠ?Š?ZSI/schema.pyc;ò Z@Ec@s2dZdklZlZlZlZdklZlZdk l Z d„Z d„Z d„Z d„Ze Ze Zd„Zd „Zd „Zd efd „ƒYZd fd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdklZlZedjo eGHndS(sXML Schema support (s _copyrights _seqtypess _find_typesEvaluateException(sSCHEMAsSOAP(s SplitQNamecKsti|||SdS(N(sSchemaInstanceTypesgetTypeDefinitions namespaceURIsnameskw(s namespaceURIsnameskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_get_type_definition scKsti|||SdS(N(sSchemaInstanceTypesgetElementDeclarations namespaceURIsnameskw(s namespaceURIsnameskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_get_global_element_declarationscCs td‚dS(NsNot implemented(sNotImplementedError(seltswhat((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_get_substitute_elementscCsti||ƒtj SdS(N(sSchemaInstanceTypesgetTypeDefinitions namespaceURIsnamesNone(s namespaceURIsname((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_has_type_definitionscCsti||ƒSdS(sfWrap immutable instance so a typecode can be set, making it self-describing ie. serializable. N(s_GetPyobjWrappers WrapImmutablespyobjswhat(spyobjswhat((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys WrapImmutable scCsti|ƒtiƒdS(sOAdd a builtin to be registered, and register it with the Any typecode. N(s_GetPyobjWrappersRegisterBuiltinsargsRegisterAnyElement(sarg((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pysRegisterBuiltin&s cCstiƒSdS(sÚregister all Wrapper classes with the Any typecode. This allows instances returned by Any to be self-describing. ie. serializable. AnyElement falls back on Any to parse anything it doesn't understand. N(s_GetPyobjWrappersRegisterAnyElement(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pysRegisterAnyElement-ssSchemaInstanceTypecBs\tZdZhZhZhZd„Zed„Ze eƒZeed„Z e e ƒZ RS(sRegister all types/elements, when hit already defined class dont create a new one just give back reference. Thus import order determines which class is loaded. class variables: types -- dict of typecode classes definitions representing global type definitions. elements -- dict of typecode classes representing global element declarations. element_typecode_cache -- dict of typecode instances representing global element declarations. cCsŽ|dddgjoti||||ƒSnt|jo˜|idƒtjp|idƒtjo t d‚n|d|df}t i i|ƒtjo#ti||||ƒt i |d}t|itƒo d}n|t|ƒ|ifSdS(Ns s(smsgs issubclasssselfsklasssElementDeclarationsid(sselfsmsg((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys__str__Ús iicKsš|i|_t|_||_|||f\|_|_|_ t ||f\|_ |_ |_ t|i ƒttfjo|\|_ |_ n|SdS(N(sselfs _reveal_types__call__sTrues_Mirage__revealskws _Mirage__kws minOccurss maxOccurssnillablesNonespnamesanamesnspnamestypestupleslist(sselfspnamesanames minOccurss maxOccurssnillableskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys _hide_typeàs   !!cKse|i|_t|_||_|ii|_ |ii |_ |||f\|_ |_ |_|SdS(N(sselfs_reveal_elements__call__sTrues_Mirage__revealskws _Mirage__kwsklasssschemasnspnamesliteralspnames minOccurss maxOccurssnillable(sselfs minOccurss maxOccurssnillableskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys _hide_elementîs   !c Csa|itjoF|id|id|id|id|id|i|i |_n|iSdS(Nspnamesanames minOccurss maxOccurssnillable( sselfs_Mirage__cachesNonesklassspnamesanames minOccurss maxOccurssnillables _Mirage__kw(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys _reveal_typeüs %cCsO|itjo4|id|id|id|i|i|_n|iSdS(Ns minOccurss maxOccurssnillable(sselfs_Mirage__cachesNonesklasss minOccurss maxOccurssnillables _Mirage__kw(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_reveal_elements%( s__name__s __module__s__doc__s__init__s__str__sFalses _hide_types _hide_elements _reveal_types_reveal_elements__call__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/schema.pys_MirageËs     s_GetPyobjWrappercBsStZdZhZd„ZeeƒZd„ZeeƒZd„ZeeƒZRS(sÛGet a python object that wraps data and typecode. Used by parse routine, so that typecode information discovered during parsing is retained in the pyobj representation and thus can be serialized. cs^ˆˆijotdˆ‚ndˆf‡‡d†ƒY}dˆi|_|ˆiˆ': key = key[1:-1] self.id_dict[key] = part key = head.get('content-location') if key: self.loc_dict[key] = part mf.pop() def GetSOAPPart(self): '''Get the SOAP body part. ''' head, part = self.parts[0] return StringIO.StringIO(part.getvalue()) def get(self, uri): '''Get the content for the bodypart identified by the uri. ''' if uri.startswith('cid:'): # Content-ID, so raise exception if not found. head, part = self.id_dict[uri[4:]] return StringIO.StringIO(part.getvalue()) if self.loc_dict.has_key(uri): head, part = self.loc_dict[uri] return StringIO.StringIO(part.getvalue()) return None def Opaque(self, uri, tc, ps, **keywords): content = self.get(uri) if content: return content.getvalue() if not self.next: raise EvaluateException("Unresolvable URI " + uri) return self.next.Opaque(uri, tc, ps, **keywords) def XML(self, uri, tc, ps, **keywords): content = self.get(uri) if content: dom = ps.readerclass().fromStream(content) return _child_elements(dom)[0] if not self.next: raise EvaluateException("Unresolvable URI " + uri) return self.next.XML(uri, tc, ps, **keywords) def Resolve(self, uri, tc, ps, **keywords): if isinstance(tc, TC.XML): return self.XML(uri, tc, ps, **keywords) return self.Opaque(uri, tc, ps, **keywords) def __getitem__(self, cid): head, body = self.id_dict[cid] newio = StringIO.StringIO(body.getvalue()) return newio if __name__ == '__main__': print _copyright PK/¤Y5i!êhhZSI/TCcompound.py#! /usr/bin/env python # $Header$ '''Compound typecodes. ''' from ZSI import _copyright, _children, _child_elements, \ _inttypes, _stringtypes, _seqtypes, _find_arraytype, _find_href, \ _find_type, _find_xmlns_prefix, _get_idstr, EvaluateException, \ ParseException from TC import _get_element_nsuri_name, \ _get_xsitype, TypeCode, Any, AnyElement, AnyType, \ Nilled, UNBOUNDED from schema import ElementDeclaration, TypeDefinition, \ _get_substitute_element, _get_type_definition from ZSI.wstools.Namespaces import SCHEMA, SOAP from ZSI.wstools.Utility import SplitQName from ZSI.wstools.logging import getLogger as _GetLogger import re, types _find_arrayoffset = lambda E: E.getAttributeNS(SOAP.ENC, "offset") _find_arrayposition = lambda E: E.getAttributeNS(SOAP.ENC, "position") _offset_pat = re.compile(r'\[[0-9]+\]') _position_pat = _offset_pat def _check_typecode_list(ofwhat, tcname): '''Check a list of typecodes for compliance with Struct requirements.''' for o in ofwhat: if callable(o): #skip if _Mirage continue if not isinstance(o, TypeCode): raise TypeError( tcname + ' ofwhat outside the TypeCode hierarchy, ' + str(o.__class__)) if o.pname is None and not isinstance(o, AnyElement): raise TypeError(tcname + ' element ' + str(o) + ' has no name') def _get_type_or_substitute(typecode, pyobj, sw, elt): '''return typecode or substitute type for wildcard or derived type. For serialization only. ''' sub = getattr(pyobj, 'typecode', typecode) if sub is typecode or sub is None: return typecode # Element WildCard if isinstance(typecode, AnyElement): return sub # Global Element Declaration if isinstance(sub, ElementDeclaration): if (typecode.nspname,typecode.pname) == (sub.nspname,sub.pname): raise TypeError(\ 'bad usage, failed to serialize element reference (%s, %s), in: %s' % (typecode.nspname, typecode.pname, sw.Backtrace(elt),)) raise TypeError(\ 'failed to serialize (%s, %s) illegal sub GED (%s,%s): %s' % (typecode.nspname, typecode.pname, sub.nspname, sub.pname, sw.Backtrace(elt),)) # Local Element if not isinstance(typecode, AnyType) and not isinstance(sub, typecode.__class__): raise TypeError(\ 'failed to serialize substitute %s for %s, not derivation: %s' % (sub, typecode, sw.Backtrace(elt),)) sub.nspname = typecode.nspname sub.pname = typecode.pname sub.aname = typecode.aname sub.minOccurs = 1 sub.maxOccurs = 1 return sub def _get_any_instances(ofwhat, d): '''Run thru list ofwhat.anames and find unmatched keys in value dictionary d. Assume these are element wildcard instances. ''' any_keys = [] anames = map(lambda what: what.aname, ofwhat) for aname,pyobj in d.items(): if isinstance(pyobj, AnyType) or aname in anames or pyobj is None: continue any_keys.append(aname) return any_keys class ComplexType(TypeCode): '''Represents an element of complexType, potentially containing other elements. ''' logger = _GetLogger('ZSI.TCcompound.ComplexType') def __init__(self, pyclass, ofwhat, pname=None, inorder=False, inline=False, mutable=True, mixed=False, mixed_aname='_text', **kw): '''pyclass -- the Python class to hold the fields ofwhat -- a list of fields to be in the complexType inorder -- fields must be in exact order or not inline -- don't href/id when serializing mutable -- object could change between multiple serializations type -- the (URI,localname) of the datatype mixed -- mixed content model? True/False mixed_aname -- if mixed is True, specify text content here. Default _text ''' TypeCode.__init__(self, pname, pyclass=pyclass, **kw) self.inorder = inorder self.inline = inline self.mutable = mutable self.mixed = mixed self.mixed_aname = None if mixed is True: self.mixed_aname = mixed_aname if self.mutable is True: self.inline = True self.type = kw.get('type') or _get_xsitype(self) t = type(ofwhat) if t not in _seqtypes: raise TypeError( 'Struct ofwhat must be list or sequence, not ' + str(t)) self.ofwhat = tuple(ofwhat) if TypeCode.typechecks: # XXX Not sure how to determine if new-style class.. if self.pyclass is not None and \ type(self.pyclass) is not types.ClassType and not isinstance(self.pyclass, object): raise TypeError('pyclass must be None or an old-style/new-style class, not ' + str(type(self.pyclass))) _check_typecode_list(self.ofwhat, 'ComplexType') def parse(self, elt, ps): debug = self.logger.debugOn() debug and self.logger.debug('parse') xtype = self.checkname(elt, ps) if self.type and xtype not in [ self.type, (None,None) ]: if not isinstance(self, TypeDefinition): raise EvaluateException(\ 'ComplexType for %s has wrong type(%s), looking for %s' % (self.pname, self.checktype(elt,ps), self.type), ps.Backtrace(elt)) else: #TODO: mabye change MRO to handle this debug and self.logger.debug('delegate to substitute type') what = TypeDefinition.getSubstituteType(self, elt, ps) return what.parse(elt, ps) href = _find_href(elt) if href: if _children(elt): raise EvaluateException('Struct has content and HREF', ps.Backtrace(elt)) elt = ps.FindLocalHREF(href, elt) c = _child_elements(elt) count = len(c) if self.nilled(elt, ps): return Nilled # Create the object. v = {} # parse all attributes contained in attribute_typecode_dict (user-defined attributes), # the values (if not None) will be keyed in self.attributes dictionary. attributes = self.parse_attributes(elt, ps) if attributes: v[self.attrs_aname] = attributes #MIXED if self.mixed is True: v[self.mixed_aname] = self.simple_value(elt,ps, mixed=True) # Clone list of kids (we null it out as we process) c, crange = c[:], range(len(c)) # Loop over all items we're expecting if debug: self.logger.debug("ofwhat: %s",str(self.ofwhat)) any = None for i,what in [ (i, self.ofwhat[i]) for i in range(len(self.ofwhat)) ]: # retrieve typecode if it is hidden if callable(what): what = what() # Loop over all available kids if debug: self.logger.debug("what: (%s,%s)", what.nspname, what.pname) for j,c_elt in [ (j, c[j]) for j in crange if c[j] ]: if debug: self.logger.debug("child node: (%s,%s)", c_elt.namespaceURI, c_elt.tagName) if what.name_match(c_elt): # Parse value, and mark this one done. try: value = what.parse(c_elt, ps) except EvaluateException, e: #what = _get_substitute_element(c_elt, what) #value = what.parse(c_elt, ps) raise if what.maxOccurs > 1: if v.has_key(what.aname): v[what.aname].append(value) else: v[what.aname] = [value] c[j] = None continue else: v[what.aname] = value c[j] = None break else: if debug: self.logger.debug("no element (%s,%s)", what.nspname, what.pname) # No match; if it was supposed to be here, that's an error. if self.inorder is True and i == j: raise EvaluateException('Out of order complexType', ps.Backtrace(c_elt)) else: # only supporting 1 declaration in content. if isinstance(what,AnyElement): any = what elif hasattr(what, 'default'): v[what.aname] = what.default elif what.minOccurs > 0 and not v.has_key(what.aname): raise EvaluateException('Element "' + what.aname + \ '" missing from complexType', ps.Backtrace(elt)) # Look for wildcards and unprocessed children # XXX Stick all this stuff in "any", hope for no collisions if any is not None: occurs = 0 v[any.aname] = [] for j,c_elt in [ (j, c[j]) for j in crange if c[j] ]: value = any.parse(c_elt, ps) if any.maxOccurs == UNBOUNDED or any.maxOccurs > 1: v[any.aname].append(value) else: v[any.aname] = value occurs += 1 # No such thing as nillable if any.maxOccurs == 1 and occurs == 0: v[any.aname] = None elif occurs < any.minOccurs or (any.maxOccurs!=UNBOUNDED and any.maxOccurs elements(#%d) bound by (%d,%s)' %( occurs, any.minOccurs,str(any.maxOccurs)), ps.Backtrace(elt)) if not self.pyclass: return v # type definition must be informed of element tag (nspname,pname), # element declaration is initialized with a tag. try: pyobj = self.pyclass() except Exception, e: raise TypeError("Constructing element (%s,%s) with pyclass(%s), %s" \ %(self.nspname, self.pname, self.pyclass.__name__, str(e))) for key in v.keys(): setattr(pyobj, key, v[key]) return pyobj def serialize(self, elt, sw, pyobj, inline=False, name=None, **kw): if inline or self.inline: self.cb(elt, sw, pyobj, name=name, **kw) else: objid = _get_idstr(pyobj) ns,n = self.get_name(name, objid) el = elt.createAppendElement(ns, n) el.setAttributeNS(None, 'href', "#%s" %objid) sw.AddCallback(self.cb, elt, sw, pyobj) def cb(self, elt, sw, pyobj, name=None, **kw): debug = self.logger.debugOn() if debug: self.logger.debug("cb: %s" %str(self.ofwhat)) objid = _get_idstr(pyobj) ns,n = self.get_name(name, objid) if pyobj is None: if self.nillable is True: elem = elt.createAppendElement(ns, n) self.serialize_as_nil(elem) return raise EvaluateException, 'element(%s,%s) is not nillable(%s)' %( self.nspname,self.pname,self.nillable) if self.mutable is False and sw.Known(pyobj): return if debug: self.logger.debug("element: (%s, %s)", str(ns), n) if n is not None: elem = elt.createAppendElement(ns, n) self.set_attributes(elem, pyobj) if kw.get('typed', self.typed) is True: self.set_attribute_xsi_type(elem) #MIXED For now just stick it in front. if self.mixed is True and self.mixed_aname is not None: if hasattr(pyobj, self.mixed_aname): textContent = getattr(pyobj, self.mixed_aname) if hasattr(textContent, 'typecode'): textContent.typecode.serialize_text_node(elem, sw, textContent) elif type(textContent) in _stringtypes: if debug: self.logger.debug("mixed text content:\n\t%s", textContent) elem.createAppendTextNode(textContent) else: raise EvaluateException('mixed test content in element (%s,%s) must be a string type' %( self.nspname,self.pname), sw.Backtrace(elt)) else: if debug: self.logger.debug("mixed NO text content in %s", self.mixed_aname) else: #For information items w/o tagNames # ie. model groups,SOAP-ENC:Header elem = elt if self.inline: pass elif not self.inline and self.unique: raise EvaluateException('Not inline, but unique makes no sense. No href/id.', sw.Backtrace(elt)) elif n is not None: self.set_attribute_id(elem, objid) if self.pyclass and type(self.pyclass) is type: f = lambda attr: getattr(pyobj, attr, None) elif self.pyclass: d = pyobj.__dict__ f = lambda attr: d.get(attr) else: d = pyobj f = lambda attr: pyobj.get(attr) if TypeCode.typechecks and type(d) != types.DictType: raise TypeError("Classless struct didn't get dictionary") indx, lenofwhat = 0, len(self.ofwhat) if debug: self.logger.debug('element declaration (%s,%s)', self.nspname, self.pname) if self.type: self.logger.debug('xsi:type definition (%s,%s)', self.type[0], self.type[1]) else: self.logger.warning('NO xsi:type') while indx < lenofwhat: occurs = 0 what = self.ofwhat[indx] # retrieve typecode if hidden if callable(what): what = what() if debug: self.logger.debug('serialize what -- %s', what.__class__.__name__) # No way to order instances, so just grab any unmatched # anames and serialize them. Only support one in all content. # Must be self-describing instances # Regular handling of declared elements aname = what.aname v = f(aname) indx += 1 if what.minOccurs == 0 and v is None: continue # Default to typecode, if self-describing instance, and check # to make sure it is derived from what. whatTC = what if whatTC.maxOccurs > 1 and v is not None: if type(v) not in _seqtypes: raise EvaluateException('pyobj (%s,%s), aname "%s": maxOccurs %s, expecting a %s' %( self.nspname,self.pname,what.aname,whatTC.maxOccurs,_seqtypes), sw.Backtrace(elt)) for v2 in v: occurs += 1 if occurs > whatTC.maxOccurs: raise EvaluateException('occurances (%d) exceeded maxOccurs(%d) for <%s>' %( occurs, whatTC.maxOccurs, what.pname), sw.Backtrace(elt)) what = _get_type_or_substitute(whatTC, v2, sw, elt) if debug and what is not whatTC: self.logger.debug('substitute derived type: %s' % what.__class__) what.serialize(elem, sw, v2, **kw) # try: # what.serialize(elem, sw, v2, **kw) # except Exception, e: # raise EvaluateException('Serializing %s.%s, %s %s' % # (n, whatTC.aname or '?', e.__class__.__name__, str(e))) if occurs < whatTC.minOccurs: raise EvaluateException(\ 'occurances(%d) less than minOccurs(%d) for <%s>' % (occurs, whatTC.minOccurs, what.pname), sw.Backtrace(elt)) continue if v is not None or what.nillable is True: what = _get_type_or_substitute(whatTC, v, sw, elt) if debug and what is not whatTC: self.logger.debug('substitute derived type: %s' % what.__class__) what.serialize(elem, sw, v, **kw) # try: # what.serialize(elem, sw, v, **kw) # except (ParseException, EvaluateException), e: # raise # except Exception, e: # raise EvaluateException('Serializing %s.%s, %s %s' % # (n, whatTC.aname or '?', e.__class__.__name__, str(e)), # sw.Backtrace(elt)) continue raise EvaluateException('Got None for nillable(%s), minOccurs(%d) element (%s,%s), %s' % (what.nillable, what.minOccurs, what.nspname, what.pname, elem), sw.Backtrace(elt)) def setDerivedTypeContents(self, extensions=None, restrictions=None): """For derived types set appropriate parameter and """ if extensions: ofwhat = list(self.ofwhat) if type(extensions) in _seqtypes: ofwhat += list(extensions) else: ofwhat.append(extensions) elif restrictions: if type(restrictions) in _seqtypes: ofwhat = restrictions else: ofwhat = (restrictions,) else: return self.ofwhat = tuple(ofwhat) self.lenofwhat = len(self.ofwhat) class Struct(ComplexType): '''Struct is a complex type for accessors identified by name. Constraint: No element may have the same name as any other, nor may any element have a maxOccurs > 1. ''' logger = _GetLogger('ZSI.TCcompound.Struct') def __init__(self, pyclass, ofwhat, pname=None, inorder=False, inline=False, mutable=True, **kw): '''pyclass -- the Python class to hold the fields ofwhat -- a list of fields to be in the struct inorder -- fields must be in exact order or not inline -- don't href/id when serializing mutable -- object could change between multiple serializations ''' ComplexType.__init__(self, pyclass, ofwhat, pname=pname, inorder=inorder, inline=inline, mutable=mutable, **kw ) # Check Constraints whats = map(lambda what: (what.nspname,what.pname), self.ofwhat) for idx in range(len(self.ofwhat)): what = self.ofwhat[idx] key = (what.nspname,what.pname) if not isinstance(what, AnyElement) and what.maxOccurs > 1: raise TypeError,\ 'Constraint: no element can have a maxOccurs>1' if key in whats[idx+1:]: raise TypeError,\ 'Constraint: No element may have the same name as any other' class Array(TypeCode): '''An array. atype -- arrayType, (namespace,ncname) mutable -- object could change between multiple serializations undeclared -- do not serialize/parse arrayType attribute. ''' logger = _GetLogger('ZSI.TCcompound.Array') def __init__(self, atype, ofwhat, pname=None, dimensions=1, fill=None, sparse=False, mutable=False, size=None, nooffset=0, undeclared=False, childnames=None, **kw): TypeCode.__init__(self, pname, **kw) self.dimensions = dimensions self.atype = atype if undeclared is False and self.atype[1].endswith(']') is False: self.atype = (self.atype[0], '%s[]' %self.atype[1]) # Support multiple dimensions if self.dimensions != 1: raise TypeError("Only single-dimensioned arrays supported") self.fill = fill self.sparse = sparse #if self.sparse: ofwhat.minOccurs = 0 self.mutable = mutable self.size = size self.nooffset = nooffset self.undeclared = undeclared self.childnames = childnames if self.size: t = type(self.size) if t in _inttypes: self.size = (self.size,) elif t in _seqtypes: self.size = tuple(self.size) elif TypeCode.typechecks: raise TypeError('Size must be integer or list, not ' + str(t)) if TypeCode.typechecks: if self.undeclared is False and type(atype) not in _seqtypes and len(atype) == 2: raise TypeError("Array type must be a sequence of len 2.") t = type(ofwhat) if not isinstance(ofwhat, TypeCode): raise TypeError( 'Array ofwhat outside the TypeCode hierarchy, ' + str(ofwhat.__class__)) if self.size: if len(self.size) != self.dimensions: raise TypeError('Array dimension/size mismatch') for s in self.size: if type(s) not in _inttypes: raise TypeError('Array size "' + str(s) + '" is not an integer.') self.ofwhat = ofwhat def parse_offset(self, elt, ps): o = _find_arrayoffset(elt) if not o: return 0 if not _offset_pat.match(o): raise EvaluateException('Bad offset "' + o + '"', ps.Backtrace(elt)) return int(o[1:-1]) def parse_position(self, elt, ps): o = _find_arrayposition(elt) if not o: return None if o.find(','): raise EvaluateException('Sorry, no multi-dimensional arrays', ps.Backtrace(elt)) if not _position_pat.match(o): raise EvaluateException('Bad array position "' + o + '"', ps.Backtrace(elt)) return int(o[-1:1]) def parse(self, elt, ps): href = _find_href(elt) if href: if _children(elt): raise EvaluateException('Array has content and HREF', ps.Backtrace(elt)) elt = ps.FindLocalHREF(href, elt) if self.nilled(elt, ps): return Nilled if not _find_arraytype(elt) and self.undeclared is False: raise EvaluateException('Array expected', ps.Backtrace(elt)) t = _find_type(elt) if t: pass # XXX should check the type, but parsing that is hairy. offset = self.parse_offset(elt, ps) v, vlen = [], 0 if offset and not self.sparse: while vlen < offset: vlen += 1 v.append(self.fill) for c in _child_elements(elt): item = self.ofwhat.parse(c, ps) position = self.parse_position(c, ps) or offset if self.sparse: v.append((position, item)) else: while offset < position: offset += 1 v.append(self.fill) v.append(item) offset += 1 return v def serialize(self, elt, sw, pyobj, name=None, childnames=None, **kw): debug = self.logger.debugOn() if debug: self.logger.debug("serialize: %r" %pyobj) if self.mutable is False and sw.Known(pyobj): return objid = _get_idstr(pyobj) ns,n = self.get_name(name, objid) el = elt.createAppendElement(ns, n) # nillable if self.nillable is True and pyobj is None: self.serialize_as_nil(el) return None # other attributes self.set_attributes(el, pyobj) # soap href attribute unique = self.unique or kw.get('unique', False) if unique is False and sw.Known(pyobj): self.set_attribute_href(el, objid) return None # xsi:type attribute if kw.get('typed', self.typed) is True: self.set_attribute_xsi_type(el, **kw) # soap id attribute if self.unique is False: self.set_attribute_id(el, objid) offset = 0 if self.sparse is False and self.nooffset is False: offset, end = 0, len(pyobj) while offset < end and pyobj[offset] == self.fill: offset += 1 if offset: el.setAttributeNS(SOAP.ENC, 'offset', '[%d]' %offset) if self.undeclared is False: el.setAttributeNS(SOAP.ENC, 'arrayType', '%s:%s' %(el.getPrefix(self.atype[0]), self.atype[1]) ) if debug: self.logger.debug("ofwhat: %r" %self.ofwhat) d = {} kn = childnames or self.childnames if kn: d['name'] = kn elif not self.ofwhat.aname: d['name'] = 'element' if self.sparse is False: for e in pyobj[offset:]: self.ofwhat.serialize(el, sw, e, **d) else: position = 0 for pos, v in pyobj: if pos != position: el.setAttributeNS(SOAP.ENC, 'position', '[%d]' %pos) position = pos self.ofwhat.serialize(el, sw, v, **d) position += 1 if __name__ == '__main__': print _copyright PK/¤Y5WÿŒÁ.Á. ZSI/schema.py#! /usr/bin/env python # $Header$ '''XML Schema support ''' from ZSI import _copyright, _seqtypes, _find_type, EvaluateException from ZSI.wstools.Namespaces import SCHEMA, SOAP from ZSI.wstools.Utility import SplitQName def _get_type_definition(namespaceURI, name, **kw): return SchemaInstanceType.getTypeDefinition(namespaceURI, name, **kw) def _get_global_element_declaration(namespaceURI, name, **kw): return SchemaInstanceType.getElementDeclaration(namespaceURI, name, **kw) def _get_substitute_element(elt, what): raise NotImplementedError, 'Not implemented' def _has_type_definition(namespaceURI, name): return SchemaInstanceType.getTypeDefinition(namespaceURI, name) is not None # # functions for retrieving schema items from # the global schema instance. # GED = _get_global_element_declaration GTD = _get_type_definition def WrapImmutable(pyobj, what): '''Wrap immutable instance so a typecode can be set, making it self-describing ie. serializable. ''' return _GetPyobjWrapper.WrapImmutable(pyobj, what) def RegisterBuiltin(arg): '''Add a builtin to be registered, and register it with the Any typecode. ''' _GetPyobjWrapper.RegisterBuiltin(arg) _GetPyobjWrapper.RegisterAnyElement() def RegisterAnyElement(): '''register all Wrapper classes with the Any typecode. This allows instances returned by Any to be self-describing. ie. serializable. AnyElement falls back on Any to parse anything it doesn't understand. ''' return _GetPyobjWrapper.RegisterAnyElement() class SchemaInstanceType(type): '''Register all types/elements, when hit already defined class dont create a new one just give back reference. Thus import order determines which class is loaded. class variables: types -- dict of typecode classes definitions representing global type definitions. elements -- dict of typecode classes representing global element declarations. element_typecode_cache -- dict of typecode instances representing global element declarations. ''' types = {} elements = {} element_typecode_cache = {} def __new__(cls,classname,bases,classdict): '''If classdict has literal and schema register it as a element declaration, else if has type and schema register it as a type definition. ''' if classname in ['ElementDeclaration', 'TypeDefinition', 'LocalElementDeclaration',]: return type.__new__(cls,classname,bases,classdict) if ElementDeclaration in bases: if classdict.has_key('schema') is False or classdict.has_key('literal') is False: raise AttributeError, 'ElementDeclaration must define schema and literal attributes' key = (classdict['schema'],classdict['literal']) if SchemaInstanceType.elements.has_key(key) is False: SchemaInstanceType.elements[key] = type.__new__(cls,classname,bases,classdict) return SchemaInstanceType.elements[key] if TypeDefinition in bases: if classdict.has_key('type') is None: raise AttributeError, 'TypeDefinition must define type attribute' key = classdict['type'] if SchemaInstanceType.types.has_key(key) is False: SchemaInstanceType.types[key] = type.__new__(cls,classname,bases,classdict) return SchemaInstanceType.types[key] if LocalElementDeclaration in bases: return type.__new__(cls,classname,bases,classdict) raise TypeError, 'SchemaInstanceType must be an ElementDeclaration or TypeDefinition ' def getTypeDefinition(cls, namespaceURI, name, lazy=False): '''Grab a type definition, returns a typecode class definition because the facets (name, minOccurs, maxOccurs) must be provided. Parameters: namespaceURI -- name -- ''' klass = cls.types.get((namespaceURI, name), None) if lazy and klass is not None: return _Mirage(klass) return klass getTypeDefinition = classmethod(getTypeDefinition) def getElementDeclaration(cls, namespaceURI, name, isref=False, lazy=False): '''Grab an element declaration, returns a typecode instance representation or a typecode class definition. An element reference has its own facets, and is local so it will not be cached. Parameters: namespaceURI -- name -- isref -- if element reference, return class definition. ''' key = (namespaceURI, name) if isref: klass = cls.elements.get(key,None) if klass is not None and lazy is True: return _Mirage(klass) return klass typecode = cls.element_typecode_cache.get(key, None) if typecode is None: tcls = cls.elements.get(key,None) if tcls is not None: typecode = cls.element_typecode_cache[key] = tcls() typecode.typed = False return typecode getElementDeclaration = classmethod(getElementDeclaration) class ElementDeclaration: '''Typecodes subclass to represent a Global Element Declaration by setting class variables schema and literal. schema = namespaceURI literal = NCName ''' __metaclass__ = SchemaInstanceType class LocalElementDeclaration: '''Typecodes subclass to represent a Local Element Declaration. ''' __metaclass__ = SchemaInstanceType class TypeDefinition: '''Typecodes subclass to represent a Global Type Definition by setting class variable type. type = (namespaceURI, NCName) ''' __metaclass__ = SchemaInstanceType def getSubstituteType(self, elt, ps): '''if xsi:type does not match the instance type attr, check to see if it is a derived type substitution. DONT Return the element's type. Parameters: elt -- the DOM element being parsed ps -- the ParsedSoap object. ''' pyclass = SchemaInstanceType.getTypeDefinition(*self.type) if pyclass is None: raise EvaluateException( 'No Type registed for xsi:type=(%s, %s)' % (self.type[0], self.type[1]), ps.Backtrace(elt)) typeName = _find_type(elt) prefix,typeName = SplitQName(typeName) uri = ps.GetElementNSdict(elt).get(prefix) subclass = SchemaInstanceType.getTypeDefinition(uri, typeName) if subclass is None: raise EvaluateException( 'No registered xsi:type=(%s, %s), substitute for xsi:type=(%s, %s)' % (uri, typeName, self.type[0], self.type[1]), ps.Backtrace(elt)) if not issubclass(subclass, pyclass) and subclass(None) and not issubclass(subclass, pyclass): raise TypeError( 'Substitute Type (%s, %s) is not derived from %s' % (self.type[0], self.type[1], pyclass), ps.Backtrace(elt)) return subclass((self.nspname, self.pname)) class _Mirage: '''Used with SchemaInstanceType for lazy evaluation, eval during serialize or parse as needed. Mirage is callable, TypeCodes are not. When called it returns the typecode. Tightly coupled with generated code. NOTE: **Must Use ClassType** for intended MRO of __call__ since setting it in an instance attribute rather than a class attribute (will not work for object). ''' def __init__(self, klass): self.klass = klass self.__reveal = False self.__cache = None if issubclass(klass, ElementDeclaration): self.__call__ = self._hide_element def __str__(self): msg = "" if issubclass(self.klass, ElementDeclaration): msg = "" return msg %(id(self), self.klass) def _hide_type(self, pname, aname, minOccurs=0, maxOccurs=1, nillable=False, **kw): self.__call__ = self._reveal_type self.__reveal = True # store all attributes, make some visable for pyclass_type self.__kw = kw self.minOccurs,self.maxOccurs,self.nillable = minOccurs,maxOccurs,nillable self.nspname,self.pname,self.aname = None,pname,aname if type(self.pname) in (tuple,list): self.nspname,self.pname = pname return self def _hide_element(self, minOccurs=0, maxOccurs=1, nillable=False, **kw): self.__call__ = self._reveal_element self.__reveal = True # store all attributes, make some visable for pyclass_type self.__kw = kw self.nspname = self.klass.schema self.pname = self.klass.literal #TODO: Fix hack #self.aname = '_%s' %self.pname self.minOccurs,self.maxOccurs,self.nillable = minOccurs,maxOccurs,nillable return self def _reveal_type(self): if self.__cache is None: self.__cache = self.klass(pname=self.pname, aname=self.aname, minOccurs=self.minOccurs, maxOccurs=self.maxOccurs, nillable=self.nillable, **self.__kw) return self.__cache def _reveal_element(self): if self.__cache is None: self.__cache = self.klass(minOccurs=self.minOccurs, maxOccurs=self.maxOccurs, nillable=self.nillable, **self.__kw) return self.__cache __call__ = _hide_type class _GetPyobjWrapper: '''Get a python object that wraps data and typecode. Used by parse routine, so that typecode information discovered during parsing is retained in the pyobj representation and thus can be serialized. ''' types_dict = {} def RegisterBuiltin(cls, arg): '''register a builtin, create a new wrapper. ''' if arg in cls.types_dict: raise RuntimeError, '%s already registered' %arg class _Wrapper(arg): 'Wrapper for builtin %s\n%s' %(arg, cls.__doc__) _Wrapper.__name__ = '_%sWrapper' %arg.__name__ cls.types_dict[arg] = _Wrapper RegisterBuiltin = classmethod(RegisterBuiltin) def RegisterAnyElement(cls): '''If find registered TypeCode instance, add Wrapper class to TypeCode class serialmap and Re-RegisterType. Provides Any serialzation of any instances of the Wrapper. ''' for k,v in cls.types_dict.items(): what = Any.serialmap.get(k) if what is None: continue if v in what.__class__.seriallist: continue what.__class__.seriallist.append(v) RegisterType(what.__class__, clobber=1, **what.__dict__) RegisterAnyElement = classmethod(RegisterAnyElement) def WrapImmutable(cls, pyobj, what): '''return a wrapper for pyobj, with typecode attribute set. Parameters: pyobj -- instance of builtin type (immutable) what -- typecode describing the data ''' d = cls.types_dict if type(pyobj) is bool: pyclass = d[int] elif d.has_key(type(pyobj)) is True: pyclass = d[type(pyobj)] else: raise TypeError,\ 'Expecting a built-in type in %s (got %s).' %( d.keys(),type(pyobj)) newobj = pyclass(pyobj) newobj.typecode = what return newobj WrapImmutable = classmethod(WrapImmutable) from TC import Any, RegisterType if __name__ == '__main__': print _copyright PK‚¨58ÿPÙácácZSI/TCcompound.pyc;ò Z@Ec@sŽdZdklZlZlZlZlZlZlZl Z l Z l Z l Z l Z lZdklZlZlZlZlZlZlZlZdklZlZlZlZdklZlZdk l!Z!dk"l#Z$dk%Z%dk&Z&d„Z'd „Z(e%i)d ƒZ*e*Z+d „Z,d „Z-d „Z.defd„ƒYZ/de/fd„ƒYZ0defd„ƒYZ1e2djo eGHndS(sCompound typecodes. ( s _copyrights _childrens_child_elementss _inttypess _stringtypess _seqtypess_find_arraytypes _find_hrefs _find_types_find_xmlns_prefixs _get_idstrsEvaluateExceptionsParseException(s_get_element_nsuri_names _get_xsitypesTypeCodesAnys AnyElementsAnyTypesNilleds UNBOUNDED(sElementDeclarationsTypeDefinitions_get_substitute_elements_get_type_definition(sSCHEMAsSOAP(s SplitQName(s getLoggerNcCs|itidƒS(Nsoffset(sEsgetAttributeNSsSOAPsENC(sE((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysscCs|itidƒS(Nsposition(sEsgetAttributeNSsSOAPsENC(sE((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysss \[[0-9]+\]cCsžx—|D]}t|ƒoqnt|tƒ o!t|dt|iƒƒ‚n|i t jot|t ƒ o"t|dt|ƒdƒ‚qqWdS(sFCheck a list of typecodes for compliance with Struct requirements.s( ofwhat outside the TypeCode hierarchy, s element s has no nameN( sofwhatsoscallables isinstancesTypeCodes TypeErrorstcnamesstrs __class__spnamesNones AnyElement(sofwhatstcnameso((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys_check_typecode_lists !!cCsnt|d|ƒ}||jp |tjo|Snt|tƒo|Snt|tƒo‰|i|i f|i|i fjo,t d|i|i |i |ƒfƒ‚nt d|i|i |i|i |i |ƒfƒ‚nt|tƒ ot||iƒ o&t d|||i |ƒfƒ‚n|i|_|i |_ |i|_d|_d|_|SdS(sbreturn typecode or substitute type for wildcard or derived type. For serialization only. stypecodesAbad usage, failed to serialize element reference (%s, %s), in: %ss8failed to serialize (%s, %s) illegal sub GED (%s,%s): %ss=failed to serialize substitute %s for %s, not derivation: %siN(sgetattrspyobjstypecodessubsNones isinstances AnyElementsElementDeclarationsnspnamespnames TypeErrorssws BacktraceseltsAnyTypes __class__sanames minOccurss maxOccurs(stypecodespyobjsswseltssub((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys_get_type_or_substitute+s$%,8%&     cCs{g}td„|ƒ}xX|iƒD]J\}}t|t ƒp||jp |t joq%n|i |ƒq%W|SdS(sƒRun thru list ofwhat.anames and find unmatched keys in value dictionary d. Assume these are element wildcard instances. cCs|iS(N(swhatsaname(swhat((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysVsN( sany_keyssmapsofwhatsanamessdsitemssanamespyobjs isinstancesAnyTypesNonesappend(sofwhatsdsanamesanamesspyobjsany_keys((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys_get_any_instancesQs *s ComplexTypecBshtZdZedƒZeeeeedd„Zd„Z eed„Z ed„Z eed„Z RS(sVRepresents an element of complexType, potentially containing other elements. sZSI.TCcompound.ComplexTypes_textc Ks`ti||d|| ||_||_||_||_ t |_ |t jo ||_ n|it jo t |_n| i dƒp t|ƒ|_t|ƒ} | tjotdt| ƒƒ‚nt|ƒ|_tiot|it j o*t|iƒtij ot|itƒ o#tdtt|iƒƒƒ‚nt|idƒndS(sÚpyclass -- the Python class to hold the fields ofwhat -- a list of fields to be in the complexType inorder -- fields must be in exact order or not inline -- don't href/id when serializing mutable -- object could change between multiple serializations type -- the (URI,localname) of the datatype mixed -- mixed content model? True/False mixed_aname -- if mixed is True, specify text content here. Default _text spyclassstypes,Struct ofwhat must be list or sequence, not s:pyclass must be None or an old-style/new-style class, not s ComplexTypeN(sTypeCodes__init__sselfspnamespyclassskwsinordersinlinesmutablesmixedsNones mixed_anamesTruesgets _get_xsitypestypesofwhatsts _seqtypess TypeErrorsstrstuples typechecksstypess ClassTypes isinstancesobjects_check_typecode_list( sselfspyclasssofwhatspnamesinordersinlinesmutablesmixeds mixed_anameskwst((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys__init__fs(            =#cCsÒ|iiƒ}|o|iidƒ|i||ƒ}|io||it t fgjoŒt |t ƒ o;t d|i |i||ƒ|if|i|ƒƒ‚qê|o|iidƒt i|||ƒ}|i||ƒSnt|ƒ}|o?t|ƒot d|i|ƒƒ‚n|i||ƒ}nt|ƒ} t| ƒ} |i||ƒotSnh}|i||ƒ}|o|||i ~D]g\}}t-|ƒo |ƒ}n|o |iid|i.|i ƒnxgi*}|D])}| |o||| |fƒqÀqÀ~D]L\}} |o |iid| i1| i2ƒn|i3| ƒo©y|i| |ƒ}Wnt j o }‚nX|i6d joL|i7|i8ƒo||i8i*|ƒn|g||i8 elements(#%d) bound by (%d,%s)s1Constructing element (%s,%s) with pyclass(%s), %s(HsselfsloggersdebugOnsdebugs checknameseltspssxtypestypesNones isinstancesTypeDefinitionsEvaluateExceptionspnames checktypes BacktracesgetSubstituteTypeswhatsparses _find_hrefshrefs _childrens FindLocalHREFs_child_elementsscslenscountsnilledsNilledsvsparse_attributess attributess attrs_anamesmixedsTrues simple_values mixed_anamesrangescrangesstrsofwhatsanysappends_[1]siscallablesnspnamesjsc_elts namespaceURIstagNames name_matchsvalueses maxOccursshas_keysanamesinorders AnyElementshasattrsdefaults minOccurssoccurss UNBOUNDEDspyclassspyobjs Exceptions TypeErrors__name__skeysskeyssetattr(sselfseltspssxtypeshrefsanyswhatscrangespyobjsoccursskeysc_eltscountscsesisjsvalues_[1]svsdebugs attributes((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysparse‰sº&%    # D   A      $  A   0 3 c Ks›|p|io |i|||d||ngt|ƒ} |i || ƒ\} }|i | |ƒ}|itdd| ƒ|i|i|||ƒdS(Nsnameshrefs#%s(sinlinesselfscbseltsswspyobjsnameskws _get_idstrsobjidsget_namesnssnscreateAppendElementselssetAttributeNSsNones AddCallback( sselfseltsswspyobjsinlinesnameskwselsnsnssobjid((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys serializes  c s¿|iiƒ}|o!|iidt|iƒƒntˆƒ} |i || ƒ\} }ˆt joZ|itjo'|i| |ƒ}|i|ƒdSntd|i|i|if‚n|itjo |iˆƒodSn|o |iidt| ƒ|ƒn|t j oU|i| |ƒ}|i|ˆƒ|id|iƒtjo|i|ƒn|i tjo |i!t j oât"ˆ|i!ƒoªt#ˆ|i!ƒ}t"|dƒo|i%i&|||ƒqkt'|ƒt(jo/|o|iid|ƒn|i)|ƒqktd|i|if|i*|ƒƒ‚qo|o|iid|i!ƒqoqyn|}|i+onS|i+ o|i,otd |i*|ƒƒ‚n"|t j o|i-|| ƒn|i.ot'|i.ƒt'jo‡d †}nf|i.oˆi0‰‡d †}nCˆ‰‡d †}t2i3ot'ˆƒt4i5jot6d ƒ‚ndt7|iƒf\}}|ob|iid|i|iƒ|i'o(|iid|i'd|i'dƒqò|ii:dƒnxÆ||jo¸d} |i|} t=| ƒo | ƒ} n|o|iid| i>i?ƒn| i@}||ƒ}|d7}| iBdjo |t joqõn| }|iDdjo |t j oHt'|ƒtEjo;td|i|i| i@|iDtEf|i*|ƒƒ‚nx±|D]©} | d7} | |iDjo/td| |iD| if|i*|ƒƒ‚ntG|| ||ƒ} |o | |j o|iid| i>ƒn| iH||| |qW| |iBjo/td| |iB| if|i*|ƒƒ‚qõqõn|t j p | itjoatG||||ƒ} |o | |j o|iid| i>ƒn| iH||||qõntd| i| iB| i| i|f|i*|ƒƒ‚qõWdS(Nscb: %ss"element(%s,%s) is not nillable(%s)selement: (%s, %s)stypedstypecodesmixed text content: %ss;mixed test content in element (%s,%s) must be a string typesmixed NO text content in %ss2Not inline, but unique makes no sense. No href/id.cstˆ|tƒS(N(sgetattrspyobjsattrsNone(sattr(spyobj(s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysTscs ˆi|ƒS(N(sdsgetsattr(sattr(sd(s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysWscs ˆi|ƒS(N(spyobjsgetsattr(sattr(spyobj(s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysZss&Classless struct didn't get dictionaryiselement declaration (%s,%s)sxsi:type definition (%s,%s)is NO xsi:typesserialize what -- %ss7pyobj (%s,%s), aname "%s": maxOccurs %s, expecting a %ss/occurances (%d) exceeded maxOccurs(%d) for <%s>ssubstitute derived type: %ss/occurances(%d) less than minOccurs(%d) for <%s>s<Got None for nillable(%s), minOccurs(%d) element (%s,%s), %s(IsselfsloggersdebugOnsdebugsstrsofwhats _get_idstrspyobjsobjidsget_namesnamesnssnsNonesnillablesTrueseltscreateAppendElementselemsserialize_as_nilsEvaluateExceptionsnspnamespnamesmutablesFalsesswsKnownsset_attributesskwsgetstypedsset_attribute_xsi_typesmixeds mixed_anameshasattrsgetattrs textContentstypecodesserialize_text_nodestypes _stringtypesscreateAppendTextNodes Backtracesinlinesuniquesset_attribute_idspyclasssfs__dict__sdsTypeCodes typechecksstypessDictTypes TypeErrorslensindxs lenofwhatswarningsoccursswhatscallables __class__s__name__sanamesvs minOccursswhatTCs maxOccurss _seqtypessv2s_get_type_or_substitutes serialize(sselfseltsswspyobjsnameskwsindxs lenofwhatswhatTCsnssoccurssobjidswhatsv2sanamesdsfs textContentselemsnsvsdebug((spyobjsds2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pyscbsÊ!   #                       %  %cCs¨|oGt|iƒ}t|ƒtjo|t|ƒ7}qƒ|i|ƒn6|o*t|ƒtjo |}qƒ|f}ndSt|ƒ|_t |iƒ|_ dS(s9For derived types set appropriate parameter and N( s extensionsslistsselfsofwhatstypes _seqtypessappends restrictionsstupleslens lenofwhat(sselfs extensionss restrictionssofwhat((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pyssetDerivedTypeContents¶s  ( s__name__s __module__s__doc__s _GetLoggersloggersNonesFalsesTrues__init__sparses serializescbssetDerivedTypeContents(((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys ComplexType`s  # † sStructcBs/tZdZedƒZeeeed„ZRS(s(Struct is a complex type for accessors identified by name. Constraint: No element may have the same name as any other, nor may any element have a maxOccurs > 1. sZSI.TCcompound.Structc KsÖti|||d|d|d|d||t d„|iƒ} xŒt t |iƒƒD]u} |i| }|i|if} t|tƒ o |idjo td‚n| | | djo td‚qYqYWd S( spyclass -- the Python class to hold the fields ofwhat -- a list of fields to be in the struct inorder -- fields must be in exact order or not inline -- don't href/id when serializing mutable -- object could change between multiple serializations spnamesinordersinlinesmutablecCs|i|ifS(N(swhatsnspnamespname(swhat((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysêsis-Constraint: no element can have a maxOccurs>1s:Constraint: No element may have the same name as any otherN(s ComplexTypes__init__sselfspyclasssofwhatspnamesinordersinlinesmutableskwsmapswhatssrangeslensidxswhatsnspnameskeys isinstances AnyElements maxOccurss TypeError( sselfspyclasssofwhatspnamesinordersinlinesmutableskwswhatswhatssidxskey((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys__init__Üs ! ( s__name__s __module__s__doc__s _GetLoggersloggersNonesFalsesTrues__init__(((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysStructÊs  sArrayc BshtZdZedƒZedeeeedeed„ Zd„Zd„Z d„Z eed„Z RS( sÇAn array. atype -- arrayType, (namespace,ncname) mutable -- object could change between multiple serializations undeclared -- do not serialize/parse arrayType attribute. sZSI.TCcompound.Arrayiic Ksnti||| ||_||_| tjo|idi dƒtjo%|idd|idf|_n|idjot dƒ‚n||_ ||_ ||_ ||_| |_| |_| |_|iozt|iƒ}|tjo|if|_qW|tjot|iƒ|_qWtiot dt|ƒƒ‚qWntio|itjo#t|ƒtjot|ƒdjot dƒ‚nt|ƒ}t|tƒ ot d t|iƒƒ‚n|iort|iƒ|ijot d ƒ‚nxF|iD]7} t| ƒtjot d t| ƒd ƒ‚qqWqan||_dS( Nis]is%s[]s(Only single-dimensioned arrays supporteds"Size must be integer or list, not is'Array type must be a sequence of len 2.s-Array ofwhat outside the TypeCode hierarchy, sArray dimension/size mismatchs Array size "s" is not an integer.(sTypeCodes__init__sselfspnameskws dimensionssatypes undeclaredsFalsesendswiths TypeErrorsfillssparsesmutablessizesnooffsets childnamesstypests _inttypess _seqtypesstuples typecheckssstrslensofwhats isinstances __class__ss(sselfsatypesofwhatspnames dimensionssfillssparsesmutablessizesnooffsets undeclareds childnamesskwssst((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys__init__þsH  *%            6   *cCsft|ƒ}| odSnti|ƒ o$td|d|i|ƒƒ‚nt|dd!ƒSdS(Nis Bad offset "s"iiÿÿÿÿ( s_find_arrayoffsetseltsos _offset_patsmatchsEvaluateExceptionspss Backtracesint(sselfseltspsso((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys parse_offset+s cCs’t|ƒ}| otSn|idƒotd|i|ƒƒ‚nti |ƒ o$td|d|i|ƒƒ‚nt |dd!ƒSdS(Ns,s"Sorry, no multi-dimensional arrayssBad array position "s"iÿÿÿÿi( s_find_arraypositionseltsosNonesfindsEvaluateExceptionspss Backtraces _position_patsmatchsint(sselfseltspsso((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysparse_position3s c CsÛt|ƒ}|o?t|ƒotd|i|ƒƒ‚n|i||ƒ}n|i ||ƒot Snt |ƒ o |i t jotd|i|ƒƒ‚nt|ƒ}|on|i||ƒ} gdf\}}| o|i o3x0|| jo|d7}|i|iƒq÷Wnx©t|ƒD]›}|ii||ƒ}|i||ƒp| } |io|i| |fƒn=x,| | jo| d7} |i|iƒqŒW|i|ƒ| d7} q4W|SdS(NsArray has content and HREFsArray expectedii(s _find_hrefseltshrefs _childrensEvaluateExceptionspss Backtraces FindLocalHREFsselfsnilledsNilleds_find_arraytypes undeclaredsFalses _find_typests parse_offsetsoffsetsvsvlenssparsesappendsfills_child_elementsscsofwhatsparsesitemsparse_positionsposition( sselfseltspsscsvsvlensitemshrefstsoffsetsposition((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysparse>sB          cKsx|iiƒ}|o|iid|ƒn|itjo |i|ƒodSnt |ƒ} |i || ƒ\} }|i| |ƒ}|itjo |tjo|i|ƒtSn|i||ƒ|ip|idtƒ}|tjo |i|ƒo|i|| ƒtSn|id|iƒtjo|i||n|itjo|i|| ƒnd} |itjo |i tjotdt!|ƒf\} } x0| | jo|| |i#jo| d7} q´W| o|i$t%i&dd| ƒq n|i'tjo;|i$t%i&dd |i(|i)dƒ|i)dfƒn|o|iid |i*ƒnh}|p|i,}|o||d s\]*>i”s)WSDL not available for that service [%s].sService not found [%s].N(sselfspathslowersendswiths service_pathsserversgetNodesserviceshasattrs_wsdlswsdlsprotos server_names server_ports serviceUrls soapAddresssrescompiles IGNORECASEswsdlressubssend_xmls send_error(sselfsservicesprotos soapAddresss serviceUrlswsdlswsdlres service_path((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysdo_GETgs   " (s__name__s __module__s__doc__sdo_POSTsdo_GET(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysSOAPRequestHandler9s  +sServiceContainercBsctZdZdfd„ƒYZged„Zd„Zed„Zed„Z d„Z d„Z RS( s­HTTPServer that stores service instances according to POST values. An action value is instance specific, and specifies an operation (function) of an instance. sNodeTreecBsDtZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s8Simple dictionary implementation of a node tree cCs h|_dS(N(sselfs_NodeTree__dict(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__init__ŠscCst|iƒSdS(N(sstrsselfs_NodeTree__dict(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__str__scCs|iiƒGHdS(N(sselfs_NodeTree__dictskeys(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys listNodesscCsdti|ƒd}|idƒo|d}n|ii|ƒo|i|Sntd|‚dS(Nis/is"No service(%s) in ServiceContainer( surlparsesurlsplitsurlspaths startswithsselfs_NodeTree__dictshas_keys NoSuchService(sselfsurlspath((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysgetNode“s cCs„ti|ƒd}|idƒo|d}nt|tƒ o td‚n|i i |ƒot d|‚n||i |server_address -- RequestHandlerClass -- cs ˆi|ƒS(N(sselfssetNodess(ss(sself(s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys»sN( s HTTPServers__init__sselfsserver_addresssRequestHandlerClasssNodeTrees_nodessmapsservices(sselfsserver_addresssservicessRequestHandlerClass((sselfs8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__init__µscCs'd|it|ƒt|iƒfSdS(Ns%s(%s) nodes( %s )(sselfs __class__s _get_idstrsstrs_nodes(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__str__½scCsG|i|||ƒ}t|itƒo|||ƒSn||ƒSdS(sÏps -- ParsedSoap representing the request post -- HTTP POST --> instance action -- Soap Action header --> method address -- Address instance representing WS-Address N( sselfs getCallBackspsspostsactionsmethods isinstancesim_selfsSimpleWSResourcesaddress(sselfspsspostsactionsaddresssmethod((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__call__Às cCs4|tjo|iƒ}n|ii||ƒdS(N(surlsNonesservicesgetPostsselfs_nodesssetNode(sselfsservicesurl((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pyssetNodeÌs cCs|ii|ƒSdS(N(sselfs_nodessgetNodesurl(sselfsurl((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysgetNodeÑscCs|ii|ƒdS(N(sselfs_nodess removeNodesurl(sselfsurl((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys removeNodeÔs( s__name__s __module__s__doc__sNodeTreesSOAPRequestHandlers__init__s__str__sNones__call__ssetNodesgetNodes removeNode(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysServiceContainer‚s .   cBs#tZd„Zd„Zd„ZRS(NcCs|ii|ƒSdS(s post -- POST HTTP value N(sselfs_nodessgetNodespost(sselfspost((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysgetNodeÚscCs|ii||ƒdS(sGservice -- service instance post -- POST HTTP value N(sselfs_nodesssetNodesservicespost(sselfsservicespost((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pyssetNodeßscCsa|i|ƒ}|tjo t‚n|it||ƒo|i||ƒSnt d|‚dS(sGpost -- POST HTTP value action -- SOAP Action value s"Authorization failed for method %sN( sselfsgetNodespostsnodesNonesNoSuchFunctions authorizesactions getOperationspss NotAuthorized(sselfspsspostsactionsnode((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys getCallBackås  (s__name__s __module__sgetNodessetNodes getCallBack(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysSimpleWSResourceØs  s__main__(7s__doc__surlparsestypessosssyss cStringIOsStringIOsthreadsresBaseHTTPServersBaseHTTPRequestHandlers HTTPServersZSIsParseExceptionsFaultFromExceptionsFaultFromZSIExceptionsFaults _copyrights _seqtypess_get_element_nsuri_names resolverss _get_idstrs ZSI.addresssAddresss ZSI.parses ParsedSoaps ZSI.writers SoapWriters ZSI.dispatchs_ModPythonSendXMLs_ModPythonSendFaults _CGISendXMLs _CGISendFaultsSOAPRequestHandlersBaseSOAPRequestHandlers Exceptions NoSuchServicesUnknownRequestExceptionsPostNotSpecifiedsSOAPActionNotSpecifiedsWSActionExceptionsWSActionNotSpecifieds NotAuthorizedsServiceAlreadyPresents SOAPContextsdicts _contextssGetSOAPContexts _DispatchsAsServersServiceInterfacesServiceSOAPBindingsSimpleWSResourcesServiceContainers__name__(+sSOAPRequestHandlers_get_element_nsuri_names_ModPythonSendFaults _CGISendFaultsSimpleWSResources ParsedSoaps _copyrightsServiceAlreadyPresents _get_idstrs SoapWritersAsServers NotAuthorizeds _CGISendXMLsresAddresssFaultFromZSIExceptionsBaseSOAPRequestHandlersGetSOAPContexts_ModPythonSendXMLsServiceSOAPBindings HTTPServers NoSuchServicesFaultsFaultFromExceptionssyssWSActionNotSpecifiedsParseExceptions _Dispatchstypess resolverssPostNotSpecifiedsthreads _seqtypessStringIOsWSActionExceptionsurlparsesServiceInterfacesUnknownRequestExceptionsBaseHTTPRequestHandlersServiceContainersoss SOAPContextsSOAPActionNotSpecified((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys?s@?        T 9 ZIV PKƒ¨58[­Á»%%ZSI/digest_auth.pyc;ò Z@Ec@s¼dZdklZdkZdkZdkZeieeiƒdƒƒd„Zd„Ze e d„Z d„Z e d„Z d e d „Z d „Zd „Zed jo eGHndS(s)Utilities for HTTP Digest Authentication (smd5Ni cCst|ƒiƒSdS(N(smd5svals hexdigest(sval((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pysH scCstd||fƒSdS(Ns%s:%s(sHssecretsdata(ssecretsdata((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pysKDscCs>|o|od|||||fSnd|||fSdS(Ns%s:%s:%s:%s:%ss%s:%s:%s(snoncescnoncesusernamesrealmspasswd(susernamesrealmspasswdsnoncescnonce((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pysA1scCsd||fSdS(Ns%s:%s(smethodsuri(smethodsuri((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pysA2scCs$|i|ƒo ||Sn|SdS(N(sdshas_keysksdefval(sdsksdefval((s3build/bdist.darwin-8.0.1-x86/egg/ZSI/digest_auth.pys dict_fetchs sGETcCs¡h} t|dƒ}t|dƒ}t|dƒ}t|dƒ}t|ddƒ}t|ddƒ} t|dƒ} d } | o&t t tid d ƒƒƒd }n|iƒd jot|| |||ƒ}nt|| |ƒ}t||ƒ}t |ƒ} d|| ||t |ƒf}d|| d          cCsæt}|iƒ|idjo|i|iƒ}ny+|id|i ƒd|idjƒ}Wn$t j o}dG|GHt}nX|iƒy+|id|i ƒd|idjƒ}Wn$t j o}dG|GHt}nXt}}|idjo`|o%tidtd|d |iƒ}n|o)tidtd|d d |iƒ}qˆn+|o|d }n|o|d }n|o|o |idjo2d hd |<d|i<d|i<|_n||fSdS(sûReturns typecodes representing input and output messages, if request and/or response fails to be generated return None for either or both. callinfo -- WSDLTools.SOAPCallInfo instance describing an operation. sencodeds parameterssliterals$DEBUG: Request Failed to generate --s%DEBUG: Response Failed to generate --srpcspyclasssofwhatspnames %sResponseis7%(prefix)s:%(name)s xmlns:%(prefix)s="%(namespaceURI)s"sprefixsnames namespaceURIN(sNonesprefixsselfs_resetPrefixDictscallinfosuses _getPrefixs namespaces _getTypeCodesgetInParameterss requestTCsEvaluateExceptionsexsgetOutParameterssreplyTCsrequestsresponsesstylesTCsStructs methodNamesanamesoname(sselfscallinfosreplyTCsrequestsprefixsexsresponses requestTC((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getTypeCodesjs: +   +   %-2c Csìg}xÛ|D]Ó}|i\}} |io<|ii |i | } |i | d|dtd|ƒ} nl|i}|i|| ƒ}| o<|ii |i | }|i|||dtd|ƒ} n ||ƒ} |i| ƒq W|SdS(s²Returns typecodes representing a parameter set parameters -- list of WSDLTools.ParameterInfo instances representing the parts of a WSDL Message. sliteralslocals namespaceURIN(sofwhats parametersspartstypes namespaceURIs localNames element_typesselfs_wsdlstypesselementsselements _getElementsliteralsFalsestcsnames _getTypeClasss typeClassstps_getTypesTruesappend( sselfs parameterssliteralsnamestpsofwhats namespaceURIsparts typeClasss localNameselementstc((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getTypeCodes  % % cCsC|o8dhd|i|ƒ<d|i<d|<|_ndS(sßnamespaces typecodes representing global elements with literal encoding. typeCode -- typecode representing an element. namespaceURI -- namespace literal -- True/False s7%(prefix)s:%(name)s xmlns:%(prefix)s="%(namespaceURI)s"sprefixsnames namespaceURIN(sliteralsselfs _getPrefixs namespaceURIstypeCodesoname(sselfstypeCodes namespaceURIsliteral((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys_globalElement©scCsu|iƒ}|i|ƒo||}nDd}x0||iƒjodt|dƒd}q3W|||<|SdS(sTRetrieves a prefix/namespace mapping. namespaceURI -- namespace sns1sns%diÿÿÿÿiN(sselfs_getPrefixDicts prefixDictshas_keys namespaceURIsprefixsvaluessint(sselfs namespaceURIsprefixs prefixDict((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getPrefix´s  cCs)t|dƒ o h|_n|iSdS(s3Used to hide the actual prefix dictionary. s _prefixDictN(shasattrsselfs_ServiceProxy__prefixDict(sself((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys_getPrefixDictÂs cCs|iƒiƒdS(s¹Clears the prefix dictionary, this needs to be done before creating a new typecode for a message (ie. before, and after creating a new message typecode) N(sselfs_getPrefixDictsclear(sself((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys_resetPrefixDictÉscCs+|iƒ o td‚nt} |idƒ}|idƒ}t}|p|i o7|idƒ\} } |i| | ƒ} | |ƒ}n| o |i }n| o|i|||||ƒ}nt|idƒƒ}| |_||_|idƒ} | djpt| ƒdj|_|SdS( sùReturns a typecode instance representing the passed in element. element -- XMLSchema.ElementDeclaration instance literal -- literal encoding? local -- is locally defined? namespaceURI -- namespace sExpecting an ElementDeclarationsnamestypes minOccurss maxOccurss unboundediN(selements isElements TypeErrorsNonestcs getAttributes elementNamesgetTypeDefinitionstpstypeObjscontents nsuriTypes localNamesselfs _getTypeClasss typeClasss_getTypesliteralslocals namespaceURIsints minOccurssoptionals maxOccurss repeatable(sselfselementsliteralslocals namespaceURIs minOccursstypeObjs elementNamestps nsuriTypes typeClasss maxOccurss localNamestc((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getElementÐs*    "c CsBg} |iƒo |iƒ o td‚n|iiƒo]t|idƒo|iiiƒo*|ii} |i | i dƒŒ}|tijoÊ| iditi}t|dƒ\}} | idid|ƒ}| idƒd} |i d|d | ƒ} | o | ƒ} qk|ii|i| }|id |d td |d t!d|ƒ} n td‚|d|d| d|ddƒSq5td‚n›|ii#ƒoŠ|i}x3|iD](} | i&|i'| d |d t!ƒƒq¾Wti(dtd| d|ƒ}| o|i+|d|d |ƒn|Sntd‚dS(sReturns a typecode instance representing the passed in type and name. tp -- XMLSchema.TypeDefinition instance name -- element name literal -- literal encoding? local -- is locally defined? namespaceURI -- namespace s&only supporting complexType definitions derivationsbaseis arrayTypesprefixs[s namespaceURIs localNamestpsnamesliteralslocals'only support soapenc:Array restrictionssatypesofwhatspnames childNamessitems;complexContent only supported for soapenc:Array derivationsspyclasssHonly supporting complexType w/ model group, or soapenc:Array restrictionN(-sofwhatstps isDefinitions isComplexsEvaluateExceptionscontentshasattrs derivations isRestrictionsderivedsselfs _getTypeClasss getAttributes typeClasssTCsArrays attr_contents attributessWSDLsBASEsattrss SplitQNamesprefixs localNamesgetXMLNSsnsurissplitssimpleTypeClasss_wsdlstypess_getTypesNonesliteralsTruesnames isModelGroups modelGroupsitemsappends _getElementsStructstcslocals_globalElements namespaceURI(sselfstpsnamesliteralslocals namespaceURIsprefixsnsurisattrsssimpleTypeClasssitems localNamesderivedsofwhatstcs modelGroups typeClass((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys_getTypeós> &  . #   &cCs#tƒ}|i||ƒ}|SdS(sÇReturns a typecode class representing the type we are looking for. localName -- name of the type we are looking for. namespaceURI -- defining XMLSchema targetNamespace. N(sBaseTypeInterpretersbtis get_typeclasss localNames namespaceURIssimpleTypeClass(sselfs namespaceURIs localNamessimpleTypeClasssbti((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getTypeClasss (s__name__s __module__s__doc__sNones__init__s_calls _getTypeCodessFalses _getTypeCodes_globalElements _getPrefixs_getPrefixDicts_resetPrefixDicts _getElements_getTypes _getTypeClass(((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys ServiceProxys # - &    # +s MethodProxycBs tZdZd„Zd„ZRS(s cCs7|i|_|i|_||_ti|ƒ|_dS(N( scallinfos methodNamesselfs__name__s documentations__doc__sweakrefsrefsparent(sselfsparentscallinfo((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys__init__*s   cOs |iƒi|i||ŽSdS(N(sselfsparents_calls__name__sargsskwargs(sselfsargsskwargs((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys__call__0s(s__name__s __module__s__doc__s__init__s__call__(((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys MethodProxy(s  (sZSI.wstools.Utilitys SplitQNamesZSI.wstools.NamespacessWSDLsZSIs ZSI.clientsZSI.TCsAnysZSI.typeinterpretersBaseTypeInterpreterswstoolsswstools.UtilitysDOMsurlparsesweakrefs ServiceProxys MethodProxy( sweakrefs ServiceProxysBaseTypeInterpretersDOMswstoolssurlparses SplitQNames MethodProxysWSDLsAny((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys? s        ÿPK/¤Y5ZËÜnK)K)ZSI/TCtimes.py#! /usr/bin/env python # $Header$ '''Typecodes for dates and times. ''' from ZSI import _copyright, _floattypes, _inttypes, _get_idstr, EvaluateException from ZSI.TC import TypeCode, SimpleType from ZSI.wstools.Namespaces import SCHEMA import operator, re, time as _time from time import mktime as _mktime, localtime as _localtime, gmtime as _gmtime from datetime import tzinfo as _tzinfo, timedelta as _timedelta,\ datetime as _datetime from math import modf as _modf _niltime = [ 0, 0, 0, # year month day 0, 0, 0, # hour minute second 0, 0, 0 # weekday, julian day, dst flag ] #### Code added to check current timezone offset _zero = _timedelta(0) _dstoffset = _stdoffset = _timedelta(seconds=-_time.timezone) if _time.daylight: _dstoffset = _timedelta(seconds=-_time.altzone) _dstdiff = _dstoffset - _stdoffset class _localtimezone(_tzinfo): """ """ def dst(self, dt): """datetime -> DST offset in minutes east of UTC.""" tt = _localtime(_mktime((dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.weekday(), 0, -1))) if tt.tm_isdst > 0: return _dstdiff return _zero #def fromutc(...) #datetime in UTC -> datetime in local time. def tzname(self, dt): """datetime -> string name of time zone.""" tt = _localtime(_mktime((dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.weekday(), 0, -1))) return _time.tzname[tt.tm_isdst > 0] def utcoffset(self, dt): """datetime -> minutes east of UTC (negative for west of UTC).""" tt = _localtime(_mktime((dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.weekday(), 0, -1))) if tt.tm_isdst > 0: return _dstoffset return _stdoffset class _fixedoffset(_tzinfo): """Fixed offset in minutes east from UTC. A class building tzinfo objects for fixed-offset time zones. Note that _fixedoffset(0, "UTC") is a different way to build a UTC tzinfo object. """ #def __init__(self, offset, name): def __init__(self, offset): self.__offset = _timedelta(minutes=offset) #self.__name = name def dst(self, dt): """datetime -> DST offset in minutes east of UTC.""" return _zero def tzname(self, dt): """datetime -> string name of time zone.""" #return self.__name return "server" def utcoffset(self, dt): """datetime -> minutes east of UTC (negative for west of UTC).""" return self.__offset def _dict_to_tuple(d): '''Convert a dictionary to a time tuple. Depends on key values in the regexp pattern! ''' retval = _niltime[:] for k,i in ( ('Y', 0), ('M', 1), ('D', 2), ('h', 3), ('m', 4), ): v = d.get(k) if v: retval[i] = int(v) v = d.get('s') if v: msec,sec = _modf(float(v)) retval[6],retval[5] = int(round(msec*1000)), int(sec) v = d.get('tz') if v and v != 'Z': h,m = map(int, v.split(':')) # check for time zone offset, if within the same timezone, # ignore offset specific calculations offset=_localtimezone().utcoffset(_datetime.now()) local_offset_hour = offset.seconds/3600 local_offset_min = (offset.seconds%3600)%60 if local_offset_hour > 12: local_offset_hour -= 24 if local_offset_hour != h or local_offset_min != m: if h<0: #TODO: why is this set to server #foff = _fixedoffset(-((abs(h)*60+m)),"server") foff = _fixedoffset(-((abs(h)*60+m))) else: #TODO: why is this set to server #foff = _fixedoffset((abs(h)*60+m),"server") foff = _fixedoffset((abs(h)*60+m)) dt = _datetime(retval[0],retval[1],retval[2],retval[3],retval[4], retval[5],0,foff) # update dict with calculated timezone localdt=dt.astimezone(_localtimezone()) retval[0] = localdt.year retval[1] = localdt.month retval[2] = localdt.day retval[3] = localdt.hour retval[4] = localdt.minute retval[5] = localdt.second if d.get('neg', 0): retval[0:5] = map(operator.__neg__, retval[0:5]) return tuple(retval) class Duration(SimpleType): '''Time duration. ''' parselist = [ (None,'duration') ] lex_pattern = re.compile('^' r'(?P-?)P' \ r'((?P\d+)Y)?' r'((?P\d+)M)?' r'((?P\d+)D)?' \ r'(?PT?)' r'((?P\d+)H)?' r'((?P\d+)M)?' \ r'((?P\d*(\.\d+)?)S)?' '$') type = (SCHEMA.XSD3, 'duration') def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' if text is None: return None m = Duration.lex_pattern.match(text) if m is None: raise EvaluateException('Illegal duration', ps.Backtrace(elt)) d = m.groupdict() if d['T'] and (d['h'] is None and d['m'] is None and d['s'] is None): raise EvaluateException('Duration has T without time') try: retval = _dict_to_tuple(d) except ValueError, e: raise EvaluateException(str(e)) if self.pyclass is not None: return self.pyclass(retval) return retval def get_formatted_content(self, pyobj): if type(pyobj) in _floattypes or type(pyobj) in _inttypes: pyobj = _gmtime(pyobj) d = {} pyobj = tuple(pyobj) if 1 in map(lambda x: x < 0, pyobj[0:6]): pyobj = map(abs, pyobj) neg = '-' else: neg = '' val = '%sP%dY%dM%dDT%dH%dM%dS' % \ ( neg, pyobj[0], pyobj[1], pyobj[2], pyobj[3], pyobj[4], pyobj[5]) return val class Gregorian(SimpleType): '''Gregorian times. ''' lex_pattern = tag = format = None def text_to_data(self, text, elt, ps): '''convert text into typecode specific data. ''' if text is None: return None m = self.lex_pattern.match(text) if not m: raise EvaluateException('Bad Gregorian: %s' %text, ps.Backtrace(elt)) try: retval = _dict_to_tuple(m.groupdict()) except ValueError, e: #raise EvaluateException(str(e)) raise if self.pyclass is not None: return self.pyclass(retval) return retval def get_formatted_content(self, pyobj): if type(pyobj) in _floattypes or type(pyobj) in _inttypes: pyobj = _gmtime(pyobj) d = {} pyobj = tuple(pyobj) if 1 in map(lambda x: x < 0, pyobj[0:6]): pyobj = map(abs, pyobj) d['neg'] = '-' else: d['neg'] = '' ms = pyobj[6] if not ms: d = { 'Y': pyobj[0], 'M': pyobj[1], 'D': pyobj[2], 'h': pyobj[3], 'm': pyobj[4], 's': pyobj[5], } return self.format % d if ms > 999: raise ValueError, 'milliseconds must be a integer between 0 and 999' d = { 'Y': pyobj[0], 'M': pyobj[1], 'D': pyobj[2], 'h': pyobj[3], 'm': pyobj[4], 's': pyobj[5], 'ms':ms, } return self.format_ms % d class gDateTime(Gregorian): '''A date and time. ''' parselist = [ (None,'dateTime') ] lex_pattern = re.compile('^' r'(?P-?)' \ '(?P\d{4,})-' r'(?P\d\d)-' r'(?P\d\d)' 'T' \ r'(?P\d\d):' r'(?P\d\d):' r'(?P\d*(\.\d+)?)' \ r'(?P(Z|([-+]\d\d:\d\d))?)' '$') tag, format = 'dateTime', '%(Y)04d-%(M)02d-%(D)02dT%(h)02d:%(m)02d:%(s)02dZ' format_ms = format[:-1] + '.%(ms)03dZ' type = (SCHEMA.XSD3, 'dateTime') class gDate(Gregorian): '''A date. ''' parselist = [ (None,'date') ] lex_pattern = re.compile('^' r'(?P-?)' \ '(?P\d{4,})-' r'(?P\d\d)-' r'(?P\d\d)' \ r'(?PZ|([-+]\d\d:\d\d))?' '$') tag, format = 'date', '%(Y)04d-%(M)02d-%(D)02dZ' type = (SCHEMA.XSD3, 'date') class gYearMonth(Gregorian): '''A date. ''' parselist = [ (None,'gYearMonth') ] lex_pattern = re.compile('^' r'(?P-?)' \ '(?P\d{4,})-' r'(?P\d\d)' \ r'(?PZ|([-+]\d\d:\d\d))?' '$') tag, format = 'gYearMonth', '%(Y)04d-%(M)02dZ' type = (SCHEMA.XSD3, 'gYearMonth') class gYear(Gregorian): '''A date. ''' parselist = [ (None,'gYear') ] lex_pattern = re.compile('^' r'(?P-?)' \ '(?P\d{4,})' \ r'(?PZ|([-+]\d\d:\d\d))?' '$') tag, format = 'gYear', '%(Y)04dZ' type = (SCHEMA.XSD3, 'gYear') class gMonthDay(Gregorian): '''A gMonthDay. ''' parselist = [ (None,'gMonthDay') ] lex_pattern = re.compile('^' r'(?P-?)' \ r'--(?P\d\d)-' r'(?P\d\d)' \ r'(?PZ|([-+]\d\d:\d\d))?' '$') tag, format = 'gMonthDay', '---%(M)02d-%(D)02dZ' type = (SCHEMA.XSD3, 'gMonthDay') class gDay(Gregorian): '''A gDay. ''' parselist = [ (None,'gDay') ] lex_pattern = re.compile('^' r'(?P-?)' \ r'---(?P\d\d)' \ r'(?PZ|([-+]\d\d:\d\d))?' '$') tag, format = 'gDay', '---%(D)02dZ' type = (SCHEMA.XSD3, 'gDay') class gMonth(Gregorian): '''A gMonth. ''' parselist = [ (None,'gMonth') ] lex_pattern = re.compile('^' r'(?P-?)' \ r'---(?P\d\d)' \ r'(?PZ|([-+]\d\d:\d\d))?' '$') tag, format = 'gMonth', '---%(M)02dZ' type = (SCHEMA.XSD3, 'gMonth') class gTime(Gregorian): '''A time. ''' parselist = [ (None,'time') ] lex_pattern = re.compile('^' r'(?P-?)' \ r'(?P\d\d):' r'(?P\d\d):' r'(?P\d*(\.\d+)?)' \ r'(?PZ|([-+]\d\d:\d\d))?' '$') tag, format = 'time', '%(h)02d:%(m)02d:%(s)02dZ' format_ms = format[:-1] + '.%(ms)03dZ' type = (SCHEMA.XSD3, 'time') if __name__ == '__main__': print _copyright PK/¤Y5TJX %s%s """ def __init__(self, name=None, password=None): self.Name = name self.Password = password _AuthHeader.typecode = Struct(_AuthHeader, ofwhat=(String((ZSI_SCHEMA_URI,'Name'), typed=False), String((ZSI_SCHEMA_URI,'Password'), typed=False)), pname=(ZSI_SCHEMA_URI,'BasicAuth'), typed=False) class _Caller: '''Internal class used to give the user a callable object that calls back to the Binding object to make an RPC call. ''' def __init__(self, binding, name): self.binding, self.name = binding, name def __call__(self, *args): return self.binding.RPC(None, self.name, args, encodingStyle="http://schemas.xmlsoap.org/soap/encoding/", replytype=TC.Any(self.name+"Response")) class _NamedParamCaller: '''Similar to _Caller, expect that there are named parameters not positional. ''' def __init__(self, binding, name): self.binding, self.name = binding, name def __call__(self, **params): # Pull out arguments that Send() uses kw = { } for key in [ 'auth_header', 'nsdict', 'requesttypecode' 'soapaction' ]: if params.has_key(key): kw[key] = params[key] del params[key] return self.binding.RPC(None, self.name, None, encodingStyle="http://schemas.xmlsoap.org/soap/encoding/", _args=params, replytype=TC.Any(self.name+"Response", aslist=False), **kw) class _Binding: '''Object that represents a binding (connection) to a SOAP server. Once the binding is created, various ways of sending and receiving SOAP messages are available. ''' defaultHttpTransport = httplib.HTTPConnection defaultHttpsTransport = httplib.HTTPSConnection logger = _GetLogger('ZSI.client.Binding') def __init__(self, nsdict=None, transport=None, url=None, tracefile=None, readerclass=None, writerclass=None, soapaction='', wsAddressURI=None, sig_handler=None, transdict=None, **kw): '''Initialize. Keyword arguments include: transport -- default use HTTPConnection. transdict -- dict of values to pass to transport. url -- URL of resource, POST is path soapaction -- value of SOAPAction header auth -- (type, name, password) triplet; default is unauth nsdict -- namespace entries to add tracefile -- file to dump packet traces cert_file, key_file -- SSL data (q.v.) readerclass -- DOM reader class writerclass -- DOM writer class, implements MessageInterface wsAddressURI -- namespaceURI of WS-Address to use. By default it's not used. sig_handler -- XML Signature handler, must sign and verify. endPointReference -- optional Endpoint Reference. ''' self.data = None self.ps = None self.user_headers = [] self.nsdict = nsdict or {} self.transport = transport self.transdict = transdict or {} self.url = url self.trace = tracefile self.readerclass = readerclass self.writerclass = writerclass self.soapaction = soapaction self.wsAddressURI = wsAddressURI self.sig_handler = sig_handler self.address = None self.endPointReference = kw.get('endPointReference', None) self.cookies = Cookie.SimpleCookie() self.http_callbacks = {} if kw.has_key('auth'): self.SetAuth(*kw['auth']) else: self.SetAuth(AUTH.none) def SetAuth(self, style, user=None, password=None): '''Change auth style, return object to user. ''' self.auth_style, self.auth_user, self.auth_pass = \ style, user, password return self def SetURL(self, url): '''Set the URL we post to. ''' self.url = url return self def ResetHeaders(self): '''Empty the list of additional headers. ''' self.user_headers = [] return self def ResetCookies(self): '''Empty the list of cookies. ''' self.cookies = Cookie.SimpleCookie() def AddHeader(self, header, value): '''Add a header to send. ''' self.user_headers.append((header, value)) return self def __addcookies(self): '''Add cookies from self.cookies to request in self.h ''' for cname, morsel in self.cookies.items(): attrs = [] value = morsel.get('version', '') if value != '' and value != '0': attrs.append('$Version=%s' % value) attrs.append('%s=%s' % (cname, morsel.coded_value)) value = morsel.get('path') if value: attrs.append('$Path=%s' % value) value = morsel.get('domain') if value: attrs.append('$Domain=%s' % value) self.h.putheader('Cookie', "; ".join(attrs)) def RPC(self, url, opname, obj, replytype=None, **kw): '''Send a request, return the reply. See Send() and Recieve() docstrings for details. ''' self.Send(url, opname, obj, **kw) return self.Receive(replytype, **kw) def Send(self, url, opname, obj, nsdict={}, soapaction=None, wsaction=None, endPointReference=None, **kw): '''Send a message. If url is None, use the value from the constructor (else error). obj is the object (data) to send. Data may be described with a requesttypecode keyword, the default is the class's typecode (if there is one), else Any. Try to serialize as a Struct, if this is not possible serialize an Array. If data is a sequence of built-in python data types, it will be serialized as an Array, unless requesttypecode is specified. arguments: url -- opname -- struct wrapper obj -- python instance key word arguments: nsdict -- soapaction -- wsaction -- WS-Address Action, goes in SOAP Header. endPointReference -- set by calling party, must be an EndPointReference type instance. requesttypecode -- ''' url = url or self.url endPointReference = endPointReference or self.endPointReference # Serialize the object. d = {} d.update(self.nsdict) d.update(nsdict) sw = SoapWriter(nsdict=d, header=True, outputclass=self.writerclass, encodingStyle=kw.get('encodingStyle'),) requesttypecode = kw.get('requesttypecode') if kw.has_key('_args'): #NamedParamBinding tc = requesttypecode or TC.Any(pname=opname, aslist=False) sw.serialize(kw['_args'], tc) elif not requesttypecode: tc = getattr(obj, 'typecode', None) or TC.Any(pname=opname, aslist=False) try: if type(obj) in _seqtypes: obj = dict(map(lambda i: (i.typecode.pname,i), obj)) except AttributeError: # can't do anything but serialize this in a SOAP:Array tc = TC.Any(pname=opname, aslist=True) else: tc = TC.Any(pname=opname, aslist=False) sw.serialize(obj, tc) else: sw.serialize(obj, requesttypecode) # # Determine the SOAP auth element. SOAP:Header element if self.auth_style & AUTH.zsibasic: sw.serialize_header(_AuthHeader(self.auth_user, self.auth_pass), _AuthHeader.typecode) # # Serialize WS-Address if self.wsAddressURI is not None: if self.soapaction and wsaction.strip('\'"') != self.soapaction: raise WSActionException, 'soapAction(%s) and WS-Action(%s) must match'\ %(self.soapaction,wsaction) self.address = Address(url, self.wsAddressURI) self.address.setRequest(endPointReference, wsaction) self.address.serialize(sw) # # WS-Security Signature Handler if self.sig_handler is not None: self.sig_handler.sign(sw) scheme,netloc,path,nil,nil,nil = urlparse.urlparse(url) transport = self.transport if transport is None and url is not None: if scheme == 'https': transport = self.defaultHttpsTransport elif scheme == 'http': transport = self.defaultHttpTransport else: raise RuntimeError, 'must specify transport or url startswith https/http' # Send the request. if issubclass(transport, httplib.HTTPConnection) is False: raise TypeError, 'transport must be a HTTPConnection' soapdata = str(sw) self.h = transport(netloc, None, **self.transdict) self.h.connect() self.SendSOAPData(soapdata, url, soapaction, **kw) def SendSOAPData(self, soapdata, url, soapaction, headers={}, **kw): # Tracing? if self.trace: print >>self.trace, "_" * 33, time.ctime(time.time()), "REQUEST:" print >>self.trace, soapdata #scheme,netloc,path,nil,nil,nil = urlparse.urlparse(url) path = _get_postvalue_from_absoluteURI(url) self.h.putrequest("POST", path) self.h.putheader("Content-length", "%d" % len(soapdata)) self.h.putheader("Content-type", 'text/xml; charset=utf-8') self.__addcookies() for header,value in headers.items(): self.h.putheader(header, value) SOAPActionValue = '"%s"' % (soapaction or self.soapaction) self.h.putheader("SOAPAction", SOAPActionValue) if self.auth_style & AUTH.httpbasic: val = _b64_encode(self.auth_user + ':' + self.auth_pass) \ .replace("\012", "") self.h.putheader('Authorization', 'Basic ' + val) elif self.auth_style == AUTH.httpdigest and not headers.has_key('Authorization') \ and not headers.has_key('Expect'): def digest_auth_cb(response): self.SendSOAPDataHTTPDigestAuth(response, soapdata, url, soapaction, **kw) self.http_callbacks[401] = None self.http_callbacks[401] = digest_auth_cb for header,value in self.user_headers: self.h.putheader(header, value) self.h.endheaders() self.h.send(soapdata) # Clear prior receive state. self.data, self.ps = None, None def SendSOAPDataHTTPDigestAuth(self, response, soapdata, url, soapaction, **kw): '''Resend the initial request w/http digest authorization headers. The SOAP server has requested authorization. Fetch the challenge, generate the authdict for building a response. ''' if self.trace: print >>self.trace, "------ Digest Auth Header" url = url or self.url if response.status != 401: raise RuntimeError, 'Expecting HTTP 401 response.' if self.auth_style != AUTH.httpdigest: raise RuntimeError,\ 'Auth style(%d) does not support requested digest authorization.' %self.auth_style from ZSI.digest_auth import fetch_challenge,\ generate_response,\ build_authorization_arg,\ dict_fetch chaldict = fetch_challenge( response.getheader('www-authenticate') ) if dict_fetch(chaldict,'challenge','').lower() == 'digest' and \ dict_fetch(chaldict,'nonce',None) and \ dict_fetch(chaldict,'realm',None) and \ dict_fetch(chaldict,'qop',None): authdict = generate_response(chaldict, url, self.auth_user, self.auth_pass, method='POST') headers = {\ 'Authorization':build_authorization_arg(authdict), 'Expect':'100-continue', } self.SendSOAPData(soapdata, url, soapaction, headers, **kw) return raise RuntimeError,\ 'Client expecting digest authorization challenge.' def ReceiveRaw(self, **kw): '''Read a server reply, unconverted to any format and return it. ''' if self.data: return self.data trace = self.trace while 1: response = self.h.getresponse() self.reply_code, self.reply_msg, self.reply_headers, self.data = \ response.status, response.reason, response.msg, response.read() if trace: print >>trace, "_" * 33, time.ctime(time.time()), "RESPONSE:" for i in (self.reply_code, self.reply_msg,): print >>trace, str(i) print >>trace, "-------" print >>trace, str(self.reply_headers) print >>trace, self.data saved = None for d in response.msg.getallmatchingheaders('set-cookie'): if d[0] in [ ' ', '\t' ]: saved += d.strip() else: if saved: self.cookies.load(saved) saved = d.strip() if saved: self.cookies.load(saved) if response.status == 401: if not callable(self.http_callbacks.get(response.status,None)): raise RuntimeError, 'HTTP Digest Authorization Failed' self.http_callbacks[response.status](response) continue if response.status != 100: break # The httplib doesn't understand the HTTP continuation header. # Horrible internals hack to patch things up. self.h._HTTPConnection__state = httplib._CS_REQ_SENT self.h._HTTPConnection__response = None return self.data def IsSOAP(self): if self.ps: return 1 self.ReceiveRaw() mimetype = self.reply_headers.type return mimetype == 'text/xml' def ReceiveSOAP(self, readerclass=None, **kw): '''Get back a SOAP message. ''' if self.ps: return self.ps if not self.IsSOAP(): raise TypeError( 'Response is "%s", not "text/xml"' % self.reply_headers.type) if len(self.data) == 0: raise TypeError('Received empty response') self.ps = ParsedSoap(self.data, readerclass=readerclass or self.readerclass, encodingStyle=kw.get('encodingStyle')) if self.sig_handler is not None: self.sig_handler.verify(self.ps) return self.ps def IsAFault(self): '''Get a SOAP message, see if it has a fault. ''' self.ReceiveSOAP() return self.ps.IsAFault() def ReceiveFault(self, **kw): '''Parse incoming message as a fault. Raise TypeError if no fault found. ''' self.ReceiveSOAP(**kw) if not self.ps.IsAFault(): raise TypeError("Expected SOAP Fault not found") return FaultFromFaultMessage(self.ps) def Receive(self, replytype, **kw): '''Parse message, create Python object. KeyWord data: faults -- list of WSDL operation.fault typecodes wsaction -- If using WS-Address, must specify Action value we expect to receive. ''' self.ReceiveSOAP(**kw) if self.ps.IsAFault(): msg = FaultFromFaultMessage(self.ps) raise FaultException(msg) tc = replytype if hasattr(replytype, 'typecode'): tc = replytype.typecode reply = self.ps.Parse(tc) if self.address is not None: self.address.checkResponse(self.ps, kw.get('wsaction')) return reply def __repr__(self): return "<%s instance %s>" % (self.__class__.__name__, _get_idstr(self)) class Binding(_Binding): '''Object that represents a binding (connection) to a SOAP server. Can be used in the "name overloading" style. class attr: gettypecode -- funcion that returns typecode from typesmodule, can be set so can use whatever mapping you desire. ''' gettypecode = staticmethod(lambda mod,e: getattr(mod, str(e.localName)).typecode) logger = _GetLogger('ZSI.client.Binding') def __init__(self, typesmodule=None, **kw): self.typesmodule = typesmodule _Binding.__init__(self, **kw) def __getattr__(self, name): '''Return a callable object that will invoke the RPC method named by the attribute. ''' if name[:2] == '__' and len(name) > 5 and name[-2:] == '__': if hasattr(self, name): return getattr(self, name) return getattr(self.__class__, name) return _Caller(self, name) def __parse_child(self, node): '''for rpc-style map each message part to a class in typesmodule ''' try: tc = self.gettypecode(self.typesmodule, node) except: self.logger.debug('didnt find typecode for "%s" in typesmodule: %s', node.localName, self.typesmodule) tc = TC.Any(aslist=1) return tc.parse(node, self.ps) self.logger.debug('parse child with typecode : %s', tc) try: return tc.parse(node, self.ps) except Exception: self.logger.debug('parse failed try Any : %s', tc) tc = TC.Any(aslist=1) return tc.parse(node, self.ps) def Receive(self, replytype, **kw): '''Parse message, create Python object. KeyWord data: faults -- list of WSDL operation.fault typecodes wsaction -- If using WS-Address, must specify Action value we expect to receive. ''' self.ReceiveSOAP(**kw) ps = self.ps tp = _find_type(ps.body_root) isarray = ((type(tp) in (tuple,list) and tp[1] == 'Array') or _find_arraytype(ps.body_root)) if self.typesmodule is None or isarray: return _Binding.Receive(self, replytype, **kw) if ps.IsAFault(): msg = FaultFromFaultMessage(ps) raise FaultException(msg) tc = replytype if hasattr(replytype, 'typecode'): tc = replytype.typecode #Ignore response wrapper reply = {} for elt in _child_elements(ps.body_root): name = str(elt.localName) reply[name] = self.__parse_child(elt) if self.address is not None: self.address.checkResponse(ps, kw.get('wsaction')) return reply class NamedParamBinding(Binding): '''Like Binding, except the argument list for invocation is named parameters. ''' logger = _GetLogger('ZSI.client.Binding') def __getattr__(self, name): '''Return a callable object that will invoke the RPC method named by the attribute. ''' if name[:2] == '__' and len(name) > 5 and name[-2:] == '__': if hasattr(self, name): return getattr(self, name) return getattr(self.__class__, name) return _NamedParamCaller(self, name) if __name__ == '__main__': print _copyright PK/¤Y5HÞQ77ZSI/version.py# Auto-generated file; do not edit Version = (2, 0, 0) PKЍ58–J N"N"ZSI/writer.pyo;ò Z@Ec@sdZdklZlZlZdklZlZlZdkl Z l Z dk l Z l Z lZdklZdkZde ifde ifgZhd e i<d e i<d e<d ei<d eidReturn a tuple containing client authentication data. s BasicAuthsNamesPasswordsHTTP_AUTHENTICATIONs iisbasicis:N(sselfsauthspssGetMyHeaderElementsselts localNames namespaceURIsZSI_SCHEMA_URIs_auth_tcsparsesdsAUTHszsibasicsenvironsgetsbassplitslenslowers _b64_decodes httpbasicstuplesnone(sselfsdsbaselt((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pysGetAuth#s$  *"cCs|iiipdSdS(s;Return namespace for the top main request element. sN(sselfspss body_roots namespaceURI(sself((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pysGetNS7scCs |iSdS(s'Return the ParsedSoap request. N(sselfsps(sself((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pys GetRequest<s(s__name__s __module__s__doc__s__init__sGetAuthsGetNSs GetRequest(((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pys ClientBindings    s__main__(s__doc__sZSIs _copyrightsbase64soss decodestrings _b64_decodesTCsStructsNonesStrings_auth_tcsAUTHs ClientBindings__name__(sbase64s ClientBindingsAUTHs _b64_decodes _copyrightsoss_auth_tc((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pys?s    ( PK‚¨58>-8±1;1;ZSI/TCtimes.pyc;ò Z@Ec @s?dZdklZlZlZlZlZdklZl Z dk l Z dk Z dk Z dkZdklZlZlZdklZlZlZdklZdddddddddg ZedƒZ ed ei! ƒZ"Z#ei$oed ei% ƒZ"ne"e#Z&d efd „ƒYZ'd efd „ƒYZ(d„Z)de fd„ƒYZ*de fd„ƒYZ+de+fd„ƒYZ,de+fd„ƒYZ-de+fd„ƒYZ.de+fd„ƒYZ/de+fd„ƒYZ0de+fd„ƒYZ1de+fd „ƒYZ2d!e+fd"„ƒYZ3e4d#jo eGHndS($sTypecodes for dates and times. (s _copyrights _floattypess _inttypess _get_idstrsEvaluateException(sTypeCodes SimpleType(sSCHEMAN(smktimes localtimesgmtime(stzinfos timedeltasdatetime(smodfissecondss_localtimezonecBs)tZdZd„Zd„Zd„ZRS(s c Csett|i|i|i|i|i|i|i ƒddf ƒƒ}|i djot Snt SdS(s.datetime -> DST offset in minutes east of UTC.iiÿÿÿÿN(s _localtimes_mktimesdtsyearsmonthsdayshoursminutessecondsweekdaysttstm_isdsts_dstdiffs_zero(sselfsdtstt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysdsts Ec Cs]tt|i|i|i|i|i|i|i ƒddf ƒƒ}t i |i djSdS(s%datetime -> string name of time zone.iiÿÿÿÿN(s _localtimes_mktimesdtsyearsmonthsdayshoursminutessecondsweekdaystts_timestznamestm_isdst(sselfsdtstt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pystzname(sEc Csett|i|i|i|i|i|i|i ƒddf ƒƒ}|i djot Snt SdS(s;datetime -> minutes east of UTC (negative for west of UTC).iiÿÿÿÿN(s _localtimes_mktimesdtsyearsmonthsdayshoursminutessecondsweekdaysttstm_isdsts _dstoffsets _stdoffset(sselfsdtstt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys utcoffset.s E(s__name__s __module__s__doc__sdststznames utcoffset(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys_localtimezones  s _fixedoffsetcBs2tZdZd„Zd„Zd„Zd„ZRS(sËFixed offset in minutes east from UTC. A class building tzinfo objects for fixed-offset time zones. Note that _fixedoffset(0, "UTC") is a different way to build a UTC tzinfo object. cCstd|ƒ|_dS(Nsminutes(s _timedeltasoffsetsselfs_fixedoffset__offset(sselfsoffset((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys__init__=scCstSdS(s.datetime -> DST offset in minutes east of UTC.N(s_zero(sselfsdt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysdstAscCsdSdS(s%datetime -> string name of time zone.sserverN((sselfsdt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pystznameEscCs |iSdS(s;datetime -> minutes east of UTC (negative for west of UTC).N(sselfs_fixedoffset__offset(sselfsdt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys utcoffsetJs(s__name__s __module__s__doc__s__init__sdststznames utcoffset(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys _fixedoffset5s    c Cs¯t}xkddfddfddfddfd d ffD]6\} } |i| ƒ} | ot| ƒ|| -?)P((?P\d+)Y)?((?P\d+)M)?((?P\d+)D)?(?PT?)((?P\d+)H)?((?P\d+)M)?((?P\d*(\.\d+)?)S)?$cCs |tjotSntii|ƒ}|tjotd|i|ƒƒ‚n|i ƒ}|do0|dtjo|dtjo|dtjotdƒ‚nyt |ƒ}Wn'tj o}tt|ƒƒ‚nX|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. sIllegal durationsTshsmsssDuration has T without timeN(stextsNonesDurations lex_patternsmatchsmsEvaluateExceptionspss Backtraceselts groupdictsds_dict_to_tuplesretvals ValueErrorsesstrsselfspyclass(sselfstextseltspssesmsretvalsd((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys text_to_dataŽs    >c CsÆt|ƒtjpt|ƒtjot|ƒ}nh}t|ƒ}dtd„|dd!ƒjott|ƒ}d}nd}d||d|d|d|d |d |d f}|SdS( NicCs |djS(Ni(sx(sx((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys¨siis-ss%sP%dY%dM%dDT%dH%dM%dSiiii( stypespyobjs _floattypess _inttypess_gmtimesdstuplesmapsabssnegsval(sselfspyobjsdsvalsneg((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysget_formatted_content¢s&   7( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternsSCHEMAsXSD3stypes text_to_datasget_formatted_content(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysDurationƒs  s GregoriancBs.tZdZeZZZd„Zd„ZRS(sGregorian times. cCs©|tjotSn|ii|ƒ}| o td||i|ƒƒ‚nyt |i ƒƒ}Wnt j o }‚nX|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. sBad Gregorian: %sN(stextsNonesselfs lex_patternsmatchsmsEvaluateExceptionspss Backtraceselts_dict_to_tuples groupdictsretvals ValueErrorsespyclass(sselfstextseltspssesmsretval((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys text_to_data¹s  cCsŠt|ƒtjpt|ƒtjot|ƒ}nh}t|ƒ}dtd„|dd!ƒjott|ƒ}d|dÒsiis-snegssYsMsDishismissiiçs0milliseconds must be a integer between 0 and 999sms(stypespyobjs _floattypess _inttypess_gmtimesdstuplesmapsabssmssselfsformats ValueErrors format_ms(sselfspyobjsdsms((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysget_formatted_contentÌs &    T  ]( s__name__s __module__s__doc__sNones lex_patternstagsformats text_to_datasget_formatted_content(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys Gregorian´s  s gDateTimecBs[tZdZedfgZeidƒZddf\ZZ e d dZ e i dfZ RS(sA date and time. sdateTimesy^(?P-?)(?P\d{4,})-(?P\d\d)-(?P\d\d)T(?P\d\d):(?P\d\d):(?P\d*(\.\d+)?)(?P(Z|([-+]\d\d:\d\d))?)$s0%(Y)04d-%(M)02d-%(D)02dT%(h)02d:%(m)02d:%(s)02dZiÿÿÿÿs .%(ms)03dZ(s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformats format_mssSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys gDateTimeæs sgDatecBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(s A date. sdatesL^(?P-?)(?P\d{4,})-(?P\d\d)-(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s%(Y)04d-%(M)02d-%(D)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgDateòs s gYearMonthcBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(s A date. s gYearMonths@^(?P-?)(?P\d{4,})-(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s%(Y)04d-%(M)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys gYearMonthüs sgYearcBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(s A date. sgYears4^(?P-?)(?P\d{4,})(?PZ|([-+]\d\d:\d\d))?$s%(Y)04dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgYears s gMonthDaycBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(sA gMonthDay. s gMonthDays@^(?P-?)--(?P\d\d)-(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s---%(M)02d-%(D)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys gMonthDays sgDaycBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(s A gDay. sgDays5^(?P-?)---(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s ---%(D)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgDays sgMonthcBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(sA gMonth. sgMonths5^(?P-?)---(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s ---%(M)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgMonth%s sgTimecBs[tZdZedfgZeidƒZddf\ZZ e d dZ e i dfZ RS(s A time. stimesQ^(?P-?)(?P\d\d):(?P\d\d):(?P\d*(\.\d+)?)(?PZ|([-+]\d\d:\d\d))?$s%(h)02d:%(m)02d:%(s)02dZiÿÿÿÿs .%(ms)03dZ(s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformats format_mssSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgTime/s s__main__(5s__doc__sZSIs _copyrights _floattypess _inttypess _get_idstrsEvaluateExceptionsZSI.TCsTypeCodes SimpleTypesZSI.wstools.NamespacessSCHEMAsoperatorsrestimes_timesmktimes_mktimes localtimes _localtimesgmtimes_gmtimesdatetimestzinfos_tzinfos timedeltas _timedeltas _datetimesmathsmodfs_modfs_niltimes_zerostimezones _dstoffsets _stdoffsetsdaylightsaltzones_dstdiffs_localtimezones _fixedoffsets_dict_to_tuplesDurations Gregorians gDateTimesgDates gYearMonthsgYears gMonthDaysgDaysgMonthsgTimes__name__($sEvaluateExceptionsTypeCodes _inttypess _copyrights _datetimesoperators _floattypess_localtimezones _get_idstrs SimpleTypesgDatesgYears_modfs gDateTimes_tzinfos_niltimesres _stdoffsets Gregorians_mktimes gYearMonths _fixedoffsets_gmtimes_dict_to_tuples _timedeltasgTimes _dstoffsetsgMonths gMonthDays_dstdiffsgDays_zeros_timesDurations _localtimesSCHEMA((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys?s8%  !    412        PK‡¨58å$öD@D@ ZSI/parse.pyc;ò Z@Ec@sÜdZdklZlZlZlZlZlZlZl Z l Z l Z l Z l Z dklZdkZdklZlZdklZd„Zd„Zd„Zd „Zd fd „ƒYZed jo eGHndS( sSOAP messaging parsing. ( s _copyrights _childrens_attrss_child_elementss _stringtypess _backtracesEvaluateExceptionsParseExceptions_valid_encodings_Nodes _find_attrs_resolve_prefix(s AnyElementN(sSOAPsXMLNS(s SplitQNamecCs|itidƒptS(Nsactor(sEsgetAttributeNSsSOAPsENVsNone(sE((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysscCs|itidƒS(NsmustUnderstand(sEsgetAttributeNSsSOAPsENV(sE((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysscCs|itidƒS(Nsroot(sEsgetAttributeNSsSOAPsENC(sE((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysscCs t|dƒS(Nsid(s _find_attrsE(sE((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysss ParsedSoapcBs³tZdZeZeeeeed„Zd„Zdd„Z d„Z d„Z dd„Z d„Z ed „Zd „Zd „Zd „Zd „Zd„Zd„Zd„ZRS(sÄA Parsed SOAP object. Convert the text to a DOM tree and parse SOAP elements. Instance data: reader -- the DOM reader dom -- the DOM object ns_cache -- dictionary (by id(node)) of namespace dictionaries id_cache -- dictionary (by XML ID attr) of elements envelope -- the node holding the SOAP Envelope header -- the node holding the SOAP Header (or None) body -- the node holding the SOAP Body body_root -- the serialization root in the SOAP Body data_elements -- list of non-root elements in the SOAP Body trailer_elements -- list of elements following the SOAP body cKs||_||_|i o=|itjo|i|_qZdkl} | i|_nyT|iƒ|_t |ƒt jo|ii |ƒ|_ n|ii|ƒ|_ Wntj o }‚nXht|i ƒhdti<dti<dd<<|_||hf\|_|_|_gi}t|i ƒD]'} | itijo|| ƒq=q=~}t!|ƒdjot"ddƒ‚nt!|ƒdjot"ddƒ‚n|t$jo|d|_%d Sn|d} | i'd jp| i(t)i*jot"d | i'd dƒ‚n|i+d | ƒxat,| ƒD]S} | i.}|i0d ƒdjo|ddgjot"d|ddƒ‚qCqCW| |_#t1|i#ƒ ot"ddƒ‚ngi}t|i#ƒD]'} | itijo|| ƒqÞqÞ~}t!|ƒdjot"ddƒ‚n|d} | i'djo| i(t)i*joN|i+d| ƒ|i2t| ƒdƒ|i3dƒ|_4t5|i4ƒ|_6ntgf\|_4|_6t!|ƒdjot"ddƒ‚n|i3dƒ} | i'djp| i(t)i*joX|i4o't"d| i'dd| |i ƒ‚qwt"d | i'dd| |i ƒ‚n|i+d| dƒ|i2t| ƒdƒ| |_7t1|i7ƒ ot"ddƒ‚n|i o-t!|ƒot"dd| |i ƒ‚qInE||_8x8|i8D]-} | i( ot"dd| |i ƒ‚qqWtggf\|_%} }x²t5|i7ƒD]¡} t;| ƒ}|djo3|i%ot"dd| |i ƒ‚n| |_%qt|djo| i| ƒqt| o|i| ƒqtt"dd| |i ƒ‚qtW|i%tjo=t!|ƒo|d|_%qft"d d|i7|i ƒ‚nt1|i%ƒ ot"d!d| |i ƒ‚nt|i%ƒ}gi}t5|i7ƒD]'} t| ƒ|jo|| ƒq¹q¹~|_>|i2|i>dƒd S("sLInitialize. Keyword arguments: trailers -- allow trailer elments (default is zero) resolver -- function (bound method) to resolve URI's readerclass -- factory class to create a reader keepdom -- do not release the DOM envelope -- look for a SOAP envelope. (sPyExpatsxmlsxmlnssisDocument has no Envelopeis!Document has extra child elementsNsEnvelopesDocument has "s" element, not Envelopes:iÿÿÿÿsidsUnqualified attribute "s " in EnvelopesEnvelope has invalid encodingsEnvelope is empty (no Body)sHeadersEnvelope has header but no BodysBodysHeader followed by "s" element, not BodysBody has invalid encodingsElement found after BodysUnqualified trailer elements1s!Multiple seralization roots founds0s Illegal value for root attributesNo serialization root foundsInvalid encoding(?s readerclasssselfskeepdomsdefaultReaderClasssNonesxml.dom.ext.readersPyExpatsReadersreaderstypesinputs _stringtypess fromStringsdoms fromStreams ExceptionsesidsXMLNSsXMLsBASEsns_cachestrailerssresolversid_cachesappends_[1]s _childrensEsnodeTypes_Nodes ELEMENT_NODEscslensParseExceptionsenvelopesFalses body_rootselts localNames namespaceURIsSOAPsENVs_check_for_legal_childrens_attrssasnodeNamesnamesfinds_valid_encodings_check_for_pi_nodesspopsheaders_child_elementssheader_elementssbodystrailer_elementssnosmaybes _find_rootsrootsrootids data_elements(sselfsinputs readerclassskeepdomstrailerssresolversenvelopeskwsrootidsnoseltsEsPyExpatsascsesnamesmaybes_[1]sroot((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys__init__%sÆ     <!G   #   ) G ##              JcCs4y&|i o|ii|iƒnWnnXdS(N(sselfskeepdomsreaders releaseNodesdom(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys__del__Às  icCsá|dj}xÎt|ƒD]À}|i}|tijoqn|ti joM|ti jo|i i ƒdjoqnt d||||iƒ‚n|o|i o+t d|id||||iƒ‚qqWdS(s_Check if all children of this node are elements or whitespace-only text nodes. sHeaderssNon-element child in sUnqualified element "s" in N(snamesinheaders _childrenseltsnsnodeTypests_Nodes COMMENT_NODEs ELEMENT_NODEs TEXT_NODEs nodeValuesstripsParseExceptionsselfsdoms mustqualifys namespaceURIsnodeName(sselfsnameselts mustqualifysnstsinheader((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys_check_for_legal_childrenÇs   & cCs¨|}xš|o’|iƒ}|i}|tijo*td|id||i |i ƒ‚n0|ti jotd||i |i ƒ‚n|t|ƒ7}q WdS(sHRaise an exception if any of the list descendants are PI nodes. s Found processing instruction ""s Found DTDN(slistspopseltsnodeTypests_NodesPROCESSING_INSTRUCTION_NODEsParseExceptionsnodeNamesinheaders parentNodesselfsdomsDOCUMENT_TYPE_NODEs _children(sselfslistsinheaderstselt((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys_check_for_pi_nodesØs   cCst||iƒSdS(seReturn a human-readable "backtrace" from the document root to the specified element. N(s _backtraceseltsselfsdom(sselfselt((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys BacktraceèscCs&|ddjo td||i|ƒƒ‚n|d}|ii|ƒ}|o|Sn|i |i g}|o|i |iƒnxx|op|iƒ}|itijo=t|ƒ}|o&||i|<||jo|Sqíqñn|t|ƒ7}qŽWtd||i|ƒƒ‚dS(s0Find a local HREF in the data elements. is#s$Absolute HREF ("%s") not implementedisCan't find node for HREF "%s"N(shrefsEvaluateExceptionsselfs Backtraceseltsfragsid_cachesgetses data_elementss body_rootslistsheaderssextendsheader_elementsspopsnodeTypes_Nodes ELEMENT_NODEs_find_idsnodeids _children(sselfshrefseltsheaderssfragseslistsnodeid((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys FindLocalHREFîs.       cKsÃt|d|iƒ}| otd|dƒ‚ny?t|ƒti jot |ƒ}n|||||}WnDt j o8}td|dt |iƒdt |ƒƒ‚nX|SdS(NsresolversNo resolver for "s"sCan't resolve "s" (s): (sgetattrstcsselfsresolversrsEvaluateExceptionsuristypestypess UnicodeTypesstrskeywordssretvals Exceptionses __class__(sselfsuristcskeywordssesretvalsr((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys ResolveHREFs4cCs||tjottig}nt|ƒttig}gi}|iD]'}t |ƒ|jo||ƒqJqJ~SdS(sCReturn a list of all elements intended for these actor(s). N( s actorlistsNonesSOAPs ACTOR_NEXTslistsappends_[1]sselfsheader_elementssEs _find_actor(sselfs actorlistsEs_[1]((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysGetMyHeaderElementss  cCsÊ|iit|ƒƒ}| oœ||ijo|i|iƒ}nx\t |ƒD]N}|i t i jo5|idjo|i|d as child of SOAP-ENC:Headeris7number of occurances(%d) doesnt fit constraints (%d,%s)iN("sdslensofwhats lenofwhatsselfsheader_elementssrangescscrangesappends_[1]siswhats isinstances AnyElementsEvaluateExceptionsvsoccurssnspnamespnames namespaceURIstagNamesjsc_elts SplitQNamesprefixsnames_resolve_prefixsnsurisparsespyobjsNones minOccurss maxOccurs(sselfsofwhatsprefixsnsuristagNames lenofwhatswhatscrangespyobjsoccurssc_eltsnamescsdsisjs_[1]s namespaceURIsv((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pysParseHeaderElementsVs8 %8  A  *& (s__name__s __module__s__doc__sNonesdefaultReaderClasssFalsesTrues__init__s__del__s_check_for_legal_childrens_check_for_pi_nodess Backtraces FindLocalHREFs ResolveHREFsGetMyHeaderElementssGetElementNSdictsGetDomAndReadersIsAFaultsParsesWhatMustIUnderstandsWhatActorsArePresentsParseHeaderElements(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys ParsedSoaps" ›          s__main__(s__doc__sZSIs _copyrights _childrens_attrss_child_elementss _stringtypess _backtracesEvaluateExceptionsParseExceptions_valid_encodings_Nodes _find_attrs_resolve_prefixsZSI.TCs AnyElementstypessZSI.wstools.NamespacessSOAPsXMLNSsZSI.wstools.Utilitys SplitQNames _find_actors_find_mus _find_roots_find_ids ParsedSoaps__name__(sEvaluateExceptions _childrens_Nodes_find_mus ParsedSoaps_find_ids _backtraces _copyrights AnyElements_attrssXMLNSs _stringtypess_valid_encodingsParseExceptions_resolve_prefixs _find_attrstypess _find_actors_child_elementss SplitQNames _find_rootsSOAP((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/parse.pys?sO       ÿd PK‹¨58>-8±1;1;ZSI/TCtimes.pyo;ò Z@Ec @s?dZdklZlZlZlZlZdklZl Z dk l Z dk Z dk Z dkZdklZlZlZdklZlZlZdklZdddddddddg ZedƒZ ed ei! ƒZ"Z#ei$oed ei% ƒZ"ne"e#Z&d efd „ƒYZ'd efd „ƒYZ(d„Z)de fd„ƒYZ*de fd„ƒYZ+de+fd„ƒYZ,de+fd„ƒYZ-de+fd„ƒYZ.de+fd„ƒYZ/de+fd„ƒYZ0de+fd„ƒYZ1de+fd „ƒYZ2d!e+fd"„ƒYZ3e4d#jo eGHndS($sTypecodes for dates and times. (s _copyrights _floattypess _inttypess _get_idstrsEvaluateException(sTypeCodes SimpleType(sSCHEMAN(smktimes localtimesgmtime(stzinfos timedeltasdatetime(smodfissecondss_localtimezonecBs)tZdZd„Zd„Zd„ZRS(s c Csett|i|i|i|i|i|i|i ƒddf ƒƒ}|i djot Snt SdS(s.datetime -> DST offset in minutes east of UTC.iiÿÿÿÿN(s _localtimes_mktimesdtsyearsmonthsdayshoursminutessecondsweekdaysttstm_isdsts_dstdiffs_zero(sselfsdtstt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysdsts Ec Cs]tt|i|i|i|i|i|i|i ƒddf ƒƒ}t i |i djSdS(s%datetime -> string name of time zone.iiÿÿÿÿN(s _localtimes_mktimesdtsyearsmonthsdayshoursminutessecondsweekdaystts_timestznamestm_isdst(sselfsdtstt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pystzname(sEc Csett|i|i|i|i|i|i|i ƒddf ƒƒ}|i djot Snt SdS(s;datetime -> minutes east of UTC (negative for west of UTC).iiÿÿÿÿN(s _localtimes_mktimesdtsyearsmonthsdayshoursminutessecondsweekdaysttstm_isdsts _dstoffsets _stdoffset(sselfsdtstt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys utcoffset.s E(s__name__s __module__s__doc__sdststznames utcoffset(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys_localtimezones  s _fixedoffsetcBs2tZdZd„Zd„Zd„Zd„ZRS(sËFixed offset in minutes east from UTC. A class building tzinfo objects for fixed-offset time zones. Note that _fixedoffset(0, "UTC") is a different way to build a UTC tzinfo object. cCstd|ƒ|_dS(Nsminutes(s _timedeltasoffsetsselfs_fixedoffset__offset(sselfsoffset((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys__init__=scCstSdS(s.datetime -> DST offset in minutes east of UTC.N(s_zero(sselfsdt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysdstAscCsdSdS(s%datetime -> string name of time zone.sserverN((sselfsdt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pystznameEscCs |iSdS(s;datetime -> minutes east of UTC (negative for west of UTC).N(sselfs_fixedoffset__offset(sselfsdt((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys utcoffsetJs(s__name__s __module__s__doc__s__init__sdststznames utcoffset(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys _fixedoffset5s    c Cs¯t}xkddfddfddfddfd d ffD]6\} } |i| ƒ} | ot| ƒ|| -?)P((?P\d+)Y)?((?P\d+)M)?((?P\d+)D)?(?PT?)((?P\d+)H)?((?P\d+)M)?((?P\d*(\.\d+)?)S)?$cCs |tjotSntii|ƒ}|tjotd|i|ƒƒ‚n|i ƒ}|do0|dtjo|dtjo|dtjotdƒ‚nyt |ƒ}Wn'tj o}tt|ƒƒ‚nX|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. sIllegal durationsTshsmsssDuration has T without timeN(stextsNonesDurations lex_patternsmatchsmsEvaluateExceptionspss Backtraceselts groupdictsds_dict_to_tuplesretvals ValueErrorsesstrsselfspyclass(sselfstextseltspssesmsretvalsd((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys text_to_dataŽs    >c CsÆt|ƒtjpt|ƒtjot|ƒ}nh}t|ƒ}dtd„|dd!ƒjott|ƒ}d}nd}d||d|d|d|d |d |d f}|SdS( NicCs |djS(Ni(sx(sx((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys¨siis-ss%sP%dY%dM%dDT%dH%dM%dSiiii( stypespyobjs _floattypess _inttypess_gmtimesdstuplesmapsabssnegsval(sselfspyobjsdsvalsneg((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysget_formatted_content¢s&   7( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternsSCHEMAsXSD3stypes text_to_datasget_formatted_content(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysDurationƒs  s GregoriancBs.tZdZeZZZd„Zd„ZRS(sGregorian times. cCs©|tjotSn|ii|ƒ}| o td||i|ƒƒ‚nyt |i ƒƒ}Wnt j o }‚nX|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. sBad Gregorian: %sN(stextsNonesselfs lex_patternsmatchsmsEvaluateExceptionspss Backtraceselts_dict_to_tuples groupdictsretvals ValueErrorsespyclass(sselfstextseltspssesmsretval((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys text_to_data¹s  cCsŠt|ƒtjpt|ƒtjot|ƒ}nh}t|ƒ}dtd„|dd!ƒjott|ƒ}d|dÒsiis-snegssYsMsDishismissiiçs0milliseconds must be a integer between 0 and 999sms(stypespyobjs _floattypess _inttypess_gmtimesdstuplesmapsabssmssselfsformats ValueErrors format_ms(sselfspyobjsdsms((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysget_formatted_contentÌs &    T  ]( s__name__s __module__s__doc__sNones lex_patternstagsformats text_to_datasget_formatted_content(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys Gregorian´s  s gDateTimecBs[tZdZedfgZeidƒZddf\ZZ e d dZ e i dfZ RS(sA date and time. sdateTimesy^(?P-?)(?P\d{4,})-(?P\d\d)-(?P\d\d)T(?P\d\d):(?P\d\d):(?P\d*(\.\d+)?)(?P(Z|([-+]\d\d:\d\d))?)$s0%(Y)04d-%(M)02d-%(D)02dT%(h)02d:%(m)02d:%(s)02dZiÿÿÿÿs .%(ms)03dZ(s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformats format_mssSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys gDateTimeæs sgDatecBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(s A date. sdatesL^(?P-?)(?P\d{4,})-(?P\d\d)-(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s%(Y)04d-%(M)02d-%(D)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgDateòs s gYearMonthcBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(s A date. s gYearMonths@^(?P-?)(?P\d{4,})-(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s%(Y)04d-%(M)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys gYearMonthüs sgYearcBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(s A date. sgYears4^(?P-?)(?P\d{4,})(?PZ|([-+]\d\d:\d\d))?$s%(Y)04dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgYears s gMonthDaycBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(sA gMonthDay. s gMonthDays@^(?P-?)--(?P\d\d)-(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s---%(M)02d-%(D)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys gMonthDays sgDaycBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(s A gDay. sgDays5^(?P-?)---(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s ---%(D)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgDays sgMonthcBsMtZdZedfgZeidƒZddf\ZZ e i dfZ RS(sA gMonth. sgMonths5^(?P-?)---(?P\d\d)(?PZ|([-+]\d\d:\d\d))?$s ---%(M)02dZ( s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformatsSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgMonth%s sgTimecBs[tZdZedfgZeidƒZddf\ZZ e d dZ e i dfZ RS(s A time. stimesQ^(?P-?)(?P\d\d):(?P\d\d):(?P\d*(\.\d+)?)(?PZ|([-+]\d\d:\d\d))?$s%(h)02d:%(m)02d:%(s)02dZiÿÿÿÿs .%(ms)03dZ(s__name__s __module__s__doc__sNones parselistsrescompiles lex_patternstagsformats format_mssSCHEMAsXSD3stype(((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pysgTime/s s__main__(5s__doc__sZSIs _copyrights _floattypess _inttypess _get_idstrsEvaluateExceptionsZSI.TCsTypeCodes SimpleTypesZSI.wstools.NamespacessSCHEMAsoperatorsrestimes_timesmktimes_mktimes localtimes _localtimesgmtimes_gmtimesdatetimestzinfos_tzinfos timedeltas _timedeltas _datetimesmathsmodfs_modfs_niltimes_zerostimezones _dstoffsets _stdoffsetsdaylightsaltzones_dstdiffs_localtimezones _fixedoffsets_dict_to_tuplesDurations Gregorians gDateTimesgDates gYearMonthsgYears gMonthDaysgDaysgMonthsgTimes__name__($sEvaluateExceptionsTypeCodes _inttypess _copyrights _datetimesoperators _floattypess_localtimezones _get_idstrs SimpleTypesgDatesgYears_modfs gDateTimes_tzinfos_niltimesres _stdoffsets Gregorians_mktimes gYearMonths _fixedoffsets_gmtimes_dict_to_tuples _timedeltasgTimes _dstoffsetsgMonths gMonthDays_dstdiffsgDays_zeros_timesDurations _localtimesSCHEMA((s/build/bdist.darwin-8.0.1-x86/egg/ZSI/TCtimes.pys?s8%  !    412        PK/¤Y5µ¢ Ê(Ê(ZSI/dispatch.py#! /usr/bin/env python # $Header$ '''Simple CGI dispatching. ''' import types, os, sys from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from ZSI import * from ZSI import _child_elements, _copyright, _seqtypes, _find_arraytype, _find_type, resolvers from ZSI.auth import _auth_tc, AUTH, ClientBinding # Client binding information is stored in a global. We provide an accessor # in case later on it's not. _client_binding = None def GetClientBinding(): '''Return the client binding object. ''' return _client_binding gettypecode = lambda mod,e: getattr(mod, str(e.localName)).typecode def _Dispatch(ps, modules, SendResponse, SendFault, nsdict={}, typesmodule=None, gettypecode=gettypecode, rpc=False, docstyle=False, **kw): '''Find a handler for the SOAP request in ps; search modules. Call SendResponse or SendFault to send the reply back, appropriately. Behaviors: default -- Call "handler" method with pyobj representation of body root, and return a self-describing request (w/typecode). Parsing done via a typecode from typesmodule, or Any. docstyle -- Call "handler" method with ParsedSoap instance and parse result with an XML typecode (DOM). Behavior, wrap result in a body_root "Response" appended message. rpc -- Specify RPC wrapper of result. Behavior, ignore body root (RPC Wrapper) of request, parse all "parts" of message via individual typecodes. Expect the handler to return the parts of the message, whether it is a dict, single instance, or a list try to serialize it as a Struct but if this is not possible put it in an Array. Parsing done via a typecode from typesmodule, or Any. ''' global _client_binding try: what = str(ps.body_root.localName) # See what modules have the element name. if modules is None: modules = ( sys.modules['__main__'], ) handlers = [ getattr(m, what) for m in modules if hasattr(m, what) ] if len(handlers) == 0: raise TypeError("Unknown method " + what) # Of those modules, see who's callable. handlers = [ h for h in handlers if callable(h) ] if len(handlers) == 0: raise TypeError("Unimplemented method " + what) if len(handlers) > 1: raise TypeError("Multiple implementations found: " + `handlers`) handler = handlers[0] _client_binding = ClientBinding(ps) if docstyle: result = handler(ps.body_root) tc = TC.XML(aslist=1, pname=what+'Response') elif not rpc: try: tc = gettypecode(typesmodule, ps.body_root) except Exception: tc = TC.Any() try: arg = tc.parse(ps.body_root, ps) except EvaluateException, ex: SendFault(FaultFromZSIException(ex), **kw) return try: result = handler(*arg) except Exception,ex: SendFault(FaultFromZSIException(ex), **kw) try: tc = result.typecode except AttributeError,ex: SendFault(FaultFromZSIException(ex), **kw) elif typesmodule is not None: kwargs = {} for e in _child_elements(ps.body_root): try: tc = gettypecode(typesmodule, e) except Exception: tc = TC.Any() try: kwargs[str(e.localName)] = tc.parse(e, ps) except EvaluateException, ex: SendFault(FaultFromZSIException(ex), **kw) return result = handler(**kwargs) aslist = False # make sure data is wrapped, try to make this a Struct if type(result) in _seqtypes: for o in result: aslist = hasattr(result, 'typecode') if aslist: break elif type(result) is not dict: aslist = not hasattr(result, 'typecode') result = (result,) tc = TC.Any(pname=what+'Response', aslist=aslist) else: # if this is an Array, call handler with list # if this is an Struct, call handler with dict tp = _find_type(ps.body_root) isarray = ((type(tp) in (tuple,list) and tp[1] == 'Array') or _find_arraytype(ps.body_root)) data = _child_elements(ps.body_root) tc = TC.Any() if isarray and len(data) == 0: result = handler() elif isarray: try: arg = [ tc.parse(e, ps) for e in data ] except EvaluateException, e: #SendFault(FaultFromZSIException(e), **kw) SendFault(RuntimeError("THIS IS AN ARRAY: %s" %isarray)) return result = handler(*arg) else: try: kwarg = dict([ (str(e.localName),tc.parse(e, ps)) for e in data ]) except EvaluateException, e: SendFault(FaultFromZSIException(e), **kw) return result = handler(**kwarg) # reponse typecode #tc = getattr(result, 'typecode', TC.Any(pname=what+'Response')) tc = TC.Any(pname=what+'Response') sw = SoapWriter(nsdict=nsdict) sw.serialize(result, tc) return SendResponse(str(sw), **kw) except Fault, e: return SendFault(e, **kw) except Exception, e: # Something went wrong, send a fault. return SendFault(FaultFromException(e, 0, sys.exc_info()[2]), **kw) def _ModPythonSendXML(text, code=200, **kw): req = kw['request'] req.content_type = 'text/xml' req.content_length = len(text) req.send_http_header() req.write(text) def _ModPythonSendFault(f, **kw): _ModPythonSendXML(f.AsSOAP(), 500, **kw) def _JonPySendFault(f, **kw): _JonPySendXML(f.AsSOAP(), 500, **kw) def _JonPySendXML(text, code=200, **kw): req = kw['request'] req.set_header("Content-Type", 'text/xml; charset="utf-8"') req.set_header("Content-Length", str(len(text))) req.write(text) def _CGISendXML(text, code=200, **kw): print 'Status: %d' % code print 'Content-Type: text/xml; charset="utf-8"' print 'Content-Length: %d' % len(text) print '' print text def _CGISendFault(f, **kw): _CGISendXML(f.AsSOAP(), 500, **kw) class SOAPRequestHandler(BaseHTTPRequestHandler): '''SOAP handler. ''' server_version = 'ZSI/1.1 ' + BaseHTTPRequestHandler.server_version def send_xml(self, text, code=200): '''Send some XML. ''' self.send_response(code) self.send_header('Content-type', 'text/xml; charset="utf-8"') self.send_header('Content-Length', str(len(text))) self.end_headers() self.wfile.write(text) self.wfile.flush() def send_fault(self, f, code=500): '''Send a fault. ''' self.send_xml(f.AsSOAP(), code) def do_POST(self): '''The POST command. ''' try: ct = self.headers['content-type'] if ct.startswith('multipart/'): cid = resolvers.MIMEResolver(ct, self.rfile) xml = cid.GetSOAPPart() ps = ParsedSoap(xml, resolver=cid.Resolve) else: length = int(self.headers['content-length']) ps = ParsedSoap(self.rfile.read(length)) except ParseException, e: self.send_fault(FaultFromZSIException(e)) return except Exception, e: # Faulted while processing; assume it's in the header. self.send_fault(FaultFromException(e, 1, sys.exc_info()[2])) return _Dispatch(ps, self.server.modules, self.send_xml, self.send_fault, docstyle=self.server.docstyle, nsdict=self.server.nsdict, typesmodule=self.server.typesmodule, rpc=self.server.rpc) def AsServer(port=80, modules=None, docstyle=False, nsdict={}, typesmodule=None, rpc=False, addr=''): address = (addr, port) httpd = HTTPServer(address, SOAPRequestHandler) httpd.modules = modules httpd.docstyle = docstyle httpd.nsdict = nsdict httpd.typesmodule = typesmodule httpd.rpc = rpc httpd.serve_forever() def AsCGI(nsdict={}, typesmodule=None, rpc=False, modules=None): '''Dispatch within a CGI script. ''' if os.environ.get('REQUEST_METHOD') != 'POST': _CGISendFault(Fault(Fault.Client, 'Must use POST')) return ct = os.environ['CONTENT_TYPE'] try: if ct.startswith('multipart/'): cid = resolvers.MIMEResolver(ct, sys.stdin) xml = cid.GetSOAPPart() ps = ParsedSoap(xml, resolver=cid.Resolve) else: length = int(os.environ['CONTENT_LENGTH']) ps = ParsedSoap(sys.stdin.read(length)) except ParseException, e: _CGISendFault(FaultFromZSIException(e)) return _Dispatch(ps, modules, _CGISendXML, _CGISendFault, nsdict=nsdict, typesmodule=typesmodule, rpc=rpc) def AsHandler(request=None, modules=None, **kw): '''Dispatch from within ModPython.''' ps = ParsedSoap(request) kw['request'] = request _Dispatch(ps, modules, _ModPythonSendXML, _ModPythonSendFault, **kw) def AsJonPy(request=None, modules=None, **kw): '''Dispatch within a jonpy CGI/FastCGI script. ''' kw['request'] = request if request.environ.get('REQUEST_METHOD') != 'POST': _JonPySendFault(Fault(Fault.Client, 'Must use POST'), **kw) return ct = request.environ['CONTENT_TYPE'] try: if ct.startswith('multipart/'): cid = resolvers.MIMEResolver(ct, request.stdin) xml = cid.GetSOAPPart() ps = ParsedSoap(xml, resolver=cid.Resolve) else: length = int(request.environ['CONTENT_LENGTH']) ps = ParsedSoap(request.stdin.read(length)) except ParseException, e: _JonPySendFault(FaultFromZSIException(e), **kw) return _Dispatch(ps, modules, _JonPySendXML, _JonPySendFault, **kw) if __name__ == '__main__': print _copyright PK¨58–J N"N"ZSI/writer.pyc;ò Z@Ec@sdZdklZlZlZdklZlZlZdkl Z l Z dk l Z l Z lZdklZdkZde ifde ifgZhd e i<d e i<d e<d ei<d eid %s %s ''' schema = ZSI_SCHEMA_URI literal = 'FaultDetail' def __init__(self, **kw): Struct.__init__(self, ZSIFaultDetail, [String(pname=(ZSI_SCHEMA_URI, 'string')), String(pname=(ZSI_SCHEMA_URI, 'trace'),minOccurs=0),], pname=(ZSI_SCHEMA_URI, 'FaultDetail'), **kw ) class ZSIFaultDetail: def __init__(self, string=None, trace=None): self.string = string self.trace = trace def __str__(self): if self.trace: return self.string + '\n[trace: ' + self.trace + ']' return self.string def __repr__(self): return "<%s.ZSIFaultDetail %s>" % (__name__, _get_idstr(self)) ZSIFaultDetail.typecode = ZSIFaultDetailTypeCode() class URIFaultDetailTypeCode(ElementDeclaration, Struct): ''' uri localname ''' schema = ZSI_SCHEMA_URI literal = 'URIFaultDetail' def __init__(self, **kw): Struct.__init__(self, URIFaultDetail, [String(pname=(ZSI_SCHEMA_URI, 'URI')), String(pname=(ZSI_SCHEMA_URI, 'localname')),], pname=(ZSI_SCHEMA_URI, 'URIFaultDetail'), **kw ) class URIFaultDetail: def __init__(self, uri=None, localname=None): self.URI = uri self.localname = localname URIFaultDetail.typecode = URIFaultDetailTypeCode() class ActorFaultDetailTypeCode(ElementDeclaration, Struct): ''' %s ''' schema = ZSI_SCHEMA_URI literal = 'ActorFaultDetail' def __init__(self, **kw): Struct.__init__(self, ActorFaultDetail, [String(pname=(ZSI_SCHEMA_URI, 'URI')),], pname=(ZSI_SCHEMA_URI, 'ActorFaultDetail'), **kw ) class ActorFaultDetail: def __init__(self, uri=None): self.URI = uri ActorFaultDetail.typecode = ActorFaultDetailTypeCode() class Fault(ZSIException): '''SOAP Faults. ''' Client = "SOAP-ENV:Client" Server = "SOAP-ENV:Server" MU = "SOAP-ENV:MustUnderstand" def __init__(self, code, string, actor=None, detail=None, headerdetail=None): if detail is not None and type(detail) not in _seqtypes: detail = (detail,) if headerdetail is not None and type(headerdetail) not in _seqtypes: headerdetail = (headerdetail,) self.code, self.string, self.actor, self.detail, self.headerdetail = \ code, string, actor, detail, headerdetail ZSIException.__init__(self, code, string, actor, detail, headerdetail) def DataForSOAPHeader(self): if not self.headerdetail: return None # SOAP spec doesn't say how to encode header fault data. return ZSIHeaderDetail(self.headerdetail) def serialize(self, sw): '''Serialize the object.''' detail = None if self.detail is not None: detail = Detail() detail.any = self.detail pyobj = FaultType(self.code, self.string, self.actor, detail) sw.serialize(pyobj, typed=False) def AsSOAP(self, **kw): header = self.DataForSOAPHeader() sw = SoapWriter(**kw) self.serialize(sw) if header is not None: sw.serialize_header(header, header.typecode, typed=False) return str(sw) def __str__(self): strng = str(self.string) + "\n" if hasattr(self, 'detail'): if hasattr(self.detail, '__len__'): for d in self.detail: strng += str(d) else: strng += str(self.detail) return strng def __repr__(self): return "<%s.Fault at %s>" % (__name__, _get_idstr(self)) AsSoap = AsSOAP def FaultFromNotUnderstood(uri, localname, actor=None): detail, headerdetail = None, URIFaultDetail(uri, localname) return Fault(Fault.MU, 'SOAP mustUnderstand not understood', actor, detail, headerdetail) def FaultFromActor(uri, actor=None): detail, headerdetail = None, ActorFaultDetail(uri) return Fault(Fault.Client, 'Cannot process specified actor', actor, detail, headerdetail) def FaultFromZSIException(ex, actor=None): '''Return a Fault object created from a ZSI exception object. ''' mystr = getattr(ex, 'str', None) or str(ex) mytrace = getattr(ex, 'trace', '') elt = ''' %s %s ''' % (mystr, mytrace) if getattr(ex, 'inheader', 0): detail, headerdetail = None, elt else: detail, headerdetail = elt, None return Fault(Fault.Client, 'Unparseable message', actor, detail, headerdetail) def FaultFromException(ex, inheader, tb=None, actor=None): '''Return a Fault object created from a Python exception. SOAP-ENV:Server Processing Failure ''' tracetext = None if tb: try: lines = '\n'.join(['%s:%d:%s' % (name, line, func) for name, line, func, text in traceback.extract_tb(tb)]) except: pass else: tracetext = lines exceptionName = "" try: exceptionName = ":".join([ex.__module__, ex.__class__.__name__]) except: pass elt = ZSIFaultDetail(string=exceptionName + "\n" + str(ex), trace=tracetext) if inheader: detail, headerdetail = None, elt else: detail, headerdetail = elt, None return Fault(Fault.Server, 'Processing Failure', actor, detail, headerdetail) def FaultFromFaultMessage(ps): '''Parse the message as a fault. ''' pyobj = ps.Parse(FaultType.typecode) if pyobj.detail == None: detailany = None else: detailany = pyobj.detail.any return Fault(pyobj.faultcode, pyobj.faultstring, pyobj.faultactor, detailany) if __name__ == '__main__': print _copyright PKƒ¨58_ u¥3¥3ZSI/dispatch.pyc;ò Z@Ec@sodZdkZdkZdkZdklZlZdkTdklZl Z l Z l Z l Z l Z dklZlZlZead„Zd„Zheeeed„Zd d „Zd „Zd „Zd d „Zd d„Zd„Zdefd„ƒYZdeeheedd„Zheeed„Z eed„Z!eed„Z"e#djo e GHndS(sSimple CGI dispatching. N(sBaseHTTPRequestHandlers HTTPServer(s*(s_child_elementss _copyrights _seqtypess_find_arraytypes _find_types resolvers(s_auth_tcsAUTHs ClientBindingcCstSdS(s&Return the client binding object. N(s_client_binding(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/dispatch.pysGetClientBindingscCst|t|iƒƒiS(N(sgetattrsmodsstrses localNamestypecode(smodse((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/dispatch.pyssc Ksy¤t|iiƒ}|tjotidf}ngi}|D]-} t | |ƒo|t | |ƒƒqDqD~}t|ƒdjotd|ƒ‚ngi}|D]!}t|ƒo||ƒq¯q¯~}t|ƒdjotd|ƒ‚nt|ƒdjotd| ƒ‚n|d}t|ƒa|o/||iƒ} tiddd|d ƒ}nþ| o÷y|||iƒ}Wntj otiƒ}nXy|i|i|ƒ} Wn,t!j o }|t$|ƒ| d SnXy|| Œ} Wn(tj o}|t$|ƒ| nXy | i&}Wqqt'j o}|t$|ƒ| qqXnÿ|tj oLh}xžt)|iƒD]}y|||ƒ}Wntj otiƒ}nXy#|i||ƒ|t|iƒ]*>',re.IGNORECASE) wsdl = re.sub(wsdlre,soapAddress,wsdl) self.send_xml(wsdl) else: self.send_error(404, "WSDL not available for that service [%s]." % self.path) else: self.send_error(404, "Service not found [%s]." % self.path) class ServiceContainer(HTTPServer): '''HTTPServer that stores service instances according to POST values. An action value is instance specific, and specifies an operation (function) of an instance. ''' class NodeTree: '''Simple dictionary implementation of a node tree ''' def __init__(self): self.__dict = {} def __str__(self): return str(self.__dict) def listNodes(self): print self.__dict.keys() def getNode(self, url): path = urlparse.urlsplit(url)[2] if path.startswith("/"): path = path[1:] if self.__dict.has_key(path): return self.__dict[path] else: raise NoSuchService, 'No service(%s) in ServiceContainer' %path def setNode(self, service, url): path = urlparse.urlsplit(url)[2] if path.startswith("/"): path = path[1:] if not isinstance(service, ServiceSOAPBinding): raise TypeError, 'A Service must implement class ServiceSOAPBinding' if self.__dict.has_key(path): raise ServiceAlreadyPresent, 'Service(%s) already in ServiceContainer' % path else: self.__dict[path] = service def removeNode(self, url): path = urlparse.urlsplit(url)[2] if path.startswith("/"): path = path[1:] if self.__dict.has_key(path): node = self.__dict[path] del self.__dict[path] return node else: raise NoSuchService, 'No service(%s) in ServiceContainer' %path def __init__(self, server_address, services=[], RequestHandlerClass=SOAPRequestHandler): '''server_address -- RequestHandlerClass -- ''' HTTPServer.__init__(self, server_address, RequestHandlerClass) self._nodes = self.NodeTree() map(lambda s: self.setNode(s), services) def __str__(self): return '%s(%s) nodes( %s )' %(self.__class__, _get_idstr(self), str(self._nodes)) def __call__(self, ps, post, action, address=None): '''ps -- ParsedSoap representing the request post -- HTTP POST --> instance action -- Soap Action header --> method address -- Address instance representing WS-Address ''' method = self.getCallBack(ps, post, action) if isinstance(method.im_self, SimpleWSResource): return method(ps, address) return method(ps) def setNode(self, service, url=None): if url is None: url = service.getPost() self._nodes.setNode(service, url) def getNode(self, url): return self._nodes.getNode(url) def removeNode(self, url): self._nodes.removeNode(url) class SimpleWSResource(ServiceSOAPBinding): def getNode(self, post): '''post -- POST HTTP value ''' return self._nodes.getNode(post) def setNode(self, service, post): '''service -- service instance post -- POST HTTP value ''' self._nodes.setNode(service, post) def getCallBack(self, ps, post, action): '''post -- POST HTTP value action -- SOAP Action value ''' node = self.getNode(post) if node is None: raise NoSuchFunction if node.authorize(None, post, action): return node.getOperation(ps, action) else: raise NotAuthorized, "Authorization failed for method %s" % action if __name__ == '__main__': print _copyright PK/¤Y5ïä+‰µ µ ZSI/digest_auth.py#! /usr/bin/env python # $Header$ '''Utilities for HTTP Digest Authentication ''' from md5 import md5 import random import time import httplib random.seed(int(time.time()*10)) def H(val): return md5(val).hexdigest() def KD(secret,data): return H('%s:%s' % (secret,data)) def A1(username,realm,passwd,nonce=None,cnonce=None): if nonce and cnonce: return '%s:%s:%s:%s:%s' % (username,realm,passwd,nonce,cnonce) else: return '%s:%s:%s' % (username,realm,passwd) def A2(method,uri): return '%s:%s' % (method,uri) def dict_fetch(d,k,defval=None): if d.has_key(k): return d[k] return defval def generate_response(chaldict,uri,username,passwd,method='GET',cnonce=None): """ Generate an authorization response dictionary. chaldict should contain the digest challenge in dict form. Use fetch_challenge to create a chaldict from a HTTPResponse object like this: fetch_challenge(res.getheaders()). returns dict (the authdict) Note. Use build_authorization_arg() to turn an authdict into the final Authorization header value. """ authdict = {} qop = dict_fetch(chaldict,'qop') domain = dict_fetch(chaldict,'domain') nonce = dict_fetch(chaldict,'nonce') stale = dict_fetch(chaldict,'stale') algorithm = dict_fetch(chaldict,'algorithm','MD5') realm = dict_fetch(chaldict,'realm','MD5') opaque = dict_fetch(chaldict,'opaque') nc = "00000001" if not cnonce: cnonce = H(str(random.randint(0,10000000)))[:16] if algorithm.lower()=='md5-sess': a1 = A1(username,realm,passwd,nonce,cnonce) else: a1 = A1(username,realm,passwd) a2 = A2(method,uri) secret = H(a1) data = '%s:%s:%s:%s:%s' % (nonce,nc,cnonce,qop,H(a2)) authdict['username'] = '"%s"' % username authdict['realm'] = '"%s"' % realm authdict['nonce'] = '"%s"' % nonce authdict['uri'] = '"%s"' % uri authdict['response'] = '"%s"' % KD(secret,data) authdict['qop'] = '"%s"' % qop authdict['nc'] = nc authdict['cnonce'] = '"%s"' % cnonce return authdict def fetch_challenge(http_header): """ Create a challenge dictionary from a HTTPResponse objects getheaders() method. """ chaldict = {} vals = http_header.split(' ') chaldict['challenge'] = vals[0] for val in vals[1:]: try: a,b = val.split('=') b=b.replace('"','') b=b.replace("'",'') b=b.replace(",",'') chaldict[a.lower()] = b except: pass return chaldict def build_authorization_arg(authdict): """ Create an "Authorization" header value from an authdict (created by generate_response()). """ vallist = [] for k in authdict.keys(): vallist += ['%s=%s' % (k,authdict[k])] return 'Digest '+', '.join(vallist) if __name__ == '__main__': print _copyright PK/¤Y5c¦’QQZSI/TCnumbers.py#! /usr/bin/env python # $Header$ '''Typecodes for numbers. ''' import types from ZSI import _copyright, _inttypes, _floattypes, _seqtypes, \ EvaluateException from ZSI.TC import TypeCode, Integer, Decimal from ZSI.wstools.Namespaces import SCHEMA class IunsignedByte(Integer): '''Unsigned 8bit value. ''' type = (SCHEMA.XSD3, "unsignedByte") parselist = [ (None, "unsignedByte") ] seriallist = [ ] class IunsignedShort(Integer): '''Unsigned 16bit value. ''' type = (SCHEMA.XSD3, "unsignedShort") parselist = [ (None, "unsignedShort") ] seriallist = [ ] class IunsignedInt(Integer): '''Unsigned 32bit value. ''' type = (SCHEMA.XSD3, "unsignedInt") parselist = [ (None, "unsignedInt") ] seriallist = [ ] class IunsignedLong(Integer): '''Unsigned 64bit value. ''' type = (SCHEMA.XSD3, "unsignedLong") parselist = [ (None, "unsignedLong") ] seriallist = [ ] class Ibyte(Integer): '''Signed 8bit value. ''' type = (SCHEMA.XSD3, "byte") parselist = [ (None, "byte") ] seriallist = [ ] class Ishort(Integer): '''Signed 16bit value. ''' type = (SCHEMA.XSD3, "short") parselist = [ (None, "short") ] seriallist = [ ] class Iint(Integer): '''Signed 32bit value. ''' type = (SCHEMA.XSD3, "int") parselist = [ (None, "int") ] seriallist = [ types.IntType ] class Ilong(Integer): '''Signed 64bit value. ''' type = (SCHEMA.XSD3, "long") parselist = [(None, "long")] seriallist = [ types.LongType ] class InegativeInteger(Integer): '''Value less than zero. ''' type = (SCHEMA.XSD3, "negativeInteger") parselist = [ (None, "negativeInteger") ] seriallist = [ ] class InonPositiveInteger(Integer): '''Value less than or equal to zero. ''' type = (SCHEMA.XSD3, "nonPositiveInteger") parselist = [ (None, "nonPositiveInteger") ] seriallist = [ ] class InonNegativeInteger(Integer): '''Value greater than or equal to zero. ''' type = (SCHEMA.XSD3, "nonNegativeInteger") parselist = [ (None, "nonNegativeInteger") ] seriallist = [ ] class IpositiveInteger(Integer): '''Value greater than zero. ''' type = (SCHEMA.XSD3, "positiveInteger") parselist = [ (None, "positiveInteger") ] seriallist = [ ] class Iinteger(Integer): '''Integer value. ''' type = (SCHEMA.XSD3, "integer") parselist = [ (None, "integer") ] seriallist = [ ] class IEnumeration(Integer): '''Integer value, limited to a specified set of values. ''' def __init__(self, choices, pname=None, **kw): Integer.__init__(self, pname, **kw) self.choices = choices t = type(choices) if t in _seqtypes: self.choices = tuple(choices) elif TypeCode.typechecks: raise TypeError( 'Enumeration choices must be list or sequence, not ' + str(t)) if TypeCode.typechecks: for c in self.choices: if type(c) not in _inttypes: raise TypeError('Enumeration choice "' + str(c) + '" is not an integer') def parse(self, elt, ps): val = Integer.parse(self, elt, ps) if val not in self.choices: raise EvaluateException('Value "' + str(val) + \ '" not in enumeration list', ps.Backtrace(elt)) return val def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw): if pyobj not in self.choices: raise EvaluateException('Value not in int enumeration list', ps.Backtrace(elt)) Integer.serialize(self, elt, sw, pyobj, name=name, orig=orig, **kw) class FPfloat(Decimal): '''IEEE 32bit floating point value. ''' type = (SCHEMA.XSD3, "float") parselist = [ (None, "float") ] seriallist = [ types.FloatType ] class FPdouble(Decimal): '''IEEE 64bit floating point value. ''' type = (SCHEMA.XSD3, "double") parselist = [ (None, "double") ] seriallist = [ ] class FPEnumeration(FPfloat): '''Floating point value, limited to a specified set of values. ''' def __init__(self, choices, pname=None, **kw): FPfloat.__init__(self, pname, **kw) self.choices = choices t = type(choices) if t in _seqtypes: self.choices = tuple(choices) elif TypeCode.typechecks: raise TypeError( 'Enumeration choices must be list or sequence, not ' + str(t)) if TypeCode.typechecks: for c in self.choices: if type(c) not in _floattypes: raise TypeError('Enumeration choice "' + str(c) + '" is not floating point number') def parse(self, elt, ps): val = Decimal.parse(self, elt, ps) if val not in self.choices: raise EvaluateException('Value "' + str(val) + \ '" not in enumeration list', ps.Backtrace(elt)) return val def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw): if pyobj not in self.choices: raise EvaluateException('Value not in int enumeration list', ps.Backtrace(elt)) Decimal.serialize(self, elt, sw, pyobj, name=name, orig=orig, **kw) if __name__ == '__main__': print _copyright PKЍ58L!  ZSI/typeinterpreter.pyo;ò Z@Ec@sdkZdklZlZlZdklZdklZlZdkl Z dk l Z l Z de fd„ƒYZdfd „ƒYZdS( N(sTCsTCtimess TCcompound(sTypeCode(s _copyrightsEvaluateException(s SplitQName(sSOAPsSCHEMAsNamespaceExceptioncBstZRS(N(s__name__s __module__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pysNamespaceExceptionssBaseTypeInterpretercBs>tZdZd„Zd„Zd„Zd„Zed„ZRS(s°Example mapping of xsd/soapenc types to zsi python types. Checks against all available classes in ZSI.TC. Used in wsdl2python, wsdlInterpreter, and ServiceProxy. cCs'tititititititititi ti ti ti ti titititititititititititititititig|_t i!i"t i!it i!it i!it i!it i!it i!it ii#t i!i t i!ig |_$t ii%t i!i&t i!it i!i g|_'t ii(t ii)t iit i!it i!it i!it i!it i!it iit iit ii*t iig |_+t ii t iit i,it i,it i,i t i,it i,it i,it i,i t i,ig |_-dSdS(N(.sTCsIintegersIunsignedShorts gYearMonthsInonNegativeIntegersIintsStrings gDateTimes IunsignedIntsDurationsIpositiveIntegersFPfloatsgDaysgMonthsInegativeIntegersgDatesURIsHexBinaryStrings IunsignedBytes gMonthDaysInonPositiveIntegersIbytesFPdoublesgTimesgYearsIlongs IunsignedLongsIshortsTokensQNamesselfs _type_listsZSIs TCnumberss IEnumerationsIntegers _tc_to_intsDecimals FPEnumerations _tc_to_floats Base64Strings Enumerations XMLStrings _tc_to_stringsTCtimess _tc_to_tuple(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys__init__s · c -uc cCs‰hdti<dti<dti<}|i|ƒo ||Snx8|iD]$}|i t i |fjoPqPqPWti }|SdS(Nsbooleansdecimals base64Binary(sTCsBooleansDecimals Base64Stringsuntaged_xsd_typesshas_keysmsg_typesselfs _type_liststcstypesSCHEMAsXSD3sAnyType(sselfsmsg_typesuntaged_xsd_typesstc((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys_get_xsd_typecodeRs*    cCsA|djo tiSn|djo tiSn|i|ƒSdS(NsArraysStruct(smsg_types TCcompoundsArraysStructsselfs_get_xsd_typecode(sselfsmsg_type((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys_get_soapenc_typecode_s     cCs_t|ƒ\}}|tijo|i|ƒSn%|t i gjo|i |ƒSnt SdS(N( s SplitQNamesmsg_typesprefixsnamestargetNamespacesSCHEMAsXSD_LISTsselfs_get_xsd_typecodesSOAPsENCs_get_soapenc_typecodesNone(sselfsmsg_typestargetNamespacesnamesprefix((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys get_typeclassgs cCsß| o|i||ƒ}n|}||ijodSnœ||ijodSn„||ijodSnl||i jodSnT|t i gjodSn9|t i gjodSnt|tƒo td‚ntSdS(Nsintsfloatsstrstupleslistsbools+failed to map zsi typecode to a python type(s typeclasssselfs get_typeclasssmsg_typestargetNamespacestcs _tc_to_ints _tc_to_floats _tc_to_strings _tc_to_tuples TCcompoundsArraysTCsBooleans isinstancesTypeCodesEvaluateExceptionsNone(sselfsmsg_typestargetNamespaces typeclassstc((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pysget_pythontypeos$ ( s__name__s __module__s__doc__s__init__s_get_xsd_typecodes_get_soapenc_typecodes get_typeclasssNonesget_pythontype(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pysBaseTypeInterpreters  :  (sZSIsTCsTCtimess TCcompoundsZSI.TCsTypeCodes _copyrightsEvaluateExceptionsZSI.wstools.Utilitys SplitQNamesZSI.wstools.NamespacessSOAPsSCHEMAs ExceptionsNamespaceExceptionsBaseTypeInterpreter( sBaseTypeInterpretersEvaluateExceptionsTypeCodesTCtimessSOAPsTCs SplitQNames TCcompounds _copyrightsNamespaceExceptionsZSIsSCHEMA((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/typeinterpreter.pys?s   PKƒ¨58SÆu´Ó7Ó7 ZSI/fault.pyc;ò Z@Ec @sñdZdklZlZlZlZlZlZlZl Z l Z dk l Z dk lZlZlZlZlZlZdklZlZdklZdk lZdkZdkZdfd „ƒYZe eed d d d ddƒgddd d ƒe_dfd„ƒYZe eeddƒeddƒedei dfd d ƒeied d d d deƒgdei dfde!dd ƒe_dfd„ƒYZ"e e"ed d d d deƒgdedfƒe"_dee fd„ƒYZ#dfd„ƒYZ$e#ƒe$_d ee fd!„ƒYZ%d"fd#„ƒYZ&e%ƒe&_d$ee fd%„ƒYZ'd&fd'„ƒYZ(e'ƒe(_de fd(„ƒYZ)e*d)„Z+e*d*„Z,e*d+„Z-e*e*d,„Z.d-„Z/e0d.jo eGHndS(/sFaults. ( s _copyrights _childrens_child_elementss _get_idstrs _stringtypess _seqtypess_Nodes SoapWriters ZSIException(sStruct(sQNamesURIsStrings XMLStrings AnyElements UNBOUNDED(sSOAPsZSI_SCHEMA_URI(s Canonicalize(sElementDeclarationNsDetailcBstZed„ZRS(NcCs ||_dS(N(sanysself(sselfsany((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__s(s__name__s __module__sNones__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysDetailssanamesanys minOccursis maxOccurss unboundedspnamesdetails FaultTypecBstZeeeed„ZRS(NcCs(||_||_||_||_dS(N(s faultcodesselfs faultstrings faultactorsdetail(sselfs faultcodes faultstrings faultactorsdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__s   (s__name__s __module__sNones__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys FaultTypess faultcodes faultstrings faultactorsFaultsinlines hasextrassZSIHeaderDetailcBstZd„ZRS(NcCs ||_dS(N(sdetailsselfsany(sselfsdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__.s(s__name__s __module__s__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysZSIHeaderDetail-ssZSIFaultDetailTypeCodecBs#tZdZeZdZd„ZRS(s| %s %s s FaultDetailc KsPti|ttdtdfƒtdtdfddƒgdtdf|dS(Nspnamesstringstraces minOccursis FaultDetail(sStructs__init__sselfsZSIFaultDetailsStringsZSI_SCHEMA_URIskw(sselfskw((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__?s9(s__name__s __module__s__doc__sZSI_SCHEMA_URIsschemasliterals__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysZSIFaultDetailTypeCode7s sZSIFaultDetailcBs)tZeed„Zd„Zd„ZRS(NcCs||_||_dS(N(sstringsselfstrace(sselfsstringstrace((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__Fs cCs/|io|id|idSn|iSdS(Ns [trace: s](sselfstracesstring(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__str__Js cCsdtt|ƒfSdS(Ns<%s.ZSIFaultDetail %s>(s__name__s _get_idstrsself(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__repr__Os(s__name__s __module__sNones__init__s__str__s__repr__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysZSIFaultDetailEs sURIFaultDetailTypeCodecBs#tZdZeZdZd„ZRS(sˆ uri localname sURIFaultDetailcKsJti|ttdtdfƒtdtdfƒgdtdf|dS(NspnamesURIs localnamesURIFaultDetail(sStructs__init__sselfsURIFaultDetailsStringsZSI_SCHEMA_URIskw(sselfskw((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__]s '(s__name__s __module__s__doc__sZSI_SCHEMA_URIsschemasliterals__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysURIFaultDetailTypeCodeTs sURIFaultDetailcBstZeed„ZRS(NcCs||_||_dS(N(surisselfsURIs localname(sselfsuris localname((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__ds (s__name__s __module__sNones__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysURIFaultDetailcssActorFaultDetailTypeCodecBs#tZdZeZdZd„ZRS(sZ %s sActorFaultDetailcKs8ti|ttdtdfƒgdtdf|dS(NspnamesURIsActorFaultDetail(sStructs__init__sselfsActorFaultDetailsStringsZSI_SCHEMA_URIskw(sselfskw((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__rs!(s__name__s __module__s__doc__sZSI_SCHEMA_URIsschemasliterals__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysActorFaultDetailTypeCodejs sActorFaultDetailcBstZed„ZRS(NcCs ||_dS(N(surisselfsURI(sselfsuri((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__xs(s__name__s __module__sNones__init__(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysActorFaultDetailwscBsetZdZdZdZdZeeed„Zd„Zd„Z d„Z d„Z d „Z e Z RS( sSOAP Faults. sSOAP-ENV:ClientsSOAP-ENV:ServersSOAP-ENV:MustUnderstandcCs­|tj ot|ƒtjo |f}n|tj ot|ƒtjo |f}n|||||f\|_|_|_|_|_t i ||||||ƒdS(N( sdetailsNonestypes _seqtypess headerdetailscodesstringsactorsselfs ZSIExceptions__init__(sselfscodesstringsactorsdetails headerdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__init__…s     3cCs$|i otSnt|iƒSdS(N(sselfs headerdetailsNonesZSIHeaderDetail(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysDataForSOAPHeaders cCsdt}|itj otƒ}|i|_nt|i|i|i|ƒ}|i |dt ƒdS(sSerialize the object.stypedN( sNonesdetailsselfsDetailsanys FaultTypescodesstringsactorspyobjssws serializesFalse(sselfsswsdetailspyobj((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys serialize”s cKs]|iƒ}t|}|i|ƒ|tj o|i||i dt ƒnt |ƒSdS(Nstyped( sselfsDataForSOAPHeadersheaders SoapWriterskwssws serializesNonesserialize_headerstypecodesFalsesstr(sselfskwsswsheader((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysAsSOAPžs     cCs}t|iƒd}t|dƒoRt|idƒo(x8|iD]}|t|ƒ7}q@Wqu|t|iƒ7}n|SdS(Ns sdetails__len__(sstrsselfsstringsstrngshasattrsdetailsd(sselfsstrngsd((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__str__§s cCsdtt|ƒfSdS(Ns<%s.Fault at %s>(s__name__s _get_idstrsself(sself((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys__repr__±s(s__name__s __module__s__doc__sClientsServersMUsNones__init__sDataForSOAPHeaders serializesAsSOAPs__str__s__repr__sAsSoap(((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFault}s   cCs8tt||ƒf\}}ttid|||ƒSdS(Ns"SOAP mustUnderstand not understood( sNonesURIFaultDetailsuris localnamesdetails headerdetailsFaultsMUsactor(suris localnamesactorsdetails headerdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromNotUnderstood·s cCs5tt|ƒf\}}ttid|||ƒSdS(NsCannot process specified actor(sNonesActorFaultDetailsurisdetails headerdetailsFaultsClientsactor(surisactorsdetails headerdetail((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromActor½s cCs™t|dtƒp t|ƒ}t|ddƒ}d||f}t|ddƒot|f\}}n|tf\}}t t i d|||ƒSdS( s?Return a Fault object created from a ZSI exception object. sstrstracesse %s %s sinheaderisUnparseable messageN( sgetattrsexsNonesstrsmystrsmytraceseltsdetails headerdetailsFaultsClientsactor(sexsactorsmytracesdetails headerdetailsmystrselt((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromZSIExceptionÃs cCst} |ojyVdigi} ti|ƒD])\}} } }| d|| | fƒq-~ ƒ}WnqwX|} nd} y"di|i|iigƒ} WnnXtd| dt|ƒd| ƒ}|ot|f\}}n|tf\}}ttid|||ƒSdS( sbReturn a Fault object created from a Python exception. SOAP-ENV:Server Processing Failure s s%s:%d:%sss:sstringstracesProcessing FailureN(sNones tracetextstbsjoinsappends_[1]s tracebacks extract_tbsnameslinesfuncstextsliness exceptionNamesexs __module__s __class__s__name__sZSIFaultDetailsstrseltsinheadersdetails headerdetailsFaultsServersactor(sexsinheaderstbsactors headerdetailsnamestextslinessdetails_[1]s exceptionNamesfuncs tracetextslineselt((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromExceptionÕs& V "# cCsX|itiƒ}|itjo t}n |ii}t |i |i |i |ƒSdS(s"Parse the message as a fault. N( spssParses FaultTypestypecodespyobjsdetailsNones detailanysanysFaults faultcodes faultstrings faultactor(spsspyobjs detailany((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pysFaultFromFaultMessageús  s__main__(1s__doc__sZSIs _copyrights _childrens_child_elementss _get_idstrs _stringtypess _seqtypess_Nodes SoapWriters ZSIExceptionsZSI.TCcompoundsStructsZSI.TCsQNamesURIsStrings XMLStrings AnyElements UNBOUNDEDsZSI.wstools.NamespacessSOAPsZSI_SCHEMA_URIsZSI.wstools.c14ns CanonicalizesElementDeclarations tracebacks cStringIOsStringIOsDetailstypecodes FaultTypesENVsTruesZSIHeaderDetailsZSIFaultDetailTypeCodesZSIFaultDetailsURIFaultDetailTypeCodesURIFaultDetailsActorFaultDetailTypeCodesActorFaultDetailsFaultsNonesFaultFromNotUnderstoodsFaultFromActorsFaultFromZSIExceptionsFaultFromExceptionsFaultFromFaultMessages__name__(%sZSIFaultDetailsFaultFromExceptionsStructs _childrensDetails_Nodes _copyrightsFaultFromActors FaultTypesFaultFromFaultMessages _get_idstrsStrings SoapWritersActorFaultDetails UNBOUNDEDsActorFaultDetailTypeCodesFaultFromZSIExceptions AnyElementsElementDeclarations _stringtypessFaultsFaultFromNotUnderstoods ZSIExceptionsURIsZSI_SCHEMA_URIsURIFaultDetailTypeCodes XMLStrings _seqtypessStringIOs_child_elementss tracebacksZSIFaultDetailTypeCodesQNamesURIFaultDetails CanonicalizesZSIHeaderDetailsSOAP((s-build/bdist.darwin-8.0.1-x86/egg/ZSI/fault.pys?sH= +  6T    :   % PK€¨588™êO8O8ZSI/ServiceProxy.pyc;ò Z@Ec@s˜dklZdklZdkTdkTdklZdkl Z dk Z dk l Z dk l Z dkZdfd „ƒYZd fd „ƒYZdS( (s SplitQName(sWSDL(s*(sAny(sBaseTypeInterpreterN(sDOM(surlparses ServiceProxycBsŒtZdZeeeeed„Zd„Zd„Zed„Zd„Z d„Z d„Z d„Z eeed „Z d „Zd „ZRS( s¾A ServiceProxy provides a convenient way to call a remote web service that is described with WSDL. The proxy exposes methods that reflect the methods of the remote web service.c Cs‡||_|ph|_||_||_t |t ƒt jot i iƒi|ƒ|_nt |it i iƒp td‚|ii|pd|_|ii|_|ii|pd|_|ii|_h|_|iiƒ}|iƒ} x‡|iiD]y}xp|iƒi!D]_} t i i#|| iƒ} t%|| ƒ}t'|| i|ƒ|ii(| igƒi)|ƒqWqWdS(sv Parameters: wsdl -- WSDLTools.WSDL instance or URL of WSDL. service -- service name or index port -- port name or index tracefile -- nsdict -- key prefix to namespace mappings for serialization in SOAP Envelope. transdict -- arguments to pass into HTTPConnection constructor. sexpecting a WSDL instanceiN(*s tracefilesselfs _tracefilesnsdicts_nsdicts transdicts _transdictswsdls_wsdls isinstances basestringsTrueswstoolss WSDLToolss WSDLReaders loadFromURLsWSDLsAssertionErrorsservicessservices_services documentations__doc__sportssports_portsnames_names_methodss getBindingsbindings getPortTypesportTypes operationssitemscallInfoFromWSDLscallinfos MethodProxysmethodssetattrs setdefaultsappend( sselfswsdlsservicesports tracefilesnsdicts transdictsbindingsmethodsitemscallinfosportType((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys__init__s.    #   cOsùt|ƒo t|ƒotdƒ‚nt||ƒi}xA|i|D]2} t| ii ƒt|ƒjo | i}qJqJW|i }|i }t|ƒ\}} }}} }t} | idƒdjo| idƒ\} } n|djo ti} n(|djo ti} ntd|‚td| d|id | d |i d | d |d |i!d|ƒ}|i#|ƒ\}}t|ƒo |}n|tjot&d|ƒ}n|i'd |dtd|d |i!d|d|ƒ|i(d|ƒSdS(s)Call the named remote web service method.s(Use positional or keyword argument only.s:ishttpshttpssUnknown protocol %sshosts tracefiles transports transdictsportsurlsnsdicts soapactionsonamesopnamesobjsrequesttypecodes replytypeN()slensargsskwargss TypeErrorsgetattrsselfsnamescallinfos_methodssmethodsinparamss soapActionslocationsurlsurlparsesprotocolshostsurisquerysfragments identifiersNonesportsfindssplitshttplibsHTTPConnections transportsHTTPSConnections RuntimeErrorsBindings _tracefiles _transdicts_nsdictsbindings _getTypeCodessrequestsresponsesAnysSendsReceive(sselfsnamesargsskwargssprotocolsrequestsbindingsqueryscallinfosports transportsmethodsfragmentshostsresponsesurls soapActionsuris identifier((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys_call=s>          cCsæt}|iƒ|idjo|i|iƒ}ny+|id|i ƒd|idjƒ}Wn$t j o}dG|GHt}nX|iƒy+|id|i ƒd|idjƒ}Wn$t j o}dG|GHt}nXt}}|idjo`|o%tidtd|d |iƒ}n|o)tidtd|d d |iƒ}qˆn+|o|d }n|o|d }n|o|o |idjo2d hd |<d|i<d|i<|_n||fSdS(sûReturns typecodes representing input and output messages, if request and/or response fails to be generated return None for either or both. callinfo -- WSDLTools.SOAPCallInfo instance describing an operation. sencodeds parameterssliterals$DEBUG: Request Failed to generate --s%DEBUG: Response Failed to generate --srpcspyclasssofwhatspnames %sResponseis7%(prefix)s:%(name)s xmlns:%(prefix)s="%(namespaceURI)s"sprefixsnames namespaceURIN(sNonesprefixsselfs_resetPrefixDictscallinfosuses _getPrefixs namespaces _getTypeCodesgetInParameterss requestTCsEvaluateExceptionsexsgetOutParameterssreplyTCsrequestsresponsesstylesTCsStructs methodNamesanamesoname(sselfscallinfosreplyTCsrequestsprefixsexsresponses requestTC((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getTypeCodesjs: +   +   %-2c Csìg}xÛ|D]Ó}|i\}} |io<|ii |i | } |i | d|dtd|ƒ} nl|i}|i|| ƒ}| o<|ii |i | }|i|||dtd|ƒ} n ||ƒ} |i| ƒq W|SdS(s²Returns typecodes representing a parameter set parameters -- list of WSDLTools.ParameterInfo instances representing the parts of a WSDL Message. sliteralslocals namespaceURIN(sofwhats parametersspartstypes namespaceURIs localNames element_typesselfs_wsdlstypesselementsselements _getElementsliteralsFalsestcsnames _getTypeClasss typeClassstps_getTypesTruesappend( sselfs parameterssliteralsnamestpsofwhats namespaceURIsparts typeClasss localNameselementstc((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getTypeCodes  % % cCsC|o8dhd|i|ƒ<d|i<d|<|_ndS(sßnamespaces typecodes representing global elements with literal encoding. typeCode -- typecode representing an element. namespaceURI -- namespace literal -- True/False s7%(prefix)s:%(name)s xmlns:%(prefix)s="%(namespaceURI)s"sprefixsnames namespaceURIN(sliteralsselfs _getPrefixs namespaceURIstypeCodesoname(sselfstypeCodes namespaceURIsliteral((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys_globalElement©scCsu|iƒ}|i|ƒo||}nDd}x0||iƒjodt|dƒd}q3W|||<|SdS(sTRetrieves a prefix/namespace mapping. namespaceURI -- namespace sns1sns%diÿÿÿÿiN(sselfs_getPrefixDicts prefixDictshas_keys namespaceURIsprefixsvaluessint(sselfs namespaceURIsprefixs prefixDict((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getPrefix´s  cCs)t|dƒ o h|_n|iSdS(s3Used to hide the actual prefix dictionary. s _prefixDictN(shasattrsselfs_ServiceProxy__prefixDict(sself((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys_getPrefixDictÂs cCs|iƒiƒdS(s¹Clears the prefix dictionary, this needs to be done before creating a new typecode for a message (ie. before, and after creating a new message typecode) N(sselfs_getPrefixDictsclear(sself((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys_resetPrefixDictÉscCs+|iƒ o td‚nt} |idƒ}|idƒ}t}|p|i o7|idƒ\} } |i| | ƒ} | |ƒ}n| o |i }n| o|i|||||ƒ}nt|idƒƒ}| |_||_|idƒ} | djpt| ƒdj|_|SdS( sùReturns a typecode instance representing the passed in element. element -- XMLSchema.ElementDeclaration instance literal -- literal encoding? local -- is locally defined? namespaceURI -- namespace sExpecting an ElementDeclarationsnamestypes minOccurss maxOccurss unboundediN(selements isElements TypeErrorsNonestcs getAttributes elementNamesgetTypeDefinitionstpstypeObjscontents nsuriTypes localNamesselfs _getTypeClasss typeClasss_getTypesliteralslocals namespaceURIsints minOccurssoptionals maxOccurss repeatable(sselfselementsliteralslocals namespaceURIs minOccursstypeObjs elementNamestps nsuriTypes typeClasss maxOccurss localNamestc((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getElementÐs*    "c CsBg} |iƒo |iƒ o td‚n|iiƒo]t|idƒo|iiiƒo*|ii} |i | i dƒŒ}|tijoÊ| iditi}t|dƒ\}} | idid|ƒ}| idƒd} |i d|d | ƒ} | o | ƒ} qk|ii|i| }|id |d td |d t!d|ƒ} n td‚|d|d| d|ddƒSq5td‚n›|ii#ƒoŠ|i}x3|iD](} | i&|i'| d |d t!ƒƒq¾Wti(dtd| d|ƒ}| o|i+|d|d |ƒn|Sntd‚dS(sReturns a typecode instance representing the passed in type and name. tp -- XMLSchema.TypeDefinition instance name -- element name literal -- literal encoding? local -- is locally defined? namespaceURI -- namespace s&only supporting complexType definitions derivationsbaseis arrayTypesprefixs[s namespaceURIs localNamestpsnamesliteralslocals'only support soapenc:Array restrictionssatypesofwhatspnames childNamessitems;complexContent only supported for soapenc:Array derivationsspyclasssHonly supporting complexType w/ model group, or soapenc:Array restrictionN(-sofwhatstps isDefinitions isComplexsEvaluateExceptionscontentshasattrs derivations isRestrictionsderivedsselfs _getTypeClasss getAttributes typeClasssTCsArrays attr_contents attributessWSDLsBASEsattrss SplitQNamesprefixs localNamesgetXMLNSsnsurissplitssimpleTypeClasss_wsdlstypess_getTypesNonesliteralsTruesnames isModelGroups modelGroupsitemsappends _getElementsStructstcslocals_globalElements namespaceURI(sselfstpsnamesliteralslocals namespaceURIsprefixsnsurisattrsssimpleTypeClasssitems localNamesderivedsofwhatstcs modelGroups typeClass((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys_getTypeós> &  . #   &cCs#tƒ}|i||ƒ}|SdS(sÇReturns a typecode class representing the type we are looking for. localName -- name of the type we are looking for. namespaceURI -- defining XMLSchema targetNamespace. N(sBaseTypeInterpretersbtis get_typeclasss localNames namespaceURIssimpleTypeClass(sselfs namespaceURIs localNamessimpleTypeClasssbti((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys _getTypeClasss (s__name__s __module__s__doc__sNones__init__s_calls _getTypeCodessFalses _getTypeCodes_globalElements _getPrefixs_getPrefixDicts_resetPrefixDicts _getElements_getTypes _getTypeClass(((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys ServiceProxys # - &    # +s MethodProxycBs tZdZd„Zd„ZRS(s cCs7|i|_|i|_||_ti|ƒ|_dS(N( scallinfos methodNamesselfs__name__s documentations__doc__sweakrefsrefsparent(sselfsparentscallinfo((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys__init__*s   cOs |iƒi|i||ŽSdS(N(sselfsparents_calls__name__sargsskwargs(sselfsargsskwargs((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys__call__0s(s__name__s __module__s__doc__s__init__s__call__(((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys MethodProxy(s  (sZSI.wstools.Utilitys SplitQNamesZSI.wstools.NamespacessWSDLsZSIs ZSI.clientsZSI.TCsAnysZSI.typeinterpretersBaseTypeInterpreterswstoolsswstools.UtilitysDOMsurlparsesweakrefs ServiceProxys MethodProxy( sweakrefs ServiceProxysBaseTypeInterpretersDOMswstoolssurlparses SplitQNames MethodProxysWSDLsAny((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceProxy.pys? s        ÿPK¨58fÌÂTnTnTZSI/__init__.pyc;ò Z@Ec@s½dZdZdklZdkZdklZei ei gZ ei gZ eieigZeieigZd„Zd„Zd„ZdklZlZlZd „Zd „Zyd klZegZ Wne!d gZ nXd „Z"d„Z#d„Z$d„Z%d„Z&d„Z'd„Z(d„Z)d„Z*d„Z+d„Z,d„Z-d„Z.d„Z/d„Z0he0_1de0_2de3fd„ƒYZ4de4fd „ƒYZ5d!e4fd"„ƒYZ6d#e4fd$„ƒYZ7d%e4fd&„ƒYZ8dk9Z9d'„Z:d(k;l<Z<d)k=l>Z>d*k?l@Z@lAZAlBZBlCZClDZDlEZEdkFZFeFiGeFiHd+d,d-eIƒeFiGeFiJd+d,d-eIƒeFiGeFiKd+d,d-eIƒeFiGeFiLd+d,d-eIƒxeFiMeFiNeFiOeFiPeFiQeFiReFiSeFiTeFiUeFiVeFiWeFiXeFiYeFiZeFi[fD]Z\eFiGe\d+d,d-eIƒqWeFiGeFi]d+d,d-eIƒeFiGeFi^d+d,d-eIƒeFiGeFi_d+d,d-eIƒeFiGeFi`d+d,d-eIƒeFiGeFiad+d,d-eIƒeFiGeFibd+d,d-eIƒeFiGeFicd+d,d-eIƒeFiGeFidd+d,d-eIƒeFiGeFied+d,d-eIƒeFiGeFifigd+d,d-eIƒdkhZhx0eiejekelemengD]ZoehipiqeoƒqWehirƒesd.jo eGHndS(/s^ZSI: Zolera Soap Infrastructure. Copyright 2001, Zolera Systems, Inc. All Rights Reserved. sãZSI: Zolera Soap Infrastructure. Copyright 2001, Zolera Systems, Inc. All Rights Reserved. Copyright 2002-2003, Rich Salz. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. Portions are also: Copyright (c) 2003, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. (2) 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. (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory, U.S. Dept. of Energy 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. You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to Lawrence Berkeley National Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such Enhancements or derivative works thereof, in binary and source code form. For wstools also: Zope Public License (ZPL) Version 2.0 ----------------------------------------------- This software is Copyright (c) Zope Corporation (tm) and Contributors. All rights reserved. This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF). Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions in source code must retain the above copyright notice, this list of conditions, and the following disclaimer. 2. 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. 3. The name Zope Corporation (tm) must not be used to endorse or promote products derived from this software without prior written permission from Zope Corporation. 4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of Zope Corporation. Use of them is covered in a separate agreement (see http://www.zope.com/Marks). 5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. Disclaimer THIS SOFTWARE IS PROVIDED BY ZOPE CORPORATION ``AS IS'' AND ANY EXPRESSED 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 ZOPE CORPORATION OR ITS 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. This software consists of contributions made by Zope Corporation and many individuals on behalf of Zope Corporation. Specific attributions are listed in the accompanying credits file. (sNodeN(sZSI_SCHEMA_URIcCs|io |iiƒpgS(N(sEs attributessvalues(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys¤scCs|ipgS(N(sEs childNodes(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys¥scCsFgi}|ipgD]'}|itijo||ƒqq~S(N(sappends_[1]sEs childNodessnsnodeTypes_Nodes ELEMENT_NODE(sEs_[1]sn((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys¦s(sSOAPsSCHEMAsXMLNScCs|itidƒS(Ns arrayType(sEsgetAttributeNSs_SOAPsENC(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys¯scCs|itidƒS(Ns encodingStyle(sEsgetAttributeNSs_SOAPsENV(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys°s(sEMPTY_NAMESPACEscCsHx=tD]5}y%|i||ƒ}|o|SnWqqXqWtSdS(N(s_empty_nsuri_listsnsurisEsgetAttributeNSsattrsvsNone(sEsattrsnsurisv((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys _find_attr¸s cCs7y%|i||ƒ}|o|SnWnnXtSdS(s"namespaceURI localName N(sEsgetAttributeNSs namespaceURIs localNamesvsNone(sEs namespaceURIs localNamesv((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys _find_attrNSÀs cCsP|i||ƒ}|tjotSny |iSWnnX|i||ƒSdS(s¡Must grab the attribute Node to distinquish between an unspecified attribute(None) and one set to empty string(""). namespaceURI localName N(sEsgetAttributeNodeNSs namespaceURIs localNamesattrsNonesvaluesgetAttributeNS(sEs namespaceURIs localNamesattr((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys_find_attrNodeNSËs  cCs t|dƒS(Nshref(s _find_attrsE(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysÛscCs?|iti|ƒp)|iti|ƒp|iti|ƒS(N(sEsgetAttributeNSs_SCHEMAsXSI3sattrsXSI1sXSI2(sEsattr((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysÜscCs t|dƒS(Nstype(s_find_xsi_attrsE(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysàscCs|iti|ƒS(N(sEsgetAttributeNSs_XMLNSsBASEsattr(sEsattr((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysâscCs|ititƒS(N(sEsgetAttributeNSs_XMLNSsBASEsNone(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysãscCs|i|ifS(N(sEs namespaceURIs localName(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysçscCs|itijS(N(sEsnodeTypes_Nodes ELEMENT_NODE(sE((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pyséscCsvt}xet|ƒo?|ot||ƒ}n t|ƒ}|oPn|i}q W|ot d|‚n|SdS(sÃresolve prefix to a namespaceURI. If None or empty str, return default namespace or None. Parameters: celt -- element node prefix -- xmlns:prefix, or empty str or None scant resolve xmlns:%sN( sNones namespaces _is_elementsceltsprefixs_find_xmlns_prefixs namespaceURIs_find_default_namespaces parentNodesEvaluateException(sceltsprefixs namespaces namespaceURI((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys_resolve_prefixës  cCsft|ƒ}| p |tijodSnx/|iƒD]!}|itiƒodSq9q9WdSdS(s*Does this node have a valid encoding? iiN(s_find_encstyleseltsencs_SOAPsENCssplitses startswith(seltsencse((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys_valid_encodings   c Csàd}xÏ||joÁ|i|if\}}|tjoPngi}t |ƒD]$}|i|jo||ƒqTqT~}t |ƒdjod||}n(|i|ƒd}d||f|}|}q W|SdS(sVReturn a "backtrace" from the given element to the DOM root, in XPath syntax. sis/s/%s[%d]N(ssseltsdomsnodeNames parentNodesnamesparentsNonesappends_[1]s_child_elementsscsmatchesslensindexsi( seltsdomsnamesparentsmatchesscs_[1]siss((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys _backtraces  A cCs7t|ƒ}|djodt|ƒSnd|SdS(s¢Python 2.3.x generates a FutureWarning for negative IDs, so we use a different prefix character to ensure uniqueness, and call abs() to avoid the warning.isx%xso%xN(sidspyobjsxsabs(spyobjsx((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys _get_idstr s   cCs©ti}|i|dƒ}| o~|idƒ\}}|iddƒ}t |ƒdjod|d}nt |ƒti jo|i ƒn|||(s__name__s _get_idstrsself(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__repr__Ts(s__name__s __module__s__doc__sNones__init__s__str__s__repr__(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysParseExceptionEs  sEvaluateExceptioncBs,tZdZed„Zd„Zd„ZRS(s=Exception raised during data evaluation (serialization). cCs)ti|ƒ||f\|_|_dS(N(s Exceptions__init__sselfsstrstrace(sselfsstrstrace((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__init__\s cCs/|io|id|idSn|iSdS(Ns [Element trace: s](sselfstracesstr(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__str__`s cCsdtt|ƒfSdS(Ns<%s.EvaluateException %s>(s__name__s _get_idstrsself(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__repr__es(s__name__s __module__s__doc__sNones__init__s__str__s__repr__(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysEvaluateExceptionXs   sFaultExceptioncBs)tZdZd„Zd„Zd„ZRS(s/Exception raised when a fault is received. cCs ||_dS(N(sfaultsself(sselfsfault((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__init__lscCst|iƒSdS(N(sstrsselfsfault(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__str__oscCsdtt|ƒfSdS(Ns<%s.FaultException %s>(s__name__s _get_idstrsself(sself((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys__repr__rs(s__name__s __module__s__doc__s__init__s__str__s__repr__(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysFaultExceptionhs   sWSActionExceptioncBstZdZRS(ssException raised when WS-Address Action Header is incorrectly specified when received by client or server. (s__name__s __module__s__doc__(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysWSActionExceptionus cCs tiSdS(N(sversionsVersion(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pysVersion~s(s SoapWriter(s ParsedSoap(sFaultsFaultFromActorsFaultFromExceptionsFaultFromFaultMessagesFaultFromNotUnderstoodsFaultFromZSIExceptions minOccursisnillables__main__(ts__doc__s _copyrightsxml.domsNodes_Nodestypess_typessZSI.wstools.NamespacessZSI_SCHEMA_URIsIntTypesLongTypes _inttypess FloatTypes _floattypess TupleTypesListTypes _seqtypess StringTypes UnicodeTypes _stringtypess_attrss _childrens_child_elementssSOAPs_SOAPsSCHEMAs_SCHEMAsXMLNSs_XMLNSs_find_arraytypes_find_encstylesEMPTY_NAMESPACEs_empty_nsuri_listsNones _find_attrs _find_attrNSs_find_attrNodeNSs _find_hrefs_find_xsi_attrs _find_types_find_xmlns_prefixs_find_default_namespaces_get_element_nsuri_names _is_elements_resolve_prefixs_valid_encodings _backtraces _get_idstrs_get_postvalue_from_absoluteURIscachesMAXLENs Exceptions ZSIExceptionsParseExceptionsEvaluateExceptionsFaultExceptionsWSActionExceptionsversionsVersionswriters SoapWritersparses ParsedSoapsfaultsFaultsFaultFromActorsFaultFromExceptionsFaultFromFaultMessagesFaultFromNotUnderstoodsFaultFromZSIExceptionsTCs RegisterTypesStringsFalsesURIs Base64StringsHexBinaryStrings IunsignedBytesIunsignedShorts IunsignedInts IunsignedLongsIbytesIshortsIintsIlongsInegativeIntegersInonPositiveIntegersInonNegativeIntegersIpositiveIntegersIintegersFPfloatsFPdoublespyclasssBooleansDurations gDateTimesgDates gYearMonthsgYears gMonthDaysgDaysgTimesApachesMapsschemasintsfloatsstrstupleslistsunicodesis_GetPyobjWrappersRegisterBuiltinsRegisterAnyElements__name__(4s_get_postvalue_from_absoluteURIsEvaluateExceptions_find_xsi_attrs _childrens_empty_nsuri_listsFaultExceptions_NodesVersionsEMPTY_NAMESPACEs _backtraces _copyrightsFaultFromActors _floattypess_find_default_namespacesFaultFromFaultMessages _get_idstrs SoapWriters _find_typespyclasssversions _find_hrefs_find_attrNodeNSsFaultFromZSIExceptions_SOAPsTCs_attrss _stringtypessFaultsFaultFromNotUnderstoods_SCHEMAs_valid_encodings ZSIExceptionsParseExceptions_resolve_prefixs_find_encstylesZSI_SCHEMA_URIs _find_attrs _find_attrNSs_typess _is_elements_XMLNSs _seqtypessis_child_elementss_find_arraytypes _inttypessFaultFromExceptions ParsedSoapsschemas_get_element_nsuri_namesWSActionExceptions_find_xmlns_prefix((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/__init__.pys?sŽ‹                               + a   PK„¨58Ÿ9ÑÚ*Ú*ZSI/TCnumbers.pyc;ò Z@Ec@sêdZdkZdklZlZlZlZlZdkl Z l Z l Z dk l Z de fd„ƒYZde fd„ƒYZd e fd „ƒYZd e fd „ƒYZd e fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd „ƒYZd!e fd"„ƒYZd#e fd$„ƒYZd%efd&„ƒYZed'jo eGHndS((sTypecodes for numbers. N(s _copyrights _inttypess _floattypess _seqtypessEvaluateException(sTypeCodesIntegersDecimal(sSCHEMAs IunsignedBytecBs2tZdZeidfZedfgZgZRS(sUnsigned 8bit value. s unsignedByte( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys IunsignedByte s sIunsignedShortcBs2tZdZeidfZedfgZgZRS(sUnsigned 16bit value. s unsignedShort( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIunsignedShorts s IunsignedIntcBs2tZdZeidfZedfgZgZRS(sUnsigned 32bit value. s unsignedInt( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys IunsignedInts s IunsignedLongcBs2tZdZeidfZedfgZgZRS(sUnsigned 64bit value. s unsignedLong( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys IunsignedLong s sIbytecBs2tZdZeidfZedfgZgZRS(sSigned 8bit value. sbyte( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIbyte's sIshortcBs2tZdZeidfZedfgZgZRS(sSigned 16bit value. sshort( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIshort.s sIintcBs8tZdZeidfZedfgZei gZ RS(sSigned 32bit value. sint( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parseliststypessIntTypes seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIint5s sIlongcBs8tZdZeidfZedfgZei gZ RS(sSigned 64bit value. slong( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parseliststypessLongTypes seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIlong<s sInegativeIntegercBs2tZdZeidfZedfgZgZRS(sValue less than zero. snegativeInteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysInegativeIntegerCs sInonPositiveIntegercBs2tZdZeidfZedfgZgZRS(s&Value less than or equal to zero. snonPositiveInteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysInonPositiveIntegerJs sInonNegativeIntegercBs2tZdZeidfZedfgZgZRS(s)Value greater than or equal to zero. snonNegativeInteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysInonNegativeIntegerQs sIpositiveIntegercBs2tZdZeidfZedfgZgZRS(sValue greater than zero. spositiveInteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIpositiveIntegerXs sIintegercBs2tZdZeidfZedfgZgZRS(sInteger value. sinteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIinteger_s s IEnumerationcBs2tZdZed„Zd„Zeed„ZRS(s9Integer value, limited to a specified set of values. cKsÃti|||||_t|ƒ}|tjot |ƒ|_n%t i ot dt |ƒƒ‚nt i oIxF|iD]7}t|ƒtjot dt |ƒdƒ‚q€q€WndS(Ns2Enumeration choices must be list or sequence, not sEnumeration choice "s" is not an integer(sIntegers__init__sselfspnameskwschoicesstypests _seqtypesstuplesTypeCodes typecheckss TypeErrorsstrscs _inttypes(sselfschoicesspnameskwscst((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys__init__js      cCsWti|||ƒ}||ijo*tdt|ƒd|i |ƒƒ‚n|SdS(NsValue "s" not in enumeration list( sIntegersparsesselfseltspssvalschoicessEvaluateExceptionsstrs Backtrace(sselfseltspssval((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysparseys c KsU||ijotdti|ƒƒ‚nti||||d|d||dS(Ns!Value not in int enumeration listsnamesorig( spyobjsselfschoicessEvaluateExceptionspss BacktraceseltsIntegers serializesswsnamesorigskw(sselfseltsswspyobjsnamesorigskw((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys serializes(s__name__s __module__s__doc__sNones__init__sparses serialize(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys IEnumerationfs   sFPfloatcBs8tZdZeidfZedfgZei gZ RS(s%IEEE 32bit floating point value. sfloat( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parseliststypess FloatTypes seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysFPfloatˆs sFPdoublecBs2tZdZeidfZedfgZgZRS(s%IEEE 64bit floating point value. sdouble( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysFPdoubles s FPEnumerationcBs2tZdZed„Zd„Zeed„ZRS(s@Floating point value, limited to a specified set of values. cKsÃti|||||_t|ƒ}|tjot |ƒ|_n%t i ot dt |ƒƒ‚nt i oIxF|iD]7}t|ƒtjot dt |ƒdƒ‚q€q€WndS(Ns2Enumeration choices must be list or sequence, not sEnumeration choice "s" is not floating point number(sFPfloats__init__sselfspnameskwschoicesstypests _seqtypesstuplesTypeCodes typecheckss TypeErrorsstrscs _floattypes(sselfschoicesspnameskwscst((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys__init__šs      cCsWti|||ƒ}||ijo*tdt|ƒd|i |ƒƒ‚n|SdS(NsValue "s" not in enumeration list( sDecimalsparsesselfseltspssvalschoicessEvaluateExceptionsstrs Backtrace(sselfseltspssval((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysparse©s c KsU||ijotdti|ƒƒ‚nti||||d|d||dS(Ns!Value not in int enumeration listsnamesorig( spyobjsselfschoicessEvaluateExceptionspss BacktraceseltsDecimals serializesswsnamesorigskw(sselfseltsswspyobjsnamesorigskw((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys serialize±s(s__name__s __module__s__doc__sNones__init__sparses serialize(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys FPEnumeration–s   s__main__( s__doc__stypessZSIs _copyrights _inttypess _floattypess _seqtypessEvaluateExceptionsZSI.TCsTypeCodesIntegersDecimalsZSI.wstools.NamespacessSCHEMAs IunsignedBytesIunsignedShorts IunsignedInts IunsignedLongsIbytesIshortsIintsIlongsInegativeIntegersInonPositiveIntegersInonNegativeIntegersIpositiveIntegersIintegers IEnumerationsFPfloatsFPdoubles FPEnumerations__name__(s IunsignedIntsIunsignedShortsEvaluateExceptionsTypeCodesInonNegativeIntegersIintegers _copyrights _floattypess IunsignedLongsIpositiveIntegersIntegersDecimalsSCHEMAsInegativeIntegersFPdoubles IunsignedBytesIintstypessIbytes _seqtypess _inttypess FPEnumerationsIlongsFPfloats IEnumerationsInonPositiveIntegersIshort((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys?s. % "" PK¨58Ÿ9ÑÚ*Ú*ZSI/TCnumbers.pyo;ò Z@Ec@sêdZdkZdklZlZlZlZlZdkl Z l Z l Z dk l Z de fd„ƒYZde fd„ƒYZd e fd „ƒYZd e fd „ƒYZd e fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZde fd „ƒYZd!e fd"„ƒYZd#e fd$„ƒYZd%efd&„ƒYZed'jo eGHndS((sTypecodes for numbers. N(s _copyrights _inttypess _floattypess _seqtypessEvaluateException(sTypeCodesIntegersDecimal(sSCHEMAs IunsignedBytecBs2tZdZeidfZedfgZgZRS(sUnsigned 8bit value. s unsignedByte( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys IunsignedByte s sIunsignedShortcBs2tZdZeidfZedfgZgZRS(sUnsigned 16bit value. s unsignedShort( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIunsignedShorts s IunsignedIntcBs2tZdZeidfZedfgZgZRS(sUnsigned 32bit value. s unsignedInt( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys IunsignedInts s IunsignedLongcBs2tZdZeidfZedfgZgZRS(sUnsigned 64bit value. s unsignedLong( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys IunsignedLong s sIbytecBs2tZdZeidfZedfgZgZRS(sSigned 8bit value. sbyte( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIbyte's sIshortcBs2tZdZeidfZedfgZgZRS(sSigned 16bit value. sshort( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIshort.s sIintcBs8tZdZeidfZedfgZei gZ RS(sSigned 32bit value. sint( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parseliststypessIntTypes seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIint5s sIlongcBs8tZdZeidfZedfgZei gZ RS(sSigned 64bit value. slong( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parseliststypessLongTypes seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIlong<s sInegativeIntegercBs2tZdZeidfZedfgZgZRS(sValue less than zero. snegativeInteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysInegativeIntegerCs sInonPositiveIntegercBs2tZdZeidfZedfgZgZRS(s&Value less than or equal to zero. snonPositiveInteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysInonPositiveIntegerJs sInonNegativeIntegercBs2tZdZeidfZedfgZgZRS(s)Value greater than or equal to zero. snonNegativeInteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysInonNegativeIntegerQs sIpositiveIntegercBs2tZdZeidfZedfgZgZRS(sValue greater than zero. spositiveInteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIpositiveIntegerXs sIintegercBs2tZdZeidfZedfgZgZRS(sInteger value. sinteger( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysIinteger_s s IEnumerationcBs2tZdZed„Zd„Zeed„ZRS(s9Integer value, limited to a specified set of values. cKsÃti|||||_t|ƒ}|tjot |ƒ|_n%t i ot dt |ƒƒ‚nt i oIxF|iD]7}t|ƒtjot dt |ƒdƒ‚q€q€WndS(Ns2Enumeration choices must be list or sequence, not sEnumeration choice "s" is not an integer(sIntegers__init__sselfspnameskwschoicesstypests _seqtypesstuplesTypeCodes typecheckss TypeErrorsstrscs _inttypes(sselfschoicesspnameskwscst((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys__init__js      cCsWti|||ƒ}||ijo*tdt|ƒd|i |ƒƒ‚n|SdS(NsValue "s" not in enumeration list( sIntegersparsesselfseltspssvalschoicessEvaluateExceptionsstrs Backtrace(sselfseltspssval((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysparseys c KsU||ijotdti|ƒƒ‚nti||||d|d||dS(Ns!Value not in int enumeration listsnamesorig( spyobjsselfschoicessEvaluateExceptionspss BacktraceseltsIntegers serializesswsnamesorigskw(sselfseltsswspyobjsnamesorigskw((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys serializes(s__name__s __module__s__doc__sNones__init__sparses serialize(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys IEnumerationfs   sFPfloatcBs8tZdZeidfZedfgZei gZ RS(s%IEEE 32bit floating point value. sfloat( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parseliststypess FloatTypes seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysFPfloatˆs sFPdoublecBs2tZdZeidfZedfgZgZRS(s%IEEE 64bit floating point value. sdouble( s__name__s __module__s__doc__sSCHEMAsXSD3stypesNones parselists seriallist(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysFPdoubles s FPEnumerationcBs2tZdZed„Zd„Zeed„ZRS(s@Floating point value, limited to a specified set of values. cKsÃti|||||_t|ƒ}|tjot |ƒ|_n%t i ot dt |ƒƒ‚nt i oIxF|iD]7}t|ƒtjot dt |ƒdƒ‚q€q€WndS(Ns2Enumeration choices must be list or sequence, not sEnumeration choice "s" is not floating point number(sFPfloats__init__sselfspnameskwschoicesstypests _seqtypesstuplesTypeCodes typecheckss TypeErrorsstrscs _floattypes(sselfschoicesspnameskwscst((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys__init__šs      cCsWti|||ƒ}||ijo*tdt|ƒd|i |ƒƒ‚n|SdS(NsValue "s" not in enumeration list( sDecimalsparsesselfseltspssvalschoicessEvaluateExceptionsstrs Backtrace(sselfseltspssval((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pysparse©s c KsU||ijotdti|ƒƒ‚nti||||d|d||dS(Ns!Value not in int enumeration listsnamesorig( spyobjsselfschoicessEvaluateExceptionspss BacktraceseltsDecimals serializesswsnamesorigskw(sselfseltsswspyobjsnamesorigskw((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys serialize±s(s__name__s __module__s__doc__sNones__init__sparses serialize(((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys FPEnumeration–s   s__main__( s__doc__stypessZSIs _copyrights _inttypess _floattypess _seqtypessEvaluateExceptionsZSI.TCsTypeCodesIntegersDecimalsZSI.wstools.NamespacessSCHEMAs IunsignedBytesIunsignedShorts IunsignedInts IunsignedLongsIbytesIshortsIintsIlongsInegativeIntegersInonPositiveIntegersInonNegativeIntegersIpositiveIntegersIintegers IEnumerationsFPfloatsFPdoubles FPEnumerations__name__(s IunsignedIntsIunsignedShortsEvaluateExceptionsTypeCodesInonNegativeIntegersIintegers _copyrights _floattypess IunsignedLongsIpositiveIntegersIntegersDecimalsSCHEMAsInegativeIntegersFPdoubles IunsignedBytesIintstypessIbytes _seqtypess _inttypess FPEnumerationsIlongsFPfloats IEnumerationsInonPositiveIntegersIshort((s1build/bdist.darwin-8.0.1-x86/egg/ZSI/TCnumbers.pys?s. % "" PKƒ¨58+4è5¥g¥gZSI/ServiceContainer.pyc;ò Z@Ec@sdZdkZdkZdkZdkZdkZdkZdkZdk l Z l Z dk l Z lZlZlZdk lZlZlZlZdk lZdklZdklZdklZd klZlZlZl Z d kl!Z"d e#fd „ƒYZ$d e#fd„ƒYZ%de#fd„ƒYZ&de#fd„ƒYZ'de#fd„ƒYZ(de(fd„ƒYZ)de#fd„ƒYZ*de#fd„ƒYZ+dfd„ƒYZ,e-ƒa.d„Z/hd„Z0dfd „Z1d!fd"„ƒYZ2d#e2fd$„ƒYZ3d%e3fd&„ƒYZ4d'e"fd(„ƒYZ!d)e fd*„ƒYZ5d%e3fd+„ƒYZ4e6d,jo eGHndS(-sCSimple Service Container -- use with wsdl2py generated modules. N(sBaseHTTPRequestHandlers HTTPServer(sParseExceptionsFaultFromExceptionsFaultFromZSIExceptionsFault(s _copyrights _seqtypess_get_element_nsuri_names resolvers(s _get_idstr(sAddress(s ParsedSoap(s SoapWriter(s_ModPythonSendXMLs_ModPythonSendFaults _CGISendXMLs _CGISendFault(sSOAPRequestHandlers NoSuchServicecBstZRS(N(s__name__s __module__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys NoSuchService!ssUnknownRequestExceptioncBstZRS(N(s__name__s __module__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysUnknownRequestException"ssPostNotSpecifiedcBstZRS(N(s__name__s __module__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysPostNotSpecified#ssSOAPActionNotSpecifiedcBstZRS(N(s__name__s __module__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysSOAPActionNotSpecified$ssWSActionExceptioncBstZRS(N(s__name__s __module__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysWSActionException%ssWSActionNotSpecifiedcBstZRS(N(s__name__s __module__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysWSActionNotSpecified&ss NotAuthorizedcBstZRS(N(s__name__s __module__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys NotAuthorized'ssServiceAlreadyPresentcBstZRS(N(s__name__s __module__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysServiceAlreadyPresent(ss SOAPContextcBstZd„ZRS(NcCs:||_||_||_||_||_||_dS(N(s containersselfsxmldataspss parsedsoaps connections httpheaderss soapaction(sselfs containersxmldataspss connections httpheaderss soapaction((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__init__,s      (s__name__s __module__s__init__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys SOAPContext+scCsttiƒSdS(N(s _contextssthreads get_ident(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysGetSOAPContext7scKsÆd|i|i|f}|} |i|ƒ} t }t | t ƒoËt }| i|ƒtƒ} y| i|ƒWn8tj o,}|t|dtiƒdƒ|SnX|o|| iƒjo9td|| iƒfƒ}|t|dtƒ|Sn| iƒ}nt | tƒt jo=td||fƒ}|t|dtiƒdƒ|Sn| it||ƒ o |tti dƒddƒSny| i!|| ƒ} Wn8tj o,}|t|dtiƒdƒ|SnXy0|t jo| || ƒ} n | |ƒ} Wn8tj o,}|t|dtiƒdƒ|SnX| i$|ƒ| tjod Snt%d |ƒ}y|i(| ƒWn8tj o,}|t|dtiƒdƒ|SnX|t jo~| i)|ƒ}td |ƒ}y!|i+| |ƒ|i(|ƒWq]tj o,}|t|dtiƒdƒ|Sq]Xn| i,|ƒyt-|ƒ} || |SWn8tj o,}|t|dtiƒdƒ|SnXd S( sBSend ParsedSoap instance to ServiceContainer, which dispatches to appropriate service via post, and method via action. Response is a self-describing pyobj, which is passed to a SoapWriter. Call SendResponse or SendFault to send the reply back, appropriately. server -- ServiceContainer instance shttp://%s:%d%siis:SOAP Action("%s") must match WS-Action("%s") if specified.s'no service at POST(%s) in container: %ssNot authorizedscodei‘Nsnsdictsaction(0sservers server_names server_portspostslocalURLsactionsaddresssgetNodesservicesFalses isWSResources isinstancesSimpleWSResourcesTrues setServiceURLsAddresssparsespss Exceptionses SendFaultsFaultFromExceptionssyssexc_infoskws getActionsWSActionExceptionsNonesServiceInterfaces NoSuchServices authorizesFaultsServers getOperationsmethodsresultsverifys SoapWritersnsdictssws serializesgetResponseActions addressRspssetResponseFromWSAddressssignsstrssoapdatas SendResponse(spssservers SendResponses SendFaultspostsactionsnsdictskws addressRspsresultssoapdatasservicesmethodsaddresssessws isWSResourceslocalURL((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys _Dispatch;sl  (' ( (  ( ,  iPcCs)d|f}t||ƒ}|iƒdS(s9port -- services -- list of service instances sN(sportsaddresssServiceContainersservicessscs serve_forever(sportsservicessscsaddress((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysAsServers sServiceInterfacecBshtZdZhZhZhZd„Zd„Zd„Zd„Z d„Z d„Z d„Z d„Z RS( s¼Defines the interface for use with ServiceContainer Handlers. class variables: soapAction -- dictionary of soapAction keys, and operation name values. These are specified in the WSDL soap bindings. There must be a class method matching the operation name value. If WS-Action is used the keys are WS-Action request values, according to the spec if soapAction and WS-Action is specified they must be equal. wsAction -- dictionary of operation name keys and WS-Action response values. These values are specified by the portType. root -- dictionary of root element keys, and operation name values. cCs ||_dS(N(spostsself(sselfspost((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__init__¯scCsdSdS(Ni((sselfs auth_infospostsaction((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys authorize²scCs$d|iit|ƒ|ifSdS(Ns%s(%s) POST(%s)(sselfs __class__s__name__s _get_idstrspost(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__str__µscCsdSdS(N((sselfssw((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pyssign¸scCsdSdS(N((sselfsps((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysverify»scCs |iSdS(N(sselfspost(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysgetPost¾scCs#|i||ƒ}t||ƒSdS(sIReturns a method of class. action -- soapAction value N(sselfsgetOperationNamespssactionsopNamesgetattr(sselfspssactionsopName((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys getOperationÁscCsc|iit|iƒƒp|ii|ƒ}|t jo t d|t|iƒf‚n|SdS(sFReturns operation name. action -- soapAction value s5failed to map request to a method: action(%s), root%sN( sselfsrootsgets_get_element_nsuri_namespss body_roots soapActionsactionsmethodsNonesUnknownRequestException(sselfspssactionsmethod((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysgetOperationNameÈs .  (s__name__s __module__s__doc__s soapActionswsActionsroots__init__s authorizes__str__ssignsverifysgetPosts getOperationsgetOperationName(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysServiceInterface›s        sServiceSOAPBindingcBs tZdZd„Zd„ZRS(sžBinding defines the set of wsdl:binding operations, it takes as input a ParsedSoap instance and parses it into a pyobj. It returns a response pyobj. cCsti||ƒdS(N(sServiceInterfaces__init__sselfspost(sselfspost((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__init__ØscCs|i||ƒ|ƒSdS(N(sselfs getOperationspssaction(sselfsactionsps((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys __call___Ûs(s__name__s __module__s__doc__s__init__s __call___(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysServiceSOAPBindingÔs  sSimpleWSResourcecBsVtZdZdZed„Zd„Zd„Zd„Zd„Z d„Z d„Z RS( sSimple WSRF service, performs method resolutions based on WS-Action values rather than SOAP Action. class variables: encoding wsAction -- Must override to set output Action values. soapAction -- Must override to set input Action values. sUTF-8cCsNt|itƒp td‚t|itƒp td‚ti||ƒdS(s$ post -- POST value ssoapAction must be a dictswsAction must be a dictN( s isinstancesselfs soapActionsdictsAssertionErrorswsActionsServiceSOAPBindings__init__spost(sselfspost((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__init__êscCs|i||ƒ||ƒSdS(N(sselfs getOperationspssactionsaddress(sselfsactionspssaddress((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys __call___òscCs |iSdS(N(sselfs_url(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys getServiceURLõscCs ||_dS(N(surlsselfs_url(sselfsurl((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys setServiceURLøscCs/|iƒ}|i||ƒ}t||ƒSdS(sBReturns a method of class. address -- ws-address N(saddresss getActionsactionsselfsgetOperationNamespssopNamesgetattr(sselfspssaddresssactionsopName((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys getOperationûs cCsK|i||ƒ}|ii|ƒtjotd|‚n|i|SdS(s^Returns response WS-Action if available action -- request WS-Action value. s#wsAction dictionary missing key(%s)N( sselfsgetOperationNamespssactionsopNameswsActionshas_keysFalsesWSActionNotSpecified(sselfspssactionsopName((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysgetResponseActions c Cs|iidƒ}|i}| o td‚n|o|idƒ}n|idƒ}y’|id}|i dƒo@t i ||i ƒ}|iƒ}t|d|idtƒ}n2t|idƒ} t|i i| ƒdtƒ}Wn_tj o}|it|ƒƒnïtj o,}|it|d tiƒd ƒƒn¸Xti ƒ}t"|i#|||i$|i|ƒt%|s\]*>i”s)WSDL not available for that service [%s].sService not found [%s].N(sselfspathslowersendswiths service_pathsserversgetNodesserviceshasattrs_wsdlswsdlsprotos server_names server_ports serviceUrls soapAddresssrescompiles IGNORECASEswsdlressubssend_xmls send_error(sselfsservicesprotos soapAddresss serviceUrlswsdlswsdlres service_path((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysdo_GETgs   " (s__name__s __module__s__doc__sdo_POSTsdo_GET(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysSOAPRequestHandler9s  +sServiceContainercBsctZdZdfd„ƒYZged„Zd„Zed„Zed„Z d„Z d„Z RS( s­HTTPServer that stores service instances according to POST values. An action value is instance specific, and specifies an operation (function) of an instance. sNodeTreecBsDtZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s8Simple dictionary implementation of a node tree cCs h|_dS(N(sselfs_NodeTree__dict(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__init__ŠscCst|iƒSdS(N(sstrsselfs_NodeTree__dict(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__str__scCs|iiƒGHdS(N(sselfs_NodeTree__dictskeys(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys listNodesscCsdti|ƒd}|idƒo|d}n|ii|ƒo|i|Sntd|‚dS(Nis/is"No service(%s) in ServiceContainer( surlparsesurlsplitsurlspaths startswithsselfs_NodeTree__dictshas_keys NoSuchService(sselfsurlspath((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysgetNode“s cCs„ti|ƒd}|idƒo|d}nt|tƒ o td‚n|i i |ƒot d|‚n||i |server_address -- RequestHandlerClass -- cs ˆi|ƒS(N(sselfssetNodess(ss(sself(s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys»sN( s HTTPServers__init__sselfsserver_addresssRequestHandlerClasssNodeTrees_nodessmapsservices(sselfsserver_addresssservicessRequestHandlerClass((sselfs8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__init__µscCs'd|it|ƒt|iƒfSdS(Ns%s(%s) nodes( %s )(sselfs __class__s _get_idstrsstrs_nodes(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__str__½scCsG|i|||ƒ}t|itƒo|||ƒSn||ƒSdS(sÏps -- ParsedSoap representing the request post -- HTTP POST --> instance action -- Soap Action header --> method address -- Address instance representing WS-Address N( sselfs getCallBackspsspostsactionsmethods isinstancesim_selfsSimpleWSResourcesaddress(sselfspsspostsactionsaddresssmethod((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys__call__Às cCs4|tjo|iƒ}n|ii||ƒdS(N(surlsNonesservicesgetPostsselfs_nodesssetNode(sselfsservicesurl((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pyssetNodeÌs cCs|ii|ƒSdS(N(sselfs_nodessgetNodesurl(sselfsurl((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysgetNodeÑscCs|ii|ƒdS(N(sselfs_nodess removeNodesurl(sselfsurl((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys removeNodeÔs( s__name__s __module__s__doc__sNodeTreesSOAPRequestHandlers__init__s__str__sNones__call__ssetNodesgetNodes removeNode(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysServiceContainer‚s .   cBs#tZd„Zd„Zd„ZRS(NcCs|ii|ƒSdS(s post -- POST HTTP value N(sselfs_nodessgetNodespost(sselfspost((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysgetNodeÚscCs|ii||ƒdS(sGservice -- service instance post -- POST HTTP value N(sselfs_nodesssetNodesservicespost(sselfsservicespost((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pyssetNodeßscCsa|i|ƒ}|tjo t‚n|it||ƒo|i||ƒSnt d|‚dS(sGpost -- POST HTTP value action -- SOAP Action value s"Authorization failed for method %sN( sselfsgetNodespostsnodesNonesNoSuchFunctions authorizesactions getOperationspss NotAuthorized(sselfspsspostsactionsnode((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys getCallBackås  (s__name__s __module__sgetNodessetNodes getCallBack(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pysSimpleWSResourceØs  s__main__(7s__doc__surlparsestypessosssyss cStringIOsStringIOsthreadsresBaseHTTPServersBaseHTTPRequestHandlers HTTPServersZSIsParseExceptionsFaultFromExceptionsFaultFromZSIExceptionsFaults _copyrights _seqtypess_get_element_nsuri_names resolverss _get_idstrs ZSI.addresssAddresss ZSI.parses ParsedSoaps ZSI.writers SoapWriters ZSI.dispatchs_ModPythonSendXMLs_ModPythonSendFaults _CGISendXMLs _CGISendFaultsSOAPRequestHandlersBaseSOAPRequestHandlers Exceptions NoSuchServicesUnknownRequestExceptionsPostNotSpecifiedsSOAPActionNotSpecifiedsWSActionExceptionsWSActionNotSpecifieds NotAuthorizedsServiceAlreadyPresents SOAPContextsdicts _contextssGetSOAPContexts _DispatchsAsServersServiceInterfacesServiceSOAPBindingsSimpleWSResourcesServiceContainers__name__(+sSOAPRequestHandlers_get_element_nsuri_names_ModPythonSendFaults _CGISendFaultsSimpleWSResources ParsedSoaps _copyrightsServiceAlreadyPresents _get_idstrs SoapWritersAsServers NotAuthorizeds _CGISendXMLsresAddresssFaultFromZSIExceptionsBaseSOAPRequestHandlersGetSOAPContexts_ModPythonSendXMLsServiceSOAPBindings HTTPServers NoSuchServicesFaultsFaultFromExceptionssyssWSActionNotSpecifiedsParseExceptions _Dispatchstypess resolverssPostNotSpecifiedsthreads _seqtypessStringIOsWSActionExceptionsurlparsesServiceInterfacesUnknownRequestExceptionsBaseHTTPRequestHandlersServiceContainersoss SOAPContextsSOAPActionNotSpecified((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/ServiceContainer.pys?s@?        T 9 ZIV PK‚¨58ˆ_Ì û û ZSI/auth.pyc;ò Z@Ec@s¥dZdkTdklZdkZdkZeiZeie ei dƒei dƒgddƒZ dfd „ƒYZ d fd „ƒYZ ed jo eGHndS( sSimple CGI dispatching. (s*(s _copyrightNsNamesPasswordsextrasisAUTHcBs&tZdZdZdZdZdZRS(s-Constants for authentication mechanisms. iiii(s__name__s __module__s__doc__snones httpbasicszsibasics httpdigest(((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pysAUTHs s ClientBindingcBs2tZdZd„Zd„Zd„Zd„ZRS(s:Information about the client that is connected to us. cCsA|tf\|_|_tiiƒ|_tdƒ|idReturn a tuple containing client authentication data. s BasicAuthsNamesPasswordsHTTP_AUTHENTICATIONs iisbasicis:N(sselfsauthspssGetMyHeaderElementsselts localNames namespaceURIsZSI_SCHEMA_URIs_auth_tcsparsesdsAUTHszsibasicsenvironsgetsbassplitslenslowers _b64_decodes httpbasicstuplesnone(sselfsdsbaselt((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pysGetAuth#s$  *"cCs|iiipdSdS(s;Return namespace for the top main request element. sN(sselfspss body_roots namespaceURI(sself((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pysGetNS7scCs |iSdS(s'Return the ParsedSoap request. N(sselfsps(sself((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pys GetRequest<s(s__name__s __module__s__doc__s__init__sGetAuthsGetNSs GetRequest(((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pys ClientBindings    s__main__(s__doc__sZSIs _copyrightsbase64soss decodestrings _b64_decodesTCsStructsNonesStrings_auth_tcsAUTHs ClientBindings__name__(sbase64s ClientBindingsAUTHs _b64_decodes _copyrightsoss_auth_tc((s,build/bdist.darwin-8.0.1-x86/egg/ZSI/auth.pys?s    ( PKЍ58!øG­x.x. ZSI/TC.pyo;ò Z@Ec@s8dZdklZlZlZlZlZlZlZl Z l Z l Z l Z l Z lZlZlZlZlZlZlZlZlZlZlZdklZlZdklZdklZdk l!Z"dk#Z#dk$Z$dk%Z%dk&Z&dk'l(Z)l*Z+dk,l-Z.l/Z0d k1l2Z3l4Z5d „Z6d „Z7d „Z8e9Z:d Z;dfd„ƒYZ<de<fd„ƒYZ=de<fd„ƒYZ>de=fd„ƒYZ?de?fd„ƒYZ@de?fd„ƒYZAde?fd„ƒYZBde?fd„ƒYZCde?fd„ƒYZDd e?fd!„ƒYZEd"e?fd#„ƒYZFd$e?fd%„ƒYZGgZHd&e=fd'„ƒYZId(„ZJhZKy$eLd)ƒeKd)fd;„ƒYZUd<e>fd=„ƒYZVd>d?„ZWd@kXTd@kYTdAkZl[Z[l\Z\l]Z]d@k^Td@k_Te[e\e]f\Z`ZaZbdB„ZcedeceedC„efƒƒƒZgehdDjo eGHndS(EsGeneral typecodes. (s _copyrights _childrens_child_elementss _floattypess _stringtypess _seqtypess _find_attrs _find_attrNSs_find_attrNodeNSs_find_arraytypes_find_default_namespaces _find_hrefs_find_encstyles_resolve_prefixs_find_xsi_attrs _find_types_find_xmlns_prefixs_get_element_nsuri_names _get_idstrs_NodesEvaluateExceptions_valid_encodingsParseException(sSCHEMAsSOAP(s SplitQName(s Canonicalize(s getLoggerN(s decodestrings encodestring(sunquotesquote(s unhexlifyshexlifycCs"|titititigjS(N(snssSCHEMAsXSD3sSOAPsENCsXSD1sXSD2(sns((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysscCst|dƒp t|dƒS(Nsnullsnil(s_find_xsi_attrsE(sE((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysscCsst|dƒot|iƒtjo |iSn5t|dƒo t|dƒo|i|ifSnttfSdS(s=returns the xsi:type as a tuple, coupled with ZSI.schema stypesschemaN(shasattrspyclassstypes _seqtypessschemasNone(spyclass((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys _get_xsitypes &  s unboundedsTypeCodec BstZdZeZeefZeZeZe dƒZ eedde eeedd„ Z d„Z eed„Zd„Zd„Zd „Zd „Zd „Zd „Zd „Zd„Ze d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s¦The parent class for all parseable SOAP types. Class data: typechecks -- do init-time type checking if non-zero Class data subclasses may define: tag -- global element declaration type -- global type definition parselist -- list of valid SOAP types for this class, as (uri,name) tuples, where a uri of None means "all the XML Schema namespaces" errorlist -- parselist in a human-readable form; will be generated if/when needed seriallist -- list of Python types or user-defined classes that this typecode can serialize. logger -- logger instance for this class. sZSI.TC.TypeCodeis_attrsc Ksñt|ƒtjo|\|_|_nt|f\|_|_|io#t|iƒidƒd|_n|p|i|_||_ ||_ ||_ ||_ ||_ | |_||_| idƒ} | tj o| d|_ndS(smBaseclass initialization. Instance data (and usually keyword arg) pname -- the parameter name (localname). nspname -- the namespace for the parameter; None to ignore the namespace typed -- output xsi:type attribute unique -- data item is not aliased (no href/id needed) minOccurs -- min occurances maxOccurs -- max occurances nillable -- is item nillable? attrs_aname -- This is variable name to dictionary of attributes encoded -- encoded namespaceURI (specify if use is encoded) s:iÿÿÿÿsencodedN(stypespnames _seqtypessselfsnspnamesNonesstrssplitsanames minOccurss maxOccurssnillablestypedsuniques attrs_anamespyclassskwsgetsencoded( sselfspnamesanames minOccurss maxOccurssnillablestypedsuniquespyclasss attrs_anameskwsencoded((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__Ds" #        cCstd|i|ƒƒ‚dS(sv Parameters: elt -- the DOM element being parsed ps -- the ParsedSoap object. sUnimplemented evaluationN(sEvaluateExceptionspss Backtraceselt(sselfseltsps((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparsejscKstd|i|ƒƒ‚dS(s¢ Parameters: elt -- the current DOMWrapper element sw -- soapWriter object pyobj -- python object to serialize sUnimplemented evaluationN(sEvaluateExceptionssws Backtraceselt(sselfseltsswspyobjsnamesorigskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serializerscCstd|i|ƒƒ‚dS(sÀconvert text into typecode specific data. Parameters: text -- text content elt -- the DOM element being parsed ps -- the ParsedSoap object. sUnimplemented evaluationN(sEvaluateExceptionspss Backtraceselt(sselfstextseltsps((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data|scCs|itiddƒdS(sP Parameters: elt -- the current DOMWrapper element snils1N(seltssetAttributeNSsSCHEMAsXSI3(sselfselt((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysserialize_as_nil…scCs‚tt|ƒƒo|Snt|ƒ}| o<|idjotSntd|d|i |ƒƒ‚n|i ||dƒSdS(sÂSimple HREF for non-string and non-struct and non-array. Parameters: elt -- the DOM element being parsed ps -- the ParsedSoap object. tag -- isRequireds missingN( slens _childrenselts _find_hrefshrefsselfs minOccurssNonesEvaluateExceptionstagspss Backtraces FindLocalHREF(sselfseltspsstagshref((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys SimpleHREFŒs cCs¡|ii}|idƒ}|idƒ}|o| oZg}x4|D],}|d|jo|i|dƒqFqFWdi |ƒ}||d typecode specific data. N(sStrings text_to_datasselfstextseltspssvals urldecode(sselfstextseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data×scCs ti||ƒ}t|ƒSdS(stypecode data --> text N(sStringsget_formatted_contentsselfspyobjs urlencode(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentÝs( s__name__s __module__s__doc__sNonesSCHEMAsXSD3s parseliststypes _GetLoggersloggers text_to_datasget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysURIÐs   sQNamecBsktZdZedfgZeidfZedƒZ edd„Z d„Z d„Z d„Z d„ZRS( sA QName type sQNames ZSI.TC.QNameicKs#ti||||t|_dS(N(sStrings__init__sselfspnamesstripskwsNonesprefix(sselfspnamesstripskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__ìscCsa|}t|tƒo7|\}}|itj od|i|f}qMnt i ||ƒSdS(Ns%s:%s( spyobjsvalues isinstancestuples namespaceURIs localNamesselfsprefixsNonesStringsget_formatted_content(sselfspyobjsvalues namespaceURIs localName((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentðs  cCs6t|tƒo"|\}}|i|ƒ|_ndS(s·use this method to set the prefix of the QName, method looks in DOM to find prefix or set new prefix. This method must be called before get_formatted_content. N( s isinstancespyobjstuples namespaceURIs localNameselts getPrefixsselfsprefix(sselfseltspyobjs namespaceURIs localName((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys set_prefixøs c Cs˜t|ƒ\}}|i|ƒ} y| |}Wn1t j o%}t d||i |ƒƒ‚nX||f}|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. scannot resolve prefix(%s)N(s SplitQNamestextsprefixs localNamespssGetElementNSdictseltsnsdicts namespaceURIsKeyErrorsexsEvaluateExceptions BacktracesvsselfspyclasssNone( sselfstextseltspss namespaceURIsprefixsexsvs localNamesnsdict((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_datas  cCs*|i||ƒti||||ƒSdS(s+Serialize without an element node. N(sselfs set_prefixseltspyobjsStringsserialize_text_nodessw(sselfseltsswspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysserialize_text_nodes(s__name__s __module__s__doc__sNones parselistsSCHEMAsXSD3stypes _GetLoggersloggers__init__sget_formatted_contents set_prefixs text_to_datasserialize_text_node(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysQNameås    sTokencBs8tZdZedfgZeidfZedƒZ RS(san xsd:token type stokens ZSI.TC.Token( s__name__s __module__s__doc__sNones parselistsSCHEMAsXSD3stypes _GetLoggerslogger(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysTokens s Base64StringcBsVtZdZedfeidfgZeidfZedƒZ d„Z d„Z RS(sA Base64 encoded string. s base64Binarysbase64sZSI.TC.Base64StringcCsYt|iddƒiddƒiddƒƒ}|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. s ss s N(s b64decodestextsreplacesvalsselfspyclasssNone(sselfstextseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data's 0cCs$dt|ƒ}ti||ƒSdS(Ns (s b64encodespyobjsStringsget_formatted_contentsself(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_content/s( s__name__s __module__s__doc__sNonesSOAPsENCs parseliststypes _GetLoggersloggers text_to_datasget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys Base64String s   s Base64BinarycBsDtZedfgZeidfZedƒZd„Z d„Z RS(Ns base64BinarysZSI.TC.Base64BinarycCs5t|ƒ}|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. N(s b64decodestextsvalsselfspyclasssNone(sselfstextseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data9s  cCst|ƒiƒ}|SdS(N(s b64encodespyobjsstrip(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentAs( s__name__s __module__sNones parselistsSCHEMAsXSD3stypes _GetLoggersloggers text_to_datasget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys Base64Binary4s   sHexBinaryStringcBsJtZdZedfgZeidfZedƒZ d„Z d„Z RS(sHex-encoded binary (yuk). s hexBinarysZSI.TC.HexBinaryStringcCs5t|ƒ}|itj o|i|ƒSn|SdS(s2convert text into typecode specific data. N(s hexdecodestextsvalsselfspyclasssNone(sselfstextseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_dataMs  cCs&t|ƒiƒ}ti||ƒSdS(N(s hexencodespyobjsuppersStringsget_formatted_contentsself(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentUs( s__name__s __module__s__doc__sNones parselistsSCHEMAsXSD3stypes _GetLoggersloggers text_to_datasget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysHexBinaryStringFs   s XMLStringcBs;tZdZedƒZeed„Zd„Zd„ZRS(s-A string that represents an XML document sZSI.TC.XMLStringcKs ti|||||_dS(N(sStrings__init__sselfspnameskws readerclass(sselfspnames readerclassskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init___scCsT|i odkl}|i|_nti|||ƒ}|iƒi |ƒSdS(N(sPyExpat( sselfs readerclasssxml.dom.ext.readersPyExpatsReadersStringsparseseltspssvs fromString(sselfseltspssvsPyExpat((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparsecs   cCs t|ƒ}ti||ƒSdS(N(s CanonicalizespyobjsStringsget_formatted_contentsself(sselfspyobj((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentjs ( s__name__s __module__s__doc__s _GetLoggersloggersNones__init__sparsesget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys XMLStringZs   s EnumerationcBs>tZdZedƒZed„Zd„Zeed„ZRS(s0A string type, limited to a set of choices. sZSI.TC.EnumerationcKsºti|||t|ƒ}|tjot |ƒ|_n%t i ot dt |ƒƒ‚nt i oIxF|iD]7}t|ƒtjot dt |ƒdƒ‚qwqwWndS(Ns2Enumeration choices must be list or sequence, not sEnumeration choice s is not a string(sStrings__init__sselfspnameskwstypeschoicessts _seqtypesstuplesTypeCodes typecheckss TypeErrorsstrscs _stringtypes(sselfschoicesspnameskwscst((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__ts     cCsIti|||ƒ}||ijotd|i|ƒƒ‚n|SdS(NsValue not in enumeration list( sStringsparsesselfseltspssvalschoicessEvaluateExceptions Backtrace(sselfseltspssval((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparse‚s c KsU||ijotdti|ƒƒ‚nti||||d|d||dS(NsValue not in enumeration listsnamesorig( spyobjsselfschoicessEvaluateExceptionspss BacktraceseltsStrings serializesswsnamesorigskw(sselfseltsswspyobjsnamesorigskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serialize‰s( s__name__s __module__s__doc__s _GetLoggersloggersNones__init__sparses serialize(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys Enumerationos    sIntegercBsRtZdZhdddf<dddf<dddf<ddd f<d d d f<d ddf<dddf<dddf<dedf<dedf<ddef<ddef<deef true iff x is a NaN.f1.0if2.0N(sx(sx((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysisnanssDecimalcBsªtZdZedfedfedfgZeZeZhddddf<dddd f unsupported use of namespaces "%s"stypecodespnamesuniquesasliststypedsname(s _get_xsitypespyobjsnsuristypeNamesselfsalls namespacessEvaluateExceptionsgetattrsNoneswhatsAnysnspnamespnamesTruesFalseskws serializeseltssw(sselfseltsswspyobjskwswhatstypeNamesnsuri((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serialize s#   c Csvt|ƒ\}} ||ijp | |ijo2td|i|i|| f|i|ƒƒ‚ntt |ƒƒ\}}t ||ƒ} t| |ƒ}| oŸt| ƒo t}qAt| ƒiƒttiidƒiƒjo,t|ƒiƒttiidƒiƒjo ti}qAtƒi||ƒ}|Sn|d|i|ifƒ}|i||ƒ}|SdS(Ns+ instance is (%s,%s) found (%s,%s)iispname(s_get_element_nsuri_nameseltsnspnamespnamesselfsEvaluateExceptionspss Backtraces SplitQNames _find_typesprefixstypeNames_resolve_prefixs namespaceURIsGTDspyclasss_is_xsd_or_soap_nss _AnyStrictsstrslowersApachesMapstypesAnysparse_into_dict_or_listspyobjswhatsparse( sselfseltspsspyclassstypeNamesprefixswhatspyobjsnspnamespnames namespaceURI((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparse5s"   ^ (s__name__s __module__s__doc__sallsothersSCHEMAsXSD3stypes _GetLoggersloggersNones__init__sget_formatted_contents text_to_datas serializesparse(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysAnyTypeýs    s AnyElementcBsYtZdZeidfZedƒZdgeddddd„Z d„Z d„Z RS( s|XML Schema xsi:any element declaration wildCard. class variables: tag -- global element declaration sanysZSI.TC.AnyElements#allisstrictc Ksa|dddfjotdƒ‚n||_ti|d|d|d|d|d ||dS( Nslaxsskipsstricts0processContents(%s) must be lax, skip, or stricts namespacesspnames minOccurss maxOccurssstrip( sprocessContentss ValueErrorsselfsAnyTypes__init__s namespacesspnames minOccurss maxOccurssstripskw(sselfs namespacesspnames minOccurss maxOccurssstripsprocessContentsskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__Xs  cKs2t|tƒo td‚nt|dtƒ}|tj ot|ƒti joR|i }t i i|ƒ}| o+ti|i if}t i i|ƒ}q¤n|tjoN|idjotd|i|ifƒ}qÿtd|i|ifƒ}n|iid|i iƒ|i||||dS(sáMust provice typecode to AnyElement for serialization, else try to use TC.Any to serialize instance which will serialize based on the data type of pyobj w/o reference to XML schema instance. spyobj is a typecode instance.stypecodesstrictspnamesserialize with %sN(s isinstancespyobjsTypeCodes TypeErrorsgetattrsNoneswhatstypestypess InstanceTypes __class__stcsAnys serialmapsgets ClassTypes__name__sselfsprocessContentss _AnyStrictsnspnamespnames_AnyLaxsloggersdebugs serializeseltsswskw(sselfseltsswspyobjskwswhatstc((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serializecs  #  c Cs>|idj}t|ƒ\} } t| | ƒ}| o |t j oN|i ||ƒ} y || _ Wn$tj o}t| |ƒ} nX| Sntt|ƒƒ\}}| o|o˜t||pdƒ} t| |ƒpt}|d| | fƒ}|i ||ƒ} y || _ Wn$tj o}t| |ƒ} nXt|_| Sn|otd| | fdtƒ}n?|idjotd| | fƒ}ntd| | fƒ}y|i ||ƒ} Wngt j o[}|i!i"d|i|iƒt#d| | fdtƒ}t|i ||ƒ|ƒ} nX| SdS( s processContents -- 'lax' | 'skip' | 'strict', 'strict' 1) if 'skip' check namespaces, and return the DOM node. 2) if 'lax' look for declaration, or definition. If not found return DOM node. 3) if 'strict' get declaration, or raise. sskipsxmlnsspnameswrappedslaxs"Give up, parse (%s,%s) as a StringstypedN($sselfsprocessContentssskips_get_element_nsuri_nameseltsnspnamespnamesGEDswhatsNonesparsespsspyobjstypecodesAttributeErrorsexs WrapImmutables SplitQNames _find_typesprefixstypeNames_resolve_prefixs namespaceURIsGTDsAnyspyclasssTruestypedsXMLsFalses_AnyLaxs _AnyStrictsEvaluateExceptionsloggerserrorsString( sselfseltspsspyclasssskipstypeNamesprefixsexswhatspyobjsnspnamespnames namespaceURI((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparsesH     ( s__name__s __module__s__doc__sSCHEMAsXSD3stags _GetLoggersloggersNones__init__s serializesparse(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys AnyElementPs   sUnioncBsMtZdZeZedƒZeddd„Zd„Zd„Z d„Z RS(s‡simpleType Union class variables: memberTypes -- list [(namespace,name),] tuples, each representing a type defintion. s ZSI.TC.Unionic Ks/ti|d|d|d||g|_dS(Nspnames minOccurss maxOccurs(s SimpleTypes__init__sselfspnames minOccurss maxOccursskwsmemberTypeCodes(sselfspnames minOccurss maxOccursskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__Ás"cCs+t|iƒdjodSn|iitjo td‚nxæ|iiD]Ø\}}t ||ƒ}|tjo:t i i ||fƒ}|id|i|ifƒ}n|d|i|ifƒ}|tjotd||f‚nt|tƒotd||f‚n|ii|ƒqKWdS(Nis<uninitialized class variable memberTypes [(namespace,name),]spnames6Typecode class for Union memberType (%s,%s) is missings0Illegal: Union memberType (%s,%s) is complexType(slensselfsmemberTypeCodess __class__s memberTypessNonesEvaluateExceptionsnsurisnamesGTDstcclasssAnysparsemapsgetstcsnspnamespnamestypecodes isinstancesStructsappend(sselfsnamestypecodesnsuristcclassstc((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pyssetMemberTypeCodesÅs    " c Ks×|iƒ|i||ƒ\}}xªtt|i ƒƒD]}|i |}y|i ||ƒ}Wn/tj o } q8ntj o } q8nX|djo'|i i|ƒ|i id|ƒnPq8W‚|SdS(sÌattempt to parse sequentially. No way to know ahead of time what this instance represents. Must be simple type so it can not have attributes nor children, so this isn't too bad. iN(sselfssetMemberTypeCodess checknameseltspssnsuristypeNamesrangeslensmemberTypeCodessindxstypecodesparsespyobjsParseExceptionsexs Exceptionsremovesinsert( sselfseltspsskwstypecodesindxstypeNamespyobjsnsurisex((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparseÚs$   cKs«|iƒx–tt|iƒƒD]|}|i|}y|iti|ƒƒ}PWnt j o }nX|djo'|ii |ƒ|iid|ƒq q W‚|SdS(Ni(sselfssetMemberTypeCodessrangeslensmemberTypeCodessindxstypecodesget_formatted_contentscopyspyobjscontentsParseExceptionsexsremovesinsert(sselfspyobjskwstypecodesindxscontentsex((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysget_formatted_contentús   ( s__name__s __module__s__doc__sNones memberTypess _GetLoggersloggers__init__ssetMemberTypeCodessparsesget_formatted_content(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysUnion¸s    sListcBsPtZdZeZedƒZeed„Zd„Zd„Z eed„Z RS(s™simpleType List Class data: itemType -- sequence (namespaceURI,name) or a TypeCode instance representing the type definition s ZSI.TC.ListcKsUti|d|||p|i|_|i|_t}t|iƒt jo|i\}}yt |iŒtƒ}Wnžt |ƒtjo‚nxVtD]N}|i|ijo|tƒ}Pq |id|jo|tƒ}q q W|tjotd|iƒ‚qnXt|dƒtjotd|ƒ‚n||_ndS(shCurrently need to require maxOccurs=1, so list is interpreted as a single unit of data. spnameisFiled to locate %ss text_to_datas-TypeCode class %s missing text_to_data methodN(s SimpleTypes__init__sselfspnameskwsitemTypes itemTypeCodesNonestypes _seqtypess namespaceURIsnamesGTDs_is_xsd_or_soap_nssFalsesTYPESspyclasssEvaluateExceptionshasattr(sselfspnamesitemTypeskwspyclasss itemTypeCodes namespaceURIsname((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__s2   cCshg}x6|idƒD]%}|i|ii|||ƒƒqW|i t j o|i |ƒSn|SdS(s^convert text into typecode specific data. items in list are space separated. s N( svstextssplitsitemsappendsselfs itemTypeCodes text_to_dataseltspsspyclasssNone(sselfstextseltspssitemsv((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys text_to_data:s#cCsB|i||ƒtt|ƒƒdjo´t|ƒ}| oU|i||ƒt jodSn|i t jot Snt d|i|ƒƒ‚n|ddjo|i||ƒSn|i||ƒ}|i||ƒn|i||ƒot Sntt|ƒƒdjodSn|i||ƒ}|i|||ƒSdS(sQelt -- the DOM element being parsed ps -- the ParsedSoap object. issRequired string missings#N(sselfs checknameseltspsslens _childrens _find_hrefshrefsnilledsFalsesnillablesTruesNilledsEvaluateExceptions Backtraces ResolveHREFs FindLocalHREFs checktypes simple_valuesvs text_to_data(sselfseltspsshrefsv((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparseFs* cKsßt|ƒtjo td‚nt|ƒ} |i|| ƒ\}} |i || ƒ}|itjo |tjo|i|ƒtSn|i} tƒ} x1|D])} | i| i| ƒƒ| idƒq¡W|itƒdS(selt -- the current DOMWrapper element sw -- soapWriter object pyobj -- python object to serialize sexpecting a lists N(stypespyobjs _seqtypessEvaluateExceptions _get_idstrsobjidsselfsget_namesnamesnssnseltscreateAppendElementselsnillablesTruesNonesserialize_as_nils itemTypeCodestcsStringIOsssitemswritesget_formatted_contentscreateAppendTextNodestextNode(sselfseltsswspyobjsnamesorigskwselsnsstcsobjidsnsitemss((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serializeas      ( s__name__s __module__s__doc__sNonesitemTypes _GetLoggersloggers__init__s text_to_datasparses serialize(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysLists  # s _AnyStrictcBs5tZdZedƒZeed„Zed„ZRS(sj Handles an unspecified types when using a concrete schemas and processContents = "strict". sZSI.TC._AnyStrictcKs,ti|d||||_t|_dS(Nspname(sTypeCodes__init__sselfspnameskwsaslistsTruesunique(sselfspnamesaslistskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__€s c Ks_t|ƒtjo|i o,ti|d|d|d|d||nt ddƒ‚dS(NseltsswspyobjsnamesGSerializing dictionaries not implemented when processContents="strict".s+Try as a list or use processContents="lax".( stypespyobjsdictsselfsaslistsAnys serializeseltsswsnameskwsEvaluateException(sselfseltsswspyobjsnameskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys serialize…s,( s__name__s __module__s__doc__s _GetLoggersloggersNonesFalses__init__s serialize(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys _AnyStrictys  s_AnyLaxcBs;tZdZedƒZeed„Zd„Zd„Z RS(sd Handles unspecified types when using a concrete schemas and processContents = "lax". sZSI.TC._AnyLaxcKs,ti|d||||_t|_dS(Nspname(sTypeCodes__init__sselfspnameskwsaslistsTruesunique(sselfspnamesaslistskw((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys__init__•s cCskt|ƒ}t|ƒ}g} |djoxt|ƒ} | ohSn|i | |ƒ}|i ||ƒt|ƒ}t|ƒ}|djo|i gƒSq£n|i ||ƒotSng} d} t}xnt|ƒD]`} | i}|| jo1|tjo| i| |fƒntƒ}n|i| ƒ|} qÝW|tjo| i| |fƒnt| ƒdjotSn<t| ƒdjot| ddƒdjo t|_nxœ| D]”\}}g}x'|D]}|i|i||ƒƒqÛWt|ƒdjo| i||fƒqÂt|ƒdjo| i||dfƒqÂqÂW|i | ƒSdS(Nisi(s_child_elementsseltscslenscountsvs _find_hrefshrefspss FindLocalHREFsselfs checktypeslistifysnilledsNilledsgroupedElementss previousNamesNonescurrentElementListsces localNamesnamesappendslistsFalsesaslistseltListslstsparse(sselfseltspsscountscsnamescurrentElementListslstseltListsceshrefs previousNamesgroupedElementssv((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pysparse_into_dict_or_listšsX               .  cCsì|iƒ\}}t|ƒ\}}|ti joa|o#t |f|jo||f|jo&t d||f|i |ƒƒ‚n||fSn|io ||ijo)t d||if|i |ƒƒ‚n|i||ƒSdS(sµSee if the name and type of the "elt" element is what we're looking for. Return the element's type. Since this is _AnyLax, it's ok if names don't resolve. s=Element mismatch (got %s wanted %s) (SOAP encoding namespace)s&Element NS mismatch (got %s wanted %s)N(sselfsget_parse_and_errorlists parselists errorlists_get_element_nsuri_nameseltsnssnamesSOAPsENCsNonesEvaluateExceptionspss Backtracesnspnames checktype(sselfseltspssnames errorlists parselistsns((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys checknameÎs-( s__name__s __module__s__doc__s _GetLoggersloggersNonesFalses__init__sparse_into_dict_or_lists checkname(((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys_AnyLaxs   4ic Os•t|||ƒ}xŠ|iidgƒD]s}ti i|ƒ}|oG|i |joq(n| o$t t|ƒdt|ƒƒ‚qŽn|ti | scCs t|ƒS(N(sevalsy(sy((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys ss__main__(is__doc__sZSIs _copyrights _childrens_child_elementss _floattypess _stringtypess _seqtypess _find_attrs _find_attrNSs_find_attrNodeNSs_find_arraytypes_find_default_namespaces _find_hrefs_find_encstyles_resolve_prefixs_find_xsi_attrs _find_types_find_xmlns_prefixs_get_element_nsuri_names _get_idstrs_NodesEvaluateExceptions_valid_encodingsParseExceptionsZSI.wstools.NamespacessSCHEMAsSOAPsZSI.wstools.Utilitys SplitQNamesZSI.wstools.c14ns CanonicalizesZSI.wstools.loggings getLoggers _GetLoggersrestypesstimescopysbase64s decodestrings b64decodes encodestrings b64encodesurllibsunquotes urldecodesquotes urlencodesbinasciis unhexlifys hexdecodeshexlifys hexencodes_is_xsd_or_soap_nss _find_nils _get_xsitypesNonesNilleds UNBOUNDEDsTypeCodes SimpleTypesAnysStringsURIsQNamesTokens Base64Strings Base64BinarysHexBinaryStrings XMLStrings Enumerations_ignoredsIntegers _make_infs _magicnumssfloatsisnansDecimalsBooleansXMLsAnyTypes AnyElementsUnionsLists _AnyStricts_AnyLaxs RegisterTypes TCnumberssTCtimessschemasGTDsGEDs WrapImmutables TCcompoundsTCapaches_get_type_definitions_get_global_element_declarationsWrapsfsfiltersmapsdirsTYPESs__name__(Ns urlencodesEvaluateExceptions _childrensUnions _get_xsitypes Base64Strings_get_type_definitions Enumerations _GetLoggers_Nodes b64encodes hexdecodes_get_global_element_declarations _copyrightsAnyTypes_is_xsd_or_soap_nss _floattypess_find_xsi_attrs _get_idstrs b64decodes SimpleTypesStringsNilleds urldecodes UNBOUNDEDsTypeCodes_AnyLaxs _find_typesresBooleans _find_hrefs_find_attrNodeNSsGEDsIntegers_find_default_namespaces AnyElementsTYPESsSCHEMAsXMLsGTDsfs _AnyStricts _stringtypess RegisterTypesDecimals_ignoredsListsURIs_valid_encodings Base64BinarysHexBinaryStringsTokens _find_nilsParseExceptions_resolve_prefixs_find_encstyles _find_attrscopystypess XMLStringsWraps WrapImmutables _find_attrNSs _seqtypessisnans _make_infs_child_elementss_find_arraytypes hexencodesQNamesAnys SplitQNames _magicnumsstimes Canonicalizes_get_element_nsuri_namesSOAPs_find_xmlns_prefix((s*build/bdist.darwin-8.0.1-x86/egg/ZSI/TC.pys?st‘   $   ÿ_mº3#L   W8MShVkW   PK‚¨58$DnG3 3 ZSI/TCapache.pyc;ò Z@Ec@s„dZdklZlZlZdklZlZl Z dfd„ƒYZ defd„ƒYZ e e _ edjo eGHndS( sApache typecodes. (s _copyrights_child_elementss _get_idstr(sTypeCodesStructsAnysApachecBstZdZRS(Nshttp://xml.apache.org/xml-soap(s__name__s __module__sNS(((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/TCapache.pysApache ss_MapcBsDtZdZeidfgZedd„Zd„Zed„Z RS(sApache's "Map" type. sMapicKsJti|||||_tttdƒtdƒgddƒ|_ dS(Nskeysvaluesinlinei( sTypeCodes__init__sselfspnameskwsaslists_StructsNones_Anystc(sselfspnamesaslistskw((s0build/bdist.darwin-8.0.1-x86/egg/ZSI/TCapache.pys__init__s cCsÒ|i||ƒ|i||ƒotSn|ii}|i oKg}x€t |ƒD]0}|||ƒ}|i|d|dfƒqTWn?h}x5t |ƒD]'}|||ƒ}|d||dscCs|itidƒS(Nsposition(sEsgetAttributeNSsSOAPsENC(sE((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysss \[[0-9]+\]cCsžx—|D]}t|ƒoqnt|tƒ o!t|dt|iƒƒ‚n|i t jot|t ƒ o"t|dt|ƒdƒ‚qqWdS(sFCheck a list of typecodes for compliance with Struct requirements.s( ofwhat outside the TypeCode hierarchy, s element s has no nameN( sofwhatsoscallables isinstancesTypeCodes TypeErrorstcnamesstrs __class__spnamesNones AnyElement(sofwhatstcnameso((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys_check_typecode_lists !!cCsnt|d|ƒ}||jp |tjo|Snt|tƒo|Snt|tƒo‰|i|i f|i|i fjo,t d|i|i |i |ƒfƒ‚nt d|i|i |i|i |i |ƒfƒ‚nt|tƒ ot||iƒ o&t d|||i |ƒfƒ‚n|i|_|i |_ |i|_d|_d|_|SdS(sbreturn typecode or substitute type for wildcard or derived type. For serialization only. stypecodesAbad usage, failed to serialize element reference (%s, %s), in: %ss8failed to serialize (%s, %s) illegal sub GED (%s,%s): %ss=failed to serialize substitute %s for %s, not derivation: %siN(sgetattrspyobjstypecodessubsNones isinstances AnyElementsElementDeclarationsnspnamespnames TypeErrorssws BacktraceseltsAnyTypes __class__sanames minOccurss maxOccurs(stypecodespyobjsswseltssub((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys_get_type_or_substitute+s$%,8%&     cCs{g}td„|ƒ}xX|iƒD]J\}}t|t ƒp||jp |t joq%n|i |ƒq%W|SdS(sƒRun thru list ofwhat.anames and find unmatched keys in value dictionary d. Assume these are element wildcard instances. cCs|iS(N(swhatsaname(swhat((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysVsN( sany_keyssmapsofwhatsanamessdsitemssanamespyobjs isinstancesAnyTypesNonesappend(sofwhatsdsanamesanamesspyobjsany_keys((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys_get_any_instancesQs *s ComplexTypecBshtZdZedƒZeeeeedd„Zd„Z eed„Z ed„Z eed„Z RS(sVRepresents an element of complexType, potentially containing other elements. sZSI.TCcompound.ComplexTypes_textc Ks`ti||d|| ||_||_||_||_ t |_ |t jo ||_ n|it jo t |_n| i dƒp t|ƒ|_t|ƒ} | tjotdt| ƒƒ‚nt|ƒ|_tiot|it j o*t|iƒtij ot|itƒ o#tdtt|iƒƒƒ‚nt|idƒndS(sÚpyclass -- the Python class to hold the fields ofwhat -- a list of fields to be in the complexType inorder -- fields must be in exact order or not inline -- don't href/id when serializing mutable -- object could change between multiple serializations type -- the (URI,localname) of the datatype mixed -- mixed content model? True/False mixed_aname -- if mixed is True, specify text content here. Default _text spyclassstypes,Struct ofwhat must be list or sequence, not s:pyclass must be None or an old-style/new-style class, not s ComplexTypeN(sTypeCodes__init__sselfspnamespyclassskwsinordersinlinesmutablesmixedsNones mixed_anamesTruesgets _get_xsitypestypesofwhatsts _seqtypess TypeErrorsstrstuples typechecksstypess ClassTypes isinstancesobjects_check_typecode_list( sselfspyclasssofwhatspnamesinordersinlinesmutablesmixeds mixed_anameskwst((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys__init__fs(            =#cCsÒ|iiƒ}|o|iidƒ|i||ƒ}|io||it t fgjoŒt |t ƒ o;t d|i |i||ƒ|if|i|ƒƒ‚qê|o|iidƒt i|||ƒ}|i||ƒSnt|ƒ}|o?t|ƒot d|i|ƒƒ‚n|i||ƒ}nt|ƒ} t| ƒ} |i||ƒotSnh}|i||ƒ}|o|||i ~D]g\}}t-|ƒo |ƒ}n|o |iid|i.|i ƒnxgi*}|D])}| |o||| |fƒqÀqÀ~D]L\}} |o |iid| i1| i2ƒn|i3| ƒo©y|i| |ƒ}Wnt j o }‚nX|i6d joL|i7|i8ƒo||i8i*|ƒn|g||i8 elements(#%d) bound by (%d,%s)s1Constructing element (%s,%s) with pyclass(%s), %s(HsselfsloggersdebugOnsdebugs checknameseltspssxtypestypesNones isinstancesTypeDefinitionsEvaluateExceptionspnames checktypes BacktracesgetSubstituteTypeswhatsparses _find_hrefshrefs _childrens FindLocalHREFs_child_elementsscslenscountsnilledsNilledsvsparse_attributess attributess attrs_anamesmixedsTrues simple_values mixed_anamesrangescrangesstrsofwhatsanysappends_[1]siscallablesnspnamesjsc_elts namespaceURIstagNames name_matchsvalueses maxOccursshas_keysanamesinorders AnyElementshasattrsdefaults minOccurssoccurss UNBOUNDEDspyclassspyobjs Exceptions TypeErrors__name__skeysskeyssetattr(sselfseltspssxtypeshrefsanyswhatscrangespyobjsoccursskeysc_eltscountscsesisjsvalues_[1]svsdebugs attributes((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysparse‰sº&%    # D   A      $  A   0 3 c Ks›|p|io |i|||d||ngt|ƒ} |i || ƒ\} }|i | |ƒ}|itdd| ƒ|i|i|||ƒdS(Nsnameshrefs#%s(sinlinesselfscbseltsswspyobjsnameskws _get_idstrsobjidsget_namesnssnscreateAppendElementselssetAttributeNSsNones AddCallback( sselfseltsswspyobjsinlinesnameskwselsnsnssobjid((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys serializes  c s¿|iiƒ}|o!|iidt|iƒƒntˆƒ} |i || ƒ\} }ˆt joZ|itjo'|i| |ƒ}|i|ƒdSntd|i|i|if‚n|itjo |iˆƒodSn|o |iidt| ƒ|ƒn|t j oU|i| |ƒ}|i|ˆƒ|id|iƒtjo|i|ƒn|i tjo |i!t j oât"ˆ|i!ƒoªt#ˆ|i!ƒ}t"|dƒo|i%i&|||ƒqkt'|ƒt(jo/|o|iid|ƒn|i)|ƒqktd|i|if|i*|ƒƒ‚qo|o|iid|i!ƒqoqyn|}|i+onS|i+ o|i,otd |i*|ƒƒ‚n"|t j o|i-|| ƒn|i.ot'|i.ƒt'jo‡d †}nf|i.oˆi0‰‡d †}nCˆ‰‡d †}t2i3ot'ˆƒt4i5jot6d ƒ‚ndt7|iƒf\}}|ob|iid|i|iƒ|i'o(|iid|i'd|i'dƒqò|ii:dƒnxÆ||jo¸d} |i|} t=| ƒo | ƒ} n|o|iid| i>i?ƒn| i@}||ƒ}|d7}| iBdjo |t joqõn| }|iDdjo |t j oHt'|ƒtEjo;td|i|i| i@|iDtEf|i*|ƒƒ‚nx±|D]©} | d7} | |iDjo/td| |iD| if|i*|ƒƒ‚ntG|| ||ƒ} |o | |j o|iid| i>ƒn| iH||| |qW| |iBjo/td| |iB| if|i*|ƒƒ‚qõqõn|t j p | itjoatG||||ƒ} |o | |j o|iid| i>ƒn| iH||||qõntd| i| iB| i| i|f|i*|ƒƒ‚qõWdS(Nscb: %ss"element(%s,%s) is not nillable(%s)selement: (%s, %s)stypedstypecodesmixed text content: %ss;mixed test content in element (%s,%s) must be a string typesmixed NO text content in %ss2Not inline, but unique makes no sense. No href/id.cstˆ|tƒS(N(sgetattrspyobjsattrsNone(sattr(spyobj(s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysTscs ˆi|ƒS(N(sdsgetsattr(sattr(sd(s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysWscs ˆi|ƒS(N(spyobjsgetsattr(sattr(spyobj(s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysZss&Classless struct didn't get dictionaryiselement declaration (%s,%s)sxsi:type definition (%s,%s)is NO xsi:typesserialize what -- %ss7pyobj (%s,%s), aname "%s": maxOccurs %s, expecting a %ss/occurances (%d) exceeded maxOccurs(%d) for <%s>ssubstitute derived type: %ss/occurances(%d) less than minOccurs(%d) for <%s>s<Got None for nillable(%s), minOccurs(%d) element (%s,%s), %s(IsselfsloggersdebugOnsdebugsstrsofwhats _get_idstrspyobjsobjidsget_namesnamesnssnsNonesnillablesTrueseltscreateAppendElementselemsserialize_as_nilsEvaluateExceptionsnspnamespnamesmutablesFalsesswsKnownsset_attributesskwsgetstypedsset_attribute_xsi_typesmixeds mixed_anameshasattrsgetattrs textContentstypecodesserialize_text_nodestypes _stringtypesscreateAppendTextNodes Backtracesinlinesuniquesset_attribute_idspyclasssfs__dict__sdsTypeCodes typechecksstypessDictTypes TypeErrorslensindxs lenofwhatswarningsoccursswhatscallables __class__s__name__sanamesvs minOccursswhatTCs maxOccurss _seqtypessv2s_get_type_or_substitutes serialize(sselfseltsswspyobjsnameskwsindxs lenofwhatswhatTCsnssoccurssobjidswhatsv2sanamesdsfs textContentselemsnsvsdebug((spyobjsds2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pyscbsÊ!   #                       %  %cCs¨|oGt|iƒ}t|ƒtjo|t|ƒ7}qƒ|i|ƒn6|o*t|ƒtjo |}qƒ|f}ndSt|ƒ|_t |iƒ|_ dS(s9For derived types set appropriate parameter and N( s extensionsslistsselfsofwhatstypes _seqtypessappends restrictionsstupleslens lenofwhat(sselfs extensionss restrictionssofwhat((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pyssetDerivedTypeContents¶s  ( s__name__s __module__s__doc__s _GetLoggersloggersNonesFalsesTrues__init__sparses serializescbssetDerivedTypeContents(((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys ComplexType`s  # † sStructcBs/tZdZedƒZeeeed„ZRS(s(Struct is a complex type for accessors identified by name. Constraint: No element may have the same name as any other, nor may any element have a maxOccurs > 1. sZSI.TCcompound.Structc KsÖti|||d|d|d|d||t d„|iƒ} xŒt t |iƒƒD]u} |i| }|i|if} t|tƒ o |idjo td‚n| | | djo td‚qYqYWd S( spyclass -- the Python class to hold the fields ofwhat -- a list of fields to be in the struct inorder -- fields must be in exact order or not inline -- don't href/id when serializing mutable -- object could change between multiple serializations spnamesinordersinlinesmutablecCs|i|ifS(N(swhatsnspnamespname(swhat((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysêsis-Constraint: no element can have a maxOccurs>1s:Constraint: No element may have the same name as any otherN(s ComplexTypes__init__sselfspyclasssofwhatspnamesinordersinlinesmutableskwsmapswhatssrangeslensidxswhatsnspnameskeys isinstances AnyElements maxOccurss TypeError( sselfspyclasssofwhatspnamesinordersinlinesmutableskwswhatswhatssidxskey((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys__init__Üs ! ( s__name__s __module__s__doc__s _GetLoggersloggersNonesFalsesTrues__init__(((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysStructÊs  sArrayc BshtZdZedƒZedeeeedeed„ Zd„Zd„Z d„Z eed„Z RS( sÇAn array. atype -- arrayType, (namespace,ncname) mutable -- object could change between multiple serializations undeclared -- do not serialize/parse arrayType attribute. sZSI.TCcompound.Arrayiic Ksnti||| ||_||_| tjo|idi dƒtjo%|idd|idf|_n|idjot dƒ‚n||_ ||_ ||_ ||_| |_| |_| |_|iozt|iƒ}|tjo|if|_qW|tjot|iƒ|_qWtiot dt|ƒƒ‚qWntio|itjo#t|ƒtjot|ƒdjot dƒ‚nt|ƒ}t|tƒ ot d t|iƒƒ‚n|iort|iƒ|ijot d ƒ‚nxF|iD]7} t| ƒtjot d t| ƒd ƒ‚qqWqan||_dS( Nis]is%s[]s(Only single-dimensioned arrays supporteds"Size must be integer or list, not is'Array type must be a sequence of len 2.s-Array ofwhat outside the TypeCode hierarchy, sArray dimension/size mismatchs Array size "s" is not an integer.(sTypeCodes__init__sselfspnameskws dimensionssatypes undeclaredsFalsesendswiths TypeErrorsfillssparsesmutablessizesnooffsets childnamesstypests _inttypess _seqtypesstuples typecheckssstrslensofwhats isinstances __class__ss(sselfsatypesofwhatspnames dimensionssfillssparsesmutablessizesnooffsets undeclareds childnamesskwssst((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys__init__þsH  *%            6   *cCsft|ƒ}| odSnti|ƒ o$td|d|i|ƒƒ‚nt|dd!ƒSdS(Nis Bad offset "s"iiÿÿÿÿ( s_find_arrayoffsetseltsos _offset_patsmatchsEvaluateExceptionspss Backtracesint(sselfseltspsso((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pys parse_offset+s cCs’t|ƒ}| otSn|idƒotd|i|ƒƒ‚nti |ƒ o$td|d|i|ƒƒ‚nt |dd!ƒSdS(Ns,s"Sorry, no multi-dimensional arrayssBad array position "s"iÿÿÿÿi( s_find_arraypositionseltsosNonesfindsEvaluateExceptionspss Backtraces _position_patsmatchsint(sselfseltspsso((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysparse_position3s c CsÛt|ƒ}|o?t|ƒotd|i|ƒƒ‚n|i||ƒ}n|i ||ƒot Snt |ƒ o |i t jotd|i|ƒƒ‚nt|ƒ}|on|i||ƒ} gdf\}}| o|i o3x0|| jo|d7}|i|iƒq÷Wnx©t|ƒD]›}|ii||ƒ}|i||ƒp| } |io|i| |fƒn=x,| | jo| d7} |i|iƒqŒW|i|ƒ| d7} q4W|SdS(NsArray has content and HREFsArray expectedii(s _find_hrefseltshrefs _childrensEvaluateExceptionspss Backtraces FindLocalHREFsselfsnilledsNilleds_find_arraytypes undeclaredsFalses _find_typests parse_offsetsoffsetsvsvlenssparsesappendsfills_child_elementsscsofwhatsparsesitemsparse_positionsposition( sselfseltspsscsvsvlensitemshrefstsoffsetsposition((s2build/bdist.darwin-8.0.1-x86/egg/ZSI/TCcompound.pysparse>sB          cKsx|iiƒ}|o|iid|ƒn|itjo |i|ƒodSnt |ƒ} |i || ƒ\} }|i| |ƒ}|itjo |tjo|i|ƒtSn|i||ƒ|ip|idtƒ}|tjo |i|ƒo|i|| ƒtSn|id|iƒtjo|i||n|itjo|i|| ƒnd} |itjo |i tjotdt!|ƒf\} } x0| | jo|| |i#jo| d7} q´W| o|i$t%i&dd| ƒq n|i'tjo;|i$t%i&dd |i(|i)dƒ|i)dfƒn|o|iid |i*ƒnh}|p|i,}|o||d %s%s cCs||_||_dS(N(snamesselfsNamespasswordsPassword(sselfsnamespassword((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__s (s__name__s __module__s__doc__sNones__init__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys _AuthHeaders sofwhatsNamestypedsPasswordspnames BasicAuths_CallercBs tZdZd„Zd„ZRS(szInternal class used to give the user a callable object that calls back to the Binding object to make an RPC call. cCs||f\|_|_dS(N(sbindingsnamesself(sselfsbindingsname((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__$sc Gs9|iit|i|dddti|idƒƒSdS(Ns encodingStyles)http://schemas.xmlsoap.org/soap/encoding/s replytypesResponse(sselfsbindingsRPCsNonesnamesargssTCsAny(sselfsargs((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__call__'s(s__name__s __module__s__doc__s__init__s__call__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys_Callers  s_NamedParamCallercBs tZdZd„Zd„ZRS(sSSimilar to _Caller, expect that there are named parameters not positional. cCs||f\|_|_dS(N(sbindingsnamesself(sselfsbindingsname((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__2sc Ks‘h}x@dddgD]/}|i|ƒo||||<||=qqW|iit|itddd|dt i |idd t ƒ|SdS( Ns auth_headersnsdictsrequesttypecodesoapactions encodingStyles)http://schemas.xmlsoap.org/soap/encoding/s_argss replytypesResponsesaslist( skwskeysparamsshas_keysselfsbindingsRPCsNonesnamesTCsAnysFalse(sselfsparamsskwskey((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__call__5s(s__name__s __module__s__doc__s__init__s__call__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys_NamedParamCaller-s  s_Bindingc BstZdZeiZeiZedƒZ e e e e e e de e e d„ Z e e d„Z d„Z d„Zd„Zd„Zd „Ze d „Zhe e e d „Zhd „Zd „Zd„Zd„Ze d„Zd„Zd„Zd„Zd„ZRS(s¬Object that represents a binding (connection) to a SOAP server. Once the binding is created, various ways of sending and receiving SOAP messages are available. sZSI.client.Bindingsc Ksòt|_t|_g|_|ph|_||_| ph|_||_||_ ||_ ||_ ||_ ||_| |_t|_| idtƒ|_tiƒ|_h|_| idƒo|i| dŒn|itiƒdS(sPInitialize. Keyword arguments include: transport -- default use HTTPConnection. transdict -- dict of values to pass to transport. url -- URL of resource, POST is path soapaction -- value of SOAPAction header auth -- (type, name, password) triplet; default is unauth nsdict -- namespace entries to add tracefile -- file to dump packet traces cert_file, key_file -- SSL data (q.v.) readerclass -- DOM reader class writerclass -- DOM writer class, implements MessageInterface wsAddressURI -- namespaceURI of WS-Address to use. By default it's not used. sig_handler -- XML Signature handler, must sign and verify. endPointReference -- optional Endpoint Reference. sendPointReferencesauthN(sNonesselfsdataspss user_headerssnsdicts transports transdictsurls tracefilestraces readerclasss writerclasss soapactions wsAddressURIs sig_handlersaddressskwsgetsendPointReferencesCookies SimpleCookiescookiesshttp_callbacksshas_keysSetAuthsAUTHsnone( sselfsnsdicts transportsurls tracefiles readerclasss writerclasss soapactions wsAddressURIs sig_handlers transdictskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__Ls*             cCs)|||f\|_|_|_|SdS(s2Change auth style, return object to user. N(sstylesuserspasswordsselfs auth_styles auth_users auth_pass(sselfsstylesuserspassword((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysSetAuthws!cCs||_|SdS(s Set the URL we post to. N(surlsself(sselfsurl((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysSetURL~s cCsg|_|SdS(s.Empty the list of additional headers. N(sselfs user_headers(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys ResetHeaders„s cCstiƒ|_dS(s#Empty the list of cookies. N(sCookies SimpleCookiesselfscookies(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys ResetCookiesŠscCs|ii||fƒ|SdS(sAdd a header to send. N(sselfs user_headerssappendsheadersvalue(sselfsheadersvalue((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys AddHeaderscCs÷xð|iiƒD]ß\}}g}|iddƒ}|djo |djo|id|ƒn|id||i fƒ|idƒ}|o|id|ƒn|idƒ}|o|id |ƒn|i i d d i |ƒƒqWd S( s;Add cookies from self.cookies to request in self.h sversionss0s $Version=%ss%s=%sspaths$Path=%ssdomains $Domain=%ssCookies; N( sselfscookiessitemsscnamesmorselsattrssgetsvaluesappends coded_valueshs putheadersjoin(sselfscnamesmorselsattrssvalue((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys __addcookies•s cKs*|i|||||i||SdS(sdSend a request, return the reply. See Send() and Recieve() docstrings for details. N(sselfsSendsurlsopnamesobjskwsReceives replytype(sselfsurlsopnamesobjs replytypeskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysRPC¦sc Ksp|p|i}|p|i}h}|i|iƒ|i|ƒtd|dtd|id|i dƒƒ}|i dƒ} |i dƒo7| ptid|dtƒ}|i|d|ƒnÑ| o¸t|d tƒptid|dtƒ}y3t|ƒtjottd „|ƒƒ}nWn+tj otid|dtƒ}nXtid|dtƒ}|i||ƒn|i|| ƒ|iti@o&|it |i!|i"ƒt i#ƒn|i$tj oy|i%o|i'd ƒ|i%jot(d |i%|f‚nt)||i$ƒ|_*|i*i+||ƒ|i*i|ƒn|i,tj o|i,i-|ƒnt.i.|ƒ\} }} }}}|i3} | tjo |tj oA| d jo |i4} qÿ| djo |i5} qÿt6d‚nt7| t8i9ƒtjo t:d‚nt;|ƒ} | |t|i=|_>|i>i?ƒ|i@| |||dS(s‚Send a message. If url is None, use the value from the constructor (else error). obj is the object (data) to send. Data may be described with a requesttypecode keyword, the default is the class's typecode (if there is one), else Any. Try to serialize as a Struct, if this is not possible serialize an Array. If data is a sequence of built-in python data types, it will be serialized as an Array, unless requesttypecode is specified. arguments: url -- opname -- struct wrapper obj -- python instance key word arguments: nsdict -- soapaction -- wsaction -- WS-Address Action, goes in SOAP Header. endPointReference -- set by calling party, must be an EndPointReference type instance. requesttypecode -- snsdictsheaders outputclasss encodingStylesrequesttypecodes_argsspnamesasliststypecodecCs|ii|fS(N(sistypecodespname(si((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysÙss'"s+soapAction(%s) and WS-Action(%s) must matchshttpsshttps3must specify transport or url startswith https/https"transport must be a HTTPConnectionN(AsurlsselfsendPointReferencesdsupdatesnsdicts SoapWritersTrues writerclassskwsgetsswsrequesttypecodeshas_keysTCsAnysopnamesFalsestcs serializesgetattrsobjsNonestypes _seqtypessdictsmapsAttributeErrors auth_stylesAUTHszsibasicsserialize_headers _AuthHeaders auth_users auth_passstypecodes wsAddressURIs soapactionswsactionsstripsWSActionExceptionsAddresssaddresss setRequests sig_handlerssignsurlparsesschemesnetlocspathsnils transportsdefaultHttpsTransportsdefaultHttpTransports RuntimeErrors issubclassshttplibsHTTPConnections TypeErrorsstrssoapdatas transdictshsconnects SendSOAPData(sselfsurlsopnamesobjsnsdicts soapactionswsactionsendPointReferenceskwsrequesttypecodespathssoapdatas transportsschemesnilsnetlocsdsswstc((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysSend­s^ + #!         c s ˆio=ˆiddItitiƒƒIdIJˆiˆIJntˆƒ} ˆii d| ƒˆii ddt ˆƒƒˆii ddƒˆi ƒx-|iƒD]\}} ˆii || ƒq­Wd ˆpˆi} ˆii d | ƒˆiti@oAtˆid ˆiƒid d ƒ}ˆii dd|ƒn_ˆitijo|idƒ o|idƒ o)‡‡‡‡‡d†}|ˆid(sselfs __class__s__name__s _get_idstr(sself((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__repr__¹s(s__name__s __module__s__doc__shttplibsHTTPConnectionsdefaultHttpTransportsHTTPSConnectionsdefaultHttpsTransports _GetLoggersloggersNones__init__sSetAuthsSetURLs ResetHeaderss ResetCookiess AddHeaders_Binding__addcookiessRPCsSends SendSOAPDatasSendSOAPDataHTTPDigestAuths ReceiveRawsIsSOAPs ReceiveSOAPsIsAFaults ReceiveFaultsReceives__repr__(((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys_BindingCs,    '+      ` % $ %    sBindingcBsPtZdZed„ƒZedƒZed„Zd„Z d„Z d„Z RS(sObject that represents a binding (connection) to a SOAP server. Can be used in the "name overloading" style. class attr: gettypecode -- funcion that returns typecode from typesmodule, can be set so can use whatever mapping you desire. cCst|t|iƒƒiS(N(sgetattrsmodsstrses localNamestypecode(smodse((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pysÅssZSI.client.BindingcKs||_ti||dS(N(s typesmodulesselfs_Bindings__init__skw(sselfs typesmoduleskw((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys__init__Ès cCs{|d djo!t|ƒdjo|ddjo5t||ƒot||ƒSnt|i|ƒSnt||ƒSdS(saReturn a callable object that will invoke the RPC method named by the attribute. is__iiþÿÿÿN(snameslenshasattrsselfsgetattrs __class__s_Caller(sselfsname((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys __getattr__Ìs 5cCsày|i|i|ƒ}WnH|iid|i|iƒti ddƒ}|i ||i ƒSnX|iid|ƒy|i ||i ƒSWn&t j o|iid|ƒnXti ddƒ}|i ||i ƒSdS(sFfor rpc-style map each message part to a class in typesmodule s/didnt find typecode for "%s" in typesmodule: %ssaslistisparse child with typecode : %ssparse failed try Any : %sN( sselfs gettypecodes typesmodulesnodestcsloggersdebugs localNamesTCsAnysparsespss Exception(sselfsnodestc((s.build/bdist.darwin-8.0.1-x86/egg/ZSI/client.pys __parse_childÕs c KsR|i||i}t|iƒ}t|ƒtt fjo|ddjp t |iƒ} |i t jp| oti|||Sn|iƒot|ƒ}t|ƒ‚n|}t|dƒo |i}nh}x9t|iƒD](}t|iƒ} |i|ƒ|| "', inheader, elt.parentNode, self.dom) elif t == _Node.DOCUMENT_TYPE_NODE: raise ParseException('Found DTD', inheader, elt.parentNode, self.dom) list += _children(elt) def Backtrace(self, elt): '''Return a human-readable "backtrace" from the document root to the specified element. ''' return _backtrace(elt, self.dom) def FindLocalHREF(self, href, elt, headers=1): '''Find a local HREF in the data elements. ''' if href[0] != '#': raise EvaluateException( 'Absolute HREF ("%s") not implemented' % href, self.Backtrace(elt)) frag = href[1:] # Already found? e = self.id_cache.get(frag) if e: return e # Do a breadth-first search, in the data first. Most likely # to find multi-ref targets shallow in the data area. list = self.data_elements[:] + [self.body_root] if headers: list.extend(self.header_elements) while list: e = list.pop() if e.nodeType == _Node.ELEMENT_NODE: nodeid = _find_id(e) if nodeid: self.id_cache[nodeid] = e if nodeid == frag: return e list += _children(e) raise EvaluateException('''Can't find node for HREF "%s"''' % href, self.Backtrace(elt)) def ResolveHREF(self, uri, tc, **keywords): r = getattr(tc, 'resolver', self.resolver) if not r: raise EvaluateException('No resolver for "' + uri + '"') try: if type(uri) == types.UnicodeType: uri = str(uri) retval = r(uri, tc, self, **keywords) except Exception, e: raise EvaluateException('''Can't resolve "''' + uri + '" (' + \ str(e.__class__) + "): " + str(e)) return retval def GetMyHeaderElements(self, actorlist=None): '''Return a list of all elements intended for these actor(s). ''' if actorlist is None: actorlist = [None, SOAP.ACTOR_NEXT] else: actorlist = list(actorlist) + [None, SOAP.ACTOR_NEXT] return [ E for E in self.header_elements if _find_actor(E) in actorlist ] def GetElementNSdict(self, elt): '''Get a dictionary of all the namespace attributes for the indicated element. The dictionaries are cached, and we recurse up the tree as necessary. ''' d = self.ns_cache.get(id(elt)) if not d: if elt != self.dom: d = self.GetElementNSdict(elt.parentNode) for a in _attrs(elt): if a.namespaceURI == XMLNS.BASE: if a.localName == "xmlns": d[''] = a.nodeValue else: d[a.localName] = a.nodeValue self.ns_cache[id(elt)] = d return d.copy() def GetDomAndReader(self): '''Returns a tuple containing the dom and reader objects. (dom, reader) Unless keepdom is true, the dom and reader objects will go out of scope when the ParsedSoap instance is deleted. If keepdom is true, the reader object is needed to properly clean up the dom tree with reader.releaseNode(dom). ''' return (self.dom, self.reader) def IsAFault(self): '''Is this a fault message? ''' e = self.body_root if not e: return 0 return e.namespaceURI == SOAP.ENV and e.localName == 'Fault' def Parse(self, how): '''Parse the message. ''' if type(how) == types.ClassType: how = how.typecode return how.parse(self.body_root, self) def WhatMustIUnderstand(self): '''Return a list of (uri,localname) tuples for all elements in the header that have mustUnderstand set. ''' return [ ( E.namespaceURI, E.localName ) for E in self.header_elements if _find_mu(E) == "1" ] def WhatActorsArePresent(self): '''Return a list of URI's of all the actor attributes found in the header. The special actor "next" is ignored. ''' results = [] for E in self.header_elements: a = _find_actor(E) if a not in [ None, SOAP.ACTOR_NEXT ]: results.append(a) return results def ParseHeaderElements(self, ofwhat): '''Returns a dictionary of pyobjs. ofhow -- list of typecodes w/matching nspname/pname to the header_elements. ''' d = {} lenofwhat = len(ofwhat) c, crange = self.header_elements[:], range(len(self.header_elements)) for i,what in [ (i, ofwhat[i]) for i in range(lenofwhat) ]: if isinstance(what, AnyElement): raise EvaluateException, 'not supporting as child of SOAP-ENC:Header' v = [] occurs = 0 namespaceURI,tagName = what.nspname,what.pname for j,c_elt in [ (j, c[j]) for j in crange if c[j] ]: prefix,name = SplitQName(c_elt.tagName) nsuri = _resolve_prefix(c_elt, prefix) if tagName == name and namespaceURI == nsuri: pyobj = what.parse(c_elt, self) else: continue v.append(pyobj) c[j] = None if what.minOccurs > len(v) > what.maxOccurs: raise EvaluateException, 'number of occurances(%d) doesnt fit constraints (%d,%s)'\ %(len(v),what.minOccurs,what.maxOccurs) if what.maxOccurs == 1: if len(v) == 0: v = None else: v = v[0] d[(what.nspname,what.pname)] = v return d if __name__ == '__main__': print _copyright PKލ58J¬J½7½7ZSI/generate/commands.pyo;ò V@Ec@s<dkZdkZdkZdkZdkZdklZdkZdklZdk l Z l Z dk l Z lZdklZdklZlZdklZlZdklZ d klZd klZd klZei d d ei!ƒd„Z"d„Z#d„Z$d„Z%d„Z&e'd„Z(e'd„Z)dS(N(sxor(s ConfigParser(sWriteServiceModulesServiceDescription(s WSDLToolss XMLSchema(ssetBasicLoggerDEBUG(s containerssutility(sNCName_to_ClassNames TextProtect(sServiceModuleWriter(sDelAuthServiceModuleWriter(sWSAServiceModuleWriter(sDelAuthWSAServiceModuleWritersignorescOstƒtiƒdS(N(ssetBasicLoggerDEBUGswarningss resetwarnings(soptionsoptsvaluesparsersargsskwargs((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysSetDebugCallbacksc OsRdkl}l}l}|d|_|iid|ƒ|iid|ƒdS(s)set up pyclass metaclass for complexTypes(sServiceHeaderContainersTypecodeContainerBasesTypesHeaderContainers metaclasss$from %(module)s import %(metaclass)sN(sZSI.generate.containerssServiceHeaderContainersTypecodeContainerBasesTypesHeaderContainerskwargss metaclasssimportssappend( soptionsoptsvaluesparsersargsskwargssTypecodeContainerBasesTypesHeaderContainersServiceHeaderContainer((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysSetPyclassMetaclasss  cOs1dkl}|iidƒ|iidƒdS(N(sServiceHeaderContainersfrom ZSI import clientsfrom ZSI.twisted import client(sZSI.generate.containerssServiceHeaderContainersimportssremovesappend(soptionsoptsvaluesparsersargsskwargssServiceHeaderContainer((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysSetUpTwistedClient%s cOsdkl}t|_dS(N(sTypecodeContainerBase(sZSI.generate.containerssTypecodeContainerBasesTrueslazy(soptionsoptsvaluesparsersargsskwargssTypecodeContainerBase((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysSetUpLazyEvaluation+s cCs•dfd„ƒY}|ƒ}|idƒo$||idƒdidƒ}n|idƒ}|dd|d|_h|i|<|_ |SdS( s¼ In the case of a 'schema only' generation (-s) this creates a fake wsdl object that will function w/in the adapters and allow the generator to do what it needs to do. sfakecBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysfake6ss/is.is_N( sfakesfsfnamesrfindssplitstmpsnames schemaObjstargetNamespacestypes(sfnames schemaObjstmpsfsfake((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysformatSchemaObject0s $c Cs‡tidddtiƒ}|idddddd d td d d dƒ|iddddddd td d d dƒ|iddddddd td dƒ|idddddtd dƒ|iddddddd td dƒ|id d!dddt d"hd#d$<d%d&ƒ|id?d@ddddAd td dBƒ|idCdDddddEd td d d dFƒ|idGdHddddId td d d dJƒ|tjo|i ƒ\}}n|i |ƒ\}}t|itj|itjƒ odKGHtitiƒn|i}|itj o |i}n|itjotidL|ƒ}n tiƒ}|i}|itj o |i }nt} y||ƒ} Wn4t"j o(} dM|| fGHtiti$ƒnX|i%oQdNt&_'tt(_)t*i+dO„ƒt*i,dP„ƒdQ„t*i-_.dR„t/_0n|i1odSk2l3} |i1| _1n|itjot4|| ƒ} n|i5tj o5|i5i6d=dTƒ}dUk2l7}t8t9ƒ|_.n|i:tjoRt;|i:ƒ}|i:i=d=ƒ}x!|dTD]}t@||ƒ}q W|iA}nt}t&| dV|iCdW|iDdX|ƒ} |iFtjo| iG|iFƒn|itjotHtiIiJ|iKdY| iLƒƒdZƒ} |i% o| iN| ƒnItHtiIiJ|iKdY| iOƒƒdZƒ}| iN| d[|ƒ|iQƒ| iQƒntHtiIiJ|iKdY| iRƒƒdZƒ} | iS| ƒ| iQƒd\S(]s A utility for automatically generating client interface code from a wsdl definition, and a set of classes representing element declarations and type definitions. This will produce two files in the current working directory named after the wsdl definition name. eg. SampleService.py SampleService_types.py susagesusage: %prog [options]s descriptions-fs--filesactionsstoresdestsfilesdefaultstypesstringshelpsFILE to load wsdl froms-us--urlsurlsURL to load wsdl froms-xs--schemas store_truesschemas6process just the schema from an xsd file [no services]s-ds--debugscallbacks debug outputs-as --addresssaddresss9ws-addressing support, must include WS-Addressing schema.s-bs --complexTypescallback_kwargssmodulesZSI.generate.pyclasss metaclasss pyclass_typesžadd convenience functions for complexTypes, including Getters, Setters, factory methods, and properties (via metaclass). *** DONT USE WITH --simple-naming ***s-ls--lazysCEXPERIMENTAL: recursion error solution, lazy evalution of typecodess-ws --twistedsZgenerate a twisted.web client, dependencies python>=2.4, Twisted>=2.0.0, TwistedWeb>=0.5.0s-es --extendedsextendedsDo Extended code generation.s-zs--anamesanames.pass in a function for attribute name creations-ts--typesstypessfile to load types froms-os --output-dirs output_dirs.s#Write generated files to OUTPUT_DIRs-ss--simple-namings simple_namingsSimplify generated naming.s-cs--clientClassSuffixsclientClassSuffixs7Suffix to use for service client class (default "SOAP")s-ms--pyclassMapModulespyclassMapModulesíPython file that maps external python classes to a schema type. The classes are used as the "pyclass" for that type. The module should contain a dict() called mapping in the format: mapping = {schemaTypeName:(moduleName.py,className) }s*Must specify either --file or --url optionsbase_urlsError loading %s: %ss_clientcCsdt|ƒS(Ns%s_(sNC_to_CNsn(sn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys¶scCsdt|ƒS(Ns%s(sNC_to_CNsn(sn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys·scCstt|ƒƒS(N(s TextProtectsstrsn(sinstncsn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys¹scCs ti|ƒS(N(sutilitysNamespace2ModuleNamesns(sclssns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys»s(sServiceContainerBasei(sTypecodeContainerBases addressings do_extendeds extPyClassess%s.pysw+smsg_fdN(Tsoptparses OptionParserswsdl2pys__doc__sops add_optionsNonesFalsesSetDebugCallbacksSetPyclassMetaclasssSetUpLazyEvaluationsSetUpTwistedClientsargss parse_argssoptionssxorsfilesurlssyssexitsossEX_USAGEslocationsschemasTrues XMLSchemas SchemaReadersreaders WSDLToolss WSDLReaders loadFromFilesloads loadFromURLswsdls Exceptionses EX_NOINPUTs simple_namingsWriteServiceModulesclient_module_suffixsServiceDescriptionsseparate_messagess containerssSetTypeNameFuncsSetElementNameFuncs ContainerBases func_anamesutilitysnamespace_namesclientClassSuffixsZSI.generate.containerssServiceContainerBasesformatSchemaObjectsanamesrsplitsTypecodeContainerBases staticmethodsFUNCspyclassMapModules __import__smodssplits componentsscompsgetattrsmappings extPyClassessaddresssextendedswsmstypesssetTypesModuleNamesopenspathsjoins output_dirsgetClientModuleNamesfds writeClientsgetMessagesModuleNamesmsg_fdsclosesgetTypesModuleNames writeTypes(sargssloads extPyClassessmsg_fdsTypecodeContainerBaseslocationsreadersmodscompsfdsServiceContainerBaseseswsdlswsms componentssoptionssop((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pyswsdl2pyEsà                                     #             $+ + + c Csýtiƒ}|idddddddtdd d d ƒ|id d dddddtdd d dƒ|idddddddtd dƒ|idddddddtd dƒ|idddddtd dƒ|idddddddtdd d d ƒ|id!d"dddd#dd$dd d d%ƒ|id&d'dddd(dtd d)ƒ|tjo|iƒ\}}n|i|ƒ\}}|i o.d*t _ d+„t _ tt _d,„t_ntiƒ}t}|itj o|i|iƒ}n'|itj o|i|iƒ}nt}|itjo6|iotd-|iƒ}qªtd-|iƒ}n3|iotd-|iƒ}nt d-|iƒ}|i |ƒt!t"i#i$|i%|i&ƒd.ƒd/ƒ}|i(|ƒ|i)ƒd0S(1sy wsdl2dispatch A utility for automatically generating service skeleton code from a wsdl definition. s-fs--filesactionsstoresdestsfilesdefaultstypesstringshelpsfile to load wsdl froms-us--urlsurlsURL to load wsdl froms-as --addresss store_truesaddresss9ws-addressing support, must include WS-Addressing schema.s-es --extendedsextendedsExtended code generation.s-ds--debugscallbacks debug outputs-ts--typesstypess#Write generated files to OUTPUT_DIRs-os --output-dirs output_dirs.sfile to load types froms-ss--simple-namings simple_namingsSimplify generated naming.s _interfacecCs t|ƒS(N(s TextProtectsn(sinstncsn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysscCs ti|ƒS(N(sutilitysNamespace2ModuleNamesns(sclssns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysss do_extendeds.pysw+N(*soptparses OptionParsersops add_optionsNonesFalsesSetDebugCallbacksargss parse_argssoptionss simple_namingsServiceDescriptionsserver_module_suffixs func_anamesTruesseparate_messagessutilitysnamespace_names WSDLToolss WSDLReadersreaderswsdlsfiles loadFromFilesurls loadFromURLssssaddresssextendedsDelAuthServiceDescriptionWSAsServiceDescriptionWSAsDelAuthServiceDescriptionsfromWSDLsopensosspathsjoins output_dirsgetServiceModuleNamesfdswritesclose(sargsssssfdsreaderswsdlsoptionssop((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys wsdl2dispatchêsj                           + (*s exceptionsssyssoptparsesosswarningssoperatorsxorsZSIs ConfigParsersZSI.generate.wsdl2pythonsWriteServiceModulesServiceDescriptions ZSI.wstoolss WSDLToolss XMLSchemasZSI.wstools.loggingssetBasicLoggerDEBUGs ZSI.generates containerssutilitysZSI.generate.utilitysNCName_to_ClassNamesNC_to_CNs TextProtectsZSI.generate.wsdl2dispatchsServiceModuleWritersDelAuthServiceModuleWritersDelAuthServiceDescriptionsWSAServiceModuleWritersServiceDescriptionWSAsDelAuthWSAServiceModuleWritersDelAuthServiceDescriptionWSAsfilterwarningss UserWarningsSetDebugCallbacksSetPyclassMetaclasssSetUpTwistedClientsSetUpLazyEvaluationsformatSchemaObjectsNoneswsdl2pys wsdl2dispatch(sWriteServiceModulesSetPyclassMetaclasssServiceDescriptionWSAsutilitysxorsDelAuthServiceDescriptionsZSIsNC_to_CNsformatSchemaObjects ConfigParsers containersswarningssoptparsesSetDebugCallbacks XMLSchemasSetUpLazyEvaluations WSDLToolssServiceDescriptionssyss wsdl2dispatchswsdl2pys TextProtectssetBasicLoggerDEBUGsDelAuthServiceDescriptionWSAsSetUpTwistedClients exceptionssos((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys?s(-             ¥PK…¨58Y\•’Š`Š`ZSI/generate/wsdl2python.pyc;ò V@Ec@sKdkZdklZdklZdklZdkl Z l Z l Z l Z l Z dklZlZlZdklZdklZlZdkTd klZd klZd klZd fd „ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZ dfd„ƒYZ!de!fd„ƒYZ"de!fd„ƒYZ#dS(N(s _get_idstr(s getLogger(s WSDLTools(sSoapAddressBindingsSoapBodyBindings SoapBindingsMimeContentBindingsHttpUrlEncodedBinding(s SchemaReadersElementDeclarations SchemaError(sBaseTypeInterpreter(sWsdlGeneratorErrorsWsdl2PythonError(s*(sutility(sNamespaceAliasDict(sGetModuleBaseNameFromWSDLsWriteServiceModulecBs¶tZdZdZdZdZedƒZeeee e d„Z d„Z d„Z d„Z d „Zd „Zd „Zd „Zd „Zd„Zd„Ze e d„Zd„ZRS(s²top level driver class invoked by wsd2py class variables: client_module_suffix -- suffix of client module. types_module_suffix -- suffix of types module. s _servicess _messagess_services_typessWriteServiceModulecCsp||_||_||_||_t |_ g|_ t |_ t |_ t |_t |_||_||_dS(N(swsdlsselfs_wsdls addressings _addressings notifications _notifications configParsers _configParsersNonesusedNamespacessservicessclient_module_pathstypes_module_namestypes_module_pathsmessages_module_paths do_extendeds extPyClasses(sselfswsdls addressings notifications do_extendeds extPyClassess configParser((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pys__init__;s           cCsQt|iƒ}| o td‚n|itjo|Snd||ifSdS(sclient module name. s"could not determine a service names%s%sN(sGetModuleBaseNameFromWSDLsselfs_wsdlsnamesWsdlGeneratorErrorsclient_module_suffixsNone(sselfsname((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetClientModuleNameJs cCsut|iƒ}| o td‚n|itjo|Snt|iƒdjo|iƒSnd||ifSdS(Ns"could not determine a service nameis%s%s( sGetModuleBaseNameFromWSDLsselfs_wsdlsnamesWsdlGeneratorErrorsmessages_module_suffixsNoneslensgetClientModuleName(sselfsname((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetMessagesModuleNameVs cCs ||_dS(N(snamesselfstypes_module_name(sselfsname((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pyssetTypesModuleNamecscCsl|itj o |iSnt|iƒ}| o td‚n|itjo|Snd||ifSdS(stypes module name. s"could not determine a service names%s%sN(sselfstypes_module_namesNonesGetModuleBaseNameFromWSDLs_wsdlsnamesWsdlGeneratorErrorstypes_module_suffix(sselfsname((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetTypesModuleNamefs  cCs ||_dS(ssetup module path to where client module before calling fromWsdl. module path to types module eg. MyApp.client N(spathsselfsclient_module_path(sselfspath((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pyssetClientModulePathuscCs |iSdS(s4module path to types module eg. MyApp.types N(sselfstypes_module_path(sself((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetTypesModulePath{scCs |iSdS(sEmodule path to messages module same as types path N(sselfsmessages_module_path(sself((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetMessagesModulePath€scCs ||_dS(ssetup module path to where service module before calling fromWsdl. module path to types module eg. MyApp.types N(spathsselfstypes_module_path(sselfspath((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pyssetTypesModulePath†scCs ||_dS(ssetup module path to where message module before calling fromWsdl. module path to types module eg. MyApp.types N(spathsselfsmessages_module_path(sselfspath((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pyssetMessagesModulePathŒscCsT|itj odSn|iidƒh|_x‘|iiiƒD]}}|i ƒ}|iidt |ƒ|fƒ|ii |ƒt jog|i|tƒ|_ n€|iƒtjotƒ|_ n]|iƒtjotƒ|_ n:|iƒotd|iƒ|_ ntd|iƒ‚|iid|i |iƒfƒ|i i|ƒdS(s set up global elements. s(expecting global element declaration: %sstypes do_extendedsUnknown element declaration: %ss4ElementWriter setUp container "%r", Schema Item "%s"N(sitems isElementsFalsesisLocalsTrues TypeErrors getItemTraceslocals getAttributesqNamescontentsetpsgetTypeDefinitionsNones ElementLocalComplexTypeContainersselfs do_extendedsElementSimpleTypeContainersElementGlobalDefContainersisSimplesElementLocalSimpleTypeContainers isComplexsWsdl2PythonErrorsloggersdebugssetUp(sselfsitemsetpsqNameslocal((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysfromSchemaItem¹s,&     #(s__name__s __module__s__doc__s _GetLoggersloggersfromSchemaItem(((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pys ElementWriterµs  s TypeWritercBs#tZdZedƒZd„ZRS(s&contains/generates a single definitions TypeWritercCsE|iƒtjp|iƒtjotd|iƒ‚nt|_ |i ƒo‹|i i ƒot ƒ|_ nT|i i ƒotƒ|_ n4|i iƒotƒ|_ ntd|iƒ‚|i i|ƒdSn|iƒoCh}|i tjp |i iƒo5td|id|iƒ|_ |i tj|dscCstidd|ƒS(Ns[-./:# ]s_(sressubss(ss((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysscCstd|ƒS(Ns_%s(s TextProtectsname(sname((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysscCst|idƒƒidƒS(Nshttp://s_(s TextProtectsnsslstripsrstrip(sns((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysscCsM|ip|idi}t|ƒd}|tjotSnt|ƒSdS(snBy default try to construct a reasonable base name for all generated modules. Otherwise return None. iiN(swsdlsnamesservicess base_names SplitQNamesNonesNCName_to_ModuleName(swsdls base_name((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysGetModuleBaseNameFromWSDLs  cCsdt|iƒS(Nsns%s(slensclss alias_list(sclssns((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys$ssNamespaceAliasDictcBsntZdZhZgZd„ZeeƒZd„ZeeƒZd„ZeeƒZd„Z ee ƒZ RS(s=a lookup table to store relevant namespaces and their aliasescCsU|ii|ƒodSnt|ƒdt||ƒf|i|<|ii|ƒdS(Ns%s(sclss alias_dictshas_keysnssNamespace2ModuleNamesnamespace_names alias_listsappend(sclssns((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysadd+s&cCs_|ii|ƒo|i|dSnd|d}|tijod|}nt|‚dS(Nis%failed to find import for schema "%s"s+possibly missing @schemaLocation attribute.s)missing built-in typecode for schema "%s"(sclss alias_dictshas_keysnssmsgsSCHEMAsXSD_LISTsWsdlGeneratorError(sclssnssmsg((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys getModuleName2s cCs_|ii|ƒo|i|dSnd|d}|tijod|}nt|‚dS(Nis%failed to find import for schema "%s"s+possibly missing @schemaLocation attribute.s)missing built-in typecode for schema "%s"(sclss alias_dictshas_keysnssmsgsSCHEMAsXSD_LISTsWsdlGeneratorError(sclssnssmsg((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysgetAlias?s cCst|iƒSdS(N(stuplesclss alias_list(scls((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys getNSListLs( s__name__s __module__s__doc__s alias_dicts alias_listsadds classmethods getModuleNamesgetAliass getNSList(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysNamespaceAliasDict&s      s StringWritercBsGtZdZed„Zd„Zd„Zd„Zd„Zd„Z RS(sgenerator utilcCs(g|_|o|ii|ƒndS(N(sselfsdatasvalsappend(sselfsval((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys__init__Ss cCs4|iot|_g|_n|ii|ƒdS(N(sselfsdatasNonesappendsval(sselfsval((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pyssetXs   cCs|ii|ƒdS(N(sselfsdatasappendsval(sselfsval((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pyswrite`scCs&|iodi|iƒSndSdS(Ns(sselfsdatasjoin(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysgetvaluecs cCs|ii|ƒ|SdS(N(sselfsdatasappendsval(sselfsval((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys__iadd__iscCs|iƒSdS(N(sselfsgetvalue(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys__str__ms( s__name__s __module__s__doc__sNones__init__ssetswritesgetvalues__iadd__s__str__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys StringWriterQs      sMessageContainercBstZdZRS(s#generator util - used by address.py(s__name__s __module__s__doc__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysMessageContainerss cCs½t}dkl}l}||d|ƒ}|iƒg}xw|D]o} g}xS|i i ƒD]B}x9|D]1}|d|ƒ} | i|ƒ| id}| i|joòxï| iD]à} | id} t| ƒt| iiƒjo®g}| iitjo‘xŽ| iiD]|} d}| iƒo d}nM| i i!dƒo| i d}n)| i i!dƒo| i dd}n|i"|ƒq Wq”q´q´WqkqkWq^W|i"|ƒqBW|SdS( N(sWriteServiceModulesSchemaDescriptions do_extendediisNonesanysnamesref(#sTrues do_extendeds wsdl2pythonsWriteServiceModulesSchemaDescriptionswsdlswsmsgatherNamespacesstoReturnsargssargs argSubnamessusedNamespacessvaluesslsschemassds fromSchemaselements argNamespacestargetNamespacesitemssisargElementTypesstrscontentsnames mgContentsNonescsnValues isWildCards attributesshas_keysappend(sargsswsdlsSchemaDescriptions argSubnamessnValuesWriteServiceModulestoReturnswsmslscsisargElementTypesargssds argNamespaces do_extendedsschema((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysGetPartsSubNameszsD        )(sresZSIsEvaluateExceptionsZSI.TCcompoundsStructs ZSI.generatesWsdlGeneratorErrorsWsdl2PythonErrorsZSI.wstools.Utilitys SplitQNamesZSI.wstools.NamespacessSCHEMAsNCName_to_ModuleNamesNCName_to_ClassNames TextProtectsTextProtectAttributeNamesNamespace2ModuleNamesGetModuleBaseNameFromWSDLsnamespace_namesNamespaceAliasDicts StringWritersMessageContainersGetPartsSubNames(snamespace_namesNCName_to_ClassNamesEvaluateExceptionsGetModuleBaseNameFromWSDLsStructs TextProtectsNCName_to_ModuleNamesTextProtectAttributeNamesWsdl2PythonErrors StringWritersNamespaceAliasDictsres SplitQNamesGetPartsSubNamessMessageContainersSCHEMAsNamespace2ModuleNamesWsdlGeneratorError((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys? s           +"PKލ588O[ìÌmÌmZSI/generate/wsdl2dispatch.pyo;ò V@Ec@ssdklZdkZdkZdkZdkZdkZdkZdkZdk l Z dk l Z l Z dklZlZdklZlZlZlZlZdklZlZdk lZd„Zeid d !d d d d d fd d !jo d „Zndfd„ƒYZdfd„ƒYZdefd„ƒYZdefd„ƒYZ defd„ƒYZ!dS((sStringION(s WSDLTools(sWriteServiceModulesMessageTypecodeContainer(sServiceSOAPBindingsSimpleWSResource(s TextProtectsGetModuleBaseNameFromWSDLsNCName_to_ClassNamesGetPartsSubNamessTextProtectAttributeName(sWsdlGeneratorErrorsWsdl2PythonError(sSchemaDescriptioncCs(||i|ƒ ||i|ƒdfS(Ni(sxsrfindssep(sxssep((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys siiisfinalcCs|i|dƒS(Ni(sxsrsplitssep(sxssep((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysss SOAPServicecBstZd„Zd„ZRS(NcCs.tƒ|_tƒ|_d|_g|_dS(Ns(sStringIOsselfsclassdefsinitdefslocationsmethods(sselfsservice((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__s   cCs"|iitƒƒ|idSdS(sname -- operation name iÿÿÿÿN(sselfsmethodssappendsStringIO(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys newMethods(s__name__s __module__s__init__s newMethod(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys SOAPServices sServiceModuleWritercBstZdZddZdZeZeeƒZeZ e de ed„Z d„Z d„Zd„Zd d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Ze i!d„Z"d„Z#RS(s4Creates a skeleton for a SOAP service instance. s is_services_serverssoapcCsgt|_||_||_t|_t|_ t|_ t|_ t|_ t|_ t|_||_dS(sŸ parameters: base -- either a class definition, or a str representing a qualified class name. prefix -- method prefix. N(sNonesselfswsdlsbases base_classsprefixs method_prefixs SOAPServices_service_classsheadersimportss _servicessclient_module_pathsclient_module_namesmessages_module_names do_extended(sselfsbasesprefixs service_classs do_extended((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__'s          cCs%tƒ|_tƒ|_h|_dS(N(sStringIOsselfsheadersimportss _services(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysreset:s  cCs?t|iƒtijo|iiSnt|idƒdSdS(s1return base class name, do not override. s.iÿÿÿÿN(stypesselfs base_classstypess ClassTypes__name__srsplit(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys_getBaseClassName?scCs`t|iƒtijo|iiSn|iidƒdjot|idƒdSntSdS(s3return base class module, do not override. s.iN( stypesselfs base_classstypess ClassTypes __module__sfindsrsplitsNone(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys_getBaseClassModuleFs icCs|i|SdS(sreturn indent. N(sselfsindentslevel(sselfslevel((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys getIndentOscCsd|it|ƒfSdS(sreturn method name. s%s_%sN(sselfs method_prefixs TextProtectsmethod(sselfsmethod((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys getMethodNameUscCst|ƒSdS(sreturn class name. N(sNCName_to_ClassNamesname(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys getClassNameZscCs ||_dS(N(snamesselfsclient_module_name(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pyssetClientModuleName_scCsA|itj o |iSnt|id|iƒ}|iƒSdS(sreturn module name. s do_extendedN(sselfsclient_module_namesNonesWriteServiceModuleswsdls do_extendedswsmsgetClientModuleName(sselfswsm((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetClientModuleNamebs  cCsA|itj o |iSnt|id|iƒ}|iƒSdS(sreturn module name. s do_extendedN(sselfsmessages_module_namesNonesWriteServiceModuleswsdls do_extendedswsmsgetMessagesModuleName(sselfswsm((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetMessagesModuleNamels  cCsQt|iƒ}| o td‚n|itjo|Snd||ifSdS(sreturn module name. s"could not determine a service names%s%sN(sGetModuleBaseNameFromWSDLsselfswsdlsnamesWsdlGeneratorErrorsserver_module_suffixsNone(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetServiceModuleNamevs cCs |iSdS(N(sselfsclient_module_path(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetClientModulePathscCs ||_dS(sJsetup module path to where client module before calling fromWSDL. N(spathsselfsclient_module_path(sselfspath((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pyssetClientModulePath„sc Cs”|i|ii}|d|i|iƒ|iƒfIJ|d|iddƒIJ|d|iddƒIJ|d|iddƒ|i fIJdS(saset class definition and class variables. service -- ServiceDescription instance s class %s(%s):s%ssoapAction = {}slevelis %sroot = {}s%s_wsdl = """%s"""N( sselfs _servicessservicesnamesclassdefsss getClassNames_getBaseClassNames getIndentsraw_wsdl(sselfsservicess((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpClassDef‰s&c Csí|iƒ}|i}|tjo:|io|d|iƒIJqž|d|iƒIJnC|io|d||iƒfIJn|d||iƒfIJ|i ƒ}|i ƒ}|tjo|d|IJn|d||fIJdS(sset import statements sfrom %s import *sfrom %s.%s import *s import %ssfrom %s import %sN( sselfsgetClientModulePathspathsimportssisNonesseparate_messagessgetMessagesModuleNamesgetClientModuleNames_getBaseClassModulesmods_getBaseClassNamesname(sselfsnamesispathsmod((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpImports–s        c Csµ|i|i} | i}| itj oHt i | iƒ\}}}}}}|d|iddƒ|fIJn|d|iddƒIJ|d|iddƒ|iƒfIJdS(sset __init__ function s&%sdef __init__(self, post='%s', **kw):slevelis!%sdef __init__(self, post, **kw):s%s%s.__init__(self, post)iN(sselfs _servicessservicesnamessdsinitdefsdslocationsNonesurlparsesschemesnetlocspathsparamssquerysfragments getIndents_getBaseClassName( sselfsservicesdsfragmentsnetlocsparamssqueryspathsschemessd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpInitDef­s $$cCst|ƒSdS(N(s TextProtectsname(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysmangle½scCs|i|ƒSdS(N(sselfs func_anamesname(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetAttributeNameÀsc"Cs(|ii|iƒiƒ} |iƒ}|i ƒ} d} xä|i D]Ù}y| i |i}!Wn:tj o.}td|i| i|i|if‚nXxU|iD]'}t|tiƒo|i} Pq¤q¤Wtid|i|!i|ifƒ|!iƒ} t| iƒ}|i|!iƒ} | i ƒ}|d|i"ddƒ| fIJ| t#j o$|d|i"ddƒ|fIJn|d |i"ddƒIJ|!i$ƒ}|i&oº| i'i(ƒ}gi*}|D]}|d |iƒqÉ~}|t#j o|i'i(ƒ}ng}gi*}|D]}|d |iƒq~}|o*t0|ƒdjod GHd |}qtnd}t1| i'i(ƒ|i2ƒ}x¦t4t0|ƒƒD]’}||}t0|ƒd jooddi7t8|i9|ƒƒ}t0|ƒdjod|d}n|d|i"ddƒ|||fIJq¢q¢W|d|i"ddƒIJ|d|i"ddƒIJg}x…|D]}}||}t0|ƒd joZt0|ƒdjo6x@t4t0|ƒƒD]}|i*|d|ƒqÂWqö|i*|ƒqyqyWdi7|ƒ}di7|ƒ}t0|ƒd jo|d7}n|d|i"ddƒ||!i|fIJn|t#j o"t|iƒ}|i&oå|d|i"ddƒ|fIJt1|i'i(ƒ|i2ƒ}t0|ƒd jot0|d ƒd job|d|i"ddƒIJ|d|i"ddƒIJx+t4t0|ƒƒD]}||}t0|ƒdjo„|d|i"ddƒt0|ƒfIJxÇt4t0|ƒƒD]C}||} |d|i"ddƒ|i9| ƒ|||fIJq”Wq8t0|ƒdjo>|d } |d|i"ddƒ|i9| ƒ||fIJq8tDd |d!|!iƒ‚q8Wn|d"|i"ddƒIJqÉ|d#|i"ddƒ|fIJn5|d$|i"ddƒIJ|d%|i"ddƒIJ|dIJ|d&|i"ddƒ| | fIJ|d'|i"ddƒ||| fIJqCWd(Sd(S()s‡set up all methods representing the port operations. Parameters: port -- Port that defines the operations. ssBPort(%s) PortType(%s) missing operation(%s) defined in Binding(%s)s@Port(%s) operation(%s) defined in Binding(%s) missing soapActions%sdef %s(self, ps):slevelis&%sself.request = ps.Parse(%s.typecode)is %s# NO inputs%ss4Message has more than one return value (Bad Design).s(%s)is self.request.s, self.request.s(s)s %s%s = %ss/ %s# If we have an implementation object use its%sif hasattr(self,'impl'):s[%i]s,s, s = s%s%sself.impl.%s(%s)is %sresult = %s()s9%s# If we have an implementation object, copy the result s"%s# Should have a tuple of %i argss%sresult.%s = %s[%i]s%sresult.%s = %ssThe subnames within message s<'s part were not found. Message is the output of operation s%sreturn results %sreturn %s()s %s# NO outputs %sreturn Nones%ssoapAction['%s'] = '%s's6%sroot[(%s.typecode.nspname,%s.typecode.pname)] = '%s'N(Esselfs _servicessgetsports getServicesnamessds getBindingsbindings getPortTypesportTypes action_ins operationssbopsopsKeyErrorsexsWsdlGeneratorErrors extensionssexts isinstances WSDLToolssSoapOperationBindings soapActionswarningsswarnsgetInputMessagesmsgins TextProtects msgin_names getMethodNames method_names newMethodsms getIndentsNonesgetOutputMessagesmsgouts do_extendedspartssvaluess input_argssappends_[1]sxsiargss output_argssoargsslensGetPartsSubNamesswsdls iSubNamessrangesis argSubNamessjoinsmapsgetAttributeNames subNamesStrs iargsStrListsargsiargsStrsoargsStrs msgout_names oSubNamess oargSubNamessjs oargSubNames Exception("sselfsportsiargsStrs argSubNamess msgin_names input_argssbindingsexsargsmsgins method_names action_inssdsportTypesmsgouts subNamesStrs msgout_names output_argssiargss iargsStrListsoargssbopsjsms_[1]sisextsoargsStrs oSubNamess iSubNamess oargSubNamessxs oargSubNamesop((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpMethodsÃs¾   *   #    $  . . / -   * & ; 4#$ #*cCsV|idIJ|id|iƒIJ|id|iIJ|idIJ|idIJdS(Ns2##################################################s# %s.pys# Generated by %ss#(sselfsheadersgetServiceModuleNames __class__(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpHeader<s   c Cs”||iiƒIJ||iiƒIJxg|iiƒD]V\}}||i iƒIJ||i iƒIJx!|i D]}||iƒIJqrWq6WdS(sLwrite out to file descriptor, should not need to override. N( sfdsselfsheadersgetvaluesimportss _servicessitemssksvsclassdefsinitdefsmethodsss(sselfsfdsssksv((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pyswriteCs  cCst|iƒdjo td‚n|iƒ||_|iiƒiddƒ|_ |i ƒ|i ƒx¥|iD]š}|i |iƒ}||i|ibuild/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysfromWSDLOs,         ($s__name__s __module__s__doc__sindentsserver_module_suffixsTextProtectAttributeNames func_anames staticmethodsFalsesseparate_messagessServiceSOAPBindings SOAPServices__init__sresets_getBaseClassNames_getBaseClassModules getIndents getMethodNames getClassNamessetClientModuleNamesgetClientModuleNamesgetMessagesModuleNamesgetServiceModuleNamesgetClientModulePathssetClientModulePaths setUpClassDefs setUpImportss setUpInitDefsmanglesgetAttributeNames setUpMethodss setUpHeaderssyssstdoutswritesfromWSDL(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysServiceModuleWriters8                y  sWSAServiceModuleWritercBsJtZdZedeed„Zd„ZeeƒZd„Z d„Z RS(s:Creates a skeleton for a WS-Address service instance. swsacCs#ti||||ƒ||_dS(sm Parameters: strict -- check that soapAction and input ws-action do not collide. N(sServiceModuleWriters__init__sselfsbasesprefixs service_classsstrict(sselfsbasesprefixs service_classsstrict((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__oscKseg}|tj o|id|ƒn|tj o|id|ƒn|idƒt|ƒSdS(s‹return a tuple of strings containing the body of a method. msgInName -- None or a str msgOutName -- None or a str s$self.request = ps.Parse(%s.typecode)s return %s()s return NoneN(sbodys msgInNamesNonesappends msgOutNamestuple(s msgInNames msgOutNameskwsbody((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pyscreateMethodBodyws   c Cs‹|i|ii}|d|i|iƒ|iƒfIJ|d|iddƒIJ|d|iddƒIJ|d|iddƒIJdS(ssuse soapAction dict for WS-Action input, setup wsAction dict for grabbing WS-Action output values. s class %s(%s):s%ssoapAction = {}slevelis%swsAction = {}s %sroot = {}N( sselfs _servicessservicesnamesclassdefsss getClassNames_getBaseClassNames getIndent(sselfsservicess((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpClassDefˆs&cCs|iƒ}|iƒ} |iƒ}|i|i }xÍ|i D]Â}y| i |i }Wn:tj o.}td|i | i |i |i f‚nXt}} } |itj o|iƒ} n|itj o|iƒ} nxÁ|iD]¶}t|tiƒtjoqín|i}| tjoPn| |joPn|i tjo.t!i"d|i |i |i || fƒPntd|i |i |i || f‚qíW|i#|i ƒ} |i%ƒ}|d|i'ddƒ| fIJt}}|i*ƒ|i+ƒf\}} |tj ot.|i ƒ}n| tj ot.| i ƒ}n|i'ddƒ}x(|i0||ƒD]}|||IJqrW|dIJ|d |i'ddƒ| | fIJ|d |i'ddƒ| | fIJ|d |i'ddƒ||| fIJq>Wd S( s‡set up all methods representing the port operations. Parameters: port -- Port that defines the operations. sBPort(%s) PortType(%s) missing operation(%s) defined in Binding(%s)sEPort(%s) operation(%s) in Binding(%s) soapAction(%s) != WS-Action(%s)sMPort(%s) operation(%s) in Binding(%s) soapAction(%s) MUST match WS-Action(%s)s%sdef %s(self, ps, address):sleveliiss%ssoapAction['%s'] = '%s's%swsAction['%s'] = '%s's6%sroot[(%s.typecode.nspname,%s.typecode.pname)] = '%s'N(2sports getBindingsbindings getPortTypesportTypes getServicesservicesselfs _servicessnamesss operationssbopsopsKeyErrorsexsWsdlGeneratorErrorsNones soap_actions wsaction_ins wsaction_outsinputsgetInputActionsoutputsgetOutputActions extensionssexts isinstances WSDLToolssSoapOperationBindingsFalses soapActionsstrictswarningsswarns getMethodNames method_names newMethodsms getIndents msgin_names msgout_namesgetInputMessagesgetOutputMessagesmsginsmsgouts TextProtectsindentscreateMethodBodysl(sselfsports msgin_namesbindings soap_actionsexsmsginsservicesss method_namesportTypesmsgouts wsaction_outs wsaction_insindentsbopsmslsexts msgout_namesop((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpMethods”s^    *    ))      ##( s__name__s __module__s__doc__sSimpleWSResources SOAPServicesTrues__init__screateMethodBodys staticmethods setUpClassDefs setUpMethods(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysWSAServiceModuleWriterls    sDelAuthServiceModuleWritercBs>tZdZedeed„Zd„Zd„Zd„Z RS(s Includes the generation of lines to call an authorization method on the server side if an authorization function has been defined. ssoapc Cs)ti|d|d|d|d|ƒdS(Nsbasesprefixs service_classs do_extended(sServiceModuleWriters__init__sselfsbasesprefixs service_classs do_extended(sselfsbasesprefixs service_classs do_extended((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__ØscCs5ti||ƒx|iD]}|i|ƒqWdS(N(sServiceModuleWritersfromWSDLsselfswsdlsservicessservices setUpAuthDef(sselfswsdlsservice((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysfromWSDLÛs c Cs¯ti||ƒ|i|i}|i}|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJdS( Ns%sif kw.has_key('impl'):slevelis%sself.impl = kw['impl']is%sself.auth_method_name = Nones$%sif kw.has_key('auth_method_name'):s0%sself.auth_method_name = kw['auth_method_name']( sServiceModuleWriters setUpInitDefsselfsservices _servicessnamessdsinitdefsds getIndent(sselfsservicesdssd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpInitDefàs c CsŸ|i|i}|i}|d|iddƒIJ|d|iddƒIJ|d|iddƒIJ|d|iddƒIJ|d |iddƒIJd S( sset __auth__ function s/%sdef authorize(self, auth_info, post, action):slevelisI%sif self.auth_method_name and hasattr(self.impl, self.auth_method_name):isK%sreturn getattr(self.impl, self.auth_method_name)(auth_info, post, action)is%selse:s %sreturn 1N(sselfs _servicessservicesnamessdsinitdefses getIndent(sselfsservicesessd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpAuthDefës ( s__name__s __module__s__doc__sServiceSOAPBindings SOAPServicesFalses__init__sfromWSDLs setUpInitDefs setUpAuthDef(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysDelAuthServiceModuleWriterÔs   sDelAuthWSAServiceModuleWritercBs8tZedeed„Zd„Zd„Zd„ZRS(Nswsac Cs)ti|d|d|d|d|ƒdS(Nsbasesprefixs service_classsstrict(sWSAServiceModuleWriters__init__sselfsbasesprefixs service_classsstrict(sselfsbasesprefixs service_classsstrict((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__÷scCs5ti||ƒx|iD]}|i|ƒqWdS(N(sWSAServiceModuleWritersfromWSDLsselfswsdlsservicessservices setUpAuthDef(sselfswsdlsservice((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysfromWSDLús c Cs•ti||ƒ|i|i}|i}|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJdS(Ns%sif kw.has_key('impl'):slevelis%sself.impl = kw['impl']is$%sif kw.has_key('auth_method_name'):s0%sself.auth_method_name = kw['auth_method_name']( sWSAServiceModuleWriters setUpInitDefsselfsservices _servicessnamessdsinitdefsds getIndent(sselfsservicesdssd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpInitDefÿs c CsŸ|i|i}|i}|d|iddƒIJ|d|iddƒIJ|d|iddƒIJ|d|iddƒIJ|d |iddƒIJd S( sset __auth__ function s/%sdef authorize(self, auth_info, post, action):slevelisI%sif self.auth_method_name and hasattr(self.impl, self.auth_method_name):isK%sreturn getattr(self.impl, self.auth_method_name)(auth_info, post, action)is%selse:s %sreturn 1N(sselfs _servicessservicesnamessdsinitdefses getIndent(sselfsservicesessd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpAuthDef s ( s__name__s __module__sSimpleWSResources SOAPServicesTrues__init__sfromWSDLs setUpInitDefs setUpAuthDef(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysDelAuthWSAServiceModuleWriterös  ("s cStringIOsStringIOsZSIsstringssyssgetoptsurlparsestypesswarningss ZSI.wstoolss WSDLToolssZSI.generate.wsdl2pythonsWriteServiceModulesMessageTypecodeContainersZSI.ServiceContainersServiceSOAPBindingsSimpleWSResourcesZSI.generate.utilitys TextProtectsGetModuleBaseNameFromWSDLsNCName_to_ClassNamesGetPartsSubNamessTextProtectAttributeNames ZSI.generatesWsdlGeneratorErrorsWsdl2PythonErrorsSchemaDescriptionsrsplits version_infos SOAPServicesServiceModuleWritersWSAServiceModuleWritersDelAuthServiceModuleWritersDelAuthWSAServiceModuleWriter(sServiceModuleWritersWsdl2PythonErrorsSimpleWSResourcesGetModuleBaseNameFromWSDLsGetPartsSubNamessNCName_to_ClassNamesZSIsSchemaDescriptionsDelAuthWSAServiceModuleWriterstypessMessageTypecodeContainersgetoptsDelAuthServiceModuleWritersServiceSOAPBindingsstringswarningssWriteServiceModulessyssWSAServiceModuleWritersrsplits WSDLToolssStringIOs TextProtectsTextProtectAttributeNamesurlparses SOAPServicesWsdlGeneratorError((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys?s ? %  -  ÿOh"PK-¤Y5Ó›ýÔË)Ë)ZSI/generate/pyclass.py############################################################################ # Joshua R. Boverhof, LBNL # See LBNLCopyright for copyright notice! ########################################################################### import pydoc, sys, warnings from ZSI import TC # If function.__name__ is read-only, fail def _x(): return try: _x.func_name = '_y' except: raise RuntimeError,\ 'use python-2.4 or later, cannot set function names in python "%s"'\ %sys.version del _x #def GetNil(typecode=None): # """returns the nilled element, use to set an element # as nilled for immutable instance. # """ # # nil = TC.Nilled() # if typecode is not None: nil.typecode = typecode # return nil # # #def GetNilAsSelf(cls, typecode=None): # """returns the nilled element with typecode specified, # use returned instance to set this element as nilled. # # Key Word Parameters: # typecode -- use to specify a derived type or wildcard as nilled. # """ # if typecode is not None and not isinstance(typecode, TC.TypeCode): # raise TypeError, "Expecting a TypeCode instance" # # nil = TC.Nilled() # nil.typecode = typecode or cls.typecode # return nil class pyclass_type(type): """Stability: Unstable type for pyclasses used with typecodes. expects the typecode to be available in the classdict. creates python properties for accessing and setting the elements specified in the ofwhat list, and factory methods for constructing the elements. Known Limitations: 1)Uses XML Schema element names directly to create method names, using characters in this set will cause Syntax Errors: (NCNAME)-(letter U digit U "_") """ def __new__(cls, classname, bases, classdict): """ """ #import new typecode = classdict.get('typecode') assert typecode is not None, 'MUST HAVE A TYPECODE.' # Assume this means immutable type. ie. str if len(bases) > 0: #classdict['new_Nill'] = classmethod(GetNilAsSelf) pass # Assume this means mutable type. ie. ofwhat. else: assert hasattr(typecode, 'ofwhat'), 'typecode has no ofwhat list??' assert hasattr(typecode, 'attribute_typecode_dict'),\ 'typecode has no attribute_typecode_dict??' #classdict['new_Nill'] = staticmethod(GetNil) if typecode.mixed: get,set = cls.__create_text_functions_from_what(typecode) if classdict.has_key(get.__name__): raise AttributeError,\ 'attribute %s previously defined.' %get.__name__ if classdict.has_key(set.__name__): raise AttributeError,\ 'attribute %s previously defined.' %set.__name__ classdict[get.__name__] = get classdict[set.__name__] = set for what in typecode.ofwhat: get,set,new_func = cls.__create_functions_from_what(what) if classdict.has_key(get.__name__): raise AttributeError,\ 'attribute %s previously defined.' %get.__name__ classdict[get.__name__] = get if classdict.has_key(set.__name__): raise AttributeError,\ 'attribute %s previously defined.' %set.__name__ classdict[set.__name__] = set if new_func is not None: if classdict.has_key(new_func.__name__): raise AttributeError,\ 'attribute %s previously defined.' %new_func.__name__ classdict[new_func.__name__] = new_func assert not classdict.has_key(what.pname),\ 'collision with pname="%s", bail..' %what.pname pname = what.pname if pname is None and isinstance(what, TC.AnyElement): pname = 'any' assert pname is not None, 'Element with no name: %s' %what # TODO: for pname if keyword just uppercase first letter. #if pydoc.Helper.keywords.has_key(pname): pname = pname[0].upper() + pname[1:] assert not pydoc.Helper.keywords.has_key(pname), 'unexpected keyword: %s' %pname classdict[pname] =\ property(get, set, None, 'property for element (%s,%s), minOccurs="%s" maxOccurs="%s" nillable="%s"'\ %(what.nspname,what.pname,what.minOccurs,what.maxOccurs,what.nillable) ) # # mutable type complexContent | modelGroup # or immutable type simpleContent (float, str, etc) # if hasattr(typecode, 'attribute_typecode_dict'): attribute_typecode_dict = typecode.attribute_typecode_dict or {} for key,what in attribute_typecode_dict.items(): get,set = cls.__create_attr_functions_from_what(key, what) if classdict.has_key(get.__name__): raise AttributeError,\ 'attribute %s previously defined.' %get.__name__ if classdict.has_key(set.__name__): raise AttributeError,\ 'attribute %s previously defined.' %set.__name__ classdict[get.__name__] = get classdict[set.__name__] = set return type.__new__(cls,classname,bases,classdict) def __create_functions_from_what(what): if not callable(what): def get(self): return getattr(self, what.aname) if what.maxOccurs > 1: def set(self, value): if not (value is None or hasattr(value, '__iter__')): raise TypeError, 'expecting an iterable instance' setattr(self, what.aname, value) else: def set(self, value): setattr(self, what.aname, value) else: def get(self): return getattr(self, what().aname) if what.maxOccurs > 1: def set(self, value): if not (value is None or hasattr(value, '__iter__')): raise TypeError, 'expecting an iterable instance' setattr(self, what().aname, value) else: def set(self, value): setattr(self, what().aname, value) # # new factory function # if pyclass is None, skip # if not callable(what) and getattr(what, 'pyclass', None) is None: new_func = None elif (isinstance(what, TC.ComplexType) or isinstance(what, TC.Array)): def new_func(self): '''returns a mutable type ''' return what.pyclass() elif not callable(what): def new_func(self, value): '''value -- initialize value returns an immutable type ''' return what.pyclass(value) elif (issubclass(what.klass, TC.ComplexType) or issubclass(what.klass, TC.Array)): def new_func(self): '''returns a mutable type or None (if no pyclass). ''' p = what().pyclass if p is None: return return p() else: def new_func(self, value=None): '''if simpleType provide initialization value, else if complexType value should be left as None. Parameters: value -- initialize value or None returns a mutable instance (value is None) or an immutable instance or None (if no pyclass) ''' p = what().pyclass if p is None: return if value is None: return p() return p(value) #TODO: sub all illegal characters in set # (NCNAME)-(letter U digit U "_") if new_func is not None: new_func.__name__ = 'new_%s' %what.pname get.func_name = 'get_element_%s' %what.pname set.func_name = 'set_element_%s' %what.pname return get,set,new_func __create_functions_from_what = staticmethod(__create_functions_from_what) def __create_attr_functions_from_what(key, what): def get(self): '''returns attribute value for attribute %s, else None. ''' %str(key) return getattr(self, what.attrs_aname, {}).get(key, None) def set(self, value): '''set value for attribute %s. value -- initialize value, immutable type ''' %str(key) if not hasattr(self, what.attrs_aname): setattr(self, what.attrs_aname, {}) getattr(self, what.attrs_aname)[key] = value #TODO: sub all illegal characters in set # (NCNAME)-(letter U digit U "_") if type(key) in (tuple, list): get.__name__ = 'get_attribute_%s' %key[1] set.__name__ = 'set_attribute_%s' %key[1] else: get.__name__ = 'get_attribute_%s' %key set.__name__ = 'set_attribute_%s' %key return get,set __create_attr_functions_from_what = \ staticmethod(__create_attr_functions_from_what) def __create_text_functions_from_what(what): def get(self): '''returns text content, else None. ''' return getattr(self, what.mixed_aname, None) get.im_func = 'get_text' def set(self, value): '''set text content. value -- initialize value, immutable type ''' setattr(self, what.mixed_aname, value) get.im_func = 'set_text' return get,set __create_text_functions_from_what = \ staticmethod(__create_text_functions_from_what) PK…¨58¯dÆbÚ8Ú8ZSI/generate/commands.pyc;ò V@Ec@s<dkZdkZdkZdkZdkZdklZdkZdklZdk l Z l Z dk l Z lZdklZdklZlZdklZlZdklZ d klZd klZd klZei d d ei!ƒd„Z"d„Z#d„Z$d„Z%d„Z&e'd„Z(e'd„Z)dS(N(sxor(s ConfigParser(sWriteServiceModulesServiceDescription(s WSDLToolss XMLSchema(ssetBasicLoggerDEBUG(s containerssutility(sNCName_to_ClassNames TextProtect(sServiceModuleWriter(sDelAuthServiceModuleWriter(sWSAServiceModuleWriter(sDelAuthWSAServiceModuleWritersignorescOstƒtiƒdS(N(ssetBasicLoggerDEBUGswarningss resetwarnings(soptionsoptsvaluesparsersargsskwargs((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysSetDebugCallbacksc OsRdkl}l}l}|d|_|iid|ƒ|iid|ƒdS(s)set up pyclass metaclass for complexTypes(sServiceHeaderContainersTypecodeContainerBasesTypesHeaderContainers metaclasss$from %(module)s import %(metaclass)sN(sZSI.generate.containerssServiceHeaderContainersTypecodeContainerBasesTypesHeaderContainerskwargss metaclasssimportssappend( soptionsoptsvaluesparsersargsskwargssTypecodeContainerBasesTypesHeaderContainersServiceHeaderContainer((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysSetPyclassMetaclasss  cOs1dkl}|iidƒ|iidƒdS(N(sServiceHeaderContainersfrom ZSI import clientsfrom ZSI.twisted import client(sZSI.generate.containerssServiceHeaderContainersimportssremovesappend(soptionsoptsvaluesparsersargsskwargssServiceHeaderContainer((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysSetUpTwistedClient%s cOsdkl}t|_dS(N(sTypecodeContainerBase(sZSI.generate.containerssTypecodeContainerBasesTrueslazy(soptionsoptsvaluesparsersargsskwargssTypecodeContainerBase((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysSetUpLazyEvaluation+s cCs•dfd„ƒY}|ƒ}|idƒo$||idƒdidƒ}n|idƒ}|dd|d|_h|i|<|_ |SdS( s¼ In the case of a 'schema only' generation (-s) this creates a fake wsdl object that will function w/in the adapters and allow the generator to do what it needs to do. sfakecBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysfake6ss/is.is_N( sfakesfsfnamesrfindssplitstmpsnames schemaObjstargetNamespacestypes(sfnames schemaObjstmpsfsfake((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysformatSchemaObject0s $c CsÂtidddtiƒ}|idddddd d td d d dƒ|iddddddd td d d dƒ|iddddddd td dƒ|idddddtd dƒ|iddddddd td dƒ|id d!dddt d"hd#d$<d%d&ƒ|id?d@ddddAd td dBƒ|idCdDddddEd td d d dFƒ|idGdHddddId td d d dJƒ|tjo|i ƒ\}}n|i |ƒ\}}t|itj|itjƒ odKGHtitiƒn|i}|itj o |i}n|itjotidL|ƒ}n tiƒ}|i}|itj o |i }nt} y||ƒ} Wn4t"j o(} dM|| fGHtiti$ƒnX|i%oQdNt&_'tt(_)t*i+dO„ƒt*i,dP„ƒdQ„t*i-_.dR„t/_0n|i1odSk2l3} |i1| _1n|itjot4|| ƒ} n|i5tj op|i5i6d=dTƒ}t7|ƒdUjp t8dV‚t9t:ƒpt8dW|i5‚dXk2l;}t<t:ƒ|_.n|i=tjoRt>|i=ƒ}|i=i@d=ƒ}x!|dTD]}tC||ƒ}q[W|iD}nt}t&| dY|iFdZ|iGd[|ƒ} |iItjo| iJ|iIƒn|itjotKtiLiM|iNd\| iOƒƒd]ƒ} |i% o| iQ| ƒnItKtiLiM|iNd\| iRƒƒd]ƒ}| iQ| d^|ƒ|iTƒ| iTƒntKtiLiM|iNd\| iUƒƒd]ƒ} | iV| ƒ| iTƒd_S(`s A utility for automatically generating client interface code from a wsdl definition, and a set of classes representing element declarations and type definitions. This will produce two files in the current working directory named after the wsdl definition name. eg. SampleService.py SampleService_types.py susagesusage: %prog [options]s descriptions-fs--filesactionsstoresdestsfilesdefaultstypesstringshelpsFILE to load wsdl froms-us--urlsurlsURL to load wsdl froms-xs--schemas store_truesschemas6process just the schema from an xsd file [no services]s-ds--debugscallbacks debug outputs-as --addresssaddresss9ws-addressing support, must include WS-Addressing schema.s-bs --complexTypescallback_kwargssmodulesZSI.generate.pyclasss metaclasss pyclass_typesžadd convenience functions for complexTypes, including Getters, Setters, factory methods, and properties (via metaclass). *** DONT USE WITH --simple-naming ***s-ls--lazysCEXPERIMENTAL: recursion error solution, lazy evalution of typecodess-ws --twistedsZgenerate a twisted.web client, dependencies python>=2.4, Twisted>=2.0.0, TwistedWeb>=0.5.0s-es --extendedsextendedsDo Extended code generation.s-zs--anamesanames.pass in a function for attribute name creations-ts--typesstypessfile to load types froms-os --output-dirs output_dirs.s#Write generated files to OUTPUT_DIRs-ss--simple-namings simple_namingsSimplify generated naming.s-cs--clientClassSuffixsclientClassSuffixs7Suffix to use for service client class (default "SOAP")s-ms--pyclassMapModulespyclassMapModulesíPython file that maps external python classes to a schema type. The classes are used as the "pyclass" for that type. The module should contain a dict() called mapping in the format: mapping = {schemaTypeName:(moduleName.py,className) }s*Must specify either --file or --url optionsbase_urlsError loading %s: %ss_clientcCsdt|ƒS(Ns%s_(sNC_to_CNsn(sn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys¶scCsdt|ƒS(Ns%s(sNC_to_CNsn(sn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys·scCstt|ƒƒS(N(s TextProtectsstrsn(sinstncsn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys¹scCs ti|ƒS(N(sutilitysNamespace2ModuleNamesns(sclssns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys»s(sServiceContainerBaseiisexpecting module.functions6%s must be a callable method with one string parameter(sTypecodeContainerBases addressings do_extendeds extPyClassess%s.pysw+smsg_fdN(Wsoptparses OptionParserswsdl2pys__doc__sops add_optionsNonesFalsesSetDebugCallbacksSetPyclassMetaclasssSetUpLazyEvaluationsSetUpTwistedClientsargss parse_argssoptionssxorsfilesurlssyssexitsossEX_USAGEslocationsschemasTrues XMLSchemas SchemaReadersreaders WSDLToolss WSDLReaders loadFromFilesloads loadFromURLswsdls Exceptionses EX_NOINPUTs simple_namingsWriteServiceModulesclient_module_suffixsServiceDescriptionsseparate_messagess containerssSetTypeNameFuncsSetElementNameFuncs ContainerBases func_anamesutilitysnamespace_namesclientClassSuffixsZSI.generate.containerssServiceContainerBasesformatSchemaObjectsanamesrsplitslensAssertionErrorscallablesFUNCsTypecodeContainerBases staticmethodspyclassMapModules __import__smodssplits componentsscompsgetattrsmappings extPyClassessaddresssextendedswsmstypesssetTypesModuleNamesopenspathsjoins output_dirsgetClientModuleNamesfds writeClientsgetMessagesModuleNamesmsg_fdsclosesgetTypesModuleNames writeTypes(sargssloads extPyClassessmsg_fdsTypecodeContainerBaseslocationsreadersmodscompsfdsServiceContainerBaseseswsdlswsms componentssoptionssop((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pyswsdl2pyEsà                                     #             $+ + + c Cstiƒ}|idddddddtdd d d ƒ|id d dddddtdd d dƒ|idddddddtd dƒ|idddddddtd dƒ|idddddtd dƒ|idddddddtdd d d ƒ|id!d"dddd#dd$dd d d%ƒ|id&d'dddd(dtd d)ƒ|tjo|iƒ\}}n|i|ƒ\}}|i o.d*t _ d+„t _ tt _d,„t_ntiƒ}t}|itj o|i|iƒ}n'|itj o|i|iƒ}n|tj p td-‚t}|itjo6|iotd.|iƒ}qÁtd.|iƒ}n3|iot d.|iƒ}nt d.|iƒ}|i!|ƒt"t#i$i%|i&|i'ƒd/ƒd0ƒ}|i)|ƒ|i*ƒd1S(2sy wsdl2dispatch A utility for automatically generating service skeleton code from a wsdl definition. s-fs--filesactionsstoresdestsfilesdefaultstypesstringshelpsfile to load wsdl froms-us--urlsurlsURL to load wsdl froms-as --addresss store_truesaddresss9ws-addressing support, must include WS-Addressing schema.s-es --extendedsextendedsExtended code generation.s-ds--debugscallbacks debug outputs-ts--typesstypess#Write generated files to OUTPUT_DIRs-os --output-dirs output_dirs.sfile to load types froms-ss--simple-namings simple_namingsSimplify generated naming.s _interfacecCs t|ƒS(N(s TextProtectsn(sinstncsn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysscCs ti|ƒS(N(sutilitysNamespace2ModuleNamesns(sclssns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pysss-Must specify WSDL either with --file or --urls do_extendeds.pysw+N(+soptparses OptionParsersops add_optionsNonesFalsesSetDebugCallbacksargss parse_argssoptionss simple_namingsServiceDescriptionsserver_module_suffixs func_anamesTruesseparate_messagessutilitysnamespace_names WSDLToolss WSDLReadersreaderswsdlsfiles loadFromFilesurls loadFromURLsAssertionErrorssssaddresssextendedsDelAuthServiceDescriptionWSAsServiceDescriptionWSAsDelAuthServiceDescriptionsfromWSDLsopensosspathsjoins output_dirsgetServiceModuleNamesfdswritesclose(sargsssssfdsreaderswsdlsoptionssop((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys wsdl2dispatchêsj                           + (*s exceptionsssyssoptparsesosswarningssoperatorsxorsZSIs ConfigParsersZSI.generate.wsdl2pythonsWriteServiceModulesServiceDescriptions ZSI.wstoolss WSDLToolss XMLSchemasZSI.wstools.loggingssetBasicLoggerDEBUGs ZSI.generates containerssutilitysZSI.generate.utilitysNCName_to_ClassNamesNC_to_CNs TextProtectsZSI.generate.wsdl2dispatchsServiceModuleWritersDelAuthServiceModuleWritersDelAuthServiceDescriptionsWSAServiceModuleWritersServiceDescriptionWSAsDelAuthWSAServiceModuleWritersDelAuthServiceDescriptionWSAsfilterwarningss UserWarningsSetDebugCallbacksSetPyclassMetaclasssSetUpTwistedClientsSetUpLazyEvaluationsformatSchemaObjectsNoneswsdl2pys wsdl2dispatch(sWriteServiceModulesSetPyclassMetaclasssServiceDescriptionWSAsutilitysxorsDelAuthServiceDescriptionsZSIsNC_to_CNsformatSchemaObjects ConfigParsers containersswarningssoptparsesSetDebugCallbacks XMLSchemasSetUpLazyEvaluations WSDLToolssServiceDescriptionssyss wsdl2dispatchswsdl2pys TextProtectssetBasicLoggerDEBUGsDelAuthServiceDescriptionWSAsSetUpTwistedClients exceptionssos((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/commands.pys?s(-             ¥PK¨58¶y\ \ ZSI/generate/__init__.pyo;ò V@Ec@sddddgZdefd„ƒYZdefd„ƒYZdefd „ƒYZd efd „ƒYZd fd „ƒYZdS(s wsdl2pythonsutilitys containersscommandssWSDLFormatErrorcBstZdZRS(s)Detected errors in the WSDL document. (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWSDLFormatErrors sWsdlGeneratorErrorcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWsdlGeneratorError ssWsdl2PythonErrorcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWsdl2PythonError ssWSInteropErrorcBstZdZRS(s7Conformance to WS-I Basic-Profile 1.0 specification (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWSInteropErrors sWSISpeccBs tZdZdZdZdZRS(Ns¢An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the type attribute.suThe operations in a wsdl:binding in a DESCRIPTION MUST result in wire signatures that are different from one another.s¦An rpc-literal binding in a DESCRIPTION MUST have the namespace attribute specified, the value of which MUST be an absolute URI, on contained soapbind:body elements.s¾A MESSAGE described with an rpc-literal binding that is a response message MUST have a wrapper element whose name is the corresponding wsdl:operation name suffixed with the string "Response"(s__name__s __module__sR2203sR2710sR2717sR2729(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWSISpecsN(s__all__s ExceptionsWSDLFormatErrorsWsdlGeneratorErrorsWsdl2PythonErrorsWSInteropErrorsWSISpec(sWSISpecs__all__sWsdl2PythonErrorsWSDLFormatErrorsWSInteropErrorsWsdlGeneratorError((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pys?s PK¨58!  ZSI/generate/utility.pyo;ò V@Ec@sÕdkZdklZdklZdklZlZdkl Z dk l Z d„Z d„Z d„Zd„Zd „Zd „Zd „Zd fd „ƒYZdfd„ƒYZdfd„ƒYZd„ZdS(N(sEvaluateException(sStruct(sWsdlGeneratorErrorsWsdl2PythonError(s SplitQName(sSCHEMAcCstiddt|ƒƒS(Ns\.s_(sressubs TextProtectsname(sname((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysscCstidd|ƒS(Ns[-./:# ]s_(sressubss(ss((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysscCstd|ƒS(Ns_%s(s TextProtectsname(sname((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysscCst|idƒƒidƒS(Nshttp://s_(s TextProtectsnsslstripsrstrip(sns((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysscCsM|ip|idi}t|ƒd}|tjotSnt|ƒSdS(snBy default try to construct a reasonable base name for all generated modules. Otherwise return None. iiN(swsdlsnamesservicess base_names SplitQNamesNonesNCName_to_ModuleName(swsdls base_name((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysGetModuleBaseNameFromWSDLs  cCsdt|iƒS(Nsns%s(slensclss alias_list(sclssns((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys$ssNamespaceAliasDictcBsntZdZhZgZd„ZeeƒZd„ZeeƒZd„ZeeƒZd„Z ee ƒZ RS(s=a lookup table to store relevant namespaces and their aliasescCsU|ii|ƒodSnt|ƒdt||ƒf|i|<|ii|ƒdS(Ns%s(sclss alias_dictshas_keysnssNamespace2ModuleNamesnamespace_names alias_listsappend(sclssns((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysadd+s&cCs_|ii|ƒo|i|dSnd|d}|tijod|}nt|‚dS(Nis%failed to find import for schema "%s"s+possibly missing @schemaLocation attribute.s)missing built-in typecode for schema "%s"(sclss alias_dictshas_keysnssmsgsSCHEMAsXSD_LISTsWsdlGeneratorError(sclssnssmsg((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys getModuleName2s cCs_|ii|ƒo|i|dSnd|d}|tijod|}nt|‚dS(Nis%failed to find import for schema "%s"s+possibly missing @schemaLocation attribute.s)missing built-in typecode for schema "%s"(sclss alias_dictshas_keysnssmsgsSCHEMAsXSD_LISTsWsdlGeneratorError(sclssnssmsg((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysgetAlias?s cCst|iƒSdS(N(stuplesclss alias_list(scls((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys getNSListLs( s__name__s __module__s__doc__s alias_dicts alias_listsadds classmethods getModuleNamesgetAliass getNSList(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysNamespaceAliasDict&s      s StringWritercBsGtZdZed„Zd„Zd„Zd„Zd„Zd„Z RS(sgenerator utilcCs(g|_|o|ii|ƒndS(N(sselfsdatasvalsappend(sselfsval((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys__init__Ss cCs4|iot|_g|_n|ii|ƒdS(N(sselfsdatasNonesappendsval(sselfsval((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pyssetXs   cCs|ii|ƒdS(N(sselfsdatasappendsval(sselfsval((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pyswrite`scCs&|iodi|iƒSndSdS(Ns(sselfsdatasjoin(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysgetvaluecs cCs|ii|ƒ|SdS(N(sselfsdatasappendsval(sselfsval((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys__iadd__iscCs|iƒSdS(N(sselfsgetvalue(sself((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys__str__ms( s__name__s __module__s__doc__sNones__init__ssetswritesgetvalues__iadd__s__str__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys StringWriterQs      sMessageContainercBstZdZRS(s#generator util - used by address.py(s__name__s __module__s__doc__(((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysMessageContainerss cCs½t}dkl}l}||d|ƒ}|iƒg}xw|D]o} g}xS|i i ƒD]B}x9|D]1}|d|ƒ} | i|ƒ| id}| i|joòxï| iD]à} | id} t| ƒt| iiƒjo®g}| iitjo‘xŽ| iiD]|} d}| iƒo d}nM| i i!dƒo| i d}n)| i i!dƒo| i dd}n|i"|ƒq Wq”q´q´WqkqkWq^W|i"|ƒqBW|SdS( N(sWriteServiceModulesSchemaDescriptions do_extendediisNonesanysnamesref(#sTrues do_extendeds wsdl2pythonsWriteServiceModulesSchemaDescriptionswsdlswsmsgatherNamespacesstoReturnsargssargs argSubnamessusedNamespacessvaluesslsschemassds fromSchemaselements argNamespacestargetNamespacesitemssisargElementTypesstrscontentsnames mgContentsNonescsnValues isWildCards attributesshas_keysappend(sargsswsdlsSchemaDescriptions argSubnamessnValuesWriteServiceModulestoReturnswsmslscsisargElementTypesargssds argNamespaces do_extendedsschema((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pysGetPartsSubNameszsD        )(sresZSIsEvaluateExceptionsZSI.TCcompoundsStructs ZSI.generatesWsdlGeneratorErrorsWsdl2PythonErrorsZSI.wstools.Utilitys SplitQNamesZSI.wstools.NamespacessSCHEMAsNCName_to_ModuleNamesNCName_to_ClassNames TextProtectsTextProtectAttributeNamesNamespace2ModuleNamesGetModuleBaseNameFromWSDLsnamespace_namesNamespaceAliasDicts StringWritersMessageContainersGetPartsSubNames(snamespace_namesNCName_to_ClassNamesEvaluateExceptionsGetModuleBaseNameFromWSDLsStructs TextProtectsNCName_to_ModuleNamesTextProtectAttributeNamesWsdl2PythonErrors StringWritersNamespaceAliasDictsres SplitQNamesGetPartsSubNamessMessageContainersSCHEMAsNamespace2ModuleNamesWsdlGeneratorError((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/utility.pys? s           +"PK-¤Y5¼hº½DŸDŸZSI/generate/containers.py############################################################################ # Monte M. Goode, LBNL # See LBNLCopyright for copyright notice! ########################################################################### # contains text container classes for new generation generator # $Id: containers.py 1276 2006-10-23 23:18:07Z boverhof $ import types from utility import StringWriter, TextProtect, TextProtectAttributeName,\ GetPartsSubNames from utility import NamespaceAliasDict as NAD, NCName_to_ClassName as NC_to_CN import ZSI from ZSI.TC import _is_xsd_or_soap_ns from ZSI.wstools import XMLSchema, WSDLTools from ZSI.wstools.Namespaces import SCHEMA, SOAP, WSDL from ZSI.wstools.logging import getLogger as _GetLogger from ZSI.typeinterpreter import BaseTypeInterpreter from ZSI.generate import WSISpec, WSInteropError, Wsdl2PythonError,\ WsdlGeneratorError, WSDLFormatError ID1 = ' ' ID2 = 2*ID1 ID3 = 3*ID1 ID4 = 4*ID1 ID5 = 5*ID1 ID6 = 6*ID1 KW = {'ID1':ID1, 'ID2':ID2, 'ID3':ID3,'ID4':ID4, 'ID5':ID5, 'ID6':ID6,} DEC = '_Dec' DEF = '_Def' """ type_class_name -- function to return the name formatted as a type class. element_class_name -- function to return the name formatted as an element class. """ type_class_name = lambda n: '%s%s' %(NC_to_CN(n), DEF) element_class_name = lambda n: '%s%s' %(NC_to_CN(n), DEC) def IsRPC(item): """item -- OperationBinding instance. """ if not isinstance(item, WSDLTools.OperationBinding): raise TypeError, 'IsRPC takes 1 argument of type WSDLTools.OperationBinding' soapbinding = item.getBinding().findBinding(WSDLTools.SoapBinding) sob = item.findBinding(WSDLTools.SoapOperationBinding) style = soapbinding.style if sob is not None: style = sob.style or soapbinding.style return style == 'rpc' def IsLiteral(item): """item -- MessageRoleBinding instance. """ if not isinstance(item, WSDLTools.MessageRoleBinding): raise TypeError, 'IsLiteral takes 1 argument of type WSDLTools.MessageRoleBinding' sbb = None if item.type == 'input' or item.type == 'output': sbb = item.findBinding(WSDLTools.SoapBodyBinding) if sbb is None: raise ValueError, 'Missing soap:body binding.' return sbb.use == 'literal' def SetTypeNameFunc(func): global type_class_name type_class_name = func def SetElementNameFunc(func): global element_class_name element_class_name = func def GetClassNameFromSchemaItem(item,do_extended=False): ''' ''' assert isinstance(item, XMLSchema.XMLSchemaComponent), 'must be a schema item.' alias = NAD.getAlias(item.getTargetNamespace()) if item.isDefinition() is True: return '%s.%s' %(alias, NC_to_CN('%s' %type_class_name(item.getAttributeName()))) return None def FromMessageGetSimpleElementDeclaration(message): '''If message consists of one part with an element attribute, and this element is a simpleType return a string representing the python type, else return None. ''' assert isinstance(message, WSDLTools.Message), 'expecting WSDLTools.Message' if len(message.parts) == 1 and message.parts[0].element is not None: part = message.parts[0] nsuri,name = part.element wsdl = message.getWSDL() types = wsdl.types if types.has_key(nsuri) and types[nsuri].elements.has_key(name): e = types[nsuri].elements[name] if isinstance(e, XMLSchema.ElementDeclaration) is True and e.getAttribute('type'): typ = e.getAttribute('type') bt = BaseTypeInterpreter() ptype = bt.get_pythontype(typ[1], typ[0]) return ptype return None class AttributeMixIn: '''for containers that can declare attributes. Class Attributes: attribute_typecode -- typecode attribute name typecode dict built_in_refs -- attribute references that point to built-in types. Skip resolving them into attribute declarations. ''' attribute_typecode = 'self.attribute_typecode_dict' built_in_refs = [(SOAP.ENC, 'arrayType'),] def _setAttributes(self, attributes): '''parameters attributes -- a flat list of all attributes, from this list all items in attribute_typecode_dict will be generated into attrComponents. returns a list of strings representing the attribute_typecode_dict. ''' atd = self.attribute_typecode atd_list = formatted_attribute_list = [] if not attributes: return formatted_attribute_list atd_list.append('# attribute handling code') for a in attributes: if a.isWildCard() and a.isDeclaration(): atd_list.append(\ '%s[("%s","anyAttribute")] = ZSI.TC.AnyElement()'\ % (atd, SCHEMA.XSD3) ) elif a.isDeclaration(): tdef = a.getTypeDefinition('type') if tdef is not None: tc = '%s.%s(None)' %(NAD.getAlias(tdef.getTargetNamespace()), self.mangle(type_class_name(tdef.getAttributeName())) ) else: # built-in t = a.getAttribute('type') try: tc = BTI.get_typeclass(t[1], t[0]) except: # hand back a string by default. tc = ZSI.TC.String if tc is not None: tc = '%s()' %tc key = None if a.getAttribute('form') == 'qualified': key = '("%s","%s")' % ( a.getTargetNamespace(), a.getAttribute('name') ) elif a.getAttribute('form') == 'unqualified': key = '"%s"' % a.getAttribute('name') else: raise ContainerError, \ 'attribute form must be un/qualified %s' \ % a.getAttribute('form') atd_list.append(\ '%s[%s] = %s' % (atd, key, tc) ) elif a.isReference() and a.isAttributeGroup(): # flatten 'em out.... for ga in a.getAttributeGroup().getAttributeContent(): if not ga.isAttributeGroup(): attributes += (ga,) continue elif a.isReference(): try: ga = a.getAttributeDeclaration() except XMLSchema.SchemaError: key = a.getAttribute('ref') self.logger.debug('No schema item for attribute ref (%s, %s)' %key) if key in self.built_in_refs: continue raise tp = None if ga is not None: tp = ga.getTypeDefinition('type') key = '("%s","%s")' %(ga.getTargetNamespace(), ga.getAttribute('name')) if ga is None: # TODO: probably SOAPENC:arrayType key = '("%s","%s")' %( a.getAttribute('ref').getTargetNamespace(), a.getAttribute('ref').getName()) atd_list.append(\ '%s[%s] = ZSI.TC.String()' %(atd, key) ) elif tp is None: # built in simple type try: namespace,typeName = ga.getAttribute('type') except TypeError, ex: # TODO: attribute declaration could be anonymous type # hack in something to work atd_list.append(\ '%s[%s] = ZSI.TC.String()' %(atd, key) ) else: atd_list.append(\ '%s[%s] = %s()' %(atd, key, BTI.get_typeclass(typeName, namespace)) ) else: typeName = tp.getAttribute('name') namespace = tp.getTargetNamespace() alias = NAD.getAlias(namespace) key = '("%s","%s")' \ % (ga.getTargetNamespace(),ga.getAttribute('name')) atd_list.append(\ '%s[%s] = %s.%s(None)' \ % (atd, key, alias, type_class_name(typeName)) ) else: raise TypeError, 'expecting an attribute: %s' %a.getItemTrace() return formatted_attribute_list class ContainerError(Exception): pass class ContainerBase: '''Base class for all Containers. func_aname -- function that takes name, and returns aname. ''' func_aname = TextProtectAttributeName func_aname = staticmethod(func_aname) logger = _GetLogger("ContainerBase") def __init__(self): self.content = StringWriter('\n') self.__setup = False self.ns = None def __str__(self): return self.getvalue() # - string content methods def mangle(self, s): '''class/variable name illegalities ''' return TextProtect(s) def write(self, s): self.content.write(s) def writeArray(self, a): self.content.write('\n'.join(a)) def _setContent(self): '''override in subclasses. formats the content in the desired way. ''' raise NotImplementedError, 'abstract method not implemented' def getvalue(self): if not self.__setup: self._setContent() self.__setup = True return self.content.getvalue() # - namespace utility methods def getNSAlias(self): if self.ns: return NAD.getAlias(self.ns) raise ContainerError, 'no self.ns attr defined in %s' % self.__class__ def getNSModuleName(self): if self.ns: return NAD.getModuleName(self.ns) raise ContainerError, 'no self.ns attr defined in %s' % self.__class__ def getAttributeName(self, name): '''represents the aname ''' if self.func_aname is None: return name assert callable(self.func_aname), \ 'expecting callable method for attribute func_aname, not %s' %type(self.func_aname) f = self.func_aname return f(name) # -- containers for services file components class ServiceContainerBase(ContainerBase): clientClassSuffix = "SOAP" logger = _GetLogger("ServiceContainerBase") class ServiceHeaderContainer(ServiceContainerBase): imports = ['\nimport urlparse, types', 'from ZSI.TCcompound import ComplexType, Struct', 'from ZSI import client', 'import ZSI' ] logger = _GetLogger("ServiceHeaderContainer") def __init__(self, do_extended=False): ServiceContainerBase.__init__(self) self.basic = self.imports[:] self.types = None self.messages = None self.extras = [] self.do_extended = do_extended def setTypesModuleName(self, module): self.types = module def setMessagesModuleName(self, module): self.messages = module def appendImport(self, statement): '''append additional import statement(s). import_stament -- tuple or list or str ''' if type(statement) in (list,tuple): self.extras += statement else: self.extras.append(statement) def _setContent(self): if self.messages: self.write('from %s import *' % self.messages) if self.types: self.write('from %s import *' % self.types) imports = self.basic[:] imports += self.extras self.writeArray(imports) class ServiceLocatorContainer(ServiceContainerBase): logger = _GetLogger("ServiceLocatorContainer") def __init__(self): ServiceContainerBase.__init__(self) self.serviceName = None self.portInfo = [] self.locatorName = None self.portMethods = [] def setUp(self, service): assert isinstance(service, WSDLTools.Service), \ 'expecting WDSLTools.Service instance.' self.serviceName = service.name for p in service.ports: try: ab = p.getAddressBinding() except WSDLTools.WSDLError, ex: self.logger.warning('Skip port(%s), missing address binding' %p.name) continue if isinstance(ab, WSDLTools.SoapAddressBinding) is False: self.logger.warning('Skip port(%s), not a SOAP-1.1 address binding' %p.name) continue info = (p.getBinding().getPortType().name, p.getBinding().name, ab.location) self.portInfo.append(info) def getLocatorName(self): '''return class name of generated locator. ''' return self.locatorName def getPortMethods(self): '''list of get port accessor methods of generated locator class. ''' return self.portMethods def _setContent(self): if not self.serviceName: raise ContainerError, 'no service name defined!' self.serviceName = self.mangle(self.serviceName) self.locatorName = '%sLocator' %self.serviceName locator = ['# Locator', 'class %s:' %self.locatorName, ] self.portMethods = [] for p in self.portInfo: ptName = NC_to_CN(p[0]) bName = NC_to_CN(p[1]) sAdd = p[2] method = 'get%s' %ptName pI = [ '%s%s_address = "%s"' % (ID1, ptName, sAdd), '%sdef get%sAddress(self):' % (ID1, ptName), '%sreturn %sLocator.%s_address' % (ID2, self.serviceName,ptName), '%sdef %s(self, url=None, **kw):' %(ID1, method), '%sreturn %s%s(url or %sLocator.%s_address, **kw)' \ % (ID2, bName, self.clientClassSuffix, self.serviceName, ptName), ] self.portMethods.append(method) locator += pI self.writeArray(locator) class ServiceOperationContainer(ServiceContainerBase): logger = _GetLogger("ServiceOperationContainer") def __init__(self, useWSA=False, do_extended=False): '''Parameters: useWSA -- boolean, enable ws-addressing do_extended -- boolean ''' ServiceContainerBase.__init__(self) self.useWSA = useWSA self.do_extended = do_extended def hasInput(self): return self.inputName is not None def hasOutput(self): return self.outputName is not None def isRPC(self): return IsRPC(self.binding_operation) def isLiteral(self, input=True): msgrole = self.binding_operation.input if input is False: msgrole = self.binding_operation.output return IsLiteral(msgrole) def isSimpleType(self, input=True): if input is False: return self.outputSimpleType return self.inputSimpleType def getOperation(self): return self.port.operations.get(self.name) def getBOperation(self): return self.port.get(self.name) def getOperationName(self): return self.name def setUp(self, item): ''' Parameters: item -- WSDLTools BindingOperation instance. ''' if not isinstance(item, WSDLTools.OperationBinding): raise TypeError, 'Expecting WSDLTools Operation instance' if not item.input: raise WSDLFormatError('No in ' %( item.getBinding().name, item.name)) self.name = None self.port = None self.soapaction = None self.inputName = None self.outputName = None self.inputSimpleType = None self.outputSimpleType = None self.inputAction = None self.outputAction = None self.port = port = item.getBinding().getPortType() self._wsdl = item.getWSDL() self.name = name = item.name self.binding_operation = bop = item op = port.operations.get(name) if op is None: raise WSDLFormatError( ' no match for ' %( port.name, item.getBinding().name, item.name)) soap_bop = bop.findBinding(WSDLTools.SoapOperationBinding) if soap_bop is None: raise SOAPBindingError, 'expecting SOAP Bindings' self.soapaction = soap_bop.soapAction sbody = bop.input.findBinding(WSDLTools.SoapBodyBinding) if not sbody: raise SOAPBindingError('Missing ' %( port.binding.name, bop.name)) self.encodingStyle = None if sbody.use == 'encoded': assert sbody.encodingStyle == SOAP.ENC,\ 'Supporting encodingStyle=%s, not %s'%(SOAP.ENC, sbody.encodingStyle) self.encodingStyle = sbody.encodingStyle self.inputName = op.getInputMessage().name self.inputSimpleType = \ FromMessageGetSimpleElementDeclaration(op.getInputMessage()) self.inputAction = op.getInputAction() if bop.output is not None: sbody = bop.output.findBinding(WSDLTools.SoapBodyBinding) if not item.output: raise WSDLFormatError, "Operation %s, no match for output binding" %name self.outputName = op.getOutputMessage().name self.outputSimpleType = \ FromMessageGetSimpleElementDeclaration(op.getOutputMessage()) self.outputAction = op.getOutputAction() def _setContent(self): '''create string representation of operation. ''' kwstring = 'kw = {}' tCheck = 'if isinstance(request, %s) is False:' % self.inputName bindArgs = '' if self.encodingStyle is not None: bindArgs = 'encodingStyle="%s", ' %self.encodingStyle if self.useWSA: wsactionIn = 'wsaction = "%s"' % self.inputAction wsactionOut = 'wsaction = "%s"' % self.outputAction bindArgs += 'wsaction=wsaction, endPointReference=self.endPointReference, ' responseArgs = ', wsaction=wsaction' else: wsactionIn = '# no input wsaction' wsactionOut = '# no output wsaction' responseArgs = '' bindArgs += '**kw)' if self.do_extended: inputName = self.getOperation().getInputMessage().name wrap_str = "" partsList = self.getOperation().getInputMessage().parts.values() try: subNames = GetPartsSubNames(partsList, self._wsdl) except TypeError, ex: raise Wsdl2PythonError,\ "Extended generation failure: only supports doc/lit, "\ +"and all element attributes () must refer to single global "\ +"element declaration with complexType content. "\ +"\n\n**** TRY WITHOUT EXTENDED ****\n" args = [] for pa in subNames: args += pa for arg in args: wrap_str += "%srequest.%s = %s\n" % (ID2, self.getAttributeName(arg), self.mangle(arg)) #args = [pa.name for pa in self.getOperation().getInputMessage().parts.values()] argsStr = ",".join(args) if len(argsStr) > 1: # add inital comma if args exist argsStr = ", " + argsStr method = [ '%s# op: %s' % (ID1, self.getOperation().getInputMessage()), '%sdef %s(self%s):' % (ID1, self.name, argsStr), '\n%srequest = %s()' % (ID2, self.inputName), '%s' % (wrap_str), '%s%s' % (ID2, kwstring), '%s%s' % (ID2, wsactionIn), '%sself.binding.Send(None, None, request, soapaction="%s", %s'\ %(ID2, self.soapaction, bindArgs), ] else: method = [ '%s# op: %s' % (ID1, self.name), '%sdef %s(self, request):' % (ID1, self.name), '%s%s' % (ID2, tCheck), '%sraise TypeError, "%%s incorrect request type" %% (%s)' %(ID3, 'request.__class__'), '%s%s' % (ID2, kwstring), '%s%s' % (ID2, wsactionIn), '%sself.binding.Send(None, None, request, soapaction="%s", %s'\ %(ID2, self.soapaction, bindArgs), ] # # BP 1.0: rpc/literal # WSDL 1.1 Section 3.5 could be interpreted to mean the RPC response # wrapper element must be named identical to the name of the # wsdl:operation. # R2729 # # SOAP-1.1 Note: rpc/encoded # Each parameter accessor has a name corresponding to the name of the # parameter and type corresponding to the type of the parameter. The name of # the return value accessor is not significant. Likewise, the name of the struct is # not significant. However, a convention is to name it after the method name # with the string "Response" appended. # if self.outputName: response = ['%s%s' % (ID2, wsactionOut),] if self.isRPC() and not self.isLiteral(): # rpc/encoded Replace wrapper name with None response.append(\ '%stypecode = Struct(pname=None, ofwhat=%s.typecode.ofwhat, pyclass=%s.typecode.pyclass)' %( ID2, self.outputName, self.outputName) ) response.append(\ '%sresponse = self.binding.Receive(typecode%s)' %( ID2, responseArgs) ) else: response.append(\ '%sresponse = self.binding.Receive(%s.typecode%s)' %( ID2, self.outputName, responseArgs) ) if self.outputSimpleType: response.append('%sreturn %s(response)' %(ID2, self.outputName)) else: if self.do_extended: partsList = self.getOperation().getOutputMessage().parts.values() subNames = GetPartsSubNames(partsList, self._wsdl) args = [] for pa in subNames: args += pa for arg in args: response.append('%s%s = response.%s' % (ID2, self.mangle(arg), self.getAttributeName(arg)) ) margs = ",".join(args) response.append("%sreturn %s" % (ID2, margs) ) else: response.append('%sreturn response' %ID2) method += response self.writeArray(method) class ServiceOperationsClassContainer(ServiceContainerBase): ''' class variables: readerclass -- writerclass -- operationclass -- representation of each operation. ''' readerclass = None writerclass = None operationclass = ServiceOperationContainer logger = _GetLogger("ServiceOperationsClassContainer") def __init__(self, useWSA=False, do_extended=False, wsdl=None): '''Parameters: name -- binding name property -- resource properties useWSA -- boolean, enable ws-addressing name -- binding name ''' ServiceContainerBase.__init__(self) self.useWSA = useWSA self.rProp = None self.bName = None self.operations = None self.do_extended = do_extended self._wsdl = wsdl # None unless do_extended == True def setReaderClass(cls, className): '''specify a reader class name, this must be imported in service module. ''' cls.readerclass = className setReaderClass = classmethod(setReaderClass) def setWriterClass(cls, className): '''specify a writer class name, this must be imported in service module. ''' cls.writerclass = className setWriterClass = classmethod(setWriterClass) def setOperationClass(cls, className): '''specify an operation container class name. ''' cls.operationclass = className setOperationClass = classmethod(setOperationClass) def setUp(self, port): '''This method finds all SOAP Binding Operations, it will skip all bindings that are not SOAP. port -- WSDL.Port instance ''' assert isinstance(port, WSDLTools.Port), 'expecting WSDLTools Port instance' self.operations = [] self.bName = port.getBinding().name self.rProp = port.getBinding().getPortType().getResourceProperties() soap_binding = port.getBinding().findBinding(WSDLTools.SoapBinding) if soap_binding is None: raise Wsdl2PythonError,\ 'port(%s) missing WSDLTools.SoapBinding' %port.name for bop in port.getBinding().operations: soap_bop = bop.findBinding(WSDLTools.SoapOperationBinding) if soap_bop is None: self.logger.warning(\ 'Skip port(%s) operation(%s) no SOAP Binding Operation'\ %(port.name, bop.name), ) continue #soapAction = soap_bop.soapAction if bop.input is not None: soapBodyBind = bop.input.findBinding(WSDLTools.SoapBodyBinding) if soapBodyBind is None: self.logger.warning(\ 'Skip port(%s) operation(%s) Bindings(%s) not supported'\ %(port.name, bop.name, bop.extensions) ) continue op = port.getBinding().getPortType().operations.get(bop.name) if op is None: raise Wsdl2PythonError,\ 'no matching portType/Binding operation(%s)' % bop.name c = self.operationclass(useWSA=self.useWSA, do_extended=self.do_extended) c.setUp(bop) self.operations.append(c) def _setContent(self): if self.useWSA is True: ctorArgs = 'endPointReference=None, **kw' epr = 'self.endPointReference = endPointReference' else: ctorArgs = '**kw' epr = '# no ws-addressing' if self.rProp: rprop = 'kw.setdefault("ResourceProperties", ("%s","%s"))'\ %(self.rProp[0], self.rProp[1]) else: rprop = '# no resource properties' methods = [ '# Methods', 'class %s%s:' % (NC_to_CN(self.bName), self.clientClassSuffix), '%sdef __init__(self, url, %s):' % (ID1, ctorArgs), '%skw.setdefault("readerclass", %s)' % (ID2, self.readerclass), '%skw.setdefault("writerclass", %s)' % (ID2, self.writerclass), '%s%s' % (ID2, rprop), '%sself.binding = client.Binding(url=url, **kw)' %ID2, '%s%s' % (ID2,epr), ] for op in self.operations: methods += [ op.getvalue() ] self.writeArray(methods) class MessageContainerInterface: logger = _GetLogger("MessageContainerInterface") def setUp(self, port, soc, input): '''sets the attribute _simple which represents a primitive type message represents, or None if not primitive. soc -- WSDLTools.ServiceOperationContainer instance port -- WSDLTools.Port instance input-- boolean, input messasge or output message of operation. ''' raise NotImplementedError, 'Message container must implemented setUp.' class ServiceDocumentLiteralMessageContainer(ServiceContainerBase, MessageContainerInterface): logger = _GetLogger("ServiceDocumentLiteralMessageContainer") def __init__(self, do_extended=False): ServiceContainerBase.__init__(self) self.do_extended=do_extended def setUp(self, port, soc, input): content = self.content # TODO: check soapbody for part name simple = self._simple = soc.isSimpleType(soc.getOperationName()) name = soc.getOperationName() # Document/literal operation = port.getBinding().getPortType().operations.get(name) bop = port.getBinding().operations.get(name) soapBodyBind = None if input is True: soapBodyBind = bop.input.findBinding(WSDLTools.SoapBodyBinding) message = operation.getInputMessage() else: soapBodyBind = bop.output.findBinding(WSDLTools.SoapBodyBinding) message = operation.getOutputMessage() # using underlying data structure to avoid phantom problem. # parts = message.parts.data.values() # if len(parts) > 1: # raise Wsdl2PythonError, 'not suporting multi part doc/lit msgs' if len(message.parts) == 0: raise Wsdl2PythonError, 'must specify part for doc/lit msg' p = None if soapBodyBind.parts is not None: if len(soapBodyBind.parts) > 1: raise Wsdl2PythonError,\ 'not supporting multiple parts in soap body' if len(soapBodyBind.parts) == 0: return p = message.parts.get(soapBodyBind.parts[0]) # XXX: Allow for some slop p = p or message.parts[0] if p.type: raise Wsdl2PythonError, 'no doc/lit suport for ' if not p.element: return content.ns = p.element[0] content.pName = p.element[1] content.mName = message.name def _setContent(self): '''create string representation of doc/lit message container. If message element is simple(primitive), use python type as base class. ''' try: simple = self._simple except AttributeError: raise RuntimeError, 'call setUp first' # TODO: Hidden contract. Must set self.ns before getNSAlias... # File "/usr/local/python/lib/python2.4/site-packages/ZSI/generate/containers.py", line 625, in _setContent # kw['message'],kw['prefix'],kw['typecode'] = \ # File "/usr/local/python/lib/python2.4/site-packages/ZSI/generate/containers.py", line 128, in getNSAlias # raise ContainerError, 'no self.ns attr defined in %s' % self.__class__ # ZSI.generate.containers.ContainerError: no self.ns attr defined in ZSI.generate.containers.ServiceDocumentLiteralMessageContainer # self.ns = self.content.ns kw = KW.copy() kw['message'],kw['prefix'],kw['typecode'] = \ self.content.mName, self.getNSAlias(), element_class_name(self.content.pName) # These messsages are just global element declarations self.writeArray(['%(message)s = %(prefix)s.%(typecode)s().pyclass' %kw]) class ServiceRPCEncodedMessageContainer(ServiceContainerBase, MessageContainerInterface): logger = _GetLogger("ServiceRPCEncodedMessageContainer") def setUp(self, port, soc, input): ''' Instance Data: op -- WSDLTools Operation instance bop -- WSDLTools BindingOperation instance input -- boolean input/output ''' name = soc.getOperationName() bop = port.getBinding().operations.get(name) op = port.getBinding().getPortType().operations.get(name) assert op is not None, 'port has no operation %s' %name assert bop is not None, 'port has no binding operation %s' %name self.input = input self.op = op self.bop = bop def _setContent(self): try: self.op except AttributeError: raise RuntimeError, 'call setUp first' pname = self.op.name msgRole = self.op.input msgRoleB = self.bop.input if self.input is False: pname = '%sResponse' %self.op.name msgRole = self.op.output msgRoleB = self.bop.output sbody = msgRoleB.findBinding(WSDLTools.SoapBodyBinding) if not sbody or not sbody.namespace: raise WSInteropError, WSISpec.R2717 assert sbody.use == 'encoded', 'Expecting use=="encoded"' encodingStyle = sbody.encodingStyle assert encodingStyle == SOAP.ENC,\ 'Supporting encodingStyle=%s, not %s' %(SOAP.ENC, encodingStyle) namespace = sbody.namespace tcb = MessageTypecodeContainer(\ tuple(msgRole.getMessage().parts.list), ) ofwhat = '[%s]' %tcb.getTypecodeList() pyclass = msgRole.getMessage().name fdict = KW.copy() fdict['nspname'] = sbody.namespace fdict['pname'] = pname fdict['pyclass'] = None fdict['ofwhat'] = ofwhat fdict['encoded'] = namespace #if self.input is False: # fdict['typecode'] = \ # 'Struct(pname=None, ofwhat=%(ofwhat)s, pyclass=%(pyclass)s, encoded="%(encoded)s")' #else: fdict['typecode'] = \ 'Struct(pname=("%(nspname)s","%(pname)s"), ofwhat=%(ofwhat)s, pyclass=%(pyclass)s, encoded="%(encoded)s")' message = ['class %(pyclass)s:', '%(ID1)sdef __init__(self):'] for aname in tcb.getAttributeNames(): message.append('%(ID2)sself.' + aname +' = None') message.append('%(ID2)sreturn') # TODO: This isn't a TypecodeContainerBase instance but it # certaintly generates a pyclass and typecode. #if self.metaclass is None: if TypecodeContainerBase.metaclass is None: fdict['pyclass'] = pyclass fdict['typecode'] = fdict['typecode'] %fdict message.append('%(pyclass)s.typecode = %(typecode)s') else: # Need typecode to be available when class is constructed. fdict['typecode'] = fdict['typecode'] %fdict fdict['pyclass'] = pyclass fdict['metaclass'] = TypecodeContainerBase.metaclass message.insert(0, '_%(pyclass)sTypecode = %(typecode)s') message.insert(2, '%(ID1)stypecode = _%(pyclass)sTypecode') message.insert(3, '%(ID1)s__metaclass__ = %(metaclass)s') message.append('%(pyclass)s.typecode.pyclass = %(pyclass)s') self.writeArray(map(lambda l: l %fdict, message)) class ServiceRPCLiteralMessageContainer(ServiceContainerBase, MessageContainerInterface): logger = _GetLogger("ServiceRPCLiteralMessageContainer") def setUp(self, port, soc, input): ''' Instance Data: op -- WSDLTools Operation instance bop -- WSDLTools BindingOperation instance input -- boolean input/output ''' name = soc.getOperationName() bop = port.getBinding().operations.get(name) op = port.getBinding().getPortType().operations.get(name) assert op is not None, 'port has no operation %s' %name assert bop is not None, 'port has no binding operation %s' %name self.op = op self.bop = bop self.input = input def _setContent(self): try: self.op except AttributeError: raise RuntimeError, 'call setUp first' operation = self.op input = self.input pname = operation.name msgRole = operation.input msgRoleB = self.bop.input if input is False: pname = '%sResponse' %operation.name msgRole = operation.output msgRoleB = self.bop.output sbody = msgRoleB.findBinding(WSDLTools.SoapBodyBinding) if not sbody or not sbody.namespace: raise WSInteropError, WSISpec.R2717 namespace = sbody.namespace tcb = MessageTypecodeContainer(\ tuple(msgRole.getMessage().parts.list), ) ofwhat = '[%s]' %tcb.getTypecodeList() pyclass = msgRole.getMessage().name fdict = KW.copy() fdict['nspname'] = sbody.namespace fdict['pname'] = pname fdict['pyclass'] = None fdict['ofwhat'] = ofwhat fdict['encoded'] = namespace fdict['typecode'] = \ 'Struct(pname=("%(nspname)s","%(pname)s"), ofwhat=%(ofwhat)s, pyclass=%(pyclass)s, encoded="%(encoded)s")' message = ['class %(pyclass)s:', '%(ID1)sdef __init__(self):'] for aname in tcb.getAttributeNames(): message.append('%(ID2)sself.' + aname +' = None') message.append('%(ID2)sreturn') # TODO: This isn't a TypecodeContainerBase instance but it # certaintly generates a pyclass and typecode. #if self.metaclass is None: if TypecodeContainerBase.metaclass is None: fdict['pyclass'] = pyclass fdict['typecode'] = fdict['typecode'] %fdict message.append('%(pyclass)s.typecode = %(typecode)s') else: # Need typecode to be available when class is constructed. fdict['typecode'] = fdict['typecode'] %fdict fdict['pyclass'] = pyclass fdict['metaclass'] = TypecodeContainerBase.metaclass message.insert(0, '_%(pyclass)sTypecode = %(typecode)s') message.insert(2, '%(ID1)stypecode = _%(pyclass)sTypecode') message.insert(3, '%(ID1)s__metaclass__ = %(metaclass)s') message.append('%(pyclass)s.typecode.pyclass = %(pyclass)s') self.writeArray(map(lambda l: l %fdict, message)) TypesContainerBase = ContainerBase class TypesHeaderContainer(TypesContainerBase): '''imports for all generated types modules. ''' imports = [ 'import ZSI', 'import ZSI.TCcompound', 'from ZSI.schema import LocalElementDeclaration, ElementDeclaration, TypeDefinition, GTD, GED', ] logger = _GetLogger("TypesHeaderContainer") def _setContent(self): self.writeArray(TypesHeaderContainer.imports) NamespaceClassContainerBase = TypesContainerBase class NamespaceClassHeaderContainer(NamespaceClassContainerBase): logger = _GetLogger("NamespaceClassHeaderContainer") def _setContent(self): head = [ '#' * 30, '# targetNamespace', '# %s' % self.ns, '#' * 30 + '\n', 'class %s:' % self.getNSAlias(), '%stargetNamespace = "%s"' % (ID1, self.ns) ] self.writeArray(head) class NamespaceClassFooterContainer(NamespaceClassContainerBase): logger = _GetLogger("NamespaceClassFooterContainer") def _setContent(self): foot = [ '# end class %s (tns: %s)' % (self.getNSAlias(), self.ns), ] self.writeArray(foot) BTI = BaseTypeInterpreter() class TypecodeContainerBase(TypesContainerBase): '''Base class for all classes representing anything with element content. class variables: mixed_content_aname -- text content will be placed in this attribute. attributes_aname -- attributes will be placed in this attribute. metaclass -- set this attribute to specify a pyclass __metaclass__ ''' mixed_content_aname = 'text' attributes_aname = 'attrs' metaclass = None lazy = False logger = _GetLogger("TypecodeContainerBase") def __init__(self, do_extended=False, extPyClasses=None): TypesContainerBase.__init__(self) self.name = None # attrs for model groups and others with elements, tclists, etc... self.allOptional = False self.mgContent = None self.contentFlattened = False self.elementAttrs = [] self.tcListElements = [] self.tcListSet = False self.localTypes = [] # used when processing nested anonymous types self.parentClass = None # used when processing attribute content self.mixed = False self.extraFlags = '' self.attrComponents = None # --> EXTENDED # Used if an external pyclass was specified for this type. self.do_extended = do_extended if extPyClasses is None: self.extPyClasses = {} else: self.extPyClasses = extPyClasses # <-- def getvalue(self): out = ContainerBase.getvalue(self) for item in self.localTypes: content = None assert True is item.isElement() is item.isLocal(), 'expecting local elements only' etp = item.content qName = item.getAttribute('type') if not qName: etp = item.content local = True else: etp = item.getTypeDefinition('type') if etp is None: if local is True: content = ElementLocalComplexTypeContainer(do_extended=self.do_extended) else: content = ElementSimpleTypeContainer() elif etp.isLocal() is False: content = ElementGlobalDefContainer() elif etp.isSimple() is True: content = ElementLocalSimpleTypeContainer() elif etp.isComplex(): content = ElementLocalComplexTypeContainer(do_extended=self.do_extended) else: raise Wsdl2PythonError, "Unknown element declaration: %s" %item.getItemTrace() content.setUp(item) out += '\n\n' if self.parentClass: content.parentClass = \ '%s.%s' %(self.parentClass, self.getClassName()) else: content.parentClass = '%s.%s' %(self.getNSAlias(), self.getClassName()) for l in content.getvalue().split('\n'): if l: out += '%s%s\n' % (ID1, l) else: out += '\n' out += '\n\n' return out def getAttributeName(self, name): '''represents the aname ''' if self.func_aname is None: return name assert callable(self.func_aname), \ 'expecting callable method for attribute func_aname, not %s' %type(self.func_aname) f = self.func_aname return f(name) def getMixedTextAName(self): '''returns an aname representing mixed text content. ''' return self.getAttributeName(self.mixed_content_aname) def getClassName(self): if not self.name: raise ContainerError, 'self.name not defined!' if not hasattr(self.__class__, 'type'): raise ContainerError, 'container type not defined!' #suffix = self.__class__.type if self.__class__.type == DEF: classname = type_class_name(self.name) elif self.__class__.type == DEC: classname = element_class_name(self.name) return self.mangle( classname ) # --> EXTENDED def hasExtPyClass(self): if self.name in self.extPyClasses: return True else: return False # <-- def getPyClass(self): '''Name of generated inner class that will be specified as pyclass. ''' # --> EXTENDED if self.hasExtPyClass(): classInfo = self.extPyClasses[self.name] return ".".join(classInfo) # <-- return 'Holder' def getPyClassDefinition(self): '''Return a list containing pyclass definition. ''' kw = KW.copy() # --> EXTENDED if self.hasExtPyClass(): classInfo = self.extPyClasses[self.name] kw['classInfo'] = classInfo[0] return ["%(ID3)simport %(classInfo)s" %kw ] # <-- kw['pyclass'] = self.getPyClass() definition = [] definition.append('%(ID3)sclass %(pyclass)s:' %kw) if self.metaclass is not None: kw['type'] = self.metaclass definition.append('%(ID4)s__metaclass__ = %(type)s' %kw) definition.append('%(ID4)stypecode = self' %kw) #TODO: Remove pyclass holder __init__ --> definition.append('%(ID4)sdef __init__(self):' %kw) definition.append('%(ID5)s# pyclass' %kw) # JRB HACK need to call _setElements via getElements self._setUpElements() # JRB HACK need to indent additional one level for el in self.elementAttrs: kw['element'] = el definition.append('%(ID2)s%(element)s' %kw) definition.append('%(ID5)sreturn' %kw) # <-- # pyclass descriptive name if self.name is not None: kw['name'] = self.name definition.append(\ '%(ID3)s%(pyclass)s.__name__ = "%(name)s_Holder"' %kw ) return definition def nsuriLogic(self): '''set a variable "ns" that represents the targetNamespace in which this item is defined. Used for namespacing local elements. ''' if self.parentClass: return 'ns = %s.%s.schema' %(self.parentClass, self.getClassName()) return 'ns = %s.%s.schema' %(self.getNSAlias(), self.getClassName()) def schemaTag(self): if self.ns is not None: return 'schema = "%s"' % self.ns raise ContainerError, 'failed to set schema targetNamespace(%s)' %(self.__class__) def typeTag(self): if self.name is not None: return 'type = (schema, "%s")' % self.name raise ContainerError, 'failed to set type name(%s)' %(self.__class__) def literalTag(self): if self.name is not None: return 'literal = "%s"' % self.name raise ContainerError, 'failed to set element name(%s)' %(self.__class__) def getExtraFlags(self): if self.mixed: self.extraFlags += 'mixed=True, mixed_aname="%s", ' %self.getMixedTextAName() return self.extraFlags def simpleConstructor(self, superclass=None): if superclass: return '%s.__init__(self, **kw)' % superclass else: return 'def __init__(self, **kw):' def pnameConstructor(self, superclass=None): if superclass: return '%s.__init__(self, pname, **kw)' % superclass else: return 'def __init__(self, pname, **kw):' def _setUpElements(self): """TODO: Remove this method This method ONLY sets up the instance attributes. Dependency instance attribute: mgContent -- expected to be either a complex definition with model group content, a model group, or model group content. TODO: should only support the first two. """ self.logger.debug("_setUpElements: %s" %self._item.getItemTrace()) if hasattr(self, '_done'): #return '\n'.join(self.elementAttrs) return self._done = True flat = [] content = self.mgContent if type(self.mgContent) is not tuple: mg = self.mgContent if not mg.isModelGroup(): mg = mg.content content = mg.content if mg.isAll(): flat = content content = [] elif mg.isModelGroup() and mg.isDefinition(): mg = mg.content content = mg.content idx = 0 content = list(content) while idx < len(content): c = orig = content[idx] if c.isElement(): flat.append(c) idx += 1 continue if c.isReference() and c.isModelGroup(): c = c.getModelGroupReference() if c.isDefinition() and c.isModelGroup(): c = c.content if c.isSequence() or c.isChoice(): begIdx = idx endIdx = begIdx + len(c.content) for i in range(begIdx, endIdx): content.insert(i, c.content[i-begIdx]) content.remove(orig) continue raise ContainerError, 'unexpected schema item: %s' %c.getItemTrace() for c in flat: if c.isDeclaration() and c.isElement(): defaultValue = "None" parent = c defs = [] # stop recursion via global ModelGroupDefinition while defs.count(parent) <= 1: maxOccurs = parent.getAttribute('maxOccurs') if maxOccurs == 'unbounded' or int(maxOccurs) > 1: defaultValue = "[]" break parent = parent._parent() if not parent.isModelGroup(): break if parent.isReference(): parent = parent.getModelGroupReference() if parent.isDefinition(): parent = parent.content defs.append(parent) if None == c.getAttribute('name') and c.isWildCard(): e = '%sself.%s = %s' %(ID3, self.getAttributeName('any'), defaultValue) else: e = '%sself.%s = %s' %(ID3, self.getAttributeName(c.getAttribute('name')), defaultValue) self.elementAttrs.append(e) continue # TODO: This seems wrong if c.isReference(): e = '%sself._%s = None' %(ID3, self.mangle(c.getAttribute('ref')[1])) self.elementAttrs.append(e) continue raise ContainerError, 'unexpected item: %s' % c.getItemTrace() #return '\n'.join(self.elementAttrs) return def _setTypecodeList(self): """generates ofwhat content, minOccurs/maxOccurs facet generation. Dependency instance attribute: mgContent -- expected to be either a complex definition with model group content, a model group, or model group content. TODO: should only support the first two. localTypes -- produce local class definitions later tcListElements -- elements, local/global """ self.logger.debug("_setTypecodeList(%r): %s" % (self.mgContent, self._item.getItemTrace())) flat = [] content = self.mgContent #TODO: too much slop permitted here, impossible # to tell what is going on. if type(content) is not tuple: mg = content if not mg.isModelGroup(): raise Wsdl2PythonErr("Expecting ModelGroup: %s" % mg.getItemTrace()) self.logger.debug("ModelGroup(%r) contents(%r): %s" % (mg, mg.content, mg.getItemTrace())) # if mg.isReference(): raise RuntimeError("Unexpected modelGroup reference: %s" % mg.getItemTrace()) # if mg.isDefinition(): mg = mg.content if mg.isAll(): flat = mg.content content = [] elif mg.isSequence(): content = mg.content elif mg.isChoice(): content = mg.content else: raise RuntimeError("Unknown schema item") idx = 0 content = list(content) self.logger.debug("content: %r" %content) while idx < len(content): c = orig = content[idx] if c.isElement(): flat.append(c) idx += 1 continue if c.isReference() and c.isModelGroup(): c = c.getModelGroupReference() if c.isDefinition() and c.isModelGroup(): c = c.content if c.isSequence() or c.isChoice(): begIdx = idx endIdx = begIdx + len(c.content) for i in range(begIdx, endIdx): content.insert(i, c.content[i-begIdx]) content.remove(orig) continue raise ContainerError, 'unexpected schema item: %s' %c.getItemTrace() # TODO: Need to store "parents" in a dict[id] = list(), # because cannot follow references, but not currently # a big concern. self.logger.debug("flat: %r" %list(flat)) for c in flat: tc = TcListComponentContainer() # TODO: Remove _getOccurs min,max,nil = self._getOccurs(c) min = max = None maxOccurs = 1 parent = c defs = [] # stop recursion via global ModelGroupDefinition while defs.count(parent) <= 1: max = parent.getAttribute('maxOccurs') if max == 'unbounded': maxOccurs = '"%s"' %max break maxOccurs = int(max) * maxOccurs parent = parent._parent() if not parent.isModelGroup(): break if parent.isReference(): parent = parent.getModelGroupReference() if parent.isDefinition(): parent = parent.content defs.append(parent) del defs parent = c while 1: minOccurs = int(parent.getAttribute('minOccurs')) if minOccurs == 0 or parent.isChoice(): minOccurs = 0 break parent = parent._parent() if not parent.isModelGroup(): minOccurs = int(c.getAttribute('minOccurs')) break if parent.isReference(): parent = parent.getModelGroupReference() if parent.isDefinition(): parent = parent.content tc.setOccurs(minOccurs, maxOccurs, nil) processContents = self._getProcessContents(c) tc.setProcessContents(processContents) if c.isDeclaration() and c.isElement(): global_type = c.getAttribute('type') content = getattr(c, 'content', None) if c.isLocal() and c.isQualified() is False: tc.unQualified() if c.isWildCard(): tc.setStyleAnyElement() elif global_type is not None: tc.name = c.getAttribute('name') ns = global_type[0] if ns in SCHEMA.XSD_LIST: tpc = BTI.get_typeclass(global_type[1],global_type[0]) tc.klass = tpc # elif (self.ns,self.name) == global_type: # # elif self._isRecursiveElement(c) # # TODO: Remove this, it only works for 1 level. # tc.setStyleRecursion() else: tc.setGlobalType(*global_type) # tc.klass = '%s.%s' % (NAD.getAlias(ns), # type_class_name(global_type[1])) del ns elif content is not None and content.isLocal() and content.isComplex(): tc.name = c.getAttribute('name') tc.klass = 'self.__class__.%s' % (element_class_name(tc.name)) #TODO: Not an element reference, confusing nomenclature tc.setStyleElementReference() self.localTypes.append(c) elif content is not None and content.isLocal() and content.isSimple(): # Local Simple Type tc.name = c.getAttribute('name') tc.klass = 'self.__class__.%s' % (element_class_name(tc.name)) #TODO: Not an element reference, confusing nomenclature tc.setStyleElementReference() self.localTypes.append(c) else: raise ContainerError, 'unexpected item: %s' % c.getItemTrace() elif c.isReference(): # element references ref = c.getAttribute('ref') # tc.klass = '%s.%s' % (NAD.getAlias(ref[0]), # element_class_name(ref[1]) ) tc.setStyleElementReference() tc.setGlobalType(*ref) else: raise ContainerError, 'unexpected item: %s' % c.getItemTrace() self.tcListElements.append(tc) def getTypecodeList(self): if not self.tcListSet: # self._flattenContent() self._setTypecodeList() self.tcListSet = True list = [] for e in self.tcListElements: list.append(str(e)) return ', '.join(list) # the following _methods() are utility methods used during # TCList generation, et al. def _getOccurs(self, e): nillable = e.getAttribute('nillable') if nillable == 'true': nillable = True else: nillable = False maxOccurs = e.getAttribute('maxOccurs') if maxOccurs == 'unbounded': maxOccurs = '"%s"' %maxOccurs minOccurs = e.getAttribute('minOccurs') if self.allOptional is True: #JRB Hack minOccurs = '0' maxOccurs = '"unbounded"' return minOccurs,maxOccurs,nillable def _getProcessContents(self, e): processContents = e.getAttribute('processContents') return processContents def getBasesLogic(self, indent): try: prefix = NAD.getAlias(self.sKlassNS) except WsdlGeneratorError, ex: # XSD or SOAP raise bases = [] bases.append(\ 'if %s.%s not in %s.%s.__bases__:'\ %(NAD.getAlias(self.sKlassNS), type_class_name(self.sKlass), self.getNSAlias(), self.getClassName()), ) bases.append(\ '%sbases = list(%s.%s.__bases__)'\ %(ID1,self.getNSAlias(),self.getClassName()), ) bases.append(\ '%sbases.insert(0, %s.%s)'\ %(ID1,NAD.getAlias(self.sKlassNS), type_class_name(self.sKlass) ), ) bases.append(\ '%s%s.%s.__bases__ = tuple(bases)'\ %(ID1, self.getNSAlias(), self.getClassName()) ) s = '' for b in bases: s += '%s%s\n' % (indent, b) return s class MessageTypecodeContainer(TypecodeContainerBase): '''Used for RPC style messages, where we have serveral parts serialized within a rpc wrapper name. ''' logger = _GetLogger("MessageTypecodeContainer") def __init__(self, parts=None): TypecodeContainerBase.__init__(self) self.mgContent = parts def _getOccurs(self, e): '''return a 3 item tuple ''' minOccurs = maxOccurs = '1' nillable = True return minOccurs,maxOccurs,nillable def _setTypecodeList(self): self.logger.debug("_setTypecodeList: %s" % str(self.mgContent)) assert type(self.mgContent) is tuple,\ 'expecting tuple for mgContent not: %s' %type(self.mgContent) for p in self.mgContent: # JRB # not sure what needs to be set for tc, this should be # the job of the constructor or a setUp method. min,max,nil = self._getOccurs(p) if p.element: raise WSInteropError, WSISpec.R2203 elif p.type: nsuri,name = p.type tc = RPCMessageTcListComponentContainer(qualified=False) tc.setOccurs(min, max, nil) tc.name = p.name if nsuri in SCHEMA.XSD_LIST: tpc = BTI.get_typeclass(name, nsuri) tc.klass = tpc else: tc.klass = '%s.%s' % (NAD.getAlias(nsuri), type_class_name(name) ) else: raise ContainerError, 'part must define an element or type attribute' self.tcListElements.append(tc) def getTypecodeList(self): if not self.tcListSet: self._setTypecodeList() self.tcListSet = True list = [] for e in self.tcListElements: list.append(str(e)) return ', '.join(list) def getAttributeNames(self): '''returns a list of anames representing the parts of the message. ''' return map(lambda e: self.getAttributeName(e.name), self.tcListElements) def setParts(self, parts): self.mgContent = parts class TcListComponentContainer(ContainerBase): '''Encapsulates a single value in the TClist list. it inherits TypecodeContainerBase only to get the mangle() method, it does not call the baseclass ctor. TODO: Change this inheritance scheme. ''' logger = _GetLogger("TcListComponentContainer") def __init__(self, qualified=True): ''' qualified -- qualify element. All GEDs should be qualified, but local element declarations qualified if form attribute is qualified, else they are unqualified. Only relevant for standard style. ''' #TypecodeContainerBase.__init__(self) ContainerBase.__init__(self) self.qualified = qualified self.name = None self.klass = None self.global_type = None self.min = None self.max = None self.nil = None self.style = None self.setStyleElementDeclaration() def setOccurs(self, min, max, nil): self.min = min self.max = max self.nil = nil def setProcessContents(self, processContents): self.processContents = processContents def setGlobalType(self, namespace, name): self.global_type = (namespace, name) def setStyleElementDeclaration(self): '''set the element style. standard -- GED or local element ''' self.style = 'standard' def setStyleElementReference(self): '''set the element style. ref -- element reference ''' self.style = 'ref' def setStyleAnyElement(self): '''set the element style. anyElement -- element wildcard ''' self.name = 'any' self.style = 'anyElement' # def setStyleRecursion(self): # '''TODO: Remove. good for 1 level # ''' # self.style = 'recursion' def unQualified(self): '''Do not qualify element. ''' self.qualified = False def _getOccurs(self): return 'minOccurs=%s, maxOccurs=%s, nillable=%s' \ % (self.min, self.max, self.nil) def _getProcessContents(self): return 'processContents="%s"' \ % (self.processContents) def _getvalue(self): kw = {'occurs':self._getOccurs(), 'aname':self.getAttributeName(self.name), 'klass':self.klass, 'lazy':TypecodeContainerBase.lazy, 'typed':'typed=False', 'encoded':'encoded=kw.get("encoded")'} gt = self.global_type if gt is not None: kw['nsuri'],kw['type'] = gt if self.style == 'standard': kw['pname'] = '"%s"' %self.name if self.qualified is True: kw['pname'] = '(ns,"%s")' %self.name if gt is None: return '%(klass)s(pname=%(pname)s, aname="%(aname)s", %(occurs)s, %(typed)s, %(encoded)s)' %kw return 'GTD("%(nsuri)s","%(type)s",lazy=%(lazy)s)(pname=%(pname)s, aname="%(aname)s", %(occurs)s, %(typed)s, %(encoded)s)' %kw if self.style == 'ref': if gt is None: return '%(klass)s(%(occurs)s, %(encoded)s)' %kw return 'GED("%(nsuri)s","%(type)s",lazy=%(lazy)s, isref=True)(%(occurs)s, %(encoded)s)' %kw kw['process'] = self._getProcessContents() if self.style == 'anyElement': return 'ZSI.TC.AnyElement(aname="%(aname)s", %(occurs)s, %(process)s)' %kw # if self.style == 'recursion': # return 'ZSI.TC.AnyElement(aname="%(aname)s", %(occurs)s, %(process)s)' %kw raise RuntimeError, 'Must set style for typecode list generation' def __str__(self): return self._getvalue() class RPCMessageTcListComponentContainer(TcListComponentContainer): '''Container for rpc/literal rpc/encoded message typecode. ''' logger = _GetLogger("RPCMessageTcListComponentContainer") def __init__(self, qualified=True, encoded=None): ''' encoded -- encoded namespaceURI, if None treat as rpc/literal. ''' TcListComponentContainer.__init__(self, qualified=qualified) self._encoded = encoded def _getvalue(self): encoded = self._encoded if encoded is not None: encoded = '"%s"' %self._encoded if self.style == 'standard': pname = '"%s"' %self.name if self.qualified is True: pname = '(ns,"%s")' %self.name return '%s(pname=%s, aname="%s", typed=False, encoded=%s, %s)' \ %(self.klass, pname, self.getAttributeName(self.name), encoded, self._getOccurs()) elif self.style == 'ref': return '%s(encoded=%s, %s)' % (self.klass, encoded, self._getOccurs()) elif self.style == 'anyElement': return 'ZSI.TC.AnyElement(aname="%s", %s, %s)' \ %(self.getAttributeName(self.name), self._getOccurs(), self._getProcessContents()) # elif self.style == 'recursion': # return 'ZSI.TC.AnyElement(aname="%s", %s, %s)' \ # % (self.getAttributeName(self.name), self._getOccurs(), self._getProcessContents()) raise RuntimeError('Must set style(%s) for typecode list generation' % self.style) class ElementSimpleTypeContainer(TypecodeContainerBase): type = DEC logger = _GetLogger("ElementSimpleTypeContainer") def _setContent(self): aname = self.getAttributeName(self.name) pyclass = self.pyclass # bool cannot be subclassed if pyclass == 'bool': pyclass = 'int' kw = KW.copy() kw.update(dict(aname=aname, ns=self.ns, name=self.name, subclass=self.sKlass,literal=self.literalTag(), schema=self.schemaTag(), init=self.simpleConstructor(), klass=self.getClassName(), element="ElementDeclaration")) if self.local: kw['element'] = 'LocalElementDeclaration' element = map(lambda i: i %kw, [ '%(ID1)sclass %(klass)s(%(subclass)s, %(element)s):', '%(ID2)s%(literal)s', '%(ID2)s%(schema)s', '%(ID2)s%(init)s', '%(ID3)skw["pname"] = ("%(ns)s","%(name)s")', '%(ID3)skw["aname"] = "%(aname)s"', ] ) # TODO: What about getPyClass and getPyClassDefinition? # I want to add pyclass metaclass here but this needs to be # corrected first. # # anyType (?others) has no pyclass. app = element.append if pyclass is not None: app('%sclass IHolder(%s): typecode=self' % (ID3, pyclass),) app('%skw["pyclass"] = IHolder' %(ID3),) app('%sIHolder.__name__ = "%s_immutable_holder"' %(ID3, aname),) app('%s%s' % (ID3, self.simpleConstructor(self.sKlass)),) self.writeArray(element) def setUp(self, tp): self._item = tp self.local = tp.isLocal() try: self.name = tp.getAttribute('name') self.ns = tp.getTargetNamespace() qName = tp.getAttribute('type') except Exception, ex: raise Wsdl2PythonError('Error occured processing element: %s' %( tp.getItemTrace()), *ex.args) if qName is None: raise Wsdl2PythonError('Missing QName for element type attribute: %s' %tp.getItemTrace()) tns,local = qName.getTargetNamespace(),qName.getName() self.sKlass = BTI.get_typeclass(local, tns) if self.sKlass is None: raise Wsdl2PythonError('No built-in typecode for type definition("%s","%s"): %s' %(tns,local,tp.getItemTrace())) try: self.pyclass = BTI.get_pythontype(None, None, typeclass=self.sKlass) except Exception, ex: raise Wsdl2PythonError('Error occured processing element: %s' %( tp.getItemTrace()), *ex.args) class ElementLocalSimpleTypeContainer(TypecodeContainerBase): '''local simpleType container ''' type = DEC logger = _GetLogger("ElementLocalSimpleTypeContainer") def _setContent(self): kw = KW.copy() kw.update(dict(aname=self.getAttributeName(self.name), ns=self.ns, name=self.name, subclass=self.sKlass,literal=self.literalTag(), schema=self.schemaTag(), init=self.simpleConstructor(), klass=self.getClassName(), element="ElementDeclaration", baseinit=self.simpleConstructor(self.sKlass))) if self.local: kw['element'] = 'LocalElementDeclaration' element = map(lambda i: i %kw, [ '%(ID1)sclass %(klass)s(%(subclass)s, %(element)s):', '%(ID2)s%(literal)s', '%(ID2)s%(schema)s', '%(ID2)s%(init)s', '%(ID3)skw["pname"] = ("%(ns)s","%(name)s")', '%(ID3)skw["aname"] = "%(aname)s"', '%(ID3)s%(baseinit)s', ] ) self.writeArray(element) def setUp(self, tp): self._item = tp assert tp.isElement() is True and tp.content is not None and \ tp.content.isLocal() is True and tp.content.isSimple() is True ,\ 'expecting local simple type: %s' %tp.getItemTrace() self.local = tp.isLocal() self.name = tp.getAttribute('name') self.ns = tp.getTargetNamespace() content = tp.content.content if content.isRestriction(): try: base = content.getTypeDefinition() except XMLSchema.SchemaError, ex: base = None qName = content.getAttributeBase() if base is None: self.sKlass = BTI.get_typeclass(qName[1], qName[0]) return raise Wsdl2PythonError, 'unsupported local simpleType restriction: %s' \ %tp.content.getItemTrace() if content.isList(): try: base = content.getTypeDefinition() except XMLSchema.SchemaError, ex: base = None if base is None: qName = content.getItemType() self.sKlass = BTI.get_typeclass(qName[1], qName[0]) return raise Wsdl2PythonError, 'unsupported local simpleType List: %s' \ %tp.content.getItemTrace() if content.isUnion(): raise Wsdl2PythonError, 'unsupported local simpleType Union: %s' \ %tp.content.getItemTrace() raise Wsdl2PythonError, 'unexpected schema item: %s' \ %tp.content.getItemTrace() class ElementLocalComplexTypeContainer(TypecodeContainerBase, AttributeMixIn): type = DEC logger = _GetLogger("ElementLocalComplexTypeContainer") def _setContent(self): kw = KW.copy() try: kw.update(dict(klass=self.getClassName(), subclass='ZSI.TCcompound.ComplexType', element='ElementDeclaration', literal=self.literalTag(), schema=self.schemaTag(), init=self.simpleConstructor(), ns=self.ns, name=self.name, aname=self.getAttributeName(self.name), nsurilogic=self.nsuriLogic(), ofwhat=self.getTypecodeList(), atypecode=self.attribute_typecode, pyclass=self.getPyClass(), )) except Exception, ex: args = ['Failure processing an element w/local complexType: %s' %( self._item.getItemTrace())] args += ex.args ex.args = tuple(args) raise if self.local: kw['element'] = 'LocalElementDeclaration' element = [ '%(ID1)sclass %(klass)s(%(subclass)s, %(element)s):', '%(ID2)s%(literal)s', '%(ID2)s%(schema)s', '%(ID2)s%(init)s', '%(ID3)s%(nsurilogic)s', '%(ID3)sTClist = [%(ofwhat)s]', '%(ID3)skw["pname"] = ("%(ns)s","%(name)s")', '%(ID3)skw["aname"] = "%(aname)s"', '%(ID3)s%(atypecode)s = {}', '%(ID3)sZSI.TCcompound.ComplexType.__init__(self,None,TClist,inorder=0,**kw)', ] for l in self.attrComponents: element.append('%(ID3)s'+str(l)) element += self.getPyClassDefinition() element.append('%(ID3)sself.pyclass = %(pyclass)s' %kw) self.writeArray(map(lambda l: l %kw, element)) def setUp(self, tp): ''' {'xsd':['annotation', 'simpleContent', 'complexContent',\ 'group', 'all', 'choice', 'sequence', 'attribute', 'attributeGroup',\ 'anyAttribute', 'any']} ''' # # TODO: Need a Recursive solution, this is incomplete will ignore many # extensions, restrictions, etc. # self._item = tp # JRB HACK SUPPORTING element/no content. assert tp.isElement() is True and \ (tp.content is None or (tp.content.isComplex() is True and tp.content.isLocal() is True)),\ 'expecting element w/local complexType not: %s' %tp.content.getItemTrace() self.name = tp.getAttribute('name') self.ns = tp.getTargetNamespace() self.local = tp.isLocal() complex = tp.content # JRB HACK SUPPORTING element/no content. if complex is None: self.mgContent = () return #attributeContent = complex.getAttributeContent() #self.mgContent = None if complex.content is None: self.mgContent = () self.attrComponents = self._setAttributes(complex.getAttributeContent()) return is_simple = complex.content.isSimple() if is_simple and complex.content.content.isExtension(): # TODO: Not really supported just passing thru self.mgContent = () self.attrComponents = self._setAttributes(complex.getAttributeContent()) return if is_simple and complex.content.content.isRestriction(): # TODO: Not really supported just passing thru self.mgContent = () self.attrComponents = self._setAttributes(complex.getAttributeContent()) return if is_simple: raise ContainerError, 'not implemented local complexType/simpleContent: %s'\ %tp.getItemTrace() is_complex = complex.content.isComplex() if is_complex and complex.content.content is None: # TODO: Recursion... self.mgContent = () self.attrComponents = self._setAttributes(complex.getAttributeContent()) return if (is_complex and complex.content.content.isExtension() and complex.content.content.content is not None and complex.content.content.content.isModelGroup()): self.mgContent = complex.content.content.content.content self.attrComponents = self._setAttributes( complex.content.content.getAttributeContent() ) return if (is_complex and complex.content.content.isRestriction() and complex.content.content.content is not None and complex.content.content.content.isModelGroup()): self.mgContent = complex.content.content.content.content self.attrComponents = self._setAttributes( complex.content.content.getAttributeContent() ) return if is_complex: self.mgContent = () self.attrComponents = self._setAttributes(complex.getAttributeContent()) return if complex.content.isModelGroup(): self.mgContent = complex.content.content self.attrComponents = self._setAttributes(complex.getAttributeContent()) return # TODO: Scary Fallthru self.mgContent = () self.attrComponents = self._setAttributes(complex.getAttributeContent()) class ElementGlobalDefContainer(TypecodeContainerBase): type = DEC logger = _GetLogger("ElementGlobalDefContainer") def _setContent(self): '''GED defines element name, so also define typecode aname ''' kw = KW.copy() try: kw.update(dict(klass=self.getClassName(), element='ElementDeclaration', literal=self.literalTag(), schema=self.schemaTag(), init=self.simpleConstructor(), ns=self.ns, name=self.name, aname=self.getAttributeName(self.name), baseslogic=self.getBasesLogic(ID3), #ofwhat=self.getTypecodeList(), #atypecode=self.attribute_typecode, #pyclass=self.getPyClass(), alias=NAD.getAlias(self.sKlassNS), subclass=type_class_name(self.sKlass), )) except Exception, ex: args = ['Failure processing an element w/local complexType: %s' %( self._item.getItemTrace())] args += ex.args ex.args = tuple(args) raise if self.local: kw['element'] = 'LocalElementDeclaration' element = [ '%(ID1)sclass %(klass)s(%(element)s):', '%(ID2)s%(literal)s', '%(ID2)s%(schema)s', '%(ID2)s%(init)s', '%(ID3)skw["pname"] = ("%(ns)s","%(name)s")', '%(ID3)skw["aname"] = "%(aname)s"', '%(baseslogic)s', '%(ID3)s%(alias)s.%(subclass)s.__init__(self, **kw)', '%(ID3)sif self.pyclass is not None: self.pyclass.__name__ = "%(klass)s_Holder"', ] self.writeArray(map(lambda l: l %kw, element)) def setUp(self, element): # Save for debugging self._item = element self.local = element.isLocal() self.name = element.getAttribute('name') self.ns = element.getTargetNamespace() tp = element.getTypeDefinition('type') self.sKlass = tp.getAttribute('name') self.sKlassNS = tp.getTargetNamespace() class ComplexTypeComplexContentContainer(TypecodeContainerBase, AttributeMixIn): '''Represents ComplexType with ComplexContent. ''' type = DEF logger = _GetLogger("ComplexTypeComplexContentContainer") def __init__(self, do_extended=False): TypecodeContainerBase.__init__(self, do_extended=do_extended) def setUp(self, tp): '''complexContent/[extension,restriction] restriction extension extType -- used in figuring attrs for extensions ''' self._item = tp assert tp.content.isComplex() is True and \ (tp.content.content.isRestriction() or tp.content.content.isExtension() is True),\ 'expecting complexContent/[extension,restriction]' self.extType = None self.restriction = False self.extension = False self._kw_array = None self._is_array = False self.name = tp.getAttribute('name') self.ns = tp.getTargetNamespace() # xxx: what is this for? #self.attribute_typecode = 'attributes' derivation = tp.content.content # Defined in Schema instance? try: base = derivation.getTypeDefinition('base') except XMLSchema.SchemaError, ex: base = None # anyType, arrayType, etc... if base is None: base = derivation.getAttributeQName('base') if base is None: raise ContainerError, 'Unsupported derivation: %s'\ %derivation.getItemTrace() if base != (SOAP.ENC,'Array') and base != (SCHEMA.XSD3,'anyType'): raise ContainerError, 'Unsupported base(%s): %s' %( base, derivation.getItemTrace() ) if base == (SOAP.ENC,'Array'): # SOAP-ENC:Array expecting arrayType attribute reference self.logger.debug("Derivation of soapenc:Array") self._is_array = True self._kw_array = {'atype':None, 'id3':ID3, 'ofwhat':None} self.sKlass = BTI.get_typeclass(base[1], base[0]) self.sKlassNS = base[0] attr = None for a in derivation.getAttributeContent(): assert a.isAttribute() is True,\ 'only attribute content expected: %s' %a.getItemTrace() if a.isReference() is True: if a.getAttribute('ref') == (SOAP.ENC,'arrayType'): self._kw_array['atype'] = a.getAttributeQName((WSDL.BASE, 'arrayType')) attr = a break qname = self._kw_array.get('atype') if attr is not None: qname = self._kw_array.get('atype') ncname = qname[1].strip('[]') namespace = qname[0] try: ofwhat = attr.getSchemaItem(XMLSchema.TYPES, namespace, ncname) except XMLSchema.SchemaError, ex: ofwhat = None if ofwhat is None: self._kw_array['ofwhat'] = BTI.get_typeclass(ncname, namespace) else: self._kw_array['ofwhat'] = GetClassNameFromSchemaItem(ofwhat, do_extended=self.do_extended) if self._kw_array['ofwhat'] is None: raise ContainerError, 'For Array could not resolve ofwhat typecode(%s,%s): %s'\ %(namespace, ncname, derivation.getItemTrace()) self.logger.debug('Attribute soapenc:arrayType="%s"' % str(self._kw_array['ofwhat'])) elif isinstance(base, XMLSchema.XMLSchemaComponent): self.sKlass = base.getAttribute('name') self.sKlassNS = base.getTargetNamespace() else: # TypeDescriptionComponent self.sKlass = base.getName() self.sKlassNS = base.getTargetNamespace() attrs = [] if derivation.isRestriction(): self.restriction = True self.extension = False # derivation.getAttributeContent subset of tp.getAttributeContent attrs += derivation.getAttributeContent() or () else: self.restriction = False self.extension = True attrs += tp.getAttributeContent() or () if isinstance(derivation, XMLSchema.XMLSchemaComponent): attrs += derivation.getAttributeContent() or () # XXX: not sure what this is doing if attrs: self.extType = derivation if derivation.content is not None \ and derivation.content.isModelGroup(): group = derivation.content if group.isReference(): group = group.getModelGroupReference() self.mgContent = group.content elif derivation.content: raise Wsdl2PythonError, \ 'expecting model group, not: %s' %derivation.content.getItemTrace() else: self.mgContent = () self.attrComponents = self._setAttributes(tuple(attrs)) def _setContent(self): '''JRB What is the difference between instance data ns, name, -- type definition? sKlass, sKlassNS? -- element declaration? ''' kw = KW.copy() definition = [] if self._is_array: # SOAP-ENC:Array if _is_xsd_or_soap_ns(self.sKlassNS) is False and self.sKlass == 'Array': raise ContainerError, 'unknown type: (%s,%s)'\ %(self.sKlass, self.sKlassNS) # No need to xsi:type array items since specify with # SOAP-ENC:arrayType attribute. definition += [\ '%sclass %s(ZSI.TC.Array, TypeDefinition):' % (ID1, self.getClassName()), '%s#complexType/complexContent base="SOAP-ENC:Array"' %(ID2), '%s%s' % (ID2, self.schemaTag()), '%s%s' % (ID2, self.typeTag()), '%s%s' % (ID2, self.pnameConstructor()), '%(id3)sofwhat = %(ofwhat)s(None, typed=False)' %self._kw_array, '%(id3)satype = %(atype)s' %self._kw_array, '%s%s.__init__(self, atype, ofwhat, pname=pname, childnames=\'item\', **kw)' %(ID3, self.sKlass), ] self.writeArray(definition) return definition += [\ '%sclass %s(TypeDefinition):' % (ID1, self.getClassName()), '%s%s' % (ID2, self.schemaTag()), '%s%s' % (ID2, self.typeTag()), '%s%s' % (ID2, self.pnameConstructor()), '%s%s' % (ID3, self.nsuriLogic()), '%sTClist = [%s]' % (ID3, self.getTypecodeList()), ] definition.append( '%(ID3)sattributes = %(atc)s = attributes or {}' %{ 'ID3':ID3, 'atc':self.attribute_typecode} ) # # Special case: anyType restriction isAnyType = (self.sKlassNS, self.sKlass) == (SCHEMA.XSD3, 'anyType') if isAnyType: del definition[0] definition.insert(0, '%sclass %s(ZSI.TC.ComplexType, TypeDefinition):' % ( ID1, self.getClassName()) ) definition.insert(1, '%s#complexType/complexContent restrict anyType' %( ID2) ) # derived type support definition.append('%sif extend: TClist += ofwhat'%(ID3)) definition.append('%sif restrict: TClist = ofwhat' %(ID3)) if len(self.attrComponents) > 0: definition.append('%selse:' %(ID3)) for l in self.attrComponents: definition.append('%s%s'%(ID4, l)) if isAnyType: definition.append(\ '%sZSI.TC.ComplexType.__init__(self, None, TClist, pname=pname, **kw)' %( ID3), ) # pyclass class definition definition += self.getPyClassDefinition() kw['pyclass'] = self.getPyClass() definition.append('%(ID3)sself.pyclass = %(pyclass)s' %kw) self.writeArray(definition) return for l in self.attrComponents: definition.append('%s%s'%(ID3, l)) definition.append('%s' % self.getBasesLogic(ID3)) prefix = NAD.getAlias(self.sKlassNS) typeClassName = type_class_name(self.sKlass) if self.restriction: definition.append(\ '%s%s.%s.__init__(self, pname, ofwhat=TClist, restrict=True, **kw)' %( ID3, prefix, typeClassName), ) definition.insert(1, '%s#complexType/complexContent restriction' %ID2) self.writeArray(definition) return if self.extension: definition.append(\ '%s%s.%s.__init__(self, pname, ofwhat=TClist, extend=True, attributes=attributes, **kw)'%( ID3, prefix, typeClassName), ) definition.insert(1, '%s#complexType/complexContent extension' %(ID2)) self.writeArray(definition) return raise Wsdl2PythonError,\ 'ComplexContent must be a restriction or extension' def pnameConstructor(self, superclass=None): if superclass: return '%s.__init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw)' % superclass return 'def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):' class ComplexTypeContainer(TypecodeContainerBase, AttributeMixIn): '''Represents a global complexType definition. ''' type = DEF logger = _GetLogger("ComplexTypeContainer") def setUp(self, tp, empty=False): '''Problematic, loose all model group information. , , .. tp -- type definition empty -- no model group, just use as a dummy holder. ''' self._item = tp self.name = tp.getAttribute('name') self.ns = tp.getTargetNamespace() self.mixed = tp.isMixed() self.mgContent = () self.attrComponents = self._setAttributes(tp.getAttributeContent()) # Save reference to type for debugging self._item = tp if empty: return model = tp.content if model.isReference(): model = model.getModelGroupReference() if model is None: return if model.content is None: return # sequence, all or choice #self.mgContent = model.content self.mgContent = model def _setContent(self): try: definition = [ '%sclass %s(ZSI.TCcompound.ComplexType, TypeDefinition):' % (ID1, self.getClassName()), '%s%s' % (ID2, self.schemaTag()), '%s%s' % (ID2, self.typeTag()), '%s%s' % (ID2, self.pnameConstructor()), #'%s' % self.getElements(), '%s%s' % (ID3, self.nsuriLogic()), '%sTClist = [%s]' % (ID3, self.getTypecodeList()), ] except Exception, ex: args = ["Failure processing %s" %self._item.getItemTrace()] args += ex.args ex.args = tuple(args) raise definition.append('%s%s = attributes or {}' %(ID3, self.attribute_typecode)) # IF EXTEND definition.append('%sif extend: TClist += ofwhat'%(ID3)) # IF RESTRICT definition.append('%sif restrict: TClist = ofwhat' %(ID3)) # ELSE if len(self.attrComponents) > 0: definition.append('%selse:' %(ID3)) for l in self.attrComponents: definition.append('%s%s'%(ID4, l)) definition.append(\ '%sZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, %s**kw)' \ %(ID3, self.getExtraFlags()) ) # pyclass class definition definition += self.getPyClassDefinition() # set pyclass kw = KW.copy() kw['pyclass'] = self.getPyClass() definition.append('%(ID3)sself.pyclass = %(pyclass)s' %kw) self.writeArray(definition) def pnameConstructor(self, superclass=None): ''' TODO: Logic is a little tricky. If superclass is ComplexType this is not used. ''' if superclass: return '%s.__init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw)' % superclass return 'def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):' class SimpleTypeContainer(TypecodeContainerBase): type = DEF logger = _GetLogger("SimpleTypeContainer") def __init__(self): ''' Instance Data From TypecodeContainerBase NOT USED... mgContent ''' TypecodeContainerBase.__init__(self) def setUp(self, tp): raise NotImplementedError, 'abstract method not implemented' def _setContent(self, tp): raise NotImplementedError, 'abstract method not implemented' def getPythonType(self): pyclass = eval(str(self.sKlass)) if issubclass(pyclass, ZSI.TC.String): return 'str' if issubclass(pyclass, ZSI.TC.Ilong) or issubclass(pyclass, ZSI.TC.IunsignedLong): return 'long' if issubclass(pyclass, ZSI.TC.Boolean) or issubclass(pyclass, ZSI.TC.Integer): return 'int' if issubclass(pyclass, ZSI.TC.Decimal): return 'float' if issubclass(pyclass, ZSI.TC.Gregorian) or issubclass(pyclass, ZSI.TC.Duration): return 'tuple' return None def getPyClassDefinition(self): definition = [] pt = self.getPythonType() if pt is not None: definition.append('%sclass %s(%s):' %(ID3,self.getPyClass(),pt)) definition.append('%stypecode = self' %ID4) return definition class RestrictionContainer(SimpleTypeContainer): ''' simpleType/restriction ''' logger = _GetLogger("RestrictionContainer") def setUp(self, tp): self._item = tp assert tp.isSimple() is True and tp.isDefinition() is True and \ tp.content.isRestriction() is True,\ 'expecting simpleType restriction, not: %s' %tp.getItemTrace() if tp.content is None: raise Wsdl2PythonError, \ 'empty simpleType defintion: %s' %tp.getItemTrace() self.name = tp.getAttribute('name') self.ns = tp.getTargetNamespace() self.sKlass = None base = tp.content.getAttribute('base') if base is not None: try: item = tp.content.getTypeDefinition('base') except XMLSchema.SchemaError, ex: pass if item is None: self.sKlass = BTI.get_typeclass(base.getName(), base.getTargetNamespace()) if self.sKlass is not None: return raise Wsdl2PythonError('no built-in type nor schema instance type for base attribute("%s","%s"): %s' %( base.getTargetNamespace(), base.getName(), tp.getItemTrace())) raise Wsdl2PythonError, \ 'Not Supporting simpleType/Restriction w/User-Defined Base: %s %s' %(tp.getItemTrace(),item.getItemTrace()) sc = tp.content.getSimpleTypeContent() if sc is not None and True is sc.isSimple() is sc.isLocal() is sc.isDefinition(): base = None if sc.content.isRestriction() is True: try: item = tp.content.getTypeDefinition('base') except XMLSchema.SchemaError, ex: pass if item is None: base = sc.content.getAttribute('base') if base is not None: self.sKlass = BTI.get_typeclass(base.getTargetNamespace(), base.getName()) return raise Wsdl2PythonError, \ 'Not Supporting simpleType/Restriction w/User-Defined Base: '\ %item.getItemTrace() raise Wsdl2PythonError, \ 'Not Supporting simpleType/Restriction w/User-Defined Base: '\ %item.getItemTrace() if sc.content.isList() is True: raise Wsdl2PythonError, \ 'iction base in subtypes: %s'\ %sc.getItemTrace() if sc.content.isUnion() is True: raise Wsdl2PythonError, \ 'could not get restriction base in subtypes: %s'\ %sc.getItemTrace() return raise Wsdl2PythonError, 'No Restriction @base/simpleType: %s' %tp.getItemTrace() def _setContent(self): definition = [ '%sclass %s(%s, TypeDefinition):' %(ID1, self.getClassName(), self.sKlass), '%s%s' % (ID2, self.schemaTag()), '%s%s' % (ID2, self.typeTag()), '%s%s' % (ID2, self.pnameConstructor()), ] if self.getPythonType() is None: definition.append('%s%s.__init__(self, pname, **kw)' %(ID3, self.sKlass)) else: definition.append('%s%s.__init__(self, pname, pyclass=None, **kw)' \ %(ID3, self.sKlass,)) # pyclass class definition definition += self.getPyClassDefinition() # set pyclass kw = KW.copy() kw['pyclass'] = self.getPyClass() definition.append('%(ID3)sself.pyclass = %(pyclass)s' %kw) self.writeArray(definition) class ComplexTypeSimpleContentContainer(SimpleTypeContainer, AttributeMixIn): '''Represents a ComplexType with simpleContent. ''' type = DEF logger = _GetLogger("ComplexTypeSimpleContentContainer") def setUp(self, tp): '''tp -- complexType/simpleContent/[Exention,Restriction] ''' self._item = tp assert tp.isComplex() is True and tp.content.isSimple() is True,\ 'expecting complexType/simpleContent not: %s' %tp.content.getItemTrace() simple = tp.content dv = simple.content assert dv.isExtension() is True or dv.isRestriction() is True,\ 'expecting complexType/simpleContent/[Extension,Restriction] not: %s' \ %tp.content.getItemTrace() self.name = tp.getAttribute('name') self.ns = tp.getTargetNamespace() # TODO: Why is this being set? self.content.attributeContent = dv.getAttributeContent() base = dv.getAttribute('base') if base is not None: self.sKlass = BTI.get_typeclass( base[1], base[0] ) if not self.sKlass: self.sKlass,self.sKlassNS = base[1], base[0] self.attrComponents = self._setAttributes( self.content.attributeContent ) return raise Wsdl2PythonError,\ 'simple content derivation bad base attribute: ' %tp.getItemTrace() def _setContent(self): # TODO: Add derivation logic to constructors. if type(self.sKlass) in (types.ClassType, type): definition = [ '%sclass %s(%s, TypeDefinition):' \ % (ID1, self.getClassName(), self.sKlass), '%s# ComplexType/SimpleContent derivation of built-in type' %ID2, '%s%s' % (ID2, self.schemaTag()), '%s%s' % (ID2, self.typeTag()), '%s%s' % (ID2, self.pnameConstructor()), '%sif getattr(self, "attribute_typecode_dict", None) is None: %s = {}' %( ID3, self.attribute_typecode), ] for l in self.attrComponents: definition.append('%s%s'%(ID3, l)) definition.append('%s%s.__init__(self, pname, **kw)' %(ID3, self.sKlass)) if self.getPythonType() is not None: definition += self.getPyClassDefinition() kw = KW.copy() kw['pyclass'] = self.getPyClass() definition.append('%(ID3)sself.pyclass = %(pyclass)s' %kw) self.writeArray(definition) return definition = [ '%sclass %s(TypeDefinition):' % (ID1, self.getClassName()), '%s# ComplexType/SimpleContent derivation of user-defined type' %ID2, '%s%s' % (ID2, self.schemaTag()), '%s%s' % (ID2, self.typeTag()), '%s%s' % (ID2, self.pnameConstructor()), '%s%s' % (ID3, self.nsuriLogic()), '%s' % self.getBasesLogic(ID3), '%sif getattr(self, "attribute_typecode_dict", None) is None: %s = {}' %( ID3, self.attribute_typecode), ] for l in self.attrComponents: definition.append('%s%s'%(ID3, l)) definition.append('%s%s.%s.__init__(self, pname, **kw)' %( ID3, NAD.getAlias(self.sKlassNS), type_class_name(self.sKlass))) self.writeArray(definition) def getPyClassDefinition(self): definition = [] pt = self.getPythonType() if pt is not None: definition.append('%sclass %s(%s):' %(ID3,self.getPyClass(),pt)) if self.metaclass is not None: definition.append('%s__metaclass__ = %s' %(ID4, self.metaclass)) definition.append('%stypecode = self' %ID4) return definition class UnionContainer(SimpleTypeContainer): '''SimpleType Union ''' type = DEF logger = _GetLogger("UnionContainer") def __init__(self): SimpleTypeContainer.__init__(self) self.memberTypes = None def setUp(self, tp): self._item = tp if tp.content.isUnion() is False: raise ContainerError, 'content must be a Union: %s' %tp.getItemTrace() self.name = tp.getAttribute('name') self.ns = tp.getTargetNamespace() self.sKlass = 'ZSI.TC.Union' self.memberTypes = tp.content.getAttribute('memberTypes') def _setContent(self): definition = [ '%sclass %s(%s, TypeDefinition):' \ % (ID1, self.getClassName(), self.sKlass), '%smemberTypes = %s' % (ID2, self.memberTypes), '%s%s' % (ID2, self.schemaTag()), '%s%s' % (ID2, self.typeTag()), '%s%s' % (ID2, self.pnameConstructor()), '%s%s' % (ID3, self.pnameConstructor(self.sKlass)), ] # TODO: Union pyclass is None self.writeArray(definition) class ListContainer(SimpleTypeContainer): '''SimpleType List ''' type = DEF logger = _GetLogger("ListContainer") def setUp(self, tp): self._item = tp if tp.content.isList() is False: raise ContainerError, 'content must be a List: %s' %tp.getItemTrace() self.name = tp.getAttribute('name') self.ns = tp.getTargetNamespace() self.sKlass = 'ZSI.TC.List' self.itemType = tp.content.getAttribute('itemType') def _setContent(self): definition = [ '%sclass %s(%s, TypeDefinition):' \ % (ID1, self.getClassName(), self.sKlass), '%sitemType = %s' % (ID2, self.itemType), '%s%s' % (ID2, self.schemaTag()), '%s%s' % (ID2, self.typeTag()), '%s%s' % (ID2, self.pnameConstructor()), '%s%s' % (ID3, self.pnameConstructor(self.sKlass)), ] self.writeArray(definition) PK-¤Y5Øa@@ZSI/generate/utility.py############################################################################ # Monte M. Goode, LBNL # See LBNLCopyright for copyright notice! ########################################################################### # utility classes used by new generator - mostly 'sugar' classes # that are actually imported by the generated code. also includes # utilities used by wsdl2python itself. # $Id: utility.py 1226 2006-05-26 18:11:19Z boverhof $ import re from ZSI import EvaluateException from ZSI.TCcompound import Struct from ZSI.generate import WsdlGeneratorError, Wsdl2PythonError from ZSI.wstools.Utility import SplitQName from ZSI.wstools.Namespaces import SCHEMA NCName_to_ModuleName = lambda name: re.sub('\.', '_', TextProtect(name)) NCName_to_ClassName = lambda name: re.sub('\.', '_', TextProtect(name)) TextProtect = lambda s: re.sub('[-./:# ]', '_', s) TextProtectAttributeName = lambda name: TextProtect('_%s' %name) Namespace2ModuleName = lambda ns: TextProtect(ns.lstrip('http://')).rstrip('_') def GetModuleBaseNameFromWSDL(wsdl): """By default try to construct a reasonable base name for all generated modules. Otherwise return None. """ base_name = wsdl.name or wsdl.services[0].name base_name = SplitQName(base_name)[1] if base_name is None: return None return NCName_to_ModuleName(base_name) namespace_name = lambda cls, ns: 'ns%s' % len(cls.alias_list) class NamespaceAliasDict: """a lookup table to store relevant namespaces and their aliases""" alias_dict = {} alias_list = [] def add(cls, ns): if cls.alias_dict.has_key(ns): return cls.alias_dict[ns] = (Namespace2ModuleName(ns), '%s' % namespace_name(cls,ns)) cls.alias_list.append(ns) add = classmethod(add) def getModuleName(cls, ns): if cls.alias_dict.has_key(ns): return cls.alias_dict[ns][0] msg = 'failed to find import for schema "%s"'%ns +\ 'possibly missing @schemaLocation attribute.' if ns in SCHEMA.XSD_LIST: msg = 'missing built-in typecode for schema "%s"' %ns raise WsdlGeneratorError, msg getModuleName = classmethod(getModuleName) def getAlias(cls, ns): if cls.alias_dict.has_key(ns): return cls.alias_dict[ns][1] msg = 'failed to find import for schema "%s"'%ns +\ 'possibly missing @schemaLocation attribute.' if ns in SCHEMA.XSD_LIST: msg = 'missing built-in typecode for schema "%s"' %ns raise WsdlGeneratorError, msg getAlias = classmethod(getAlias) def getNSList(cls): return tuple(cls.alias_list) getNSList = classmethod(getNSList) class StringWriter: """generator util""" def __init__(self, val=None): self.data = [] if val: self.data.append(val) def set(self, val): if self.data: # in some cases the empty list reassignment fails, so.... self.data = None self.data = [] self.data.append(val) def write(self, val): self.data.append(val) def getvalue(self): if self.data: return ''.join(self.data) else: return '' def __iadd__(self, val): self.data.append(val) return self def __str__(self): return self.getvalue() # ---- generated code utils class MessageContainer: """generator util - used by address.py""" pass # Extract sub names from message parts so they can be used when mapping # a message's contents to a function's arguments. # Args is a list of Message Parts. i.e.: op.getInputMessage().parts.values() def GetPartsSubNames(args, wsdl): do_extended = True from wsdl2python import WriteServiceModule, SchemaDescription wsm = WriteServiceModule(wsdl, do_extended=do_extended) wsm.gatherNamespaces() toReturn = [] for arg in args: argSubnames = [] for l in wsm.usedNamespaces.values(): for schema in l: sd = SchemaDescription(do_extended=do_extended) sd.fromSchema(schema) argNamespace = arg.element[0] if (sd.targetNamespace == argNamespace): for i in sd.items: # arg.name is the part name, but we want it's type argElementType = arg.element[1] if str(argElementType) == str(i.content.name): argSubnames = [] # I'm not sure when the name attribute was dropped # but at some point, or in some circumstance it's not # there, but instead a ref attribute is there which is # tuple of (namespace, name). This hack fixes things, # but I'm not sure why this happens or has happened. # IRJ - 2005-05-25 if i.content.mgContent != None: for c in i.content.mgContent: nValue = "None" if c.isWildCard(): nValue="any" elif c.attributes.has_key("name"): nValue = c.attributes["name"] elif c.attributes.has_key("ref"): nValue = c.attributes["ref"][1] argSubnames.append(nValue) toReturn.append(argSubnames) return toReturn PK-¤Y5S™EŸLŸLZSI/generate/wsdl2python.py############################################################################ # Monte M. Goode, LBNL # See LBNLCopyright for copyright notice! ########################################################################### # main generator engine for new generation generator # $Id: wsdl2python.py 1203 2006-05-03 00:13:20Z boverhof $ import os from ZSI import _get_idstr from ZSI.wstools.logging import getLogger as _GetLogger from ZSI.wstools import WSDLTools from ZSI.wstools.WSDLTools import SoapAddressBinding,\ SoapBodyBinding, SoapBinding,MimeContentBinding,\ HttpUrlEncodedBinding from ZSI.wstools.XMLSchema import SchemaReader, ElementDeclaration, SchemaError from ZSI.typeinterpreter import BaseTypeInterpreter from ZSI.generate import WsdlGeneratorError, Wsdl2PythonError from containers import * from ZSI.generate import utility from ZSI.generate.utility import NamespaceAliasDict as NAD from ZSI.generate.utility import GetModuleBaseNameFromWSDL """ classes: WriteServiceModule -- composes/writes out client stubs and types module. ServiceDescription -- represents a single WSDL service. MessageWriter -- represents a single WSDL Message and associated bindings of the port/binding. SchemaDescription -- generates classes for defs and decs in the schema instance. TypeWriter -- represents a type definition. ElementWriter -- represents a element declaration. """ class WriteServiceModule: """top level driver class invoked by wsd2py class variables: client_module_suffix -- suffix of client module. types_module_suffix -- suffix of types module. """ client_module_suffix = '_services' messages_module_suffix = '_messages' types_module_suffix = '_services_types' logger = _GetLogger("WriteServiceModule") def __init__(self, wsdl, addressing=False, notification=False, do_extended=False, extPyClasses=None, configParser = None): self._wsdl = wsdl self._addressing = addressing self._notification = notification self._configParser = configParser self.usedNamespaces = None self.services = [] self.client_module_path = None self.types_module_name = None self.types_module_path = None self.messages_module_path = None # used in extended generation self.do_extended = do_extended self.extPyClasses = extPyClasses def getClientModuleName(self): """client module name. """ name = GetModuleBaseNameFromWSDL(self._wsdl) if not name: raise WsdlGeneratorError, 'could not determine a service name' if self.client_module_suffix is None: return name return '%s%s' %(name, self.client_module_suffix) def getMessagesModuleName(self): name = GetModuleBaseNameFromWSDL(self._wsdl) if not name: raise WsdlGeneratorError, 'could not determine a service name' if self.messages_module_suffix is None: return name if len(self.messages_module_suffix) == 0: return self.getClientModuleName() return '%s%s' %(name, self.messages_module_suffix) def setTypesModuleName(self, name): self.types_module_name = name def getTypesModuleName(self): """types module name. """ if self.types_module_name is not None: return self.types_module_name name = GetModuleBaseNameFromWSDL(self._wsdl) if not name: raise WsdlGeneratorError, 'could not determine a service name' if self.types_module_suffix is None: return name return '%s%s' %(name, self.types_module_suffix) def setClientModulePath(self, path): """setup module path to where client module before calling fromWsdl. module path to types module eg. MyApp.client """ self.client_module_path = path def getTypesModulePath(self): """module path to types module eg. MyApp.types """ return self.types_module_path def getMessagesModulePath(self): '''module path to messages module same as types path ''' return self.messages_module_path def setTypesModulePath(self, path): """setup module path to where service module before calling fromWsdl. module path to types module eg. MyApp.types """ self.types_module_path = path def setMessagesModulePath(self, path): """setup module path to where message module before calling fromWsdl. module path to types module eg. MyApp.types """ self.messages_module_path = path def gatherNamespaces(self): '''This method must execute once.. Grab all schemas representing each targetNamespace. ''' if self.usedNamespaces is not None: return self.logger.debug('gatherNamespaces') self.usedNamespaces = {} # Add all schemas defined in wsdl # to used namespace and to the Alias dict for schema in self._wsdl.types.values(): tns = schema.getTargetNamespace() self.logger.debug('Register schema(%s) -- TNS(%s)'\ %(_get_idstr(schema), tns),) if self.usedNamespaces.has_key(tns) is False: self.usedNamespaces[tns] = [] self.usedNamespaces[tns].append(schema) NAD.add(tns) # Add all xsd:import schema instances # to used namespace and to the Alias dict for k,v in SchemaReader.namespaceToSchema.items(): self.logger.debug('Register schema(%s) -- TNS(%s)'\ %(_get_idstr(v), k),) if self.usedNamespaces.has_key(k) is False: self.usedNamespaces[k] = [] self.usedNamespaces[k].append(v) NAD.add(k) def writeClient(self, fd, sdClass=None, msg_fd=None, **kw): """write out client module to file descriptor. Parameters and Keywords arguments: fd -- file descriptor msg_fd -- optional messsages module file descriptor sdClass -- service description class name imports -- list of imports readerclass -- class name of ParsedSoap reader writerclass -- class name of SoapWriter writer """ sdClass = sdClass or ServiceDescription assert issubclass(sdClass, ServiceDescription), \ 'parameter sdClass must subclass ServiceDescription' header = '%s \n# %s.py \n# generated by %s\n%s\n\n'\ %('#'*50, self.getClientModuleName(), self.__module__, '#'*50) fd.write(header) if msg_fd is not None: # TODO: Why is this not getMessagesModuleName? msg_filename = str(self.getClientModuleName()).replace("client", "messages") if self.getMessagesModulePath() is not None: msg_filename = os.path.join(self.getMessagesModulePath(), msg_filename) messages_header = header.replace("client", "messages") msg_fd.write(messages_header) self.services = [] for service in self._wsdl.services: sd = sdClass(self._addressing, do_extended=self.do_extended, wsdl=self._wsdl) if len(self._wsdl.types) > 0: sd.setTypesModuleName(self.getTypesModuleName(), self.getTypesModulePath()) sd.setMessagesModuleName(self.getMessagesModuleName(), self.getMessagesModulePath()) self.gatherNamespaces() sd.fromWsdl(service, **kw) sd.write(fd,msg_fd) self.services.append(sd) def writeTypes(self, fd): """write out types module to file descriptor. """ header = '%s \n# %s.py \n# generated by %s\n%s\n\n'\ %('#'*50, self.getTypesModuleName(), self.__module__, '#'*50) fd.write(header) print >>fd, TypesHeaderContainer() self.gatherNamespaces() for l in self.usedNamespaces.values(): sd = SchemaDescription(do_extended=self.do_extended, extPyClasses=self.extPyClasses) for schema in l: sd.fromSchema(schema) sd.write(fd) class ServiceDescription: """client interface - locator, port, etc classes""" separate_messages = False logger = _GetLogger("ServiceDescription") def __init__(self, addressing=False, do_extended=False, wsdl=None): self.typesModuleName = None self.messagesModuleName = None self.wsAddressing = addressing self.imports = ServiceHeaderContainer() self.messagesImports = ServiceHeaderContainer() self.locator = ServiceLocatorContainer() self.methods = [] self.messages = [] self.do_extended=do_extended self._wsdl = wsdl # None unless do_extended == True def setTypesModuleName(self, name, modulePath=None): """The types module to be imported. Parameters name -- name of types module modulePath -- optional path where module is located. """ self.typesModuleName = '%s' %name if modulePath is not None: self.typesModuleName = '%s.%s' %(modulePath,name) def setMessagesModuleName(self, name, modulePath=None): '''The types module to be imported. Parameters name -- name of types module modulePath -- optional path where module is located. ''' self.messagesModuleName = '%s' %name if modulePath is not None: self.messagesModuleName = '%s.%s' %(modulePath,name) def fromWsdl(self, service, **kw): self.imports.setTypesModuleName(self.typesModuleName) if self.separate_messages: self.messagesImports.setMessagesModuleName(self.messagesModuleName) self.imports.appendImport(kw.get('imports', [])) self.locator.setUp(service) for port in service.ports: sop_container = ServiceOperationsClassContainer(useWSA=self.wsAddressing, do_extended=self.do_extended, wsdl=self._wsdl) try: sop_container.setUp(port) except Wsdl2PythonError, ex: self.logger.warning('Skipping port(%s)' %port.name) if len(ex.args): self.logger.warning(ex.args[0]) else: sop_container.setReaderClass(kw.get('readerclass')) sop_container.setWriterClass(kw.get('writerclass')) for soc in sop_container.operations: if soc.hasInput() is True: mw = MessageWriter(do_extended=self.do_extended) mw.setUp(soc, port, input=True) self.messages.append(mw) if soc.hasOutput() is True: mw = MessageWriter(do_extended=self.do_extended) mw.setUp(soc, port, input=False) self.messages.append(mw) self.methods.append(sop_container) def write(self, fd, msg_fd=None): """write out module to file descriptor. fd -- file descriptor to write out service description. msg_fd -- optional file descriptor for messages module. """ if msg_fd != None: print >>fd, self.messagesImports print >>msg_fd, self.imports else: print >>fd, self.imports print >>fd, self.locator for m in self.methods: print >>fd, m if msg_fd != None: for m in self.messages: print >>msg_fd, m else: for m in self.messages: print >>fd, m class MessageWriter: logger = _GetLogger("MessageWriter") def __init__(self, do_extended=False): """Representation of a WSDL Message and associated WSDL Binding. operation -- boperation -- input -- rpc -- literal -- simple -- """ self.content = None self.do_extended = do_extended def __str__(self): if not self.content: raise Wsdl2PythonError, 'Must call setUp.' return self.content.getvalue() def setUp(self, soc, port, input=False): assert isinstance(soc, ServiceOperationContainer),\ 'expecting a ServiceOperationContainer instance' assert isinstance(port, WSDLTools.Port),\ 'expecting a WSDL.Port instance' rpc,literal = soc.isRPC(), soc.isLiteral(input) kw,klass = {}, None if rpc and literal: klass = ServiceRPCLiteralMessageContainer elif not rpc and literal: kw['do_extended'] = self.do_extended klass = ServiceDocumentLiteralMessageContainer elif rpc and not literal: klass = ServiceRPCEncodedMessageContainer else: raise WsdlGeneratorError, 'doc/enc not supported.' self.content = klass(**kw) self.content.setUp(port, soc, input) class SchemaDescription: """generates classes for defs and decs in the schema instance. """ logger = _GetLogger("SchemaDescription") def __init__(self, do_extended=False, extPyClasses=None): self.classHead = NamespaceClassHeaderContainer() self.classFoot = NamespaceClassFooterContainer() self.items = [] self.__types = [] self.__elements = [] self.targetNamespace = None self.do_extended=do_extended self.extPyClasses = extPyClasses def fromSchema(self, schema): ''' Can be called multiple times, but will not redefine a previously defined type definition or element declaration. ''' ns = schema.getTargetNamespace() assert self.targetNamespace is None or self.targetNamespace == ns,\ 'SchemaDescription instance represents %s, not %s'\ %(self.targetNamespace, ns) if self.targetNamespace is None: self.targetNamespace = ns self.classHead.ns = self.classFoot.ns = ns for item in [t for t in schema.types if t.getAttributeName() not in self.__types]: self.__types.append(item.getAttributeName()) self.items.append(TypeWriter(do_extended=self.do_extended, extPyClasses=self.extPyClasses)) self.items[-1].fromSchemaItem(item) for item in [e for e in schema.elements if e.getAttributeName() not in self.__elements]: self.__elements.append(item.getAttributeName()) self.items.append(ElementWriter(do_extended=self.do_extended)) self.items[-1].fromSchemaItem(item) def getTypes(self): return self.__types def getElements(self): return self.__elements def write(self, fd): """write out to file descriptor. """ print >>fd, self.classHead for t in self.items: print >>fd, t print >>fd, self.classFoot class SchemaItemWriter: """contains/generates a single declaration""" logger = _GetLogger("SchemaItemWriter") def __init__(self, do_extended=False, extPyClasses=None): self.content = None self.do_extended=do_extended self.extPyClasses=extPyClasses def __str__(self): '''this appears to set up whatever is in self.content.localElements, local elements simpleType|complexType. ''' assert self.content is not None, 'Must call fromSchemaItem to setup.' return str(self.content) def fromSchemaItem(self, item): raise NotImplementedError, '' class ElementWriter(SchemaItemWriter): """contains/generates a single declaration""" logger = _GetLogger("ElementWriter") def fromSchemaItem(self, item): """set up global elements. """ if item.isElement() is False or item.isLocal() is True: raise TypeError, 'expecting global element declaration: %s' %item.getItemTrace() local = False qName = item.getAttribute('type') if not qName: etp = item.content local = True else: etp = item.getTypeDefinition('type') if etp is None: if local is True: self.content = ElementLocalComplexTypeContainer(do_extended=self.do_extended) else: self.content = ElementSimpleTypeContainer() elif etp.isLocal() is False: self.content = ElementGlobalDefContainer() elif etp.isSimple() is True: self.content = ElementLocalSimpleTypeContainer() elif etp.isComplex(): self.content = ElementLocalComplexTypeContainer(do_extended=self.do_extended) else: raise Wsdl2PythonError, "Unknown element declaration: %s" %item.getItemTrace() self.logger.debug('ElementWriter setUp container "%r", Schema Item "%s"' %( self.content, item.getItemTrace())) self.content.setUp(item) class TypeWriter(SchemaItemWriter): """contains/generates a single definition""" logger = _GetLogger("TypeWriter") def fromSchemaItem(self, item): if item.isDefinition() is False or item.isLocal() is True: raise TypeError, \ 'expecting global type definition not: %s' %item.getItemTrace() self.content = None if item.isSimple(): if item.content.isRestriction(): self.content = RestrictionContainer() elif item.content.isUnion(): self.content = UnionContainer() elif item.content.isList(): self.content = ListContainer() else: raise Wsdl2PythonError,\ 'unknown simple type definition: %s' %item.getItemTrace() self.content.setUp(item) return if item.isComplex(): kw = {} if item.content is None or item.content.isModelGroup(): self.content = \ ComplexTypeContainer(\ do_extended=self.do_extended, extPyClasses=self.extPyClasses ) kw['empty'] = item.content is None elif item.content.isSimple(): self.content = ComplexTypeSimpleContentContainer() elif item.content.isComplex(): self.content = \ ComplexTypeComplexContentContainer(\ do_extended=self.do_extended ) else: raise Wsdl2PythonError,\ 'unknown complex type definition: %s' %item.getItemTrace() self.logger.debug('TypeWriter setUp container "%r", Schema Item "%s"' %( self.content, item.getItemTrace())) try: self.content.setUp(item, **kw) except Exception, ex: args = ['Failure in setUp: %s' %item.getItemTrace()] args += ex.args ex.args = tuple(args) raise return raise TypeError,\ 'expecting SimpleType or ComplexType: %s' %item.getItemTrace() PK¨58¹]‘wÞ¬Þ¬ZSI/generate/containers.pyo;ò V@Ec@s@dkZdklZlZlZlZdklZlZ dk Z dk l Z dk lZlZdklZlZlZdklZdklZdklZlZlZlZlZd Zd eZ d eZ!d eZ"d eZ#deZ$hde<de <de!<de"<de#<de$d7e>fd8„ƒYZ?e>Z@d9e@fd:„ƒYZAd;e@fd<„ƒYZBeƒZCd=e>fd>„ƒYZDd?eDfd@„ƒYZEdAe4fdB„ƒYZFdCeFfdD„ƒYZGdEeDfdF„ƒYZHdGeDfdH„ƒYZIdIeDe1fdJ„ƒYZJdKeDfdL„ƒYZKdMeDe1fdN„ƒYZLdOeDe1fdP„ƒYZMdQeDfdR„ƒYZNdSeNfdT„ƒYZOdUeNe1fdV„ƒYZPdWeNfdX„ƒYZQdYeNfdZ„ƒYZRdS([N(s StringWriters TextProtectsTextProtectAttributeNamesGetPartsSubNames(sNamespaceAliasDictsNCName_to_ClassName(s_is_xsd_or_soap_ns(s XMLSchemas WSDLTools(sSCHEMAsSOAPsWSDL(s getLogger(sBaseTypeInterpreter(sWSISpecsWSInteropErrorsWsdl2PythonErrorsWsdlGeneratorErrorsWSDLFormatErrors iiiiisID1sID2sID3sID4sID5sID6s_Decs_DefcCsdt|ƒtfS(Ns%s%s(sNC_to_CNsnsDEF(sn((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys'scCsdt|ƒtfS(Ns%s%s(sNC_to_CNsnsDEC(sn((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys(scCs†t|tiƒ o td‚n|iƒitiƒ}|iti ƒ}|i }|t j o|i p|i }n|djSdS(s'item -- OperationBinding instance. s9IsRPC takes 1 argument of type WSDLTools.OperationBindingsrpcN( s isinstancesitems WSDLToolssOperationBindings TypeErrors getBindings findBindings SoapBindings soapbindingsSoapOperationBindingssobsstylesNone(sitemsstylessobs soapbinding((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysIsRPC+s   cCsˆt|tiƒ o td‚nt}|idjp |idjo|iti ƒ}n|tjo t d‚n|i djSdS(s)item -- MessageRoleBinding instance. s?IsLiteral takes 1 argument of type WSDLTools.MessageRoleBindingsinputsoutputsMissing soap:body binding.sliteralN( s isinstancesitems WSDLToolssMessageRoleBindings TypeErrorsNonessbbstypes findBindingsSoapBodyBindings ValueErrorsuse(sitemssbb((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys IsLiteral8s    cCs |adS(N(sfuncstype_class_name(sfunc((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysSetTypeNameFuncEscCs |adS(N(sfuncselement_class_name(sfunc((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysSetElementNameFuncIscCsXti|iƒƒ}|iƒtjo(d|tdt|i ƒƒƒfSnt SdS(s s%s.%ss%sN( sNADsgetAliassitemsgetTargetNamespacesaliass isDefinitionsTruesNC_to_CNstype_class_namesgetAttributeNamesNone(sitems do_extendedsalias((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysGetClassNameFromSchemaItemMs (c Cs t|iƒdjo|iditj oÔ|id}|i\}}|iƒ}|i } | i |ƒo| |i i |ƒox| |i |}t|tiƒtjo |idƒo:|idƒ}tƒ}|i|d|dƒ}|SqýqntSdS(sªIf message consists of one part with an element attribute, and this element is a simpleType return a string representing the python type, else return None. iistypeN(slensmessagespartsselementsNonespartsnsurisnamesgetWSDLswsdlstypesshas_keyselementsses isinstances XMLSchemasElementDeclarationsTrues getAttributestypsBaseTypeInterpretersbtsget_pythontypesptype( smessagesesnamestypsptypesbtspartsnsuriswsdlstypes((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys&FromMessageGetSimpleElementDeclarationVs-   ') sAttributeMixIncBs/tZdZdZeidfgZd„ZRS(sfor containers that can declare attributes. Class Attributes: attribute_typecode -- typecode attribute name typecode dict built_in_refs -- attribute references that point to built-in types. Skip resolving them into attribute declarations. sself.attribute_typecode_dicts arrayTypecCsM|i} g} } | o| Sn| idƒx|D] } | iƒo | i ƒo| id| t i fƒq7| i ƒoR| i dƒ}|tj o8dti|iƒƒ|it|iƒƒƒf}n_| idƒ}yti|d|dƒ}Wntii}nX|tj od|}nt} | idƒd jo#d | iƒ| id ƒf} nD| idƒd jod | id ƒ} ntd| idƒ‚| id| | |fƒq7| iƒo | i ƒoCx9| i!ƒi"ƒD]%}|i ƒ o||f7}qqWq7q7| iƒoðy| i$ƒ}WnSt%i&j oD| idƒ} |i'i(d| ƒ| |i)joq7n‚nXt}|tj o2|i dƒ}d |iƒ|id ƒf} n|tjoId | idƒiƒ| idƒi+ƒf} | id| | fƒqA|tjory|idƒ\}}Wn,t.j o }| id| | fƒq*X| id| | ti||ƒfƒqA|id ƒ}|iƒ}ti|ƒ}d |iƒ|id ƒf} | id| | |t|ƒfƒq7t.d| i1ƒ‚q7W| SdS(s parameters attributes -- a flat list of all attributes, from this list all items in attribute_typecode_dict will be generated into attrComponents. returns a list of strings representing the attribute_typecode_dict. s# attribute handling codes/%s[("%s","anyAttribute")] = ZSI.TC.AnyElement()stypes %s.%s(None)iis%s()sforms qualifieds ("%s","%s")snames unqualifieds"%s"s&attribute form must be un/qualified %ss %s[%s] = %ssrefs)No schema item for attribute ref (%s, %s)s%s[%s] = ZSI.TC.String()s %s[%s] = %s()s%s[%s] = %s.%s(None)sexpecting an attribute: %sN(2sselfsattribute_typecodesatdsatd_listsformatted_attribute_lists attributessappendsas isWildCards isDeclarationsSCHEMAsXSD3sgetTypeDefinitionstdefsNonesNADsgetAliassgetTargetNamespacesmanglestype_class_namesgetAttributeNamestcs getAttributestsBTIs get_typeclasssZSIsTCsStringskeysContainerErrors isReferencesisAttributeGroupsgetAttributeGroupsgetAttributeContentsgasgetAttributeDeclarations XMLSchemas SchemaErrorsloggersdebugs built_in_refsstpsgetNames namespacestypeNames TypeErrorsexsaliass getItemTrace(sselfs attributesstypeNamesexsgas namespacestpstcstdefsatd_listskeysformatted_attribute_listsasatdsaliasst((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_setAttributesxs~     8 #  # . * '(s__name__s __module__s__doc__sattribute_typecodesSOAPsENCs built_in_refss_setAttributes(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysAttributeMixInns sContainerErrorcBstZRS(N(s__name__s __module__(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysContainerErroréss ContainerBasecBs†tZdZeZeeƒZedƒZd„Zd„Z d„Z d„Z d„Z d„Z d„Zd „Zd „Zd „ZRS( sfBase class for all Containers. func_aname -- function that takes name, and returns aname. s ContainerBasecCs%tdƒ|_t|_t|_dS(Ns (s StringWritersselfscontentsFalses_ContainerBase__setupsNonesns(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__õs cCs|iƒSdS(N(sselfsgetvalue(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__str__úscCst|ƒSdS(s)class/variable name illegalities N(s TextProtectss(sselfss((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysmangleþscCs|ii|ƒdS(N(sselfscontentswritess(sselfss((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyswritescCs|iidi|ƒƒdS(Ns (sselfscontentswritesjoinsa(sselfsa((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys writeArrayscCs td‚dS(sIoverride in subclasses. formats the content in the desired way. sabstract method not implementedN(sNotImplementedError(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent scCs3|i o|iƒt|_n|iiƒSdS(N(sselfs_ContainerBase__setups _setContentsTruescontentsgetvalue(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetvalues   cCs2|ioti|iƒSntd|i‚dS(Nsno self.ns attr defined in %s(sselfsnssNADsgetAliassContainerErrors __class__(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getNSAliass cCs2|ioti|iƒSntd|i‚dS(Nsno self.ns attr defined in %s(sselfsnssNADs getModuleNamesContainerErrors __class__(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetNSModuleNames cCs/|itjo|Sn|i}||ƒSdS(srepresents the aname N(sselfs func_anamesNonesnamesf(sselfsnamesf((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetAttributeName s  (s__name__s __module__s__doc__sTextProtectAttributeNames func_anames staticmethods _GetLoggersloggers__init__s__str__smangleswrites writeArrays _setContentsgetvalues getNSAliassgetNSModuleNamesgetAttributeName(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys ContainerBaseís            sServiceContainerBasecBstZdZedƒZRS(NsSOAPsServiceContainerBase(s__name__s __module__sclientClassSuffixs _GetLoggerslogger(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceContainerBase-ssServiceHeaderContainercBsVtZddddgZedƒZed„Zd„Zd„Zd „Z d „Z RS( Ns import urlparse, typess.from ZSI.TCcompound import ComplexType, Structsfrom ZSI import clients import ZSIsServiceHeaderContainercCsBti|ƒ|i|_t|_t|_g|_||_ dS(N( sServiceContainerBases__init__sselfsimportssbasicsNonestypessmessagessextrass do_extended(sselfs do_extended((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__:s      cCs ||_dS(N(smodulesselfstypes(sselfsmodule((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetTypesModuleNameCscCs ||_dS(N(smodulesselfsmessages(sselfsmodule((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetMessagesModuleNameFscCs@t|ƒttfjo|i|7_n|ii|ƒdS(s_append additional import statement(s). import_stament -- tuple or list or str N(stypes statementsliststuplesselfsextrassappend(sselfs statement((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys appendImportIscCsl|io|id|iƒn|io|id|iƒn|i}||i7}|i|ƒdS(Nsfrom %s import *(sselfsmessagesswritestypessbasicsimportssextrass writeArray(sselfsimports((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentRs    ( s__name__s __module__simportss _GetLoggersloggersFalses__init__ssetTypesModuleNamessetMessagesModuleNames appendImports _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceHeaderContainer2s    sServiceLocatorContainercBsAtZedƒZd„Zd„Zd„Zd„Zd„ZRS(NsServiceLocatorContainercCs5ti|ƒt|_g|_t|_g|_dS(N(sServiceContainerBases__init__sselfsNones serviceNamesportInfos locatorNames portMethods(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__`s     cCsÚ|i|_xÇ|iD]¼}y|iƒ}Wn2ti j o#}|i i d|iƒqnXt |tiƒtjo|i i d|iƒqn|iƒiƒi|iƒi|if}|ii|ƒqWdS(Ns&Skip port(%s), missing address bindings-Skip port(%s), not a SOAP-1.1 address binding(sservicesnamesselfs serviceNamesportsspsgetAddressBindingsabs WSDLToolss WSDLErrorsexsloggerswarnings isinstancesSoapAddressBindingsFalses getBindings getPortTypeslocationsinfosportInfosappend(sselfsservicesinfosabspsex((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpgs  *cCs |iSdS(s0return class name of generated locator. N(sselfs locatorName(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetLocatorNameyscCs |iSdS(sFlist of get port accessor methods of generated locator class. N(sselfs portMethods(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetPortMethods~sc Cs+|i o td‚n|i|iƒ|_d|i|_dd|ig}g|_x¾|iD]³}t |dƒ}t |dƒ}|d}d|}d t||fd t|fd t|i|fd t|fd t||i|i|fg}|ii|ƒ||7}qcW|i|ƒdS(Nsno service name defined!s %sLocators # Locators class %s:iiisget%ss%s%s_address = "%s"s%sdef get%sAddress(self):s%sreturn %sLocator.%s_addresss%sdef %s(self, url=None, **kw):s0%sreturn %s%s(url or %sLocator.%s_address, **kw)(sselfs serviceNamesContainerErrorsmangles locatorNameslocators portMethodssportInfospsNC_to_CNsptNamesbNamessAddsmethodsID1sID2sclientClassSuffixspIsappends writeArray(sselfssAddsptNamespslocatorsbNamespIsmethod((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentƒs       _ ( s__name__s __module__s _GetLoggersloggers__init__ssetUpsgetLocatorNamesgetPortMethodss _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceLocatorContainer]s      sServiceOperationContainercBsƒtZedƒZeed„Zd„Zd„Zd„Ze d„Z e d„Z d„Z d „Z d „Zd „Zd „ZRS( NsServiceOperationContainercCs#ti|ƒ||_||_dS(soParameters: useWSA -- boolean, enable ws-addressing do_extended -- boolean N(sServiceContainerBases__init__sselfsuseWSAs do_extended(sselfsuseWSAs do_extended((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__£s  cCs|itj SdS(N(sselfs inputNamesNone(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyshasInput¬scCs|itj SdS(N(sselfs outputNamesNone(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys hasOutput¯scCst|iƒSdS(N(sIsRPCsselfsbinding_operation(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysisRPC²scCs7|ii}|tjo|ii}nt|ƒSdS(N(sselfsbinding_operationsinputsmsgrolesFalsesoutputs IsLiteral(sselfsinputsmsgrole((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys isLiteralµs  cCs#|tjo |iSn|iSdS(N(sinputsFalsesselfsoutputSimpleTypesinputSimpleType(sselfsinput((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys isSimpleType»s  cCs|iii|iƒSdS(N(sselfsports operationssgetsname(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getOperationÀscCs|ii|iƒSdS(N(sselfsportsgetsname(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getBOperationÃscCs |iSdS(N(sselfsname(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetOperationNameÆscCs‰t|tiƒ o td‚n|i o&td|iƒi|ifƒ‚nt |_t |_ t |_ t |_ t |_t |_t |_t |_t |_|iƒiƒ|_ }|iƒ|_|i|_}||_}|ii|ƒ}|t jo,td|i|iƒi|ifƒ‚n|itiƒ}|t jo td‚n|i|_ |iiti ƒ}| o#td|i"i|ifƒ‚nt |_#|i$djo|i#|_#n|i%ƒi|_ t&|i%ƒƒ|_|i'ƒ|_|i(t j ok|i(iti ƒ}|i( otd|‚n|i)ƒi|_t&|i)ƒƒ|_|i*ƒ|_ndS( sV Parameters: item -- WSDLTools BindingOperation instance. s&Expecting WSDLTools Operation instances7No in sK no match for sexpecting SOAP BindingssBMissing sencodeds)Operation %s, no match for output bindingN(+s isinstancesitems WSDLToolssOperationBindings TypeErrorsinputsWSDLFormatErrors getBindingsnamesNonesselfsports soapactions inputNames outputNamesinputSimpleTypesoutputSimpleTypes inputActions outputActions getPortTypesgetWSDLs_wsdlsbinding_operationsbops operationssgetsops findBindingsSoapOperationBindingssoap_bopsSOAPBindingErrors soapActionsSoapBodyBindingssbodysbindings encodingStylesusesgetInputMessages&FromMessageGetSimpleElementDeclarationsgetInputActionsoutputsgetOutputMessagesgetOutputAction(sselfsitemsnamessbodyssoap_bopsbopsportsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpÉsT  &           ,   #  c Cs.d}d|i}d}|itj od|i}n|io.d|i}d|i }|d7}d}nd}d }d}|d 7}|i o‚|iƒiƒi}d} |iƒiƒiiƒ}yt||iƒ}Wn.tj o"}td d d dd‚nXg} x|D]} | | 7} q"Wx7| D]/}| dt|i|ƒ|i |ƒf7} q=Wdi!| ƒ}t#|ƒdjod|}ndt$|iƒiƒfdt$|i|fdt|ifd| dt|fdt|fdt|i%|fg} nndt$|ifdt$|ifdt|fdt'dfdt|fdt|fdt|i%|fg} |i(oŒdt|fg}|i*ƒo |i+ƒ o;|i,dt|i(|i(fƒ|i,dt|fƒn|i,dt|i(|fƒ|i-o|i,d t|i(fƒnÑ|i oµ|iƒi.ƒiiƒ}t||iƒ}g} x|D]} | | 7} qƒWx:| D]2}|i,d!t|i |ƒ|i|ƒfƒqžWdi!| ƒ} |i,d"t| fƒn|i,d#tƒ| |7} n|i0| ƒd$S(%s3create string representation of operation. skw = {}s$if isinstance(request, %s) is False:ssencodingStyle="%s", swsaction = "%s"s=wsaction=wsaction, endPointReference=self.endPointReference, s, wsaction=wsactions# no input wsactions# no output wsactions**kw)s4Extended generation failure: only supports doc/lit, s3and all element attributes () must refer to single global s/element declaration with complexType content. s! **** TRY WITHOUT EXTENDED **** s%srequest.%s = %s s,is, s %s# op: %ss%sdef %s(self%s):s %srequest = %s()s%ss%s%ss<%sself.binding.Send(None, None, request, soapaction="%s", %ss%sdef %s(self, request):s7%sraise TypeError, "%%s incorrect request type" %% (%s)srequest.__class__sW%stypecode = Struct(pname=None, ofwhat=%s.typecode.ofwhat, pyclass=%s.typecode.pyclass)s-%sresponse = self.binding.Receive(typecode%s)s0%sresponse = self.binding.Receive(%s.typecode%s)s%sreturn %s(response)s%s%s = response.%ss %sreturn %ss%sreturn responseN(1skwstringsselfs inputNamestChecksbindArgss encodingStylesNonesuseWSAs inputActions wsactionIns outputActions wsactionOuts responseArgss do_extendeds getOperationsgetInputMessagesnameswrap_strspartssvaluess partsListsGetPartsSubNamess_wsdlssubNamess TypeErrorsexsWsdl2PythonErrorsargsspasargsID2sgetAttributeNamesmanglesjoinsargsStrslensID1s soapactionsmethodsID3s outputNamesresponsesisRPCs isLiteralsappendsoutputSimpleTypesgetOutputMessagesmargss writeArray(sselfskwstringssubNamesstChecks responseArgssexsargs wsactionOutsbindArgsspaswrap_strsmethodsmargssargss wsactionInsresponsesargsStrs inputNames partsList((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentst        -z m    0(s__name__s __module__s _GetLoggersloggersFalses__init__shasInputs hasOutputsisRPCsTrues isLiterals isSimpleTypes getOperations getBOperationsgetOperationNamessetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceOperationContainer s          ?sServiceOperationsClassContainercBstZdZeZeZeZedƒZ e e ed„Z d„Z e e ƒZ d„Ze eƒZd„Ze eƒZd„Zd„ZRS(s† class variables: readerclass -- writerclass -- operationclass -- representation of each operation. sServiceOperationsClassContainercCsGti|ƒ||_t|_t|_t|_||_||_ dS(s¨Parameters: name -- binding name property -- resource properties useWSA -- boolean, enable ws-addressing name -- binding name N( sServiceContainerBases__init__sselfsuseWSAsNonesrPropsbNames operationss do_extendedswsdls_wsdl(sselfsuseWSAs do_extendedswsdl((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__‘s      cCs ||_dS(sVspecify a reader class name, this must be imported in service module. N(s classNamesclss readerclass(sclss className((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetReaderClass scCs ||_dS(sVspecify a writer class name, this must be imported in service module. N(s classNamesclss writerclass(sclss className((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetWriterClass§scCs ||_dS(s3specify an operation container class name. N(s classNamesclssoperationclass(sclss className((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetOperationClass®scCs³g|_|iƒi|_|iƒiƒiƒ|_|iƒi t i ƒ}|t jotd|i‚nx=|iƒiD],}|i t iƒ}|t jo'|iid|i|ifƒqn|it j oS|ii t iƒ}|t jo-|iid|i|i|ifƒqq.n|iƒiƒii|iƒ}|t jotd|i‚n|id|id|iƒ}|i|ƒ|ii|ƒqWdS(s’This method finds all SOAP Binding Operations, it will skip all bindings that are not SOAP. port -- WSDL.Port instance s&port(%s) missing WSDLTools.SoapBindings5Skip port(%s) operation(%s) no SOAP Binding Operations6Skip port(%s) operation(%s) Bindings(%s) not supporteds*no matching portType/Binding operation(%s)suseWSAs do_extendedN( sselfs operationssports getBindingsnamesbNames getPortTypesgetResourcePropertiessrProps findBindings WSDLToolss SoapBindings soap_bindingsNonesWsdl2PythonErrorsbopsSoapOperationBindingssoap_bopsloggerswarningsinputsSoapBodyBindings soapBodyBinds extensionssgetsopsoperationclasssuseWSAs do_extendedscssetUpsappend(sselfsportssoap_bopsbopscs soapBodyBinds soap_bindingsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp´s4     & !  c Cs|itjod}d}n d}d}|io"d|id|idf}nd}d d t|iƒ|i fd t |fd t |i fd t |i fdt |fdt dt |fg}x$|iD]}||iƒg7}qØW|i|ƒdS(NsendPointReference=None, **kws*self.endPointReference = endPointReferences**kws# no ws-addressings0kw.setdefault("ResourceProperties", ("%s","%s"))iis# no resource propertiess # Methodss class %s%s:s%sdef __init__(self, url, %s):s"%skw.setdefault("readerclass", %s)s"%skw.setdefault("writerclass", %s)s%s%ss.%sself.binding = client.Binding(url=url, **kw)(sselfsuseWSAsTruesctorArgsseprsrPropsrpropsNC_to_CNsbNamesclientClassSuffixsID1sID2s readerclasss writerclasssmethodss operationssopsgetvalues writeArray(sselfsmethodsseprsctorArgssrpropsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentàs  "p (s__name__s __module__s__doc__sNones readerclasss writerclasssServiceOperationContainersoperationclasss _GetLoggersloggersFalses__init__ssetReaderClasss classmethodssetWriterClassssetOperationClassssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceOperationsClassContainer…s         ,sMessageContainerInterfacecBstZedƒZd„ZRS(NsMessageContainerInterfacecCs td‚dS(s*sets the attribute _simple which represents a primitive type message represents, or None if not primitive. soc -- WSDLTools.ServiceOperationContainer instance port -- WSDLTools.Port instance input-- boolean, input messasge or output message of operation. s)Message container must implemented setUp.N(sNotImplementedError(sselfsportssocsinput((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUps(s__name__s __module__s _GetLoggersloggerssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysMessageContainerInterfaces s&ServiceDocumentLiteralMessageContainercBs2tZedƒZed„Zd„Zd„ZRS(Ns&ServiceDocumentLiteralMessageContainercCsti|ƒ||_dS(N(sServiceContainerBases__init__sselfs do_extended(sselfs do_extended((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__s c CsÅ|i}|i|iƒƒ}|_|iƒ}|i ƒi ƒi i |ƒ} |i ƒi i |ƒ} t} |tjo%| iitiƒ} | iƒ}n"| iitiƒ} | iƒ}t|iƒdjo td‚nt}| itj o^t| iƒdjo td‚nt| iƒdjodSn|ii | idƒ}n|p |id}|io td‚n|i odSn|id|_ |id|_!|i|_"dS(Nis!must specify part for doc/lit msgis*not supporting multiple parts in soap bodys!no doc/lit suport for (#sselfscontentssocs isSimpleTypesgetOperationNamessimples_simplesnamesports getBindings getPortTypes operationssgets operationsbopsNones soapBodyBindsinputsTrues findBindings WSDLToolssSoapBodyBindingsgetInputMessagesmessagesoutputsgetOutputMessageslenspartssWsdl2PythonErrorspstypeselementsnsspNamesmName( sselfsportssocsinputsnamespssimplesmessagescontentsbops operations soapBodyBind((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUps8         cCs›y |i}Wntj otd‚nX|ii|_tiƒ}|ii |i ƒt |ii ƒf\|d<|d<|d<|id|gƒdS(s•create string representation of doc/lit message container. If message element is simple(primitive), use python type as base class. scall setUp firstsmessagesprefixstypecodes/%(message)s = %(prefix)s.%(typecode)s().pyclassN(sselfs_simplessimplesAttributeErrors RuntimeErrorscontentsnssKWscopyskwsmNames getNSAliasselement_class_namespNames writeArray(sselfssimpleskw((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentEs   <(s__name__s __module__s _GetLoggersloggersFalses__init__ssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys&ServiceDocumentLiteralMessageContainers   /s!ServiceRPCEncodedMessageContainercBs&tZedƒZd„Zd„ZRS(Ns!ServiceRPCEncodedMessageContainercCsa|iƒ}|iƒii|ƒ}|iƒiƒii|ƒ}||_ ||_ ||_dS(s³ Instance Data: op -- WSDLTools Operation instance bop -- WSDLTools BindingOperation instance input -- boolean input/output N( ssocsgetOperationNamesnamesports getBindings operationssgetsbops getPortTypesopsinputsself(sselfsportssocsinputsnamesbopsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpcs   c say |iWntj otd‚nX|ii} |ii} |ii}|it jo,d|ii} |ii } |ii }n|i t iƒ}| p|i otti‚n|i}|i}tt| iƒiiƒƒ}d|iƒ}| iƒi}tiƒ‰|iˆd<| ˆdºs(+sselfsopsAttributeErrors RuntimeErrorsnamespnamesinputsmsgRolesbopsmsgRoleBsFalsesoutputs findBindings WSDLToolssSoapBodyBindingssbodys namespacesWSInteropErrorsWSISpecsR2717s encodingStylesMessageTypecodeContainerstuples getMessagespartssliststcbsgetTypecodeListsofwhatspyclasssKWscopysfdictsNonesmessagesgetAttributeNamessanamesappendsTypecodeContainerBases metaclasssinserts writeArraysmap( sselfssbodyspyclasssmsgRoleBs encodingStylesmessagestcbs namespacesofwhatspnamesfdictsmsgRolesaname((sfdicts;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentusZ                     (s__name__s __module__s _GetLoggersloggerssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys!ServiceRPCEncodedMessageContainer`s  s!ServiceRPCLiteralMessageContainercBs&tZedƒZd„Zd„ZRS(Ns!ServiceRPCLiteralMessageContainercCsa|iƒ}|iƒii|ƒ}|iƒiƒii|ƒ}||_ ||_||_ dS(s³ Instance Data: op -- WSDLTools Operation instance bop -- WSDLTools BindingOperation instance input -- boolean input/output N( ssocsgetOperationNamesnamesports getBindings operationssgetsbops getPortTypesopsselfsinput(sselfsportssocsinputsnamesbopsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpÀs   cs[y |iWntj otd‚nX|i}|i}|i} |i} |i i}|t jo&d|i} |i } |i i }n|i tiƒ}| p|i otti‚n|i}tt| iƒiiƒƒ}d|iƒ} | iƒi}tiƒ‰|iˆd<| ˆds(+sselfsopsAttributeErrors RuntimeErrors operationsinputsnamespnamesmsgRolesbopsmsgRoleBsFalsesoutputs findBindings WSDLToolssSoapBodyBindingssbodys namespacesWSInteropErrorsWSISpecsR2717sMessageTypecodeContainerstuples getMessagespartssliststcbsgetTypecodeListsofwhatspyclasssKWscopysfdictsNonesmessagesgetAttributeNamessanamesappendsTypecodeContainerBases metaclasssinserts writeArraysmap(sselfssbodyspyclasssmsgRoleBs operationstcbsmessages namespacesinputsofwhatspnamesfdictsmsgRolesaname((sfdicts;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentÒsX                        (s__name__s __module__s _GetLoggersloggerssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys!ServiceRPCLiteralMessageContainer½s  sTypesHeaderContainercBs2tZdZdddgZedƒZd„ZRS(s-imports for all generated types modules. s import ZSIsimport ZSI.TCcompounds\from ZSI.schema import LocalElementDeclaration, ElementDeclaration, TypeDefinition, GTD, GEDsTypesHeaderContainercCs|itiƒdS(N(sselfs writeArraysTypesHeaderContainersimports(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContents(s__name__s __module__s__doc__simportss _GetLoggersloggers _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysTypesHeaderContainers  sNamespaceClassHeaderContainercBstZedƒZd„ZRS(NsNamespaceClassHeaderContainercCsSdddd|idddd|iƒdt|ifg}|i|ƒdS(Ns#is# targetNamespaces# %ss s class %s:s%stargetNamespace = "%s"(sselfsnss getNSAliassID1sheads writeArray(sselfshead((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent(sB (s__name__s __module__s _GetLoggersloggers _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysNamespaceClassHeaderContainer%s sNamespaceClassFooterContainercBstZedƒZd„ZRS(NsNamespaceClassFooterContainercCs-d|iƒ|ifg}|i|ƒdS(Ns# end class %s (tns: %s)(sselfs getNSAliassnssfoots writeArray(sselfsfoot((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent8s(s__name__s __module__s _GetLoggersloggers _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysNamespaceClassFooterContainer5s sTypecodeContainerBasecBsûtZdZdZdZeZeZe dƒZ eed„Z d„Z d„Z d„Zd„Zd „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zed„Zed„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(sGBase class for all classes representing anything with element content. class variables: mixed_content_aname -- text content will be placed in this attribute. attributes_aname -- attributes will be placed in this attribute. metaclass -- set this attribute to specify a pyclass __metaclass__ stextsattrssTypecodeContainerBasecCs©ti|ƒt|_t|_t|_t|_g|_ g|_ t|_ g|_ t|_ t|_d|_t|_||_|tjo h|_n ||_dS(Ns(sTypesContainerBases__init__sselfsNonesnamesFalses allOptionals mgContentscontentFlatteneds elementAttrsstcListElementss tcListSets localTypess parentClasssmixeds extraFlagssattrComponentss do_extendeds extPyClasses(sselfs do_extendeds extPyClasses((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__Qs"                cCsÙti|ƒ}x¿|iD]´}t}|i}|i dƒ}| o|i}t }n|i dƒ}|tjo0|t jotd|iƒ}qtƒ}nw|iƒtjo tƒ}nW|iƒt jo tƒ}n7|iƒotd|iƒ}ntd|iƒ‚|i|ƒ|d7}|io d|i|iƒf|_n d|iƒ|iƒf|_xF|iƒidƒD]/}|o|dt|f7}q|d7}qW|d7}qW|SdS(Nstypes do_extendedsUnknown element declaration: %ss s%s.%ss s%s%s ( s ContainerBasesgetvaluesselfsouts localTypessitemsNonescontentsetps getAttributesqNamesTrueslocalsgetTypeDefinitions ElementLocalComplexTypeContainers do_extendedsElementSimpleTypeContainersisLocalsFalsesElementGlobalDefContainersisSimplesElementLocalSimpleTypeContainers isComplexsWsdl2PythonErrors getItemTracessetUps parentClasss getClassNames getNSAliasssplitslsID1(sselfsetpsqNamescontentsitemslocalslsout((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetvaluepsD              cCs/|itjo|Sn|i}||ƒSdS(srepresents the aname N(sselfs func_anamesNonesnamesf(sselfsnamesf((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetAttributeNames  cCs|i|iƒSdS(s:returns an aname representing mixed text content. N(sselfsgetAttributeNamesmixed_content_aname(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetMixedTextAName§scCs–|i o td‚nt|idƒ o td‚n|iitjot|iƒ}n'|iit jot |iƒ}n|i |ƒSdS(Nsself.name not defined!stypescontainer type not defined!( sselfsnamesContainerErrorshasattrs __class__stypesDEFstype_class_names classnamesDECselement_class_namesmangle(sselfs classname((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getClassName¬s   cCs#|i|ijotSntSdS(N(sselfsnames extPyClassessTruesFalse(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys hasExtPyClass¼scCs6|iƒo!|i|i}di|ƒSndSdS(sIName of generated inner class that will be specified as pyclass. s.sHolderN(sselfs hasExtPyClasss extPyClassessnames classInfosjoin(sselfs classInfo((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getPyClassÃs  cCsVtiƒ}|iƒo-|i|i}|d|d|d} | t@iAjo'tBiC|d|dƒ}|| _En| iF|Œ~ qÚ|t(j o|i8ƒo |iGƒoF|i-dƒ| _>dtH| i>ƒ| _E| iIƒ|iJi|ƒqÚ|t(j o|i8ƒo |iKƒoF|i-dƒ| _>dtH| i>ƒ| _E| iIƒ|iJi|ƒqÚt!d|iƒ‚nK|i ƒo*|i-dƒ}| iIƒ| iF|Œnt!d|iƒ‚|iMi| ƒq¼WdS(sµgenerates ofwhat content, minOccurs/maxOccurs facet generation. Dependency instance attribute: mgContent -- expected to be either a complex definition with model group content, a model group, or model group content. TODO: should only support the first two. localTypes -- produce local class definitions later tcListElements -- elements, local/global s_setTypecodeList(%r): %ssExpecting ModelGroup: %ssModelGroup(%r) contents(%r): %ss#Unexpected modelGroup reference: %ssUnknown schema itemis content: %risunexpected schema item: %ssflat: %rs maxOccurss unboundeds"%s"s minOccursstypescontentsnamesself.__class__.%ssunexpected item: %ssrefN(Nsselfsloggersdebugs mgContents_items getItemTracesflatscontentstypestuplesmgs isModelGroupsWsdl2PythonErrs isReferences RuntimeErrors isDefinitionsisAlls isSequencesisChoicesidxslistslenscsorigs isElementsappendsgetModelGroupReferencesbegIdxsendIdxsrangesisinsertsremovesContainerErrorsTcListComponentContainerstcs _getOccurssminsmaxsnilsNones maxOccurssparentsdefsscounts getAttributesints_parents minOccurss setOccurss_getProcessContentssprocessContentsssetProcessContentss isDeclarations global_typesgetattrsisLocals isQualifiedsFalses unQualifieds isWildCardssetStyleAnyElementsnamesnssSCHEMAsXSD_LISTsBTIs get_typeclassstpcsklasss setGlobalTypes isComplexselement_class_namessetStyleElementReferences localTypessisSimplesrefstcListElements(sselfsorigsparents minOccurssminscontentsmaxs maxOccurssbegIdxsnsstcsdefssflatsnils global_typesprocessContentsscsendIdxstpcsmgsidxsisref((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_setTypecodeList‰sî& &                                  ' '   cCs`|i o|iƒt|_ng}x$|iD]}|it|ƒƒq2Wdi |ƒSdS(Ns, ( sselfs tcListSets_setTypecodeListsTruesliststcListElementssesappendsstrsjoin(sselfslistse((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetTypecodeList<s    cCs–|idƒ}|djo t}nt}|idƒ}|djod|}n|idƒ}|itjod}d}n|||fSdS( Nsnillablestrues maxOccurss unboundeds"%s"s minOccurss0s "unbounded"( ses getAttributesnillablesTruesFalses maxOccurss minOccurssselfs allOptional(sselfses minOccurssnillables maxOccurs((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _getOccursKs    cCs|idƒ}|SdS(NsprocessContents(ses getAttributesprocessContents(sselfsesprocessContents((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_getProcessContents`scCs#yti|iƒ}Wntj o }‚nXg}|idti|iƒt |i ƒ|i ƒ|i ƒfƒ|idt |i ƒ|i ƒfƒ|idt ti|iƒt |i ƒfƒ|idt |i ƒ|i ƒfƒd}x"|D]}|d||f7}qýW|SdS(Ns if %s.%s not in %s.%s.__bases__:s%sbases = list(%s.%s.__bases__)s%sbases.insert(0, %s.%s)s %s%s.%s.__bases__ = tuple(bases)ss%s%s (sNADsgetAliassselfssKlassNSsprefixsWsdlGeneratorErrorsexsbasessappendstype_class_namessKlasss getNSAliass getClassNamesID1sssbsindent(sselfsindentsbsssprefixsbasessex((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getBasesLogicds>&/&( s__name__s __module__s__doc__smixed_content_anamesattributes_anamesNones metaclasssFalseslazys _GetLoggersloggers__init__sgetvaluesgetAttributeNamesgetMixedTextANames getClassNames hasExtPyClasss getPyClasssgetPyClassDefinitions nsuriLogics schemaTagstypeTags literalTags getExtraFlagsssimpleConstructorspnameConstructors_setUpElementss_setTypecodeListsgetTypecodeLists _getOccurss_getProcessContentss getBasesLogic(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysTypecodeContainerBaseBs6   -    +        d ³   sMessageTypecodeContainercBsStZdZedƒZed„Zd„Zd„Zd„Z d„Z d„Z RS(siUsed for RPC style messages, where we have serveral parts serialized within a rpc wrapper name. sMessageTypecodeContainercCsti|ƒ||_dS(N(sTypecodeContainerBases__init__sselfspartss mgContent(sselfsparts((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__Šs cCs!d}}t}|||fSdS(sreturn a 3 item tuple s1N(s minOccurss maxOccurssTruesnillable(sselfses minOccurssnillables maxOccurs((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _getOccursŽs c Cs|iidt|iƒƒxø|iD]í}|i|ƒ\}}}|i ot t i ‚n¦|io’|i\}}tdtƒ}|i|||ƒ|i|_|tijoti||ƒ}||_qdti|ƒt|ƒf|_n td‚|ii |ƒq'WdS(Ns_setTypecodeList: %ss qualifieds%s.%ss-part must define an element or type attribute(!sselfsloggersdebugsstrs mgContentsps _getOccurssminsmaxsnilselementsWSInteropErrorsWSISpecsR2203stypesnsurisnames"RPCMessageTcListComponentContainersFalsestcs setOccurssSCHEMAsXSD_LISTsBTIs get_typeclassstpcsklasssNADsgetAliasstype_class_namesContainerErrorstcListElementssappend( sselfsnamesnilsminsmaxspsnsuristpcstc((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_setTypecodeList•s$     & cCs`|i o|iƒt|_ng}x$|iD]}|it|ƒƒq2Wdi |ƒSdS(Ns, ( sselfs tcListSets_setTypecodeListsTruesliststcListElementssesappendsstrsjoin(sselfslistse((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetTypecodeList²s    cst‡d†ˆiƒSdS(sPreturns a list of anames representing the parts of the message. csˆi|iƒS(N(sselfsgetAttributeNamesesname(se(sself(s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysÀsN(smapsselfstcListElements(sself((sselfs;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetAttributeNames¼scCs ||_dS(N(spartssselfs mgContent(sselfsparts((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetPartsÂs( s__name__s __module__s__doc__s _GetLoggersloggersNones__init__s _getOccurss_setTypecodeListsgetTypecodeListsgetAttributeNamesssetParts(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysMessageTypecodeContainer„s      sTcListComponentContainercBs‰tZdZedƒZed„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „ZRS(sÓEncapsulates a single value in the TClist list. it inherits TypecodeContainerBase only to get the mangle() method, it does not call the baseclass ctor. TODO: Change this inheritance scheme. sTcListComponentContainercCscti|ƒ||_t|_t|_t|_t|_t|_ t|_ t|_ |i ƒdS(sø qualified -- qualify element. All GEDs should be qualified, but local element declarations qualified if form attribute is qualified, else they are unqualified. Only relevant for standard style. N( s ContainerBases__init__sselfs qualifiedsNonesnamesklasss global_typesminsmaxsnilsstylessetStyleElementDeclaration(sselfs qualified((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__Ïs         cCs||_||_||_dS(N(sminsselfsmaxsnil(sselfsminsmaxsnil((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys setOccursäs  cCs ||_dS(N(sprocessContentssself(sselfsprocessContents((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetProcessContentséscCs||f|_dS(N(s namespacesnamesselfs global_type(sselfs namespacesname((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys setGlobalTypeìscCs d|_dS(sLset the element style. standard -- GED or local element sstandardN(sselfsstyle(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetStyleElementDeclarationïscCs d|_dS(sDset the element style. ref -- element reference srefN(sselfsstyle(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetStyleElementReferenceõscCsd|_d|_dS(sPset the element style. anyElement -- element wildcard sanys anyElementN(sselfsnamesstyle(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetStyleAnyElementûs cCs t|_dS(s Do not qualify element. N(sFalsesselfs qualified(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys unQualifiedscCsd|i|i|ifSdS(Ns'minOccurs=%s, maxOccurs=%s, nillable=%s(sselfsminsmaxsnil(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _getOccurs scCsd|iSdS(NsprocessContents="%s"(sselfsprocessContents(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_getProcessContentsscCs[hd|iƒ<d|i|iƒ<d|i<dti<dd<dd<}|i}|t j o|\|d <|d |idjo-d|i |iƒ|i ƒ|i ƒfSnt d |iƒ‚dS( Ns"%s"sstandards (ns,"%s")s5%s(pname=%s, aname="%s", typed=False, encoded=%s, %s)srefs%s(encoded=%s, %s)s anyElements%ZSI.TC.AnyElement(aname="%s", %s, %s)s/Must set style(%s) for typecode list generation(sselfs_encodedsencodedsNonesstylesnamespnames qualifiedsTruesklasssgetAttributeNames _getOccurss_getProcessContentss RuntimeError(sselfspnamesencoded((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _getvalueFs   0-( s__name__s __module__s__doc__s _GetLoggersloggersTruesNones__init__s _getvalue(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys"RPCMessageTcListComponentContainer:s  sElementSimpleTypeContainercBs,tZeZedƒZd„Zd„ZRS(NsElementSimpleTypeContainercse|i|iƒ}|i}|djo d}ntiƒ‰ˆit d|d|i d|id|i d|i ƒd|i ƒd |iƒd |iƒd d ƒ ƒ|iod ˆd rss2%(ID1)sclass %(klass)s(%(subclass)s, %(element)s):s%(ID2)s%(literal)ss%(ID2)s%(schema)ss%(ID2)s%(init)ss*%(ID3)skw["pname"] = ("%(ns)s","%(name)s")s %(ID3)skw["aname"] = "%(aname)s"s"%sclass IHolder(%s): typecode=selfs%skw["pyclass"] = IHolders*%sIHolder.__name__ = "%s_immutable_holder"s%s%s(sselfsgetAttributeNamesnamesanamespyclasssKWscopyskwsupdatesdictsnsssKlasss literalTags schemaTagssimpleConstructors getClassNameslocalsmapselementsappendsappsNonesID3s writeArray(sselfspyclassselementskwsappsaname((skws;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentcs&   ! '   cCsg||_|iƒ|_y4|idƒ|_|iƒ|_|idƒ}Wn1t j o%}t d|i ƒ|iŒ‚nX|tjot d|i ƒƒ‚n|iƒ|iƒf\}}ti||ƒ|_|itjo#t d|||i ƒfƒ‚ny"tittd|iƒ|_Wn1t j o%}t d|i ƒ|iŒ‚nXdS(Nsnamestypes$Error occured processing element: %ss,Missing QName for element type attribute: %ss7No built-in typecode for type definition("%s","%s"): %ss typeclass(stpsselfs_itemsisLocalslocals getAttributesnamesgetTargetNamespacesnssqNames ExceptionsexsWsdl2PythonErrors getItemTracesargssNonesgetNamestnssBTIs get_typeclassssKlasssget_pythontypespyclass(sselfstpstnssqNamesexslocal((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp‹s$ ! #"(s__name__s __module__sDECstypes _GetLoggersloggers _setContentssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysElementSimpleTypeContainer_s  (sElementLocalSimpleTypeContainercBs2tZdZeZedƒZd„Zd„ZRS(slocal simpleType container sElementLocalSimpleTypeContainercsätiƒ‰ˆitd|i|iƒd|id|id|i d|i ƒd|i ƒd|i ƒd|i ƒd d d |i |i ƒƒ ƒ|iod ˆd ¶ss2%(ID1)sclass %(klass)s(%(subclass)s, %(element)s):s%(ID2)s%(literal)ss%(ID2)s%(schema)ss%(ID2)s%(init)ss*%(ID3)skw["pname"] = ("%(ns)s","%(name)s")s %(ID3)skw["aname"] = "%(aname)s"s%(ID3)s%(baseinit)s(sKWscopyskwsupdatesdictsselfsgetAttributeNamesnamesnsssKlasss literalTags schemaTagssimpleConstructors getClassNameslocalsmapselements writeArray(sselfselementskw((skws;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent«s - * cCs²||_|iƒ|_|idƒ|_|iƒ|_|i i }|i ƒo‰y|i ƒ}Wnt ij o}t}nX|iƒ}|tjo%ti|d|dƒ|_dSntd|i iƒ‚n|iƒo‰y|i ƒ}Wnt ij o}t}nX|tjo1|iƒ}ti|d|dƒ|_dSntd|i iƒ‚n|iƒotd|i iƒ‚ntd|i iƒ‚dS(Nsnameiis,unsupported local simpleType restriction: %ss%unsupported local simpleType List: %ss&unsupported local simpleType Union: %ssunexpected schema item: %s(stpsselfs_itemsisLocalslocals getAttributesnamesgetTargetNamespacesnsscontents isRestrictionsgetTypeDefinitionsbases XMLSchemas SchemaErrorsexsNonesgetAttributeBasesqNamesBTIs get_typeclassssKlasssWsdl2PythonErrors getItemTracesisLists getItemTypesisUnion(sselfstpsqNamescontentsbasesex((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpÂs:           ( s__name__s __module__s__doc__sDECstypes _GetLoggersloggers _setContentssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysElementLocalSimpleTypeContainer¥s   s ElementLocalComplexTypeContainercBs,tZeZedƒZd„Zd„ZRS(Ns ElementLocalComplexTypeContainercs¢tiƒ‰y¡ˆitd|iƒddddd|iƒd|iƒd|i ƒd |i d |i d |i |i ƒd |i ƒd |iƒd|id|iƒƒ ƒWnJtj o>}d|iiƒg}||i7}t|ƒ|_‚nX|iodˆds( sKWscopyskwsupdatesdictsselfs getClassNames literalTags schemaTagssimpleConstructorsnssnamesgetAttributeNames nsuriLogicsgetTypecodeListsattribute_typecodes getPyClasss Exceptionsexs_items getItemTracesargsstupleslocalselementsattrComponentsslsappendsstrsgetPyClassDefinitions writeArraysmap(sselfsargsslselementsexskw((skws;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentôs8         $ cCs4||_|idƒ|_|iƒ|_|iƒ|_|i }|t jof|_ dSn|i t jo)f|_ |i |iƒƒ|_dSn|i iƒ}|o|i i iƒo)f|_ |i |iƒƒ|_dSn|o|i i iƒo)f|_ |i |iƒƒ|_dSn|otd|iƒ‚n|i iƒ}|o|i i t jo)f|_ |i |iƒƒ|_dSn|o<|i i iƒo)|i i i t j o|i i i iƒo;|i i i i |_ |i |i i iƒƒ|_dSn|o<|i i iƒo)|i i i t j o|i i i iƒo;|i i i i |_ |i |i i iƒƒ|_dSn|o)f|_ |i |iƒƒ|_dSn|i iƒo/|i i |_ |i |iƒƒ|_dSnf|_ |i |iƒƒ|_dS(sµ {'xsd':['annotation', 'simpleContent', 'complexContent', 'group', 'all', 'choice', 'sequence', 'attribute', 'attributeGroup', 'anyAttribute', 'any']} snameNs3not implemented local complexType/simpleContent: %s(stpsselfs_items getAttributesnamesgetTargetNamespacesnssisLocalslocalscontentscomplexsNones mgContents_setAttributessgetAttributeContentsattrComponentssisSimples is_simples isExtensions isRestrictionsContainerErrors getItemTraces isComplexs is_complexs isModelGroup(sselfstps is_simplescomplexs is_complex((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUps`        FF  (s__name__s __module__sDECstypes _GetLoggersloggers _setContentssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys ElementLocalComplexTypeContainerðs  +sElementGlobalDefContainercBs,tZeZedƒZd„Zd„ZRS(NsElementGlobalDefContainercsPtiƒ‰yžˆitd|iƒddd|iƒd|iƒd|i ƒd|i d|i d |i |i ƒd |i tƒd ti|iƒd t|iƒƒ ƒWnJtj o>}d |iiƒg}||i7}t|ƒ|_‚nX|iodˆd¨sN(sKWscopyskwsupdatesdictsselfs getClassNames literalTags schemaTagssimpleConstructorsnssnamesgetAttributeNames getBasesLogicsID3sNADsgetAliasssKlassNSstype_class_namessKlasss Exceptionsexs_items getItemTracesargsstupleslocalselements writeArraysmap(sselfsargsselementsexskw((skws;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContents,      ! cCsm||_|iƒ|_|idƒ|_|iƒ|_|i dƒ}|idƒ|_ |iƒ|_ dS(Nsnamestype( selementsselfs_itemsisLocalslocals getAttributesnamesgetTargetNamespacesnssgetTypeDefinitionstpssKlassssKlassNS(sselfselementstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpªs (s__name__s __module__sDECstypes _GetLoggersloggers _setContentssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysElementGlobalDefContainer{s  +s"ComplexTypeComplexContentContainercBsJtZdZeZedƒZed„Zd„Z d„Z e d„Z RS(s0Represents ComplexType with ComplexContent. s"ComplexTypeComplexContentContainercCsti|d|ƒdS(Ns do_extended(sTypecodeContainerBases__init__sselfs do_extended(sselfs do_extended((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__»sc Csì||_t|_t|_t|_t|_t|_ |i dƒ|_ |i ƒ|_ |ii} y| idƒ}Wntij o}t}nX|tjo€| idƒ}|tjotd| iƒ‚n|tidfjo|tidfjotd|| iƒf‚q$n|tidfjo|iidƒt|_ hdt<d t<d t<|_t i!|d |d ƒ|_"|d |_#t} xt| i%ƒD]f} | i'ƒtjoM| i d ƒtidfjo*| it(i)dfƒ|id<| } Pqq´q´W|ii*dƒ}| tj o |ii*dƒ}|d i,dƒ}|d }y| i/ti0||ƒ}Wntij o}t}nX|tjot i!||ƒ|id d| iiƒ‚n f|_=|i?t@| ƒƒ|_AdS(sšcomplexContent/[extension,restriction] restriction extension extType -- used in figuring attrs for extensions snamesbasesUnsupported derivation: %ssArraysanyTypesUnsupported base(%s): %ssDerivation of soapenc:Arraysatypesid3sofwhatiisrefs arrayTypes[]s do_extendeds6For Array could not resolve ofwhat typecode(%s,%s): %ss Attribute soapenc:arrayType="%s"sexpecting model group, not: %sN(Bstpsselfs_itemsNonesextTypesFalses restrictions extensions _kw_arrays _is_arrays getAttributesnamesgetTargetNamespacesnsscontents derivationsgetTypeDefinitionsbases XMLSchemas SchemaErrorsexsgetAttributeQNamesContainerErrors getItemTracesSOAPsENCsSCHEMAsXSD3sloggersdebugsTruesID3sBTIs get_typeclassssKlassssKlassNSsattrsgetAttributeContentsas isReferencesWSDLsBASEsgetsqnamesstripsncnames namespaces getSchemaItemsTYPESsofwhatsGetClassNameFromSchemaItems do_extendedsstrs isinstancesXMLSchemaComponentsgetNamesattrss isRestrictions isModelGroupsgroupsgetModelGroupReferences mgContentsWsdl2PythonErrors_setAttributesstuplesattrComponents( sselfstpsqnamesexsgroups namespacesncnamesofwhatsbasesattrsas derivationsattrs((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp¾sš          ,! $        )           c Csátiƒ}g}|ioÙt|iƒtjo |i djot d|i |if‚n|dt |i ƒfdt dt |iƒfdt |iƒfdt |iƒfd|id|idt|i fg7}|i|ƒd Sn|d t |i ƒfdt |iƒfdt |iƒfdt |iƒfdt|iƒfd t|iƒfg7}|id hd t<d|i<ƒ|i|i ftidfj}|o?|d=|iddt |i ƒfƒ|iddt ƒn|idtƒ|idtƒt|iƒdjo@|idtƒx,|iD]}|idt|fƒqQWn|oW|idtƒ||i ƒ7}|i!ƒ|d<|id|ƒ|i|ƒd Snx(|iD]}|idt|fƒqÞW|id|i"tƒƒt#i$|iƒ}t&|i ƒ}|i(oC|idt||fƒ|iddt ƒ|i|ƒd Sn|i)oC|idt||fƒ|iddt ƒ|i|ƒd Snt*d‚d S( s‘JRB What is the difference between instance data ns, name, -- type definition? sKlass, sKlassNS? -- element declaration? sArraysunknown type: (%s,%s)s)%sclass %s(ZSI.TC.Array, TypeDefinition):s3%s#complexType/complexContent base="SOAP-ENC:Array"s%s%ss-%(id3)sofwhat = %(ofwhat)s(None, typed=False)s%(id3)satype = %(atype)ssH%s%s.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)Ns%sclass %s(TypeDefinition):s%sTClist = [%s]s.%(ID3)sattributes = %(atc)s = attributes or {}sID3satcsanyTypeis/%sclass %s(ZSI.TC.ComplexType, TypeDefinition):is.%s#complexType/complexContent restrict anyTypes%sif extend: TClist += ofwhats%sif restrict: TClist = ofwhats%selse:sD%sZSI.TC.ComplexType.__init__(self, None, TClist, pname=pname, **kw)spyclasss!%(ID3)sself.pyclass = %(pyclass)ss%ssA%s%s.%s.__init__(self, pname, ofwhat=TClist, restrict=True, **kw)s)%s#complexType/complexContent restrictionsV%s%s.%s.__init__(self, pname, ofwhat=TClist, extend=True, attributes=attributes, **kw)s'%s#complexType/complexContent extensions1ComplexContent must be a restriction or extension(+sKWscopyskws definitionsselfs _is_arrays_is_xsd_or_soap_nsssKlassNSsFalsessKlasssContainerErrorsID1s getClassNamesID2s schemaTagstypeTagspnameConstructors _kw_arraysID3s writeArrays nsuriLogicsgetTypecodeListsappendsattribute_typecodesSCHEMAsXSD3s isAnyTypesinsertslensattrComponentsslsID4sgetPyClassDefinitions getPyClasss getBasesLogicsNADsgetAliassprefixstype_class_names typeClassNames restrictions extensionsWsdl2PythonError(sselfs definitionsls isAnyTypesprefixskws typeClassName((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent6 sb  & | &!         cCs|o d|SndSdS(NsX%s.__init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw)sZdef __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):(s superclass(sselfs superclass((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyspnameConstructorŸ s ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggersFalses__init__ssetUps _setContentsNonespnameConstructor(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys"ComplexTypeComplexContentContainerµs    x isComplexTypeContainercBsAtZdZeZedƒZed„Zd„Z e d„Z RS(s0Represents a global complexType definition. sComplexTypeContainercCsÒ||_|idƒ|_|iƒ|_|iƒ|_f|_ |i |i ƒƒ|_ ||_|odSn|i}|iƒo|iƒ}n|tjodSn|itjodSn||_ dS(sÁProblematic, loose all model group information. , , .. tp -- type definition empty -- no model group, just use as a dummy holder. snameN(stpsselfs_items getAttributesnamesgetTargetNamespacesnssisMixedsmixeds mgContents_setAttributessgetAttributeContentsattrComponentssemptyscontentsmodels isReferencesgetModelGroupReferencesNone(sselfstpsemptysmodel((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp¬ s$      cCsÆy|dt|iƒfdt|iƒfdt|iƒfdt|iƒfdt|iƒfdt|i ƒfg}WnJt j o>}d|i iƒg}||i7}t|ƒ|_‚nX|idt|ifƒ|idtƒ|idtƒt|iƒdjo@|id tƒx,|iD]}|idt|fƒq6Wn|id t|iƒfƒ||iƒ7}tiƒ}|iƒ|d <|id |ƒ|i|ƒdS( Ns7%sclass %s(ZSI.TCcompound.ComplexType, TypeDefinition):s%s%ss%sTClist = [%s]sFailure processing %ss%s%s = attributes or {}s%sif extend: TClist += ofwhats%sif restrict: TClist = ofwhatis%selse:sY%sZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, %s**kw)spyclasss!%(ID3)sself.pyclass = %(pyclass)s(sID1sselfs getClassNamesID2s schemaTagstypeTagspnameConstructorsID3s nsuriLogicsgetTypecodeLists definitions Exceptionsexs_items getItemTracesargsstuplesappendsattribute_typecodeslensattrComponentsslsID4s getExtraFlagssgetPyClassDefinitionsKWscopyskws getPyClasss writeArray(sselfs definitionsargsskwsexsl((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentÏ s*|    cCs|o d|SndSdS(sY TODO: Logic is a little tricky. If superclass is ComplexType this is not used. sX%s.__init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw)sZdef __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):N(s superclass(sselfs superclass((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyspnameConstructorú s ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggersFalsessetUps _setContentsNonespnameConstructor(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysComplexTypeContainer¦ s   # +sSimpleTypeContainercBsGtZeZedƒZd„Zd„Zd„Zd„Z d„Z RS(NsSimpleTypeContainercCsti|ƒdS(s[ Instance Data From TypecodeContainerBase NOT USED... mgContent N(sTypecodeContainerBases__init__sself(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__ scCs td‚dS(Nsabstract method not implemented(sNotImplementedError(sselfstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp scCs td‚dS(Nsabstract method not implemented(sNotImplementedError(sselfstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent scCsõtt|iƒƒ}t|tiiƒodSnt|tii ƒpt|tii ƒodSnt|tii ƒpt|tii ƒodSnt|tii ƒodSnt|tiiƒpt|tiiƒodSntSdS(Nsstrslongsintsfloatstuple(sevalsstrsselfssKlassspyclasss issubclasssZSIsTCsStringsIlongs IunsignedLongsBooleansIntegersDecimals GregoriansDurationsNone(sselfspyclass((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getPythonType s,,,cCs\g}|iƒ}|tj o5|idt|iƒ|fƒ|idtƒn|SdS(Ns%sclass %s(%s):s%stypecode = self( s definitionsselfs getPythonTypesptsNonesappendsID3s getPyClasssID4(sselfs definitionspt((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetPyClassDefinition" s    ( s__name__s __module__sDEFstypes _GetLoggersloggers__init__ssetUps _setContents getPythonTypesgetPyClassDefinition(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysSimpleTypeContainer s     sRestrictionContainercBs,tZdZedƒZd„Zd„ZRS(s# simpleType/restriction sRestrictionContainercCsã||_|itjotd|iƒ‚n|idƒ|_|i ƒ|_ t|_ |iidƒ}|tj oÉy|ii dƒ}Wntij o }nX|tjohti|iƒ|i ƒƒ|_ |i tj odSntd|i ƒ|iƒ|iƒfƒ‚ntd|iƒ|iƒf‚n|iiƒ}|tj o9t|iƒjo"|iƒjo|iƒjno2t}|iiƒtjo´y|ii dƒ}Wntij o }nX|tjo_|iidƒ}|tj o)ti|i ƒ|iƒƒ|_ dSntd|iƒ‚ntd|iƒ‚n|iiƒtjotd|iƒ‚n|iiƒtjotd|iƒ‚ndSntd |iƒ‚dS( Nsempty simpleType defintion: %ssnamesbasesKno built-in type nor schema instance type for base attribute("%s","%s"): %ss@Not Supporting simpleType/Restriction w/User-Defined Base: %s %ss;Not Supporting simpleType/Restriction w/User-Defined Base: siction base in subtypes: %ss.could not get restriction base in subtypes: %ss#No Restriction @base/simpleType: %s(stpsselfs_itemscontentsNonesWsdl2PythonErrors getItemTraces getAttributesnamesgetTargetNamespacesnsssKlasssbasesgetTypeDefinitionsitems XMLSchemas SchemaErrorsexsBTIs get_typeclasssgetNamesgetSimpleTypeContentsscsTruesisSimplesisLocals isDefinitions isRestrictionsisListsisUnion(sselfstpsitemsbasesexssc((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp1 sP    !/#I  !cCsñdt|iƒ|ifdt|iƒfdt|iƒfdt|iƒfg}|i ƒt jo|i dt |ifƒnX|i dt |ifƒ||i ƒ7}tiƒ}|iƒ|d<|i d|ƒ|i|ƒdS(Ns%sclass %s(%s, TypeDefinition):s%s%ss %s%s.__init__(self, pname, **kw)s.%s%s.__init__(self, pname, pyclass=None, **kw)spyclasss!%(ID3)sself.pyclass = %(pyclass)s(sID1sselfs getClassNamessKlasssID2s schemaTagstypeTagspnameConstructors definitions getPythonTypesNonesappendsID3sgetPyClassDefinitionsKWscopyskws getPyClasss writeArray(sselfs definitionskw((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentv sX (s__name__s __module__s__doc__s _GetLoggersloggerssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysRestrictionContainer+ s   Es!ComplexTypeSimpleContentContainercBs;tZdZeZedƒZd„Zd„Zd„Z RS(s1Represents a ComplexType with simpleContent. s!ComplexTypeSimpleContentContainercCsí||_|i}|i}|idƒ|_|iƒ|_ |i ƒ|i_ |idƒ}|t j olti|d|dƒ|_|i o$|d|df\|_|_n|i|ii ƒ|_dSntd|iƒ‚dS(s?tp -- complexType/simpleContent/[Exention,Restriction] snamesbaseiiNs.simple content derivation bad base attribute: (stpsselfs_itemscontentssimplesdvs getAttributesnamesgetTargetNamespacesnssgetAttributeContentsattributeContentsbasesNonesBTIs get_typeclassssKlassssKlassNSs_setAttributessattrComponentssWsdl2PythonErrors getItemTrace(sselfstpssimplesbasesdv((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp— s"     $c Cs3t|iƒtitfjodt|iƒ|ifdtdt|iƒfdt|i ƒfdt|i ƒfdt |i fg}x(|iD]}|idt |fƒq˜W|idt |ifƒ|iƒtj oA||iƒ7}tiƒ}|iƒ|d<|id|ƒn|i|ƒdSndt|iƒfd tdt|iƒfdt|i ƒfdt|i ƒfdt |iƒfd |it ƒdt |i fg}x(|iD]}|idt |fƒqÒW|id t ti|iƒt|iƒfƒ|i|ƒdS( Ns%sclass %s(%s, TypeDefinition):s9%s# ComplexType/SimpleContent derivation of built-in types%s%ssD%sif getattr(self, "attribute_typecode_dict", None) is None: %s = {}s %s%s.__init__(self, pname, **kw)spyclasss!%(ID3)sself.pyclass = %(pyclass)ss%sclass %s(TypeDefinition):s=%s# ComplexType/SimpleContent derivation of user-defined types%ss#%s%s.%s.__init__(self, pname, **kw)(stypesselfssKlassstypess ClassTypesID1s getClassNamesID2s schemaTagstypeTagspnameConstructorsID3sattribute_typecodes definitionsattrComponentsslsappends getPythonTypesNonesgetPyClassDefinitionsKWscopyskws getPyClasss writeArrays nsuriLogics getBasesLogicsNADsgetAliasssKlassNSstype_class_name(sselfs definitionskwsl((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent¸ s&o   Œ /cCsŠg}|iƒ}|tj oc|idt|iƒ|fƒ|itj o|idt |ifƒn|idt ƒn|SdS(Ns%sclass %s(%s):s%s__metaclass__ = %ss%stypecode = self( s definitionsselfs getPythonTypesptsNonesappendsID3s getPyClasss metaclasssID4(sselfs definitionspt((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetPyClassDefinitionç s   ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggerssetUps _setContentsgetPyClassDefinition(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys!ComplexTypeSimpleContentContainer‘ s   ! /sUnionContainercBs;tZdZeZedƒZd„Zd„Zd„Z RS(sSimpleType Union sUnionContainercCsti|ƒt|_dS(N(sSimpleTypeContainers__init__sselfsNones memberTypes(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__ü s cCsy||_|iiƒtjotd|iƒ‚n|idƒ|_ |i ƒ|_ d|_ |iidƒ|_ dS(Nscontent must be a Union: %ssnames ZSI.TC.Unions memberTypes(stpsselfs_itemscontentsisUnionsFalsesContainerErrors getItemTraces getAttributesnamesgetTargetNamespacesnsssKlasss memberTypes(sselfstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp s  c Cs’dt|iƒ|ifdt|ifdt|iƒfdt|iƒfdt|iƒfdt |i|iƒfg}|i |ƒdS(Ns%sclass %s(%s, TypeDefinition):s%smemberTypes = %ss%s%s( sID1sselfs getClassNamessKlasssID2s memberTypess schemaTagstypeTagspnameConstructorsID3s definitions writeArray(sselfs definition((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent s ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggers__init__ssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysUnionContainerö s    s ListContainercBs2tZdZeZedƒZd„Zd„ZRS(sSimpleType List s ListContainercCsy||_|iiƒtjotd|iƒ‚n|idƒ|_ |i ƒ|_ d|_ |iidƒ|_ dS(Nscontent must be a List: %ssnames ZSI.TC.ListsitemType(stpsselfs_itemscontentsisListsFalsesContainerErrors getItemTraces getAttributesnamesgetTargetNamespacesnsssKlasssitemType(sselfstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp s  c Cs’dt|iƒ|ifdt|ifdt|iƒfdt|iƒfdt|iƒfdt |i|iƒfg}|i |ƒdS(Ns%sclass %s(%s, TypeDefinition):s%sitemType = %ss%s%s( sID1sselfs getClassNamessKlasssID2sitemTypes schemaTagstypeTagspnameConstructorsID3s definitions writeArray(sselfs definition((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent) s ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggerssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys ListContainer s   (Sstypessutilitys StringWriters TextProtectsTextProtectAttributeNamesGetPartsSubNamessNamespaceAliasDictsNADsNCName_to_ClassNamesNC_to_CNsZSIsZSI.TCs_is_xsd_or_soap_nss ZSI.wstoolss XMLSchemas WSDLToolssZSI.wstools.NamespacessSCHEMAsSOAPsWSDLsZSI.wstools.loggings getLoggers _GetLoggersZSI.typeinterpretersBaseTypeInterpreters ZSI.generatesWSISpecsWSInteropErrorsWsdl2PythonErrorsWsdlGeneratorErrorsWSDLFormatErrorsID1sID2sID3sID4sID5sID6sKWsDECsDEFstype_class_nameselement_class_namesIsRPCs IsLiteralsSetTypeNameFuncsSetElementNameFuncsFalsesGetClassNameFromSchemaItems&FromMessageGetSimpleElementDeclarationsAttributeMixIns ExceptionsContainerErrors ContainerBasesServiceContainerBasesServiceHeaderContainersServiceLocatorContainersServiceOperationContainersServiceOperationsClassContainersMessageContainerInterfaces&ServiceDocumentLiteralMessageContainers!ServiceRPCEncodedMessageContainers!ServiceRPCLiteralMessageContainersTypesContainerBasesTypesHeaderContainersNamespaceClassContainerBasesNamespaceClassHeaderContainersNamespaceClassFooterContainersBTIsTypecodeContainerBasesMessageTypecodeContainersTcListComponentContainers"RPCMessageTcListComponentContainersElementSimpleTypeContainersElementLocalSimpleTypeContainers ElementLocalComplexTypeContainersElementGlobalDefContainers"ComplexTypeComplexContentContainersComplexTypeContainersSimpleTypeContainersRestrictionContainers!ComplexTypeSimpleContentContainersUnionContainers ListContainer(EsID5sNADs"ComplexTypeComplexContentContainersWsdl2PythonErrorsTypecodeContainerBases _GetLoggersRestrictionContainersGetPartsSubNamess&FromMessageGetSimpleElementDeclarations!ServiceRPCLiteralMessageContainers_is_xsd_or_soap_nssZSIsDEFsSimpleTypeContainersWSISpecsComplexTypeContainersDECsBaseTypeInterpreters!ComplexTypeSimpleContentContainers ListContainersSetElementNameFuncsMessageContainerInterfacesElementLocalSimpleTypeContainers"RPCMessageTcListComponentContainersTypesHeaderContainers!ServiceRPCEncodedMessageContainersNC_to_CNsContainerErrorstypessElementGlobalDefContainersTypesContainerBasesUnionContainersServiceOperationContainersAttributeMixInsSCHEMAsNamespaceClassContainerBasesServiceLocatorContainers&ServiceDocumentLiteralMessageContainersIsRPCsMessageTypecodeContainers StringWritersWSDLFormatErrorsTcListComponentContainersGetClassNameFromSchemaItemsServiceContainerBases XMLSchemasSetTypeNameFuncsWSDLsNamespaceClassFooterContainersServiceHeaderContainers WSDLToolss ContainerBasesServiceOperationsClassContainersID6s TextProtectsID4sTextProtectAttributeNamesID2sID3s ElementLocalComplexTypeContainersID1sElementSimpleTypeContainersKWsNamespaceClassHeaderContainers IsLiteralsWSInteropErrorsBTIsSOAPsWsdlGeneratorError((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys? s|     %     <     {@+Cå{R]T ÿÿDBt%FK‹:ñ](fe#PK¨58ÒN-½æ%æ%ZSI/generate/pyclass.pyo;ò V@Ec@sudkZdkZdkZdklZd„Zy de_Wnedei‚nX[de fd„ƒYZ dS(N(sTCcCsdSdS(N((((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/pyclass.pys_x ss_ysAuse python-2.4 or later, cannot set function names in python "%s"s pyclass_typecBsVtZdZd„Zd„ZeeƒZd„ZeeƒZd„ZeeƒZRS(sStability: Unstable type for pyclasses used with typecodes. expects the typecode to be available in the classdict. creates python properties for accessing and setting the elements specified in the ofwhat list, and factory methods for constructing the elements. Known Limitations: 1)Uses XML Schema element names directly to create method names, using characters in this set will cause Syntax Errors: (NCNAME)-(letter U digit U "_") c Csë|idƒ}t|ƒdjonë|io|i|ƒ\}}|i |i ƒot d|i ‚n|i |i ƒot d|i ‚n|||i <|||i = 0: return rsplit(self.base_class, '.')[0] return None def getIndent(self, level=1): '''return indent. ''' assert 0 < level < 10, 'bad indent level %d' %level return self.indent*level def getMethodName(self, method): '''return method name. ''' return '%s_%s' %(self.method_prefix, TextProtect(method)) def getClassName(self, name): '''return class name. ''' return NCName_to_ClassName(name) def setClientModuleName(self, name): self.client_module_name = name def getClientModuleName(self): '''return module name. ''' assert self.wsdl is not None, 'initialize, call fromWSDL' if self.client_module_name is not None: return self.client_module_name wsm = WriteServiceModule(self.wsdl, do_extended=self.do_extended) return wsm.getClientModuleName() def getMessagesModuleName(self): '''return module name. ''' assert self.wsdl is not None, 'initialize, call fromWSDL' if self.messages_module_name is not None: return self.messages_module_name wsm = WriteServiceModule(self.wsdl, do_extended=self.do_extended) return wsm.getMessagesModuleName() def getServiceModuleName(self): '''return module name. ''' name = GetModuleBaseNameFromWSDL(self.wsdl) if not name: raise WsdlGeneratorError, 'could not determine a service name' if self.server_module_suffix is None: return name return '%s%s' %(name, self.server_module_suffix) def getClientModulePath(self): return self.client_module_path def setClientModulePath(self, path): '''setup module path to where client module before calling fromWSDL. ''' self.client_module_path = path def setUpClassDef(self, service): '''set class definition and class variables. service -- ServiceDescription instance ''' assert isinstance(service, WSDLTools.Service) is True,\ 'expecting WSDLTools.Service instance.' s = self._services[service.name].classdef print >>s, 'class %s(%s):' %(self.getClassName(service.name), self._getBaseClassName()) print >>s, '%ssoapAction = {}' % self.getIndent(level=1) print >>s, '%sroot = {}' % self.getIndent(level=1) print >>s, "%s_wsdl = \"\"\"%s\"\"\"" % (self.getIndent(level=1), self.raw_wsdl) def setUpImports(self): '''set import statements ''' path = self.getClientModulePath() i = self.imports if path is None: if self.separate_messages: print >>i, 'from %s import *' %self.getMessagesModuleName() else: print >>i, 'from %s import *' %self.getClientModuleName() else: if self.separate_messages: print >>i, 'from %s.%s import *' %(path, self.getMessagesModuleName()) else: print >>i, 'from %s.%s import *' %(path, self.getClientModuleName()) mod = self._getBaseClassModule() name = self._getBaseClassName() if mod is None: print >>i, 'import %s' %name else: print >>i, 'from %s import %s' %(mod, name) def setUpInitDef(self, service): '''set __init__ function ''' assert isinstance(service, WSDLTools.Service), 'expecting WSDLTools.Service instance.' sd = self._services[service.name] d = sd.initdef if sd.location is not None: scheme,netloc,path,params,query,fragment = urlparse.urlparse(sd.location) print >>d, '%sdef __init__(self, post=\'%s\', **kw):' %(self.getIndent(level=1), path) else: print >>d, '%sdef __init__(self, post, **kw):' %self.getIndent(level=1) print >>d, '%s%s.__init__(self, post)' %(self.getIndent(level=2),self._getBaseClassName()) def mangle(self, name): return TextProtect(name) def getAttributeName(self, name): return self.func_aname(name) def setUpMethods(self, port): '''set up all methods representing the port operations. Parameters: port -- Port that defines the operations. ''' assert isinstance(port, WSDLTools.Port), \ 'expecting WSDLTools.Port not: ' %type(port) sd = self._services.get(port.getService().name) assert sd is not None, 'failed to initialize.' binding = port.getBinding() portType = port.getPortType() action_in = '' for bop in binding.operations: try: op = portType.operations[bop.name] except KeyError, ex: raise WsdlGeneratorError,\ 'Port(%s) PortType(%s) missing operation(%s) defined in Binding(%s)' \ %(port.name,portType.name,bop.name,binding.name) for ext in bop.extensions: if isinstance(ext, WSDLTools.SoapOperationBinding): action_in = ext.soapAction break else: warnings.warn('Port(%s) operation(%s) defined in Binding(%s) missing soapAction' \ %(port.name,op.name,binding.name) ) msgin = op.getInputMessage() msgin_name = TextProtect(msgin.name) method_name = self.getMethodName(op.name) m = sd.newMethod() print >>m, '%sdef %s(self, ps):' %(self.getIndent(level=1), method_name) if msgin is not None: print >>m, '%sself.request = ps.Parse(%s.typecode)' %(self.getIndent(level=2), msgin_name) else: print >>m, '%s# NO input' %self.getIndent(level=2) msgout = op.getOutputMessage() if self.do_extended: input_args = msgin.parts.values() iargs = ["%s" % x.name for x in input_args] if msgout is not None: output_args = msgout.parts.values() else: output_args = [] oargs = ["%s" % x.name for x in output_args] if output_args: if len(output_args) > 1: print "Message has more than one return value (Bad Design)." output_args = "(%s)" % output_args else: output_args = "" # Get arg list iSubNames = GetPartsSubNames(msgin.parts.values(), self.wsdl) for i in range( len(iargs) ): # should only be one part to messages here anyway argSubNames = iSubNames[i] if len(argSubNames) > 0: subNamesStr = "self.request." + ", self.request.".join(map(self.getAttributeName, argSubNames)) if len(argSubNames) > 1: subNamesStr = "(" + subNamesStr + ")" print >>m, "%s%s = %s" % (self.getIndent(level=2), iargs[i], subNamesStr) print >>m, "\n%s# If we have an implementation object use it" % (self.getIndent(level=2)) print >>m, "%sif hasattr(self,'impl'):" % (self.getIndent(level=2)) iargsStrList = [] for arg in iargs: argSubNames = iSubNames[i] if len(argSubNames) > 0: if len(argSubNames) > 1: for i in range(len(argSubNames)): iargsStrList.append( arg + "[%i]" % i ) else: iargsStrList.append( arg ) iargsStr = ",".join(iargsStrList) oargsStr = ", ".join(oargs) if len(oargsStr) > 0: oargsStr += " = " print >>m, "%s%sself.impl.%s(%s)" % (self.getIndent(level=3), oargsStr, op.name, iargsStr) if msgout is not None: msgout_name = TextProtect(msgout.name) if self.do_extended: print >>m, '\n%sresult = %s()' %(self.getIndent(level=2), msgout_name) oSubNames = GetPartsSubNames(msgout.parts.values(), self.wsdl) if (len(oSubNames) > 0) and (len(oSubNames[0]) > 0): print >>m, "%s# If we have an implementation object, copy the result " % (self.getIndent(level=2)) print >>m, "%sif hasattr(self,'impl'):" % (self.getIndent(level=2)) # copy result's members for i in range( len(oargs) ): # should only be one part messages here anyway oargSubNames = oSubNames[i] if len(oargSubNames) > 1: print >>m, '%s# Should have a tuple of %i args' %(self.getIndent(level=3), len(oargSubNames)) for j in range(len(oargSubNames)): oargSubName = oargSubNames[j] print >>m, '%sresult.%s = %s[%i]' %(self.getIndent(level=3), self.getAttributeName(oargSubName), oargs[i], j) elif len(oargSubNames) == 1: oargSubName = oargSubNames[0] print >>m, '%sresult.%s = %s' %(self.getIndent(level=3), self.getAttributeName(oargSubName), oargs[i]) else: raise Exception("The subnames within message " + msgout_name + "'s part were not found. Message is the output of operation " + op.name) print >>m, '%sreturn result' %(self.getIndent(level=2)) else: print >>m, '%sreturn %s()' %(self.getIndent(level=2), msgout_name) else: print >>m, '%s# NO output' % self.getIndent(level=2) print >>m, '%sreturn None' % self.getIndent(level=2) print >>m, '' print >>m, '%ssoapAction[\'%s\'] = \'%s\'' %(self.getIndent(level=1), action_in, method_name) print >>m, '%sroot[(%s.typecode.nspname,%s.typecode.pname)] = \'%s\'' \ %(self.getIndent(level=1), msgin_name, msgin_name, method_name) return def setUpHeader(self): print >>self.header, '##################################################' print >>self.header, '# %s.py' %self.getServiceModuleName() print >>self.header, '# Generated by %s' %(self.__class__) print >>self.header, '#' print >>self.header, '##################################################' def write(self, fd=sys.stdout): '''write out to file descriptor, should not need to override. ''' print >>fd, self.header.getvalue() print >>fd, self.imports.getvalue() for k,v in self._services.items(): print >>fd, v.classdef.getvalue() print >>fd, v.initdef.getvalue() for s in v.methods: print >>fd, s.getvalue() def fromWSDL(self, wsdl): '''setup the service description from WSDL, should not need to override. ''' assert isinstance(wsdl, WSDLTools.WSDL), 'expecting WSDL instance' if len(wsdl.services) == 0: raise WsdlGeneratorError, 'No service defined' self.reset() self.wsdl = wsdl self.raw_wsdl = wsdl.document.toxml().replace("\"", "\\\"") self.setUpHeader() self.setUpImports() for service in wsdl.services: sd = self._service_class(service.name) self._services[service.name] = sd for port in service.ports: for e in port.extensions: if isinstance(e, WSDLTools.SoapAddressBinding): sd.location = e.location self.setUpMethods(port) self.setUpClassDef(service) self.setUpInitDef(service) class WSAServiceModuleWriter(ServiceModuleWriter): '''Creates a skeleton for a WS-Address service instance. ''' def __init__(self, base=SimpleWSResource, prefix='wsa', service_class=SOAPService, strict=True): ''' Parameters: strict -- check that soapAction and input ws-action do not collide. ''' ServiceModuleWriter.__init__(self, base, prefix, service_class) self.strict = strict def createMethodBody(msgInName, msgOutName, **kw): '''return a tuple of strings containing the body of a method. msgInName -- None or a str msgOutName -- None or a str ''' body = [] if msgInName is not None: body.append('self.request = ps.Parse(%s.typecode)' %msgInName) if msgOutName is not None: body.append('return %s()' %msgOutName) else: body.append('return None') return tuple(body) createMethodBody = staticmethod(createMethodBody) def setUpClassDef(self, service): '''use soapAction dict for WS-Action input, setup wsAction dict for grabbing WS-Action output values. ''' assert isinstance(service, WSDLTools.Service), 'expecting WSDLTools.Service instance' s = self._services[service.name].classdef print >>s, 'class %s(%s):' %(self.getClassName(service.name), self._getBaseClassName()) print >>s, '%ssoapAction = {}' % self.getIndent(level=1) print >>s, '%swsAction = {}' % self.getIndent(level=1) print >>s, '%sroot = {}' % self.getIndent(level=1) def setUpMethods(self, port): '''set up all methods representing the port operations. Parameters: port -- Port that defines the operations. ''' assert isinstance(port, WSDLTools.Port), \ 'expecting WSDLTools.Port not: ' %type(port) binding = port.getBinding() portType = port.getPortType() service = port.getService() s = self._services[service.name] for bop in binding.operations: try: op = portType.operations[bop.name] except KeyError, ex: raise WsdlGeneratorError,\ 'Port(%s) PortType(%s) missing operation(%s) defined in Binding(%s)' \ %(port.name, portType.name, op.name, binding.name) soap_action = wsaction_in = wsaction_out = None if op.input is not None: wsaction_in = op.getInputAction() if op.output is not None: wsaction_out = op.getOutputAction() for ext in bop.extensions: if isinstance(ext, WSDLTools.SoapOperationBinding) is False: continue soap_action = ext.soapAction if wsaction_in is None: break if wsaction_in == soap_action: break if self.strict is False: warnings.warn(\ 'Port(%s) operation(%s) in Binding(%s) soapAction(%s) != WS-Action(%s)' \ %(port.name, op.name, binding.name, soap_action, wsaction_in), ) break raise WsdlGeneratorError,\ 'Port(%s) operation(%s) in Binding(%s) soapAction(%s) MUST match WS-Action(%s)' \ %(port.name, op.name, binding.name, soap_action, wsaction_in) method_name = self.getMethodName(op.name) m = s.newMethod() print >>m, '%sdef %s(self, ps, address):' %(self.getIndent(level=1), method_name) msgin_name = msgout_name = None msgin,msgout = op.getInputMessage(),op.getOutputMessage() if msgin is not None: msgin_name = TextProtect(msgin.name) if msgout is not None: msgout_name = TextProtect(msgout.name) indent = self.getIndent(level=2) for l in self.createMethodBody(msgin_name, msgout_name): print >>m, indent + l print >>m, '' print >>m, '%ssoapAction[\'%s\'] = \'%s\'' %(self.getIndent(level=1), wsaction_in, method_name) print >>m, '%swsAction[\'%s\'] = \'%s\'' %(self.getIndent(level=1), method_name, wsaction_out) print >>m, '%sroot[(%s.typecode.nspname,%s.typecode.pname)] = \'%s\'' \ %(self.getIndent(level=1), msgin_name, msgin_name, method_name) class DelAuthServiceModuleWriter(ServiceModuleWriter): ''' Includes the generation of lines to call an authorization method on the server side if an authorization function has been defined. ''' def __init__(self, base=ServiceSOAPBinding, prefix='soap', service_class=SOAPService, do_extended=False): ServiceModuleWriter.__init__(self, base=base, prefix=prefix, service_class=service_class, do_extended=do_extended) def fromWSDL(self, wsdl): ServiceModuleWriter.fromWSDL(self, wsdl) for service in wsdl.services: self.setUpAuthDef(service) def setUpInitDef(self, service): ServiceModuleWriter.setUpInitDef(self, service) sd = self._services[service.name] d = sd.initdef print >>d, '%sif kw.has_key(\'impl\'):' % self.getIndent(level=2) print >>d, '%sself.impl = kw[\'impl\']' % self.getIndent(level=3) print >>d, '%sself.auth_method_name = None' % self.getIndent(level=2) print >>d, '%sif kw.has_key(\'auth_method_name\'):' % self.getIndent(level=2) print >>d, '%sself.auth_method_name = kw[\'auth_method_name\']' % self.getIndent(level=3) def setUpAuthDef(self, service): '''set __auth__ function ''' sd = self._services[service.name] e = sd.initdef print >>e, "%sdef authorize(self, auth_info, post, action):" % self.getIndent(level=1) print >>e, "%sif self.auth_method_name and hasattr(self.impl, self.auth_method_name):" % self.getIndent(level=2) print >>e, "%sreturn getattr(self.impl, self.auth_method_name)(auth_info, post, action)" % self.getIndent(level=3) print >>e, "%selse:" % self.getIndent(level=2) print >>e, "%sreturn 1" % self.getIndent(level=3) class DelAuthWSAServiceModuleWriter(WSAServiceModuleWriter): def __init__(self, base=SimpleWSResource, prefix='wsa', service_class=SOAPService, strict=True): WSAServiceModuleWriter.__init__(self, base=base, prefix=prefix, service_class=service_class, strict=strict) def fromWSDL(self, wsdl): WSAServiceModuleWriter.fromWSDL(self, wsdl) for service in wsdl.services: self.setUpAuthDef(service) def setUpInitDef(self, service): WSAServiceModuleWriter.setUpInitDef(self, service) sd = self._services[service.name] d = sd.initdef print >>d, '%sif kw.has_key(\'impl\'):' % self.getIndent(level=2) print >>d, '%sself.impl = kw[\'impl\']' % self.getIndent(level=3) print >>d, '%sif kw.has_key(\'auth_method_name\'):' % self.getIndent(level=2) print >>d, '%sself.auth_method_name = kw[\'auth_method_name\']' % self.getIndent(level=3) def setUpAuthDef(self, service): '''set __auth__ function ''' sd = self._services[service.name] e = sd.initdef print >>e, "%sdef authorize(self, auth_info, post, action):" % self.getIndent(level=1) print >>e, "%sif self.auth_method_name and hasattr(self.impl, self.auth_method_name):" % self.getIndent(level=2) print >>e, "%sreturn getattr(self.impl, self.auth_method_name)(auth_info, post, action)" % self.getIndent(level=3) print >>e, "%selse:" % self.getIndent(level=2) print >>e, "%sreturn 1" % self.getIndent(level=3) PK…¨58F+Wξq¾qZSI/generate/wsdl2dispatch.pyc;ò V@Ec@ssdklZdkZdkZdkZdkZdkZdkZdkZdk l Z dk l Z l Z dklZlZdklZlZlZlZlZdklZlZdk lZd„Zeid d !d d d d d fd d !jo d „Zndfd„ƒYZdfd„ƒYZdefd„ƒYZdefd„ƒYZ defd„ƒYZ!dS((sStringION(s WSDLTools(sWriteServiceModulesMessageTypecodeContainer(sServiceSOAPBindingsSimpleWSResource(s TextProtectsGetModuleBaseNameFromWSDLsNCName_to_ClassNamesGetPartsSubNamessTextProtectAttributeName(sWsdlGeneratorErrorsWsdl2PythonError(sSchemaDescriptioncCs(||i|ƒ ||i|ƒdfS(Ni(sxsrfindssep(sxssep((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys siiisfinalcCs|i|dƒS(Ni(sxsrsplitssep(sxssep((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysss SOAPServicecBstZd„Zd„ZRS(NcCs.tƒ|_tƒ|_d|_g|_dS(Ns(sStringIOsselfsclassdefsinitdefslocationsmethods(sselfsservice((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__s   cCs"|iitƒƒ|idSdS(sname -- operation name iÿÿÿÿN(sselfsmethodssappendsStringIO(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys newMethods(s__name__s __module__s__init__s newMethod(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys SOAPServices sServiceModuleWritercBstZdZddZdZeZeeƒZeZ e de ed„Z d„Z d„Zd„Zd d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Ze i!d„Z"d„Z#RS(s4Creates a skeleton for a SOAP service instance. s is_services_serverssoapcCsgt|_||_||_t|_t|_ t|_ t|_ t|_ t|_ t|_||_dS(sŸ parameters: base -- either a class definition, or a str representing a qualified class name. prefix -- method prefix. N(sNonesselfswsdlsbases base_classsprefixs method_prefixs SOAPServices_service_classsheadersimportss _servicessclient_module_pathsclient_module_namesmessages_module_names do_extended(sselfsbasesprefixs service_classs do_extended((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__'s          cCs%tƒ|_tƒ|_h|_dS(N(sStringIOsselfsheadersimportss _services(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysreset:s  cCs?t|iƒtijo|iiSnt|idƒdSdS(s1return base class name, do not override. s.iÿÿÿÿN(stypesselfs base_classstypess ClassTypes__name__srsplit(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys_getBaseClassName?scCs`t|iƒtijo|iiSn|iidƒdjot|idƒdSntSdS(s3return base class module, do not override. s.iN( stypesselfs base_classstypess ClassTypes __module__sfindsrsplitsNone(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys_getBaseClassModuleFs icCs;d|jo djnptd|‚|i|SdS(sreturn indent. ii sbad indent level %dN(slevelsAssertionErrorsselfsindent(sselfslevel((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys getIndentOs,cCsd|it|ƒfSdS(sreturn method name. s%s_%sN(sselfs method_prefixs TextProtectsmethod(sselfsmethod((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys getMethodNameUscCst|ƒSdS(sreturn class name. N(sNCName_to_ClassNamesname(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys getClassNameZscCs ||_dS(N(snamesselfsclient_module_name(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pyssetClientModuleName_scCs[|itj p td‚|itj o |iSnt|id|iƒ}|iƒSdS(sreturn module name. sinitialize, call fromWSDLs do_extendedN( sselfswsdlsNonesAssertionErrorsclient_module_namesWriteServiceModules do_extendedswsmsgetClientModuleName(sselfswsm((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetClientModuleNamebs  cCs[|itj p td‚|itj o |iSnt|id|iƒ}|iƒSdS(sreturn module name. sinitialize, call fromWSDLs do_extendedN( sselfswsdlsNonesAssertionErrorsmessages_module_namesWriteServiceModules do_extendedswsmsgetMessagesModuleName(sselfswsm((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetMessagesModuleNamels  cCsQt|iƒ}| o td‚n|itjo|Snd||ifSdS(sreturn module name. s"could not determine a service names%s%sN(sGetModuleBaseNameFromWSDLsselfswsdlsnamesWsdlGeneratorErrorsserver_module_suffixsNone(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetServiceModuleNamevs cCs |iSdS(N(sselfsclient_module_path(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetClientModulePathscCs ||_dS(sJsetup module path to where client module before calling fromWSDL. N(spathsselfsclient_module_path(sselfspath((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pyssetClientModulePath„sc Cs·t|tiƒtjp td‚|i|ii }|d|i |iƒ|i ƒfIJ|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒ|ifIJdS( saset class definition and class variables. service -- ServiceDescription instance s%expecting WSDLTools.Service instance.s class %s(%s):s%ssoapAction = {}slevelis %sroot = {}s%s_wsdl = """%s"""N(s isinstancesservices WSDLToolssServicesTruesAssertionErrorsselfs _servicessnamesclassdefsss getClassNames_getBaseClassNames getIndentsraw_wsdl(sselfsservicess((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpClassDef‰s#&c Csí|iƒ}|i}|tjo:|io|d|iƒIJqž|d|iƒIJnC|io|d||iƒfIJn|d||iƒfIJ|i ƒ}|i ƒ}|tjo|d|IJn|d||fIJdS(sset import statements sfrom %s import *sfrom %s.%s import *s import %ssfrom %s import %sN( sselfsgetClientModulePathspathsimportssisNonesseparate_messagessgetMessagesModuleNamesgetClientModuleNames_getBaseClassModulesmods_getBaseClassNamesname(sselfsnamesispathsmod((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpImports–s        c CsÒt|tiƒp td‚|i|i} | i }| i t j oHt i | i ƒ\}}}}}}|d|iddƒ|fIJn|d|iddƒIJ|d|iddƒ|iƒfIJdS( sset __init__ function s%expecting WSDLTools.Service instance.s&%sdef __init__(self, post='%s', **kw):slevelis!%sdef __init__(self, post, **kw):s%s%s.__init__(self, post)iN(s isinstancesservices WSDLToolssServicesAssertionErrorsselfs _servicessnamessdsinitdefsdslocationsNonesurlparsesschemesnetlocspathsparamssquerysfragments getIndents_getBaseClassName( sselfsservicesschemesdsfragmentsnetlocsparamssqueryspathssd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpInitDef­s $$cCst|ƒSdS(N(s TextProtectsname(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysmangle½scCs|i|ƒSdS(N(sselfs func_anamesname(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysgetAttributeNameÀsc"Csft|tiƒptdt|ƒ‚|ii|i ƒi ƒ} | t j p td‚|i ƒ}|iƒ} d} xä|iD]Ù}y| i|i }!Wn:tj o.}td|i | i |i |i f‚nXxU|iD]'}t|tiƒo|i} PqâqâWtid|i |!i |i fƒ|!iƒ} t | i ƒ}|i"|!i ƒ} | i$ƒ}|d|i&ddƒ| fIJ| t j o$|d |i&dd ƒ|fIJn|d |i&dd ƒIJ|!i'ƒ}|i)oº| i*i+ƒ}gi-}|D]}|d |i ƒq~}|t j o|i*i+ƒ}ng}gi-}|D]}|d |i ƒq[~}|o*t3|ƒdjod GHd|}q²nd}t4| i*i+ƒ|i5ƒ}x¦t7t3|ƒƒD]’}||}t3|ƒdjooddi:t;|i<|ƒƒ}t3|ƒdjod|d}n|d|i&dd ƒ|||fIJqàqàW|d|i&dd ƒIJ|d|i&dd ƒIJg}x…|D]}}||}t3|ƒdjoZt3|ƒdjo6x@t7t3|ƒƒD]}|i-|d|ƒqWq4|i-|ƒq·q·Wdi:|ƒ}di:|ƒ}t3|ƒdjo|d7}n|d|i&ddƒ||!i |fIJn|t j o"t |i ƒ}|i)oå|d|i&dd ƒ|fIJt4|i*i+ƒ|i5ƒ}t3|ƒdjot3|dƒdjob|d|i&dd ƒIJ|d|i&dd ƒIJx+t7t3|ƒƒD]}||}t3|ƒdjo„|d|i&ddƒt3|ƒfIJxÇt7t3|ƒƒD]C}||} |d |i&ddƒ|i<| ƒ|||fIJqÒWqvt3|ƒdjo>|d} |d!|i&ddƒ|i<| ƒ||fIJqvtGd"|d#|!i ƒ‚qvWn|d$|i&dd ƒIJq|d%|i&dd ƒ|fIJn5|d&|i&dd ƒIJ|d'|i&dd ƒIJ|dIJ|d(|i&ddƒ| | fIJ|d)|i&ddƒ||| fIJqWd*Sd*S(+s‡set up all methods representing the port operations. Parameters: port -- Port that defines the operations. sexpecting WSDLTools.Port not: sfailed to initialize.ssBPort(%s) PortType(%s) missing operation(%s) defined in Binding(%s)s@Port(%s) operation(%s) defined in Binding(%s) missing soapActions%sdef %s(self, ps):slevelis&%sself.request = ps.Parse(%s.typecode)is %s# NO inputs%ss4Message has more than one return value (Bad Design).s(%s)is self.request.s, self.request.s(s)s %s%s = %ss/ %s# If we have an implementation object use its%sif hasattr(self,'impl'):s[%i]s,s, s = s%s%sself.impl.%s(%s)is %sresult = %s()s9%s# If we have an implementation object, copy the result s"%s# Should have a tuple of %i argss%sresult.%s = %s[%i]s%sresult.%s = %ssThe subnames within message s<'s part were not found. Message is the output of operation s%sreturn results %sreturn %s()s %s# NO outputs %sreturn Nones%ssoapAction['%s'] = '%s's6%sroot[(%s.typecode.nspname,%s.typecode.pname)] = '%s'N(Hs isinstancesports WSDLToolssPortsAssertionErrorstypesselfs _servicessgets getServicesnamessdsNones getBindingsbindings getPortTypesportTypes action_ins operationssbopsopsKeyErrorsexsWsdlGeneratorErrors extensionssextsSoapOperationBindings soapActionswarningsswarnsgetInputMessagesmsgins TextProtects msgin_names getMethodNames method_names newMethodsms getIndentsgetOutputMessagesmsgouts do_extendedspartssvaluess input_argssappends_[1]sxsiargss output_argssoargsslensGetPartsSubNamesswsdls iSubNamessrangesis argSubNamessjoinsmapsgetAttributeNames subNamesStrs iargsStrListsargsiargsStrsoargsStrs msgout_names oSubNamess oargSubNamessjs oargSubNames Exception("sselfsportsiargsStrs argSubNamess msgin_names input_argssbindingsexsargsmsgins method_names action_inssdsportTypesmsgouts subNamesStrs msgout_names output_argssiargss iargsStrListsoargssbopsjsms_[1]sisextsoargsStrs oSubNamess iSubNamess oargSubNamessxs oargSubNamesop((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpMethodsÃs¾'   *   #    $  . . / -   * & ; 4#$ #*cCsV|idIJ|id|iƒIJ|id|iIJ|idIJ|idIJdS(Ns2##################################################s# %s.pys# Generated by %ss#(sselfsheadersgetServiceModuleNames __class__(sself((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpHeader<s   c Cs”||iiƒIJ||iiƒIJxg|iiƒD]V\}}||i iƒIJ||i iƒIJx!|i D]}||iƒIJqrWq6WdS(sLwrite out to file descriptor, should not need to override. N( sfdsselfsheadersgetvaluesimportss _servicessitemssksvsclassdefsinitdefsmethodsss(sselfsfdsssksv((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pyswriteCs  cCs1t|tiƒp td‚t|iƒdjo td‚n|i ƒ||_|i i ƒi ddƒ|_ |iƒ|iƒx¥|iD]š}|i|iƒ}||i|ibuild/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysfromWSDLOs,         ($s__name__s __module__s__doc__sindentsserver_module_suffixsTextProtectAttributeNames func_anames staticmethodsFalsesseparate_messagessServiceSOAPBindings SOAPServices__init__sresets_getBaseClassNames_getBaseClassModules getIndents getMethodNames getClassNamessetClientModuleNamesgetClientModuleNamesgetMessagesModuleNamesgetServiceModuleNamesgetClientModulePathssetClientModulePaths setUpClassDefs setUpImportss setUpInitDefsmanglesgetAttributeNames setUpMethodss setUpHeaderssyssstdoutswritesfromWSDL(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysServiceModuleWriters8                y  sWSAServiceModuleWritercBsJtZdZedeed„Zd„ZeeƒZd„Z d„Z RS(s:Creates a skeleton for a WS-Address service instance. swsacCs#ti||||ƒ||_dS(sm Parameters: strict -- check that soapAction and input ws-action do not collide. N(sServiceModuleWriters__init__sselfsbasesprefixs service_classsstrict(sselfsbasesprefixs service_classsstrict((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__oscKseg}|tj o|id|ƒn|tj o|id|ƒn|idƒt|ƒSdS(s‹return a tuple of strings containing the body of a method. msgInName -- None or a str msgOutName -- None or a str s$self.request = ps.Parse(%s.typecode)s return %s()s return NoneN(sbodys msgInNamesNonesappends msgOutNamestuple(s msgInNames msgOutNameskwsbody((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pyscreateMethodBodyws   c Cs¨t|tiƒp td‚|i|ii}|d|i |iƒ|i ƒfIJ|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJdS( ssuse soapAction dict for WS-Action input, setup wsAction dict for grabbing WS-Action output values. s$expecting WSDLTools.Service instances class %s(%s):s%ssoapAction = {}slevelis%swsAction = {}s %sroot = {}N( s isinstancesservices WSDLToolssServicesAssertionErrorsselfs _servicessnamesclassdefsss getClassNames_getBaseClassNames getIndent(sselfsservicess((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpClassDefˆs&cCs/t|tiƒptdt|ƒ‚|iƒ}|iƒ} |i ƒ}|i |i}xÍ|iD]Â}y| i|i}Wn:tj o.}td|i| i|i|if‚nXt}} } |itj o|iƒ} n|itj o|iƒ} nxÁ|iD]¶}t|ti ƒt!joqn|i"}| tjoPn| |joPn|i#t!jo.t$i%d|i|i|i|| fƒPntd|i|i|i|| f‚qW|i&|iƒ} |i(ƒ}|d|i*ddƒ| fIJt}}|i-ƒ|i.ƒf\}} |tj ot1|iƒ}n| tj ot1| iƒ}n|i*ddƒ}x(|i3||ƒD]}|||IJq™W|d IJ|d |i*ddƒ| | fIJ|d |i*ddƒ| | fIJ|d |i*ddƒ||| fIJqeWd S(s‡set up all methods representing the port operations. Parameters: port -- Port that defines the operations. sexpecting WSDLTools.Port not: sBPort(%s) PortType(%s) missing operation(%s) defined in Binding(%s)sEPort(%s) operation(%s) in Binding(%s) soapAction(%s) != WS-Action(%s)sMPort(%s) operation(%s) in Binding(%s) soapAction(%s) MUST match WS-Action(%s)s%sdef %s(self, ps, address):sleveliiss%ssoapAction['%s'] = '%s's%swsAction['%s'] = '%s's6%sroot[(%s.typecode.nspname,%s.typecode.pname)] = '%s'N(5s isinstancesports WSDLToolssPortsAssertionErrorstypes getBindingsbindings getPortTypesportTypes getServicesservicesselfs _servicessnamesss operationssbopsopsKeyErrorsexsWsdlGeneratorErrorsNones soap_actions wsaction_ins wsaction_outsinputsgetInputActionsoutputsgetOutputActions extensionssextsSoapOperationBindingsFalses soapActionsstrictswarningsswarns getMethodNames method_names newMethodsms getIndents msgin_names msgout_namesgetInputMessagesgetOutputMessagesmsginsmsgouts TextProtectsindentscreateMethodBodysl(sselfsports msgin_namesbindings soap_actionsexsmsginsservicesss method_namesportTypesmsgouts wsaction_outs wsaction_insindentsbopsmslsexts msgout_namesop((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpMethods”s^'    *    ))      ##( s__name__s __module__s__doc__sSimpleWSResources SOAPServicesTrues__init__screateMethodBodys staticmethods setUpClassDefs setUpMethods(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysWSAServiceModuleWriterls    sDelAuthServiceModuleWritercBs>tZdZedeed„Zd„Zd„Zd„Z RS(s Includes the generation of lines to call an authorization method on the server side if an authorization function has been defined. ssoapc Cs)ti|d|d|d|d|ƒdS(Nsbasesprefixs service_classs do_extended(sServiceModuleWriters__init__sselfsbasesprefixs service_classs do_extended(sselfsbasesprefixs service_classs do_extended((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__ØscCs5ti||ƒx|iD]}|i|ƒqWdS(N(sServiceModuleWritersfromWSDLsselfswsdlsservicessservices setUpAuthDef(sselfswsdlsservice((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysfromWSDLÛs c Cs¯ti||ƒ|i|i}|i}|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJdS( Ns%sif kw.has_key('impl'):slevelis%sself.impl = kw['impl']is%sself.auth_method_name = Nones$%sif kw.has_key('auth_method_name'):s0%sself.auth_method_name = kw['auth_method_name']( sServiceModuleWriters setUpInitDefsselfsservices _servicessnamessdsinitdefsds getIndent(sselfsservicesdssd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpInitDefàs c CsŸ|i|i}|i}|d|iddƒIJ|d|iddƒIJ|d|iddƒIJ|d|iddƒIJ|d |iddƒIJd S( sset __auth__ function s/%sdef authorize(self, auth_info, post, action):slevelisI%sif self.auth_method_name and hasattr(self.impl, self.auth_method_name):isK%sreturn getattr(self.impl, self.auth_method_name)(auth_info, post, action)is%selse:s %sreturn 1N(sselfs _servicessservicesnamessdsinitdefses getIndent(sselfsservicesessd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpAuthDefës ( s__name__s __module__s__doc__sServiceSOAPBindings SOAPServicesFalses__init__sfromWSDLs setUpInitDefs setUpAuthDef(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysDelAuthServiceModuleWriterÔs   sDelAuthWSAServiceModuleWritercBs8tZedeed„Zd„Zd„Zd„ZRS(Nswsac Cs)ti|d|d|d|d|ƒdS(Nsbasesprefixs service_classsstrict(sWSAServiceModuleWriters__init__sselfsbasesprefixs service_classsstrict(sselfsbasesprefixs service_classsstrict((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys__init__÷scCs5ti||ƒx|iD]}|i|ƒqWdS(N(sWSAServiceModuleWritersfromWSDLsselfswsdlsservicessservices setUpAuthDef(sselfswsdlsservice((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysfromWSDLús c Cs•ti||ƒ|i|i}|i}|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJ|d|i ddƒIJdS(Ns%sif kw.has_key('impl'):slevelis%sself.impl = kw['impl']is$%sif kw.has_key('auth_method_name'):s0%sself.auth_method_name = kw['auth_method_name']( sWSAServiceModuleWriters setUpInitDefsselfsservices _servicessnamessdsinitdefsds getIndent(sselfsservicesdssd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpInitDefÿs c CsŸ|i|i}|i}|d|iddƒIJ|d|iddƒIJ|d|iddƒIJ|d|iddƒIJ|d |iddƒIJd S( sset __auth__ function s/%sdef authorize(self, auth_info, post, action):slevelisI%sif self.auth_method_name and hasattr(self.impl, self.auth_method_name):isK%sreturn getattr(self.impl, self.auth_method_name)(auth_info, post, action)is%selse:s %sreturn 1N(sselfs _servicessservicesnamessdsinitdefses getIndent(sselfsservicesessd((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys setUpAuthDef s ( s__name__s __module__sSimpleWSResources SOAPServicesTrues__init__sfromWSDLs setUpInitDefs setUpAuthDef(((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pysDelAuthWSAServiceModuleWriterös  ("s cStringIOsStringIOsZSIsstringssyssgetoptsurlparsestypesswarningss ZSI.wstoolss WSDLToolssZSI.generate.wsdl2pythonsWriteServiceModulesMessageTypecodeContainersZSI.ServiceContainersServiceSOAPBindingsSimpleWSResourcesZSI.generate.utilitys TextProtectsGetModuleBaseNameFromWSDLsNCName_to_ClassNamesGetPartsSubNamessTextProtectAttributeNames ZSI.generatesWsdlGeneratorErrorsWsdl2PythonErrorsSchemaDescriptionsrsplits version_infos SOAPServicesServiceModuleWritersWSAServiceModuleWritersDelAuthServiceModuleWritersDelAuthWSAServiceModuleWriter(sServiceModuleWritersWsdl2PythonErrorsSimpleWSResourcesGetModuleBaseNameFromWSDLsGetPartsSubNamessNCName_to_ClassNamesZSIsSchemaDescriptionsDelAuthWSAServiceModuleWriterstypessMessageTypecodeContainersgetoptsDelAuthServiceModuleWritersServiceSOAPBindingsstringswarningssWriteServiceModulessyssWSAServiceModuleWritersrsplits WSDLToolssStringIOs TextProtectsTextProtectAttributeNamesurlparses SOAPServicesWsdlGeneratorError((s>build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2dispatch.pys?s ? %  -  ÿOh"PK„¨58¶y\ \ ZSI/generate/__init__.pyc;ò V@Ec@sddddgZdefd„ƒYZdefd„ƒYZdefd „ƒYZd efd „ƒYZd fd „ƒYZdS(s wsdl2pythonsutilitys containersscommandssWSDLFormatErrorcBstZdZRS(s)Detected errors in the WSDL document. (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWSDLFormatErrors sWsdlGeneratorErrorcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWsdlGeneratorError ssWsdl2PythonErrorcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWsdl2PythonError ssWSInteropErrorcBstZdZRS(s7Conformance to WS-I Basic-Profile 1.0 specification (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWSInteropErrors sWSISpeccBs tZdZdZdZdZRS(Ns¢An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the type attribute.suThe operations in a wsdl:binding in a DESCRIPTION MUST result in wire signatures that are different from one another.s¦An rpc-literal binding in a DESCRIPTION MUST have the namespace attribute specified, the value of which MUST be an absolute URI, on contained soapbind:body elements.s¾A MESSAGE described with an rpc-literal binding that is a response message MUST have a wrapper element whose name is the corresponding wsdl:operation name suffixed with the string "Response"(s__name__s __module__sR2203sR2710sR2717sR2729(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pysWSISpecsN(s__all__s ExceptionsWSDLFormatErrorsWsdlGeneratorErrorsWsdl2PythonErrorsWSInteropErrorsWSISpec(sWSISpecs__all__sWsdl2PythonErrorsWSDLFormatErrorsWSInteropErrorsWsdlGeneratorError((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/__init__.pys?s PKލ58˜ißW^W^ZSI/generate/wsdl2python.pyo;ò V@Ec@sKdkZdklZdklZdklZdkl Z l Z l Z l Z l Z dklZlZlZdklZdklZlZdkTd klZd klZd klZd fd „ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZ dfd„ƒYZ!de!fd„ƒYZ"de!fd„ƒYZ#dS(N(s _get_idstr(s getLogger(s WSDLTools(sSoapAddressBindingsSoapBodyBindings SoapBindingsMimeContentBindingsHttpUrlEncodedBinding(s SchemaReadersElementDeclarations SchemaError(sBaseTypeInterpreter(sWsdlGeneratorErrorsWsdl2PythonError(s*(sutility(sNamespaceAliasDict(sGetModuleBaseNameFromWSDLsWriteServiceModulecBs¶tZdZdZdZdZedƒZeeee e d„Z d„Z d„Z d„Z d „Zd „Zd „Zd „Zd „Zd„Zd„Ze e d„Zd„ZRS(s²top level driver class invoked by wsd2py class variables: client_module_suffix -- suffix of client module. types_module_suffix -- suffix of types module. s _servicess _messagess_services_typessWriteServiceModulecCsp||_||_||_||_t |_ g|_ t |_ t |_ t |_t |_||_||_dS(N(swsdlsselfs_wsdls addressings _addressings notifications _notifications configParsers _configParsersNonesusedNamespacessservicessclient_module_pathstypes_module_namestypes_module_pathsmessages_module_paths do_extendeds extPyClasses(sselfswsdls addressings notifications do_extendeds extPyClassess configParser((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pys__init__;s           cCsQt|iƒ}| o td‚n|itjo|Snd||ifSdS(sclient module name. s"could not determine a service names%s%sN(sGetModuleBaseNameFromWSDLsselfs_wsdlsnamesWsdlGeneratorErrorsclient_module_suffixsNone(sselfsname((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetClientModuleNameJs cCsut|iƒ}| o td‚n|itjo|Snt|iƒdjo|iƒSnd||ifSdS(Ns"could not determine a service nameis%s%s( sGetModuleBaseNameFromWSDLsselfs_wsdlsnamesWsdlGeneratorErrorsmessages_module_suffixsNoneslensgetClientModuleName(sselfsname((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetMessagesModuleNameVs cCs ||_dS(N(snamesselfstypes_module_name(sselfsname((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pyssetTypesModuleNamecscCsl|itj o |iSnt|iƒ}| o td‚n|itjo|Snd||ifSdS(stypes module name. s"could not determine a service names%s%sN(sselfstypes_module_namesNonesGetModuleBaseNameFromWSDLs_wsdlsnamesWsdlGeneratorErrorstypes_module_suffix(sselfsname((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetTypesModuleNamefs  cCs ||_dS(ssetup module path to where client module before calling fromWsdl. module path to types module eg. MyApp.client N(spathsselfsclient_module_path(sselfspath((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pyssetClientModulePathuscCs |iSdS(s4module path to types module eg. MyApp.types N(sselfstypes_module_path(sself((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetTypesModulePath{scCs |iSdS(sEmodule path to messages module same as types path N(sselfsmessages_module_path(sself((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysgetMessagesModulePath€scCs ||_dS(ssetup module path to where service module before calling fromWsdl. module path to types module eg. MyApp.types N(spathsselfstypes_module_path(sselfspath((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pyssetTypesModulePath†scCs ||_dS(ssetup module path to where message module before calling fromWsdl. module path to types module eg. MyApp.types N(spathsselfsmessages_module_path(sselfspath((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pyssetMessagesModulePathŒscCsT|itj odSn|iidƒh|_x‘|iiiƒD]}}|i ƒ}|iidt |ƒ|fƒ|ii |ƒt jog|i|tƒ|_ n€|iƒtjotƒ|_ n]|iƒtjotƒ|_ n:|iƒotd|iƒ|_ ntd|iƒ‚|iid|i |iƒfƒ|i i|ƒdS(s set up global elements. s(expecting global element declaration: %sstypes do_extendedsUnknown element declaration: %ss4ElementWriter setUp container "%r", Schema Item "%s"N(sitems isElementsFalsesisLocalsTrues TypeErrors getItemTraceslocals getAttributesqNamescontentsetpsgetTypeDefinitionsNones ElementLocalComplexTypeContainersselfs do_extendedsElementSimpleTypeContainersElementGlobalDefContainersisSimplesElementLocalSimpleTypeContainers isComplexsWsdl2PythonErrorsloggersdebugssetUp(sselfsitemsetpsqNameslocal((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pysfromSchemaItem¹s,&     #(s__name__s __module__s__doc__s _GetLoggersloggersfromSchemaItem(((s<build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/wsdl2python.pys ElementWriterµs  s TypeWritercBs#tZdZedƒZd„ZRS(s&contains/generates a single definitions TypeWritercCsE|iƒtjp|iƒtjotd|iƒ‚nt|_ |i ƒo‹|i i ƒot ƒ|_ nT|i i ƒotƒ|_ n4|i iƒotƒ|_ ntd|iƒ‚|i i|ƒdSn|iƒoCh}|i tjp |i iƒo5td|id|iƒ|_ |i tj|dd7e>fd8„ƒYZ?e>Z@d9e@fd:„ƒYZAd;e@fd<„ƒYZBeƒZCd=e>fd>„ƒYZDd?eDfd@„ƒYZEdAe4fdB„ƒYZFdCeFfdD„ƒYZGdEeDfdF„ƒYZHdGeDfdH„ƒYZIdIeDe1fdJ„ƒYZJdKeDfdL„ƒYZKdMeDe1fdN„ƒYZLdOeDe1fdP„ƒYZMdQeDfdR„ƒYZNdSeNfdT„ƒYZOdUeNe1fdV„ƒYZPdWeNfdX„ƒYZQdYeNfdZ„ƒYZRdS([N(s StringWriters TextProtectsTextProtectAttributeNamesGetPartsSubNames(sNamespaceAliasDictsNCName_to_ClassName(s_is_xsd_or_soap_ns(s XMLSchemas WSDLTools(sSCHEMAsSOAPsWSDL(s getLogger(sBaseTypeInterpreter(sWSISpecsWSInteropErrorsWsdl2PythonErrorsWsdlGeneratorErrorsWSDLFormatErrors iiiiisID1sID2sID3sID4sID5sID6s_Decs_DefcCsdt|ƒtfS(Ns%s%s(sNC_to_CNsnsDEF(sn((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys'scCsdt|ƒtfS(Ns%s%s(sNC_to_CNsnsDEC(sn((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys(scCs†t|tiƒ o td‚n|iƒitiƒ}|iti ƒ}|i }|t j o|i p|i }n|djSdS(s'item -- OperationBinding instance. s9IsRPC takes 1 argument of type WSDLTools.OperationBindingsrpcN( s isinstancesitems WSDLToolssOperationBindings TypeErrors getBindings findBindings SoapBindings soapbindingsSoapOperationBindingssobsstylesNone(sitemsstylessobs soapbinding((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysIsRPC+s   cCsˆt|tiƒ o td‚nt}|idjp |idjo|iti ƒ}n|tjo t d‚n|i djSdS(s)item -- MessageRoleBinding instance. s?IsLiteral takes 1 argument of type WSDLTools.MessageRoleBindingsinputsoutputsMissing soap:body binding.sliteralN( s isinstancesitems WSDLToolssMessageRoleBindings TypeErrorsNonessbbstypes findBindingsSoapBodyBindings ValueErrorsuse(sitemssbb((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys IsLiteral8s    cCs |adS(N(sfuncstype_class_name(sfunc((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysSetTypeNameFuncEscCs |adS(N(sfuncselement_class_name(sfunc((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysSetElementNameFuncIscCsut|tiƒp td‚ti|iƒƒ}|i ƒt jo(d|t dt |i ƒƒƒfSntSdS(s smust be a schema item.s%s.%ss%sN(s isinstancesitems XMLSchemasXMLSchemaComponentsAssertionErrorsNADsgetAliassgetTargetNamespacesaliass isDefinitionsTruesNC_to_CNstype_class_namesgetAttributeNamesNone(sitems do_extendedsalias((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysGetClassNameFromSchemaItemMs (c Cs&t|tiƒp td‚t|iƒdjo|iditj oÔ|id}|i\}}|i ƒ} | i}|i|ƒo||ii|ƒox||i|}t|tiƒtjo |idƒo:|idƒ}tƒ}|i|d|dƒ}|SqqntSdS(sªIf message consists of one part with an element attribute, and this element is a simpleType return a string representing the python type, else return None. sexpecting WSDLTools.MessageiistypeN(s isinstancesmessages WSDLToolssMessagesAssertionErrorslenspartsselementsNonespartsnsurisnamesgetWSDLswsdlstypesshas_keyselementsses XMLSchemasElementDeclarationsTrues getAttributestypsBaseTypeInterpretersbtsget_pythontypesptype( smessagesesnamestypsptypesbtspartsnsuristypesswsdl((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys&FromMessageGetSimpleElementDeclarationVs-   ') sAttributeMixIncBs/tZdZdZeidfgZd„ZRS(sfor containers that can declare attributes. Class Attributes: attribute_typecode -- typecode attribute name typecode dict built_in_refs -- attribute references that point to built-in types. Skip resolving them into attribute declarations. sself.attribute_typecode_dicts arrayTypecCsM|i} g} } | o| Sn| idƒx|D] } | iƒo | i ƒo| id| t i fƒq7| i ƒoR| i dƒ}|tj o8dti|iƒƒ|it|iƒƒƒf}n_| idƒ}yti|d|dƒ}Wntii}nX|tj od|}nt} | idƒd jo#d | iƒ| id ƒf} nD| idƒd jod | id ƒ} ntd| idƒ‚| id| | |fƒq7| iƒo | i ƒoCx9| i!ƒi"ƒD]%}|i ƒ o||f7}qqWq7q7| iƒoðy| i$ƒ}WnSt%i&j oD| idƒ} |i'i(d| ƒ| |i)joq7n‚nXt}|tj o2|i dƒ}d |iƒ|id ƒf} n|tjoId | idƒiƒ| idƒi+ƒf} | id| | fƒqA|tjory|idƒ\}}Wn,t.j o }| id| | fƒq*X| id| | ti||ƒfƒqA|id ƒ}|iƒ}ti|ƒ}d |iƒ|id ƒf} | id| | |t|ƒfƒq7t.d| i1ƒ‚q7W| SdS(s parameters attributes -- a flat list of all attributes, from this list all items in attribute_typecode_dict will be generated into attrComponents. returns a list of strings representing the attribute_typecode_dict. s# attribute handling codes/%s[("%s","anyAttribute")] = ZSI.TC.AnyElement()stypes %s.%s(None)iis%s()sforms qualifieds ("%s","%s")snames unqualifieds"%s"s&attribute form must be un/qualified %ss %s[%s] = %ssrefs)No schema item for attribute ref (%s, %s)s%s[%s] = ZSI.TC.String()s %s[%s] = %s()s%s[%s] = %s.%s(None)sexpecting an attribute: %sN(2sselfsattribute_typecodesatdsatd_listsformatted_attribute_lists attributessappendsas isWildCards isDeclarationsSCHEMAsXSD3sgetTypeDefinitionstdefsNonesNADsgetAliassgetTargetNamespacesmanglestype_class_namesgetAttributeNamestcs getAttributestsBTIs get_typeclasssZSIsTCsStringskeysContainerErrors isReferencesisAttributeGroupsgetAttributeGroupsgetAttributeContentsgasgetAttributeDeclarations XMLSchemas SchemaErrorsloggersdebugs built_in_refsstpsgetNames namespacestypeNames TypeErrorsexsaliass getItemTrace(sselfs attributesstypeNamesexsgas namespacestpstcstdefsatd_listskeysformatted_attribute_listsasatdsaliasst((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_setAttributesxs~     8 #  # . * '(s__name__s __module__s__doc__sattribute_typecodesSOAPsENCs built_in_refss_setAttributes(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysAttributeMixInns sContainerErrorcBstZRS(N(s__name__s __module__(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysContainerErroréss ContainerBasecBs†tZdZeZeeƒZedƒZd„Zd„Z d„Z d„Z d„Z d„Z d„Zd „Zd „Zd „ZRS( sfBase class for all Containers. func_aname -- function that takes name, and returns aname. s ContainerBasecCs%tdƒ|_t|_t|_dS(Ns (s StringWritersselfscontentsFalses_ContainerBase__setupsNonesns(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__õs cCs|iƒSdS(N(sselfsgetvalue(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__str__úscCst|ƒSdS(s)class/variable name illegalities N(s TextProtectss(sselfss((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysmangleþscCs|ii|ƒdS(N(sselfscontentswritess(sselfss((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyswritescCs|iidi|ƒƒdS(Ns (sselfscontentswritesjoinsa(sselfsa((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys writeArrayscCs td‚dS(sIoverride in subclasses. formats the content in the desired way. sabstract method not implementedN(sNotImplementedError(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent scCs3|i o|iƒt|_n|iiƒSdS(N(sselfs_ContainerBase__setups _setContentsTruescontentsgetvalue(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetvalues   cCs2|ioti|iƒSntd|i‚dS(Nsno self.ns attr defined in %s(sselfsnssNADsgetAliassContainerErrors __class__(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getNSAliass cCs2|ioti|iƒSntd|i‚dS(Nsno self.ns attr defined in %s(sselfsnssNADs getModuleNamesContainerErrors __class__(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetNSModuleNames cCsV|itjo|Snt|iƒptdt|iƒ‚|i}||ƒSdS(srepresents the aname s:expecting callable method for attribute func_aname, not %sN(sselfs func_anamesNonesnamescallablesAssertionErrorstypesf(sselfsnamesf((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetAttributeName s ' (s__name__s __module__s__doc__sTextProtectAttributeNames func_anames staticmethods _GetLoggersloggers__init__s__str__smangleswrites writeArrays _setContentsgetvalues getNSAliassgetNSModuleNamesgetAttributeName(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys ContainerBaseís            sServiceContainerBasecBstZdZedƒZRS(NsSOAPsServiceContainerBase(s__name__s __module__sclientClassSuffixs _GetLoggerslogger(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceContainerBase-ssServiceHeaderContainercBsVtZddddgZedƒZed„Zd„Zd„Zd „Z d „Z RS( Ns import urlparse, typess.from ZSI.TCcompound import ComplexType, Structsfrom ZSI import clients import ZSIsServiceHeaderContainercCsBti|ƒ|i|_t|_t|_g|_||_ dS(N( sServiceContainerBases__init__sselfsimportssbasicsNonestypessmessagessextrass do_extended(sselfs do_extended((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__:s      cCs ||_dS(N(smodulesselfstypes(sselfsmodule((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetTypesModuleNameCscCs ||_dS(N(smodulesselfsmessages(sselfsmodule((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetMessagesModuleNameFscCs@t|ƒttfjo|i|7_n|ii|ƒdS(s_append additional import statement(s). import_stament -- tuple or list or str N(stypes statementsliststuplesselfsextrassappend(sselfs statement((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys appendImportIscCsl|io|id|iƒn|io|id|iƒn|i}||i7}|i|ƒdS(Nsfrom %s import *(sselfsmessagesswritestypessbasicsimportssextrass writeArray(sselfsimports((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentRs    ( s__name__s __module__simportss _GetLoggersloggersFalses__init__ssetTypesModuleNamessetMessagesModuleNames appendImports _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceHeaderContainer2s    sServiceLocatorContainercBsAtZedƒZd„Zd„Zd„Zd„Zd„ZRS(NsServiceLocatorContainercCs5ti|ƒt|_g|_t|_g|_dS(N(sServiceContainerBases__init__sselfsNones serviceNamesportInfos locatorNames portMethods(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__`s     cCs÷t|tiƒp td‚|i|_xÇ|iD]¼}y|i ƒ}Wn2ti j o#}|iid|iƒq3nXt|tiƒtjo|iid|iƒq3n|iƒiƒi|iƒi|if}|ii|ƒq3WdS(Ns%expecting WDSLTools.Service instance.s&Skip port(%s), missing address bindings-Skip port(%s), not a SOAP-1.1 address binding(s isinstancesservices WSDLToolssServicesAssertionErrorsnamesselfs serviceNamesportsspsgetAddressBindingsabs WSDLErrorsexsloggerswarningsSoapAddressBindingsFalses getBindings getPortTypeslocationsinfosportInfosappend(sselfsservicesinfosabspsex((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpgs  *cCs |iSdS(s0return class name of generated locator. N(sselfs locatorName(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetLocatorNameyscCs |iSdS(sFlist of get port accessor methods of generated locator class. N(sselfs portMethods(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetPortMethods~sc Cs+|i o td‚n|i|iƒ|_d|i|_dd|ig}g|_x¾|iD]³}t |dƒ}t |dƒ}|d}d|}d t||fd t|fd t|i|fd t|fd t||i|i|fg}|ii|ƒ||7}qcW|i|ƒdS(Nsno service name defined!s %sLocators # Locators class %s:iiisget%ss%s%s_address = "%s"s%sdef get%sAddress(self):s%sreturn %sLocator.%s_addresss%sdef %s(self, url=None, **kw):s0%sreturn %s%s(url or %sLocator.%s_address, **kw)(sselfs serviceNamesContainerErrorsmangles locatorNameslocators portMethodssportInfospsNC_to_CNsptNamesbNamessAddsmethodsID1sID2sclientClassSuffixspIsappends writeArray(sselfssAddsptNamespslocatorsbNamespIsmethod((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentƒs       _ ( s__name__s __module__s _GetLoggersloggers__init__ssetUpsgetLocatorNamesgetPortMethodss _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceLocatorContainer]s      sServiceOperationContainercBsƒtZedƒZeed„Zd„Zd„Zd„Ze d„Z e d„Z d„Z d „Z d „Zd „Zd „ZRS( NsServiceOperationContainercCs#ti|ƒ||_||_dS(soParameters: useWSA -- boolean, enable ws-addressing do_extended -- boolean N(sServiceContainerBases__init__sselfsuseWSAs do_extended(sselfsuseWSAs do_extended((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__£s  cCs|itj SdS(N(sselfs inputNamesNone(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyshasInput¬scCs|itj SdS(N(sselfs outputNamesNone(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys hasOutput¯scCst|iƒSdS(N(sIsRPCsselfsbinding_operation(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysisRPC²scCs7|ii}|tjo|ii}nt|ƒSdS(N(sselfsbinding_operationsinputsmsgrolesFalsesoutputs IsLiteral(sselfsinputsmsgrole((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys isLiteralµs  cCs#|tjo |iSn|iSdS(N(sinputsFalsesselfsoutputSimpleTypesinputSimpleType(sselfsinput((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys isSimpleType»s  cCs|iii|iƒSdS(N(sselfsports operationssgetsname(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getOperationÀscCs|ii|iƒSdS(N(sselfsportsgetsname(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getBOperationÃscCs |iSdS(N(sselfsname(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetOperationNameÆscCs¶t|tiƒ o td‚n|i o&td|iƒi|ifƒ‚nt |_t |_ t |_ t |_ t |_t |_t |_t |_t |_|iƒiƒ|_ }|iƒ|_|i|_}||_}|ii|ƒ}|t jo,td|i|iƒi|ifƒ‚n|itiƒ}|t jo td‚n|i|_ |iiti ƒ}| o#td|i"i|ifƒ‚nt |_#|i$djo=|i#t%i&jpt'dt%i&|i#f‚|i#|_#n|i(ƒi|_ t)|i(ƒƒ|_|i*ƒ|_|i+t j ok|i+iti ƒ}|i+ otd|‚n|i,ƒi|_t)|i,ƒƒ|_|i-ƒ|_nd S( sV Parameters: item -- WSDLTools BindingOperation instance. s&Expecting WSDLTools Operation instances7No in sK no match for sexpecting SOAP BindingssBMissing sencodeds#Supporting encodingStyle=%s, not %ss)Operation %s, no match for output bindingN(.s isinstancesitems WSDLToolssOperationBindings TypeErrorsinputsWSDLFormatErrors getBindingsnamesNonesselfsports soapactions inputNames outputNamesinputSimpleTypesoutputSimpleTypes inputActions outputActions getPortTypesgetWSDLs_wsdlsbinding_operationsbops operationssgetsops findBindingsSoapOperationBindingssoap_bopsSOAPBindingErrors soapActionsSoapBodyBindingssbodysbindings encodingStylesusesSOAPsENCsAssertionErrorsgetInputMessages&FromMessageGetSimpleElementDeclarationsgetInputActionsoutputsgetOutputMessagesgetOutputAction(sselfsitemsnamessbodyssoap_bopsbopsportsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpÉsT  &           ,   # - c Cs.d}d|i}d}|itj od|i}n|io.d|i}d|i }|d7}d}nd}d }d}|d 7}|i o‚|iƒiƒi}d} |iƒiƒiiƒ}yt||iƒ}Wn.tj o"}td d d dd‚nXg} x|D]} | | 7} q"Wx7| D]/}| dt|i|ƒ|i |ƒf7} q=Wdi!| ƒ}t#|ƒdjod|}ndt$|iƒiƒfdt$|i|fdt|ifd| dt|fdt|fdt|i%|fg} nndt$|ifdt$|ifdt|fdt'dfdt|fdt|fdt|i%|fg} |i(oŒdt|fg}|i*ƒo |i+ƒ o;|i,dt|i(|i(fƒ|i,dt|fƒn|i,dt|i(|fƒ|i-o|i,d t|i(fƒnÑ|i oµ|iƒi.ƒiiƒ}t||iƒ}g} x|D]} | | 7} qƒWx:| D]2}|i,d!t|i |ƒ|i|ƒfƒqžWdi!| ƒ} |i,d"t| fƒn|i,d#tƒ| |7} n|i0| ƒd$S(%s3create string representation of operation. skw = {}s$if isinstance(request, %s) is False:ssencodingStyle="%s", swsaction = "%s"s=wsaction=wsaction, endPointReference=self.endPointReference, s, wsaction=wsactions# no input wsactions# no output wsactions**kw)s4Extended generation failure: only supports doc/lit, s3and all element attributes () must refer to single global s/element declaration with complexType content. s! **** TRY WITHOUT EXTENDED **** s%srequest.%s = %s s,is, s %s# op: %ss%sdef %s(self%s):s %srequest = %s()s%ss%s%ss<%sself.binding.Send(None, None, request, soapaction="%s", %ss%sdef %s(self, request):s7%sraise TypeError, "%%s incorrect request type" %% (%s)srequest.__class__sW%stypecode = Struct(pname=None, ofwhat=%s.typecode.ofwhat, pyclass=%s.typecode.pyclass)s-%sresponse = self.binding.Receive(typecode%s)s0%sresponse = self.binding.Receive(%s.typecode%s)s%sreturn %s(response)s%s%s = response.%ss %sreturn %ss%sreturn responseN(1skwstringsselfs inputNamestChecksbindArgss encodingStylesNonesuseWSAs inputActions wsactionIns outputActions wsactionOuts responseArgss do_extendeds getOperationsgetInputMessagesnameswrap_strspartssvaluess partsListsGetPartsSubNamess_wsdlssubNamess TypeErrorsexsWsdl2PythonErrorsargsspasargsID2sgetAttributeNamesmanglesjoinsargsStrslensID1s soapactionsmethodsID3s outputNamesresponsesisRPCs isLiteralsappendsoutputSimpleTypesgetOutputMessagesmargss writeArray(sselfskwstringssubNamesstChecks responseArgssexsargs wsactionOutsbindArgsspaswrap_strsmethodsmargssargss wsactionInsresponsesargsStrs inputNames partsList((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentst        -z m    0(s__name__s __module__s _GetLoggersloggersFalses__init__shasInputs hasOutputsisRPCsTrues isLiterals isSimpleTypes getOperations getBOperationsgetOperationNamessetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceOperationContainer s          ?sServiceOperationsClassContainercBstZdZeZeZeZedƒZ e e ed„Z d„Z e e ƒZ d„Ze eƒZd„Ze eƒZd„Zd„ZRS(s† class variables: readerclass -- writerclass -- operationclass -- representation of each operation. sServiceOperationsClassContainercCsGti|ƒ||_t|_t|_t|_||_||_ dS(s¨Parameters: name -- binding name property -- resource properties useWSA -- boolean, enable ws-addressing name -- binding name N( sServiceContainerBases__init__sselfsuseWSAsNonesrPropsbNames operationss do_extendedswsdls_wsdl(sselfsuseWSAs do_extendedswsdl((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__‘s      cCs ||_dS(sVspecify a reader class name, this must be imported in service module. N(s classNamesclss readerclass(sclss className((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetReaderClass scCs ||_dS(sVspecify a writer class name, this must be imported in service module. N(s classNamesclss writerclass(sclss className((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetWriterClass§scCs ||_dS(s3specify an operation container class name. N(s classNamesclssoperationclass(sclss className((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetOperationClass®scCsÐt|tiƒp td‚g|_|iƒi|_ |iƒi ƒi ƒ|_ |iƒi tiƒ}|tjotd|i‚nx=|iƒiD],}|i tiƒ}|tjo'|iid|i|ifƒqœn|itj oS|ii tiƒ}|tjo-|iid|i|i|ifƒqœqKn|iƒi ƒii|iƒ}|tjotd|i‚n|id|id|iƒ}|i!|ƒ|ii"|ƒqœWdS( s’This method finds all SOAP Binding Operations, it will skip all bindings that are not SOAP. port -- WSDL.Port instance s!expecting WSDLTools Port instances&port(%s) missing WSDLTools.SoapBindings5Skip port(%s) operation(%s) no SOAP Binding Operations6Skip port(%s) operation(%s) Bindings(%s) not supporteds*no matching portType/Binding operation(%s)suseWSAs do_extendedN(#s isinstancesports WSDLToolssPortsAssertionErrorsselfs operationss getBindingsnamesbNames getPortTypesgetResourcePropertiessrProps findBindings SoapBindings soap_bindingsNonesWsdl2PythonErrorsbopsSoapOperationBindingssoap_bopsloggerswarningsinputsSoapBodyBindings soapBodyBinds extensionssgetsopsoperationclasssuseWSAs do_extendedscssetUpsappend(sselfsportssoap_bopsbopscs soapBodyBinds soap_bindingsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp´s4     & !  c Cs|itjod}d}n d}d}|io"d|id|idf}nd}d d t|iƒ|i fd t |fd t |i fd t |i fdt |fdt dt |fg}x$|iD]}||iƒg7}qØW|i|ƒdS(NsendPointReference=None, **kws*self.endPointReference = endPointReferences**kws# no ws-addressings0kw.setdefault("ResourceProperties", ("%s","%s"))iis# no resource propertiess # Methodss class %s%s:s%sdef __init__(self, url, %s):s"%skw.setdefault("readerclass", %s)s"%skw.setdefault("writerclass", %s)s%s%ss.%sself.binding = client.Binding(url=url, **kw)(sselfsuseWSAsTruesctorArgsseprsrPropsrpropsNC_to_CNsbNamesclientClassSuffixsID1sID2s readerclasss writerclasssmethodss operationssopsgetvalues writeArray(sselfsmethodsseprsctorArgssrpropsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentàs  "p (s__name__s __module__s__doc__sNones readerclasss writerclasssServiceOperationContainersoperationclasss _GetLoggersloggersFalses__init__ssetReaderClasss classmethodssetWriterClassssetOperationClassssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysServiceOperationsClassContainer…s         ,sMessageContainerInterfacecBstZedƒZd„ZRS(NsMessageContainerInterfacecCs td‚dS(s*sets the attribute _simple which represents a primitive type message represents, or None if not primitive. soc -- WSDLTools.ServiceOperationContainer instance port -- WSDLTools.Port instance input-- boolean, input messasge or output message of operation. s)Message container must implemented setUp.N(sNotImplementedError(sselfsportssocsinput((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUps(s__name__s __module__s _GetLoggersloggerssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysMessageContainerInterfaces s&ServiceDocumentLiteralMessageContainercBs2tZedƒZed„Zd„Zd„ZRS(Ns&ServiceDocumentLiteralMessageContainercCsti|ƒ||_dS(N(sServiceContainerBases__init__sselfs do_extended(sselfs do_extended((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__s c CsÅ|i}|i|iƒƒ}|_|iƒ}|i ƒi ƒi i |ƒ} |i ƒi i |ƒ} t} |tjo%| iitiƒ} | iƒ}n"| iitiƒ} | iƒ}t|iƒdjo td‚nt}| itj o^t| iƒdjo td‚nt| iƒdjodSn|ii | idƒ}n|p |id}|io td‚n|i odSn|id|_ |id|_!|i|_"dS(Nis!must specify part for doc/lit msgis*not supporting multiple parts in soap bodys!no doc/lit suport for (#sselfscontentssocs isSimpleTypesgetOperationNamessimples_simplesnamesports getBindings getPortTypes operationssgets operationsbopsNones soapBodyBindsinputsTrues findBindings WSDLToolssSoapBodyBindingsgetInputMessagesmessagesoutputsgetOutputMessageslenspartssWsdl2PythonErrorspstypeselementsnsspNamesmName( sselfsportssocsinputsnamespssimplesmessagescontentsbops operations soapBodyBind((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUps8         cCs›y |i}Wntj otd‚nX|ii|_tiƒ}|ii |i ƒt |ii ƒf\|d<|d<|d<|id|gƒdS(s•create string representation of doc/lit message container. If message element is simple(primitive), use python type as base class. scall setUp firstsmessagesprefixstypecodes/%(message)s = %(prefix)s.%(typecode)s().pyclassN(sselfs_simplessimplesAttributeErrors RuntimeErrorscontentsnssKWscopyskwsmNames getNSAliasselement_class_namespNames writeArray(sselfssimpleskw((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentEs   <(s__name__s __module__s _GetLoggersloggersFalses__init__ssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys&ServiceDocumentLiteralMessageContainers   /s!ServiceRPCEncodedMessageContainercBs&tZedƒZd„Zd„ZRS(Ns!ServiceRPCEncodedMessageContainercCs—|iƒ}|iƒii|ƒ}|iƒiƒii|ƒ}|t j pt d|‚|t j pt d|‚||_ ||_ ||_dS(s³ Instance Data: op -- WSDLTools Operation instance bop -- WSDLTools BindingOperation instance input -- boolean input/output sport has no operation %ss port has no binding operation %sN(ssocsgetOperationNamesnamesports getBindings operationssgetsbops getPortTypesopsNonesAssertionErrorsinputsself(sselfsportssocsinputsnamesbopsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpcs   c s¢y |iWntj otd‚nX|ii} |ii} |ii}|it jo,d|ii} |ii } |ii }n|i t iƒ}| p|i otti‚n|idjp td‚|i}|tijptdti|f‚|i}tt| iƒiiƒƒ}d|iƒ}| iƒi}t"i#ƒ‰|iˆd<| ˆdºs(/sselfsopsAttributeErrors RuntimeErrorsnamespnamesinputsmsgRolesbopsmsgRoleBsFalsesoutputs findBindings WSDLToolssSoapBodyBindingssbodys namespacesWSInteropErrorsWSISpecsR2717susesAssertionErrors encodingStylesSOAPsENCsMessageTypecodeContainerstuples getMessagespartssliststcbsgetTypecodeListsofwhatspyclasssKWscopysfdictsNonesmessagesgetAttributeNamessanamesappendsTypecodeContainerBases metaclasssinserts writeArraysmap( sselfssbodyspyclasssmsgRoleBs encodingStylesmessagestcbs namespacesofwhatspnamesfdictsmsgRolesaname((sfdicts;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentusZ      '               (s__name__s __module__s _GetLoggersloggerssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys!ServiceRPCEncodedMessageContainer`s  s!ServiceRPCLiteralMessageContainercBs&tZedƒZd„Zd„ZRS(Ns!ServiceRPCLiteralMessageContainercCs—|iƒ}|iƒii|ƒ}|iƒiƒii|ƒ}|t j pt d|‚|t j pt d|‚||_ ||_||_ dS(s³ Instance Data: op -- WSDLTools Operation instance bop -- WSDLTools BindingOperation instance input -- boolean input/output sport has no operation %ss port has no binding operation %sN(ssocsgetOperationNamesnamesports getBindings operationssgetsbops getPortTypesopsNonesAssertionErrorsselfsinput(sselfsportssocsinputsnamesbopsop((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpÀs   cs[y |iWntj otd‚nX|i}|i}|i} |i} |i i}|t jo&d|i} |i } |i i }n|i tiƒ}| p|i otti‚n|i}tt| iƒiiƒƒ}d|iƒ} | iƒi}tiƒ‰|iˆd<| ˆds(+sselfsopsAttributeErrors RuntimeErrors operationsinputsnamespnamesmsgRolesbopsmsgRoleBsFalsesoutputs findBindings WSDLToolssSoapBodyBindingssbodys namespacesWSInteropErrorsWSISpecsR2717sMessageTypecodeContainerstuples getMessagespartssliststcbsgetTypecodeListsofwhatspyclasssKWscopysfdictsNonesmessagesgetAttributeNamessanamesappendsTypecodeContainerBases metaclasssinserts writeArraysmap(sselfssbodyspyclasssmsgRoleBs operationstcbsmessages namespacesinputsofwhatspnamesfdictsmsgRolesaname((sfdicts;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentÒsX                        (s__name__s __module__s _GetLoggersloggerssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys!ServiceRPCLiteralMessageContainer½s  sTypesHeaderContainercBs2tZdZdddgZedƒZd„ZRS(s-imports for all generated types modules. s import ZSIsimport ZSI.TCcompounds\from ZSI.schema import LocalElementDeclaration, ElementDeclaration, TypeDefinition, GTD, GEDsTypesHeaderContainercCs|itiƒdS(N(sselfs writeArraysTypesHeaderContainersimports(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContents(s__name__s __module__s__doc__simportss _GetLoggersloggers _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysTypesHeaderContainers  sNamespaceClassHeaderContainercBstZedƒZd„ZRS(NsNamespaceClassHeaderContainercCsSdddd|idddd|iƒdt|ifg}|i|ƒdS(Ns#is# targetNamespaces# %ss s class %s:s%stargetNamespace = "%s"(sselfsnss getNSAliassID1sheads writeArray(sselfshead((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent(sB (s__name__s __module__s _GetLoggersloggers _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysNamespaceClassHeaderContainer%s sNamespaceClassFooterContainercBstZedƒZd„ZRS(NsNamespaceClassFooterContainercCs-d|iƒ|ifg}|i|ƒdS(Ns# end class %s (tns: %s)(sselfs getNSAliassnssfoots writeArray(sselfsfoot((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent8s(s__name__s __module__s _GetLoggersloggers _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysNamespaceClassFooterContainer5s sTypecodeContainerBasecBsûtZdZdZdZeZeZe dƒZ eed„Z d„Z d„Z d„Zd„Zd „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zed„Zed„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(sGBase class for all classes representing anything with element content. class variables: mixed_content_aname -- text content will be placed in this attribute. attributes_aname -- attributes will be placed in this attribute. metaclass -- set this attribute to specify a pyclass __metaclass__ stextsattrssTypecodeContainerBasecCs©ti|ƒt|_t|_t|_t|_g|_ g|_ t|_ g|_ t|_ t|_d|_t|_||_|tjo h|_n ||_dS(Ns(sTypesContainerBases__init__sselfsNonesnamesFalses allOptionals mgContentscontentFlatteneds elementAttrsstcListElementss tcListSets localTypess parentClasssmixeds extraFlagssattrComponentss do_extendeds extPyClasses(sselfs do_extendeds extPyClasses((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__Qs"                cCs ti|ƒ}xó|iD]è}t}t|i ƒjo|i ƒjnp t d‚|i}|i dƒ}| o|i}t}n|idƒ}|tjo0|tjotd|iƒ}qNtƒ}nw|i ƒtjo tƒ}nW|iƒtjo tƒ}n7|iƒotd|iƒ}ntd|iƒ‚|i|ƒ|d7}|io d|i|iƒf|_n d|iƒ|iƒf|_xF|iƒidƒD]/}|o|dt!|f7}qÄ|d7}qÄW|d7}qW|SdS( Nsexpecting local elements onlystypes do_extendedsUnknown element declaration: %ss s%s.%ss s%s%s ("s ContainerBasesgetvaluesselfsouts localTypessitemsNonescontentsTrues isElementsisLocalsAssertionErrorsetps getAttributesqNameslocalsgetTypeDefinitions ElementLocalComplexTypeContainers do_extendedsElementSimpleTypeContainersFalsesElementGlobalDefContainersisSimplesElementLocalSimpleTypeContainers isComplexsWsdl2PythonErrors getItemTracessetUps parentClasss getClassNames getNSAliasssplitslsID1(sselfslocalsetpsqNamescontentsitemslsout((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetvaluepsD 4             cCsV|itjo|Snt|iƒptdt|iƒ‚|i}||ƒSdS(srepresents the aname s:expecting callable method for attribute func_aname, not %sN(sselfs func_anamesNonesnamescallablesAssertionErrorstypesf(sselfsnamesf((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetAttributeNames ' cCs|i|iƒSdS(s:returns an aname representing mixed text content. N(sselfsgetAttributeNamesmixed_content_aname(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetMixedTextAName§scCs–|i o td‚nt|idƒ o td‚n|iitjot|iƒ}n'|iit jot |iƒ}n|i |ƒSdS(Nsself.name not defined!stypescontainer type not defined!( sselfsnamesContainerErrorshasattrs __class__stypesDEFstype_class_names classnamesDECselement_class_namesmangle(sselfs classname((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getClassName¬s   cCs#|i|ijotSntSdS(N(sselfsnames extPyClassessTruesFalse(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys hasExtPyClass¼scCs6|iƒo!|i|i}di|ƒSndSdS(sIName of generated inner class that will be specified as pyclass. s.sHolderN(sselfs hasExtPyClasss extPyClassessnames classInfosjoin(sselfs classInfo((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getPyClassÃs  cCsVtiƒ}|iƒo-|i|i}|d|d|d} | t@iAjo'tBiC|d|dƒ}|| _En| iF|Œ~ qÚ|t(j o|i8ƒo |iGƒoF|i-dƒ| _>dtH| i>ƒ| _E| iIƒ|iJi|ƒqÚ|t(j o|i8ƒo |iKƒoF|i-dƒ| _>dtH| i>ƒ| _E| iIƒ|iJi|ƒqÚt!d|iƒ‚nK|i ƒo*|i-dƒ}| iIƒ| iF|Œnt!d|iƒ‚|iMi| ƒq¼WdS(sµgenerates ofwhat content, minOccurs/maxOccurs facet generation. Dependency instance attribute: mgContent -- expected to be either a complex definition with model group content, a model group, or model group content. TODO: should only support the first two. localTypes -- produce local class definitions later tcListElements -- elements, local/global s_setTypecodeList(%r): %ssExpecting ModelGroup: %ssModelGroup(%r) contents(%r): %ss#Unexpected modelGroup reference: %ssUnknown schema itemis content: %risunexpected schema item: %ssflat: %rs maxOccurss unboundeds"%s"s minOccursstypescontentsnamesself.__class__.%ssunexpected item: %ssrefN(Nsselfsloggersdebugs mgContents_items getItemTracesflatscontentstypestuplesmgs isModelGroupsWsdl2PythonErrs isReferences RuntimeErrors isDefinitionsisAlls isSequencesisChoicesidxslistslenscsorigs isElementsappendsgetModelGroupReferencesbegIdxsendIdxsrangesisinsertsremovesContainerErrorsTcListComponentContainerstcs _getOccurssminsmaxsnilsNones maxOccurssparentsdefsscounts getAttributesints_parents minOccurss setOccurss_getProcessContentssprocessContentsssetProcessContentss isDeclarations global_typesgetattrsisLocals isQualifiedsFalses unQualifieds isWildCardssetStyleAnyElementsnamesnssSCHEMAsXSD_LISTsBTIs get_typeclassstpcsklasss setGlobalTypes isComplexselement_class_namessetStyleElementReferences localTypessisSimplesrefstcListElements(sselfsorigsparents minOccurssminscontentsmaxs maxOccurssbegIdxsnsstcsdefssflatsnils global_typesprocessContentsscsendIdxstpcsmgsidxsisref((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_setTypecodeList‰sî& &                                  ' '   cCs`|i o|iƒt|_ng}x$|iD]}|it|ƒƒq2Wdi |ƒSdS(Ns, ( sselfs tcListSets_setTypecodeListsTruesliststcListElementssesappendsstrsjoin(sselfslistse((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetTypecodeList<s    cCs–|idƒ}|djo t}nt}|idƒ}|djod|}n|idƒ}|itjod}d}n|||fSdS( Nsnillablestrues maxOccurss unboundeds"%s"s minOccurss0s "unbounded"( ses getAttributesnillablesTruesFalses maxOccurss minOccurssselfs allOptional(sselfses minOccurssnillables maxOccurs((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _getOccursKs    cCs|idƒ}|SdS(NsprocessContents(ses getAttributesprocessContents(sselfsesprocessContents((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_getProcessContents`scCs#yti|iƒ}Wntj o }‚nXg}|idti|iƒt |i ƒ|i ƒ|i ƒfƒ|idt |i ƒ|i ƒfƒ|idt ti|iƒt |i ƒfƒ|idt |i ƒ|i ƒfƒd}x"|D]}|d||f7}qýW|SdS(Ns if %s.%s not in %s.%s.__bases__:s%sbases = list(%s.%s.__bases__)s%sbases.insert(0, %s.%s)s %s%s.%s.__bases__ = tuple(bases)ss%s%s (sNADsgetAliassselfssKlassNSsprefixsWsdlGeneratorErrorsexsbasessappendstype_class_namessKlasss getNSAliass getClassNamesID1sssbsindent(sselfsindentsbsssprefixsbasessex((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getBasesLogicds>&/&( s__name__s __module__s__doc__smixed_content_anamesattributes_anamesNones metaclasssFalseslazys _GetLoggersloggers__init__sgetvaluesgetAttributeNamesgetMixedTextANames getClassNames hasExtPyClasss getPyClasssgetPyClassDefinitions nsuriLogics schemaTagstypeTags literalTags getExtraFlagsssimpleConstructorspnameConstructors_setUpElementss_setTypecodeListsgetTypecodeLists _getOccurss_getProcessContentss getBasesLogic(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysTypecodeContainerBaseBs6   -    +        d ³   sMessageTypecodeContainercBsStZdZedƒZed„Zd„Zd„Zd„Z d„Z d„Z RS(siUsed for RPC style messages, where we have serveral parts serialized within a rpc wrapper name. sMessageTypecodeContainercCsti|ƒ||_dS(N(sTypecodeContainerBases__init__sselfspartss mgContent(sselfsparts((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__Šs cCs!d}}t}|||fSdS(sreturn a 3 item tuple s1N(s minOccurss maxOccurssTruesnillable(sselfses minOccurssnillables maxOccurs((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _getOccursŽs c CsI|iidt|iƒƒt|iƒtjptdt|iƒ‚xø|iD]í}|i |ƒ\}}}|i otti‚n¦|io’|i\}}tdtƒ}|i|||ƒ|i|_|tijoti||ƒ}||_q1dti|ƒt|ƒf|_n t d‚|i!i"|ƒqTWdS(Ns_setTypecodeList: %ss%expecting tuple for mgContent not: %ss qualifieds%s.%ss-part must define an element or type attribute(#sselfsloggersdebugsstrs mgContentstypestuplesAssertionErrorsps _getOccurssminsmaxsnilselementsWSInteropErrorsWSISpecsR2203snsurisnames"RPCMessageTcListComponentContainersFalsestcs setOccurssSCHEMAsXSD_LISTsBTIs get_typeclassstpcsklasssNADsgetAliasstype_class_namesContainerErrorstcListElementssappend( sselfsnamesnilsminsmaxspsnsuristpcstc((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_setTypecodeList•s$-     & cCs`|i o|iƒt|_ng}x$|iD]}|it|ƒƒq2Wdi |ƒSdS(Ns, ( sselfs tcListSets_setTypecodeListsTruesliststcListElementssesappendsstrsjoin(sselfslistse((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetTypecodeList²s    cst‡d†ˆiƒSdS(sPreturns a list of anames representing the parts of the message. csˆi|iƒS(N(sselfsgetAttributeNamesesname(se(sself(s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysÀsN(smapsselfstcListElements(sself((sselfs;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetAttributeNames¼scCs ||_dS(N(spartssselfs mgContent(sselfsparts((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetPartsÂs( s__name__s __module__s__doc__s _GetLoggersloggersNones__init__s _getOccurss_setTypecodeListsgetTypecodeListsgetAttributeNamesssetParts(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysMessageTypecodeContainer„s      sTcListComponentContainercBs‰tZdZedƒZed„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „ZRS(sÓEncapsulates a single value in the TClist list. it inherits TypecodeContainerBase only to get the mangle() method, it does not call the baseclass ctor. TODO: Change this inheritance scheme. sTcListComponentContainercCscti|ƒ||_t|_t|_t|_t|_t|_ t|_ t|_ |i ƒdS(sø qualified -- qualify element. All GEDs should be qualified, but local element declarations qualified if form attribute is qualified, else they are unqualified. Only relevant for standard style. N( s ContainerBases__init__sselfs qualifiedsNonesnamesklasss global_typesminsmaxsnilsstylessetStyleElementDeclaration(sselfs qualified((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__Ïs         cCs||_||_||_dS(N(sminsselfsmaxsnil(sselfsminsmaxsnil((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys setOccursäs  cCs ||_dS(N(sprocessContentssself(sselfsprocessContents((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetProcessContentséscCs||f|_dS(N(s namespacesnamesselfs global_type(sselfs namespacesname((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys setGlobalTypeìscCs d|_dS(sLset the element style. standard -- GED or local element sstandardN(sselfsstyle(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetStyleElementDeclarationïscCs d|_dS(sDset the element style. ref -- element reference srefN(sselfsstyle(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetStyleElementReferenceõscCsd|_d|_dS(sPset the element style. anyElement -- element wildcard sanys anyElementN(sselfsnamesstyle(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetStyleAnyElementûs cCs t|_dS(s Do not qualify element. N(sFalsesselfs qualified(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys unQualifiedscCsd|i|i|ifSdS(Ns'minOccurs=%s, maxOccurs=%s, nillable=%s(sselfsminsmaxsnil(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _getOccurs scCsd|iSdS(NsprocessContents="%s"(sselfsprocessContents(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys_getProcessContentsscCs[hd|iƒ<d|i|iƒ<d|i<dti<dd<dd<}|i}|t j o|\|d <|d |idjo-d|i |iƒ|i ƒ|i ƒfSnt d |iƒ‚dS( Ns"%s"sstandards (ns,"%s")s5%s(pname=%s, aname="%s", typed=False, encoded=%s, %s)srefs%s(encoded=%s, %s)s anyElements%ZSI.TC.AnyElement(aname="%s", %s, %s)s/Must set style(%s) for typecode list generation(sselfs_encodedsencodedsNonesstylesnamespnames qualifiedsTruesklasssgetAttributeNames _getOccurss_getProcessContentss RuntimeError(sselfspnamesencoded((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _getvalueFs   0-( s__name__s __module__s__doc__s _GetLoggersloggersTruesNones__init__s _getvalue(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys"RPCMessageTcListComponentContainer:s  sElementSimpleTypeContainercBs,tZeZedƒZd„Zd„ZRS(NsElementSimpleTypeContainercse|i|iƒ}|i}|djo d}ntiƒ‰ˆit d|d|i d|id|i d|i ƒd|i ƒd |iƒd |iƒd d ƒ ƒ|iod ˆd rss2%(ID1)sclass %(klass)s(%(subclass)s, %(element)s):s%(ID2)s%(literal)ss%(ID2)s%(schema)ss%(ID2)s%(init)ss*%(ID3)skw["pname"] = ("%(ns)s","%(name)s")s %(ID3)skw["aname"] = "%(aname)s"s"%sclass IHolder(%s): typecode=selfs%skw["pyclass"] = IHolders*%sIHolder.__name__ = "%s_immutable_holder"s%s%s(sselfsgetAttributeNamesnamesanamespyclasssKWscopyskwsupdatesdictsnsssKlasss literalTags schemaTagssimpleConstructors getClassNameslocalsmapselementsappendsappsNonesID3s writeArray(sselfspyclassselementskwsappsaname((skws;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentcs&   ! '   cCsg||_|iƒ|_y4|idƒ|_|iƒ|_|idƒ}Wn1t j o%}t d|i ƒ|iŒ‚nX|tjot d|i ƒƒ‚n|iƒ|iƒf\}}ti||ƒ|_|itjo#t d|||i ƒfƒ‚ny"tittd|iƒ|_Wn1t j o%}t d|i ƒ|iŒ‚nXdS(Nsnamestypes$Error occured processing element: %ss,Missing QName for element type attribute: %ss7No built-in typecode for type definition("%s","%s"): %ss typeclass(stpsselfs_itemsisLocalslocals getAttributesnamesgetTargetNamespacesnssqNames ExceptionsexsWsdl2PythonErrors getItemTracesargssNonesgetNamestnssBTIs get_typeclassssKlasssget_pythontypespyclass(sselfstpstnssqNamesexslocal((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp‹s$ ! #"(s__name__s __module__sDECstypes _GetLoggersloggers _setContentssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysElementSimpleTypeContainer_s  (sElementLocalSimpleTypeContainercBs2tZdZeZedƒZd„Zd„ZRS(slocal simpleType container sElementLocalSimpleTypeContainercsätiƒ‰ˆitd|i|iƒd|id|id|i d|i ƒd|i ƒd|i ƒd|i ƒd d d |i |i ƒƒ ƒ|iod ˆd ¶ss2%(ID1)sclass %(klass)s(%(subclass)s, %(element)s):s%(ID2)s%(literal)ss%(ID2)s%(schema)ss%(ID2)s%(init)ss*%(ID3)skw["pname"] = ("%(ns)s","%(name)s")s %(ID3)skw["aname"] = "%(aname)s"s%(ID3)s%(baseinit)s(sKWscopyskwsupdatesdictsselfsgetAttributeNamesnamesnsssKlasss literalTags schemaTagssimpleConstructors getClassNameslocalsmapselements writeArray(sselfselementskw((skws;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent«s - * cCs||_|iƒtjo9|itj o)|iiƒtjo|iiƒtjpt d|i ƒ‚|iƒ|_ |i dƒ|_ |iƒ|_|ii}|iƒo‰y|iƒ}Wntij o}t}nX|iƒ}|tjo%ti|d|dƒ|_dSntd|ii ƒ‚n|iƒo‰y|iƒ}Wntij o}t}nX|tjo1|iƒ}ti|d|dƒ|_dSntd|ii ƒ‚n|iƒotd|ii ƒ‚ntd|ii ƒ‚dS( Nsexpecting local simple type: %ssnameiis,unsupported local simpleType restriction: %ss%unsupported local simpleType List: %ss&unsupported local simpleType Union: %ssunexpected schema item: %s(stpsselfs_items isElementsTruescontentsNonesisLocalsisSimplesAssertionErrors getItemTraceslocals getAttributesnamesgetTargetNamespacesnss isRestrictionsgetTypeDefinitionsbases XMLSchemas SchemaErrorsexsgetAttributeBasesqNamesBTIs get_typeclassssKlasssWsdl2PythonErrorsisLists getItemTypesisUnion(sselfstpsqNamescontentsbasesex((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpÂs: c          ( s__name__s __module__s__doc__sDECstypes _GetLoggersloggers _setContentssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysElementLocalSimpleTypeContainer¥s   s ElementLocalComplexTypeContainercBs,tZeZedƒZd„Zd„ZRS(Ns ElementLocalComplexTypeContainercs¢tiƒ‰y¡ˆitd|iƒddddd|iƒd|iƒd|i ƒd |i d |i d |i |i ƒd |i ƒd |iƒd|id|iƒƒ ƒWnJtj o>}d|iiƒg}||i7}t|ƒ|_‚nX|iodˆds( sKWscopyskwsupdatesdictsselfs getClassNames literalTags schemaTagssimpleConstructorsnssnamesgetAttributeNames nsuriLogicsgetTypecodeListsattribute_typecodes getPyClasss Exceptionsexs_items getItemTracesargsstupleslocalselementsattrComponentsslsappendsstrsgetPyClassDefinitions writeArraysmap(sselfsargsslselementsexskw((skws;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentôs8         $ cCsš||_|iƒtjo9|itjp)|iiƒtjo|iiƒtjpt d|ii ƒ‚|i dƒ|_ |i ƒ|_|iƒ|_|i}|tjof|_dSn|itjo)f|_|i|iƒƒ|_dSn|iiƒ}|o|iiiƒo)f|_|i|iƒƒ|_dSn|o|iiiƒo)f|_|i|iƒƒ|_dSn|otd|i ƒ‚n|iiƒ}|o|iitjo)f|_|i|iƒƒ|_dSn|o<|iiiƒo)|iiitj o|iiiiƒo;|iiii|_|i|iiiƒƒ|_dSn|o<|iiiƒo)|iiitj o|iiiiƒo;|iiii|_|i|iiiƒƒ|_dSn|o)f|_|i|iƒƒ|_dSn|iiƒo/|ii|_|i|iƒƒ|_dSnf|_|i|iƒƒ|_dS(sµ {'xsd':['annotation', 'simpleContent', 'complexContent', 'group', 'all', 'choice', 'sequence', 'attribute', 'attributeGroup', 'anyAttribute', 'any']} s-expecting element w/local complexType not: %ssnameNs3not implemented local complexType/simpleContent: %s(stpsselfs_items isElementsTruescontentsNones isComplexsisLocalsAssertionErrors getItemTraces getAttributesnamesgetTargetNamespacesnsslocalscomplexs mgContents_setAttributessgetAttributeContentsattrComponentssisSimples is_simples isExtensions isRestrictionsContainerErrors is_complexs isModelGroup(sselfstps is_simplescomplexs is_complex((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUps` f       FF  (s__name__s __module__sDECstypes _GetLoggersloggers _setContentssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys ElementLocalComplexTypeContainerðs  +sElementGlobalDefContainercBs,tZeZedƒZd„Zd„ZRS(NsElementGlobalDefContainercsPtiƒ‰yžˆitd|iƒddd|iƒd|iƒd|i ƒd|i d|i d |i |i ƒd |i tƒd ti|iƒd t|iƒƒ ƒWnJtj o>}d |iiƒg}||i7}t|ƒ|_‚nX|iodˆd¨sN(sKWscopyskwsupdatesdictsselfs getClassNames literalTags schemaTagssimpleConstructorsnssnamesgetAttributeNames getBasesLogicsID3sNADsgetAliasssKlassNSstype_class_namessKlasss Exceptionsexs_items getItemTracesargsstupleslocalselements writeArraysmap(sselfsargsselementsexskw((skws;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContents,      ! cCsm||_|iƒ|_|idƒ|_|iƒ|_|i dƒ}|idƒ|_ |iƒ|_ dS(Nsnamestype( selementsselfs_itemsisLocalslocals getAttributesnamesgetTargetNamespacesnssgetTypeDefinitionstpssKlassssKlassNS(sselfselementstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUpªs (s__name__s __module__sDECstypes _GetLoggersloggers _setContentssetUp(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysElementGlobalDefContainer{s  +s"ComplexTypeComplexContentContainercBsJtZdZeZedƒZed„Zd„Z d„Z e d„Z RS(s0Represents ComplexType with ComplexContent. s"ComplexTypeComplexContentContainercCsti|d|ƒdS(Ns do_extended(sTypecodeContainerBases__init__sselfs do_extended(sselfs do_extended((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__»sc Cs_||_|iiƒtjo)|iiiƒp|iiiƒtjp td‚t |_ t |_ t |_ t |_t |_|idƒ|_|iƒ|_|ii} y| idƒ}Wntij o}t }nX|t jo€| idƒ}|t jotd| iƒ‚n|tidfjo|ti dfjotd|| iƒf‚qpn|tidfjo9|i!i"dƒt|_hd t <d t#<d t <|_t$i%|d |d ƒ|_&|d |_'t } x›| i)ƒD]} | i+ƒtjptd| iƒ‚| i,ƒtjoM| idƒtidfjo*| it-i.dfƒ|id <| } PqqqW|ii/d ƒ}| t j o |ii/d ƒ}|d i1dƒ}|d }y| i4ti5||ƒ}Wntij o}t }nX|t jot$i%||ƒ|id ƒo6| i}|i,ƒo|i@ƒ}n|i|_An.| iotBd| iiƒ‚n f|_A|iCtD| ƒƒ|_EdS(sšcomplexContent/[extension,restriction] restriction extension extType -- used in figuring attrs for extensions s0expecting complexContent/[extension,restriction]snamesbasesUnsupported derivation: %ssArraysanyTypesUnsupported base(%s): %ssDerivation of soapenc:Arraysatypesid3sofwhatiis#only attribute content expected: %ssrefs arrayTypes[]s do_extendeds6For Array could not resolve ofwhat typecode(%s,%s): %ss Attribute soapenc:arrayType="%s"sexpecting model group, not: %sN(Fstpsselfs_itemscontents isComplexsTrues isRestrictions isExtensionsAssertionErrorsNonesextTypesFalses restrictions extensions _kw_arrays _is_arrays getAttributesnamesgetTargetNamespacesnss derivationsgetTypeDefinitionsbases XMLSchemas SchemaErrorsexsgetAttributeQNamesContainerErrors getItemTracesSOAPsENCsSCHEMAsXSD3sloggersdebugsID3sBTIs get_typeclassssKlassssKlassNSsattrsgetAttributeContentsas isAttributes isReferencesWSDLsBASEsgetsqnamesstripsncnames namespaces getSchemaItemsTYPESsofwhatsGetClassNameFromSchemaItems do_extendedsstrs isinstancesXMLSchemaComponentsgetNamesattrss isModelGroupsgroupsgetModelGroupReferences mgContentsWsdl2PythonErrors_setAttributesstuplesattrComponents( sselfstpsqnamesexsgroups namespacesncnamesofwhatsbasesattrsas derivationsattrs((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp¾sš L         ,! $  '      )           c Csátiƒ}g}|ioÙt|iƒtjo |i djot d|i |if‚n|dt |i ƒfdt dt |iƒfdt |iƒfdt |iƒfd|id|idt|i fg7}|i|ƒd Sn|d t |i ƒfdt |iƒfdt |iƒfdt |iƒfdt|iƒfd t|iƒfg7}|id hd t<d|i<ƒ|i|i ftidfj}|o?|d=|iddt |i ƒfƒ|iddt ƒn|idtƒ|idtƒt|iƒdjo@|idtƒx,|iD]}|idt|fƒqQWn|oW|idtƒ||i ƒ7}|i!ƒ|d<|id|ƒ|i|ƒd Snx(|iD]}|idt|fƒqÞW|id|i"tƒƒt#i$|iƒ}t&|i ƒ}|i(oC|idt||fƒ|iddt ƒ|i|ƒd Sn|i)oC|idt||fƒ|iddt ƒ|i|ƒd Snt*d‚d S( s‘JRB What is the difference between instance data ns, name, -- type definition? sKlass, sKlassNS? -- element declaration? sArraysunknown type: (%s,%s)s)%sclass %s(ZSI.TC.Array, TypeDefinition):s3%s#complexType/complexContent base="SOAP-ENC:Array"s%s%ss-%(id3)sofwhat = %(ofwhat)s(None, typed=False)s%(id3)satype = %(atype)ssH%s%s.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)Ns%sclass %s(TypeDefinition):s%sTClist = [%s]s.%(ID3)sattributes = %(atc)s = attributes or {}sID3satcsanyTypeis/%sclass %s(ZSI.TC.ComplexType, TypeDefinition):is.%s#complexType/complexContent restrict anyTypes%sif extend: TClist += ofwhats%sif restrict: TClist = ofwhats%selse:sD%sZSI.TC.ComplexType.__init__(self, None, TClist, pname=pname, **kw)spyclasss!%(ID3)sself.pyclass = %(pyclass)ss%ssA%s%s.%s.__init__(self, pname, ofwhat=TClist, restrict=True, **kw)s)%s#complexType/complexContent restrictionsV%s%s.%s.__init__(self, pname, ofwhat=TClist, extend=True, attributes=attributes, **kw)s'%s#complexType/complexContent extensions1ComplexContent must be a restriction or extension(+sKWscopyskws definitionsselfs _is_arrays_is_xsd_or_soap_nsssKlassNSsFalsessKlasssContainerErrorsID1s getClassNamesID2s schemaTagstypeTagspnameConstructors _kw_arraysID3s writeArrays nsuriLogicsgetTypecodeListsappendsattribute_typecodesSCHEMAsXSD3s isAnyTypesinsertslensattrComponentsslsID4sgetPyClassDefinitions getPyClasss getBasesLogicsNADsgetAliassprefixstype_class_names typeClassNames restrictions extensionsWsdl2PythonError(sselfs definitionsls isAnyTypesprefixskws typeClassName((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent6 sb  & | &!         cCs|o d|SndSdS(NsX%s.__init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw)sZdef __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):(s superclass(sselfs superclass((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyspnameConstructorŸ s ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggersFalses__init__ssetUps _setContentsNonespnameConstructor(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys"ComplexTypeComplexContentContainerµs    x isComplexTypeContainercBsAtZdZeZedƒZed„Zd„Z e d„Z RS(s0Represents a global complexType definition. sComplexTypeContainercCsÒ||_|idƒ|_|iƒ|_|iƒ|_f|_ |i |i ƒƒ|_ ||_|odSn|i}|iƒo|iƒ}n|tjodSn|itjodSn||_ dS(sÁProblematic, loose all model group information. , , .. tp -- type definition empty -- no model group, just use as a dummy holder. snameN(stpsselfs_items getAttributesnamesgetTargetNamespacesnssisMixedsmixeds mgContents_setAttributessgetAttributeContentsattrComponentssemptyscontentsmodels isReferencesgetModelGroupReferencesNone(sselfstpsemptysmodel((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp¬ s$      cCsÆy|dt|iƒfdt|iƒfdt|iƒfdt|iƒfdt|iƒfdt|i ƒfg}WnJt j o>}d|i iƒg}||i7}t|ƒ|_‚nX|idt|ifƒ|idtƒ|idtƒt|iƒdjo@|id tƒx,|iD]}|idt|fƒq6Wn|id t|iƒfƒ||iƒ7}tiƒ}|iƒ|d <|id |ƒ|i|ƒdS( Ns7%sclass %s(ZSI.TCcompound.ComplexType, TypeDefinition):s%s%ss%sTClist = [%s]sFailure processing %ss%s%s = attributes or {}s%sif extend: TClist += ofwhats%sif restrict: TClist = ofwhatis%selse:sY%sZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, %s**kw)spyclasss!%(ID3)sself.pyclass = %(pyclass)s(sID1sselfs getClassNamesID2s schemaTagstypeTagspnameConstructorsID3s nsuriLogicsgetTypecodeLists definitions Exceptionsexs_items getItemTracesargsstuplesappendsattribute_typecodeslensattrComponentsslsID4s getExtraFlagssgetPyClassDefinitionsKWscopyskws getPyClasss writeArray(sselfs definitionsargsskwsexsl((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentÏ s*|    cCs|o d|SndSdS(sY TODO: Logic is a little tricky. If superclass is ComplexType this is not used. sX%s.__init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw)sZdef __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):N(s superclass(sselfs superclass((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyspnameConstructorú s ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggersFalsessetUps _setContentsNonespnameConstructor(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysComplexTypeContainer¦ s   # +sSimpleTypeContainercBsGtZeZedƒZd„Zd„Zd„Zd„Z d„Z RS(NsSimpleTypeContainercCsti|ƒdS(s[ Instance Data From TypecodeContainerBase NOT USED... mgContent N(sTypecodeContainerBases__init__sself(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__ scCs td‚dS(Nsabstract method not implemented(sNotImplementedError(sselfstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp scCs td‚dS(Nsabstract method not implemented(sNotImplementedError(sselfstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent scCsõtt|iƒƒ}t|tiiƒodSnt|tii ƒpt|tii ƒodSnt|tii ƒpt|tii ƒodSnt|tii ƒodSnt|tiiƒpt|tiiƒodSntSdS(Nsstrslongsintsfloatstuple(sevalsstrsselfssKlassspyclasss issubclasssZSIsTCsStringsIlongs IunsignedLongsBooleansIntegersDecimals GregoriansDurationsNone(sselfspyclass((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys getPythonType s,,,cCs\g}|iƒ}|tj o5|idt|iƒ|fƒ|idtƒn|SdS(Ns%sclass %s(%s):s%stypecode = self( s definitionsselfs getPythonTypesptsNonesappendsID3s getPyClasssID4(sselfs definitionspt((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetPyClassDefinition" s    ( s__name__s __module__sDEFstypes _GetLoggersloggers__init__ssetUps _setContents getPythonTypesgetPyClassDefinition(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysSimpleTypeContainer s     sRestrictionContainercBs,tZdZedƒZd„Zd„ZRS(s# simpleType/restriction sRestrictionContainercCs3||_|iƒtjo&|iƒtjo|iiƒtjptd|i ƒ‚|it jot d|i ƒ‚n|i dƒ|_ |iƒ|_t |_|ii dƒ}|t j oÉy|iidƒ}Wntij o }nX|t johti|iƒ|iƒƒ|_|it j odSnt d|iƒ|iƒ|i ƒfƒ‚nt d|i ƒ|i ƒf‚n|iiƒ}|t j o9t|iƒjo"|iƒjo|iƒjno2t }|iiƒtjo´y|iidƒ}Wntij o }nX|t jo_|ii dƒ}|t j o)ti|iƒ|iƒƒ|_dSnt d|i ƒ‚nt d|i ƒ‚n|iiƒtjot d|i ƒ‚n|iiƒtjot d |i ƒ‚ndSnt d |i ƒ‚dS( Ns)expecting simpleType restriction, not: %ssempty simpleType defintion: %ssnamesbasesKno built-in type nor schema instance type for base attribute("%s","%s"): %ss@Not Supporting simpleType/Restriction w/User-Defined Base: %s %ss;Not Supporting simpleType/Restriction w/User-Defined Base: siction base in subtypes: %ss.could not get restriction base in subtypes: %ss#No Restriction @base/simpleType: %s(stpsselfs_itemsisSimplesTrues isDefinitionscontents isRestrictionsAssertionErrors getItemTracesNonesWsdl2PythonErrors getAttributesnamesgetTargetNamespacesnsssKlasssbasesgetTypeDefinitionsitems XMLSchemas SchemaErrorsexsBTIs get_typeclasssgetNamesgetSimpleTypeContentsscsisLocalsisListsisUnion(sselfstpsitemsbasesexssc((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp1 sP P   !/#I  !cCsñdt|iƒ|ifdt|iƒfdt|iƒfdt|iƒfg}|i ƒt jo|i dt |ifƒnX|i dt |ifƒ||i ƒ7}tiƒ}|iƒ|d<|i d|ƒ|i|ƒdS(Ns%sclass %s(%s, TypeDefinition):s%s%ss %s%s.__init__(self, pname, **kw)s.%s%s.__init__(self, pname, pyclass=None, **kw)spyclasss!%(ID3)sself.pyclass = %(pyclass)s(sID1sselfs getClassNamessKlasssID2s schemaTagstypeTagspnameConstructors definitions getPythonTypesNonesappendsID3sgetPyClassDefinitionsKWscopyskws getPyClasss writeArray(sselfs definitionskw((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContentv sX (s__name__s __module__s__doc__s _GetLoggersloggerssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysRestrictionContainer+ s   Es!ComplexTypeSimpleContentContainercBs;tZdZeZedƒZd„Zd„Zd„Z RS(s1Represents a ComplexType with simpleContent. s!ComplexTypeSimpleContentContainercCsj||_|iƒtjo|iiƒtjptd|iiƒ‚|i}|i}|i ƒtjp|i ƒtjptd|iiƒ‚|i dƒ|_|iƒ|_|iƒ|i_|i dƒ}|tj olti|d|dƒ|_|i o$|d|df\|_|_n|i|iiƒ|_dSntd|iƒ‚dS( s?tp -- complexType/simpleContent/[Exention,Restriction] s+expecting complexType/simpleContent not: %ssCexpecting complexType/simpleContent/[Extension,Restriction] not: %ssnamesbaseiiNs.simple content derivation bad base attribute: (stpsselfs_items isComplexsTruescontentsisSimplesAssertionErrors getItemTracessimplesdvs isExtensions isRestrictions getAttributesnamesgetTargetNamespacesnssgetAttributeContentsattributeContentsbasesNonesBTIs get_typeclassssKlassssKlassNSs_setAttributessattrComponentssWsdl2PythonError(sselfstpssimplesbasesdv((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp— s" @  =  $c Cs3t|iƒtitfjodt|iƒ|ifdtdt|iƒfdt|i ƒfdt|i ƒfdt |i fg}x(|iD]}|idt |fƒq˜W|idt |ifƒ|iƒtj oA||iƒ7}tiƒ}|iƒ|d<|id|ƒn|i|ƒdSndt|iƒfd tdt|iƒfdt|i ƒfdt|i ƒfdt |iƒfd |it ƒdt |i fg}x(|iD]}|idt |fƒqÒW|id t ti|iƒt|iƒfƒ|i|ƒdS( Ns%sclass %s(%s, TypeDefinition):s9%s# ComplexType/SimpleContent derivation of built-in types%s%ssD%sif getattr(self, "attribute_typecode_dict", None) is None: %s = {}s %s%s.__init__(self, pname, **kw)spyclasss!%(ID3)sself.pyclass = %(pyclass)ss%sclass %s(TypeDefinition):s=%s# ComplexType/SimpleContent derivation of user-defined types%ss#%s%s.%s.__init__(self, pname, **kw)(stypesselfssKlassstypess ClassTypesID1s getClassNamesID2s schemaTagstypeTagspnameConstructorsID3sattribute_typecodes definitionsattrComponentsslsappends getPythonTypesNonesgetPyClassDefinitionsKWscopyskws getPyClasss writeArrays nsuriLogics getBasesLogicsNADsgetAliasssKlassNSstype_class_name(sselfs definitionskwsl((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent¸ s&o   Œ /cCsŠg}|iƒ}|tj oc|idt|iƒ|fƒ|itj o|idt |ifƒn|idt ƒn|SdS(Ns%sclass %s(%s):s%s__metaclass__ = %ss%stypecode = self( s definitionsselfs getPythonTypesptsNonesappendsID3s getPyClasss metaclasssID4(sselfs definitionspt((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysgetPyClassDefinitionç s   ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggerssetUps _setContentsgetPyClassDefinition(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys!ComplexTypeSimpleContentContainer‘ s   ! /sUnionContainercBs;tZdZeZedƒZd„Zd„Zd„Z RS(sSimpleType Union sUnionContainercCsti|ƒt|_dS(N(sSimpleTypeContainers__init__sselfsNones memberTypes(sself((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys__init__ü s cCsy||_|iiƒtjotd|iƒ‚n|idƒ|_ |i ƒ|_ d|_ |iidƒ|_ dS(Nscontent must be a Union: %ssnames ZSI.TC.Unions memberTypes(stpsselfs_itemscontentsisUnionsFalsesContainerErrors getItemTraces getAttributesnamesgetTargetNamespacesnsssKlasss memberTypes(sselfstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp s  c Cs’dt|iƒ|ifdt|ifdt|iƒfdt|iƒfdt|iƒfdt |i|iƒfg}|i |ƒdS(Ns%sclass %s(%s, TypeDefinition):s%smemberTypes = %ss%s%s( sID1sselfs getClassNamessKlasssID2s memberTypess schemaTagstypeTagspnameConstructorsID3s definitions writeArray(sselfs definition((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent s ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggers__init__ssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pysUnionContainerö s    s ListContainercBs2tZdZeZedƒZd„Zd„ZRS(sSimpleType List s ListContainercCsy||_|iiƒtjotd|iƒ‚n|idƒ|_ |i ƒ|_ d|_ |iidƒ|_ dS(Nscontent must be a List: %ssnames ZSI.TC.ListsitemType(stpsselfs_itemscontentsisListsFalsesContainerErrors getItemTraces getAttributesnamesgetTargetNamespacesnsssKlasssitemType(sselfstp((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pyssetUp s  c Cs’dt|iƒ|ifdt|ifdt|iƒfdt|iƒfdt|iƒfdt |i|iƒfg}|i |ƒdS(Ns%sclass %s(%s, TypeDefinition):s%sitemType = %ss%s%s( sID1sselfs getClassNamessKlasssID2sitemTypes schemaTagstypeTagspnameConstructorsID3s definitions writeArray(sselfs definition((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys _setContent) s ( s__name__s __module__s__doc__sDEFstypes _GetLoggersloggerssetUps _setContent(((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys ListContainer s   (Sstypessutilitys StringWriters TextProtectsTextProtectAttributeNamesGetPartsSubNamessNamespaceAliasDictsNADsNCName_to_ClassNamesNC_to_CNsZSIsZSI.TCs_is_xsd_or_soap_nss ZSI.wstoolss XMLSchemas WSDLToolssZSI.wstools.NamespacessSCHEMAsSOAPsWSDLsZSI.wstools.loggings getLoggers _GetLoggersZSI.typeinterpretersBaseTypeInterpreters ZSI.generatesWSISpecsWSInteropErrorsWsdl2PythonErrorsWsdlGeneratorErrorsWSDLFormatErrorsID1sID2sID3sID4sID5sID6sKWsDECsDEFstype_class_nameselement_class_namesIsRPCs IsLiteralsSetTypeNameFuncsSetElementNameFuncsFalsesGetClassNameFromSchemaItems&FromMessageGetSimpleElementDeclarationsAttributeMixIns ExceptionsContainerErrors ContainerBasesServiceContainerBasesServiceHeaderContainersServiceLocatorContainersServiceOperationContainersServiceOperationsClassContainersMessageContainerInterfaces&ServiceDocumentLiteralMessageContainers!ServiceRPCEncodedMessageContainers!ServiceRPCLiteralMessageContainersTypesContainerBasesTypesHeaderContainersNamespaceClassContainerBasesNamespaceClassHeaderContainersNamespaceClassFooterContainersBTIsTypecodeContainerBasesMessageTypecodeContainersTcListComponentContainers"RPCMessageTcListComponentContainersElementSimpleTypeContainersElementLocalSimpleTypeContainers ElementLocalComplexTypeContainersElementGlobalDefContainers"ComplexTypeComplexContentContainersComplexTypeContainersSimpleTypeContainersRestrictionContainers!ComplexTypeSimpleContentContainersUnionContainers ListContainer(EsID5sNADs"ComplexTypeComplexContentContainersWsdl2PythonErrorsTypecodeContainerBases _GetLoggersRestrictionContainersGetPartsSubNamess&FromMessageGetSimpleElementDeclarations!ServiceRPCLiteralMessageContainers_is_xsd_or_soap_nssZSIsDEFsSimpleTypeContainersWSISpecsComplexTypeContainersDECsBaseTypeInterpreters!ComplexTypeSimpleContentContainers ListContainersSetElementNameFuncsMessageContainerInterfacesElementLocalSimpleTypeContainers"RPCMessageTcListComponentContainersTypesHeaderContainers!ServiceRPCEncodedMessageContainersNC_to_CNsContainerErrorstypessElementGlobalDefContainersTypesContainerBasesUnionContainersServiceOperationContainersAttributeMixInsSCHEMAsNamespaceClassContainerBasesServiceLocatorContainers&ServiceDocumentLiteralMessageContainersIsRPCsMessageTypecodeContainers StringWritersWSDLFormatErrorsTcListComponentContainersGetClassNameFromSchemaItemsServiceContainerBases XMLSchemasSetTypeNameFuncsWSDLsNamespaceClassFooterContainersServiceHeaderContainers WSDLToolss ContainerBasesServiceOperationsClassContainersID6s TextProtectsID4sTextProtectAttributeNamesID2sID3s ElementLocalComplexTypeContainersID1sElementSimpleTypeContainersKWsNamespaceClassHeaderContainers IsLiteralsWSInteropErrorsBTIsSOAPsWsdlGeneratorError((s;build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/containers.pys? s|     %     <     {@+Cå{R]T ÿÿDBt%FK‹:ñ](fe#PK„¨58AïRaž'ž'ZSI/generate/pyclass.pyc;ò V@Ec@sudkZdkZdkZdklZd„Zy de_Wnedei‚nX[de fd„ƒYZ dS(N(sTCcCsdSdS(N((((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/generate/pyclass.pys_x ss_ysAuse python-2.4 or later, cannot set function names in python "%s"s pyclass_typecBsVtZdZd„Zd„ZeeƒZd„ZeeƒZd„ZeeƒZRS(sStability: Unstable type for pyclasses used with typecodes. expects the typecode to be available in the classdict. creates python properties for accessing and setting the elements specified in the ofwhat list, and factory methods for constructing the elements. Known Limitations: 1)Uses XML Schema element names directly to create method names, using characters in this set will cause Syntax Errors: (NCNAME)-(letter U digit U "_") c Cs›|idƒ}|tj p td‚t|ƒdjon„t|dƒp td‚t|dƒp td‚|io|i |ƒ\}}|i |i ƒotd|i ‚n|i |i ƒotd|i ‚n|||i <|||i , LBNL # Monte Goode , LBNL # See Copyright for copyright notice! ############################################################################ import exceptions, sys, optparse, os, warnings from operator import xor import ZSI from ConfigParser import ConfigParser from ZSI.generate.wsdl2python import WriteServiceModule, ServiceDescription from ZSI.wstools import WSDLTools, XMLSchema from ZSI.wstools.logging import setBasicLoggerDEBUG from ZSI.generate import containers, utility from ZSI.generate.utility import NCName_to_ClassName as NC_to_CN, TextProtect from ZSI.generate.wsdl2dispatch import ServiceModuleWriter as ServiceDescription from ZSI.generate.wsdl2dispatch import DelAuthServiceModuleWriter as DelAuthServiceDescription from ZSI.generate.wsdl2dispatch import WSAServiceModuleWriter as ServiceDescriptionWSA from ZSI.generate.wsdl2dispatch import DelAuthWSAServiceModuleWriter as DelAuthServiceDescriptionWSA warnings.filterwarnings('ignore', '', exceptions.UserWarning) def SetDebugCallback(option, opt, value, parser, *args, **kwargs): setBasicLoggerDEBUG() warnings.resetwarnings() def SetPyclassMetaclass(option, opt, value, parser, *args, **kwargs): """set up pyclass metaclass for complexTypes""" from ZSI.generate.containers import ServiceHeaderContainer, TypecodeContainerBase, TypesHeaderContainer TypecodeContainerBase.metaclass = kwargs['metaclass'] TypesHeaderContainer.imports.append(\ 'from %(module)s import %(metaclass)s' %kwargs ) ServiceHeaderContainer.imports.append(\ 'from %(module)s import %(metaclass)s' %kwargs ) def SetUpTwistedClient(option, opt, value, parser, *args, **kwargs): from ZSI.generate.containers import ServiceHeaderContainer ServiceHeaderContainer.imports.remove('from ZSI import client') ServiceHeaderContainer.imports.append('from ZSI.twisted import client') def SetUpLazyEvaluation(option, opt, value, parser, *args, **kwargs): from ZSI.generate.containers import TypecodeContainerBase TypecodeContainerBase.lazy = True def formatSchemaObject(fname, schemaObj): """ In the case of a 'schema only' generation (-s) this creates a fake wsdl object that will function w/in the adapters and allow the generator to do what it needs to do. """ class fake: pass f = fake() if fname.rfind('/'): tmp = fname[fname.rfind('/') + 1 :].split('.') else: tmp = fname.split('.') f.name = tmp[0] + '_' + tmp[1] f.types = { schemaObj.targetNamespace : schemaObj } return f def wsdl2py(args=None): """ A utility for automatically generating client interface code from a wsdl definition, and a set of classes representing element declarations and type definitions. This will produce two files in the current working directory named after the wsdl definition name. eg. SampleService.py SampleService_types.py """ op = optparse.OptionParser(usage="usage: %prog [options]", description=wsdl2py.__doc__) # Basic options op.add_option("-f", "--file", action="store", dest="file", default=None, type="string", help="FILE to load wsdl from") op.add_option("-u", "--url", action="store", dest="url", default=None, type="string", help="URL to load wsdl from") op.add_option("-x", "--schema", action="store_true", dest="schema", default=False, help="process just the schema from an xsd file [no services]") op.add_option("-d", "--debug", action="callback", callback=SetDebugCallback, help="debug output") # WS Options op.add_option("-a", "--address", action="store_true", dest="address", default=False, help="ws-addressing support, must include WS-Addressing schema.") # pyclass Metaclass op.add_option("-b", "--complexType", action="callback", callback=SetPyclassMetaclass, callback_kwargs={'module':'ZSI.generate.pyclass', 'metaclass':'pyclass_type'}, help="add convenience functions for complexTypes, including Getters, Setters, factory methods, and properties (via metaclass). *** DONT USE WITH --simple-naming ***") # Lazy Evaluation of Typecodes (done at serialization/parsing when needed). op.add_option("-l", "--lazy", action="callback", callback=SetUpLazyEvaluation, callback_kwargs={}, help="EXPERIMENTAL: recursion error solution, lazy evalution of typecodes") # Use Twisted op.add_option("-w", "--twisted", action="callback", callback=SetUpTwistedClient, callback_kwargs={'module':'ZSI.generate.pyclass', 'metaclass':'pyclass_type'}, help="generate a twisted.web client, dependencies python>=2.4, Twisted>=2.0.0, TwistedWeb>=0.5.0") # Extended generation options op.add_option("-e", "--extended", action="store_true", dest="extended", default=False, help="Do Extended code generation.") op.add_option("-z", "--aname", action="store", dest="aname", default=None, type="string", help="pass in a function for attribute name creation") op.add_option("-t", "--types", action="store", dest="types", default=None, type="string", help="file to load types from") op.add_option("-o", "--output-dir", action="store", dest="output_dir", default=".", type="string", help="Write generated files to OUTPUT_DIR") op.add_option("-s", "--simple-naming", action="store_true", dest="simple_naming", default=False, help="Simplify generated naming.") op.add_option("-c", "--clientClassSuffix", action="store", dest="clientClassSuffix", default=None, type="string", help="Suffix to use for service client class (default \"SOAP\")") op.add_option("-m", "--pyclassMapModule", action="store", dest="pyclassMapModule", default=None, type="string", help="Python file that maps external python classes to a schema type. The classes are used as the \"pyclass\" for that type. The module should contain a dict() called mapping in the format: mapping = {schemaTypeName:(moduleName.py,className) }") if args is None: (options, args) = op.parse_args() else: (options, args) = op.parse_args(args) if not xor(options.file is None, options.url is None): print 'Must specify either --file or --url option' sys.exit(os.EX_USAGE) location = options.file if options.url is not None: location = options.url if options.schema is True: reader = XMLSchema.SchemaReader(base_url=location) else: reader = WSDLTools.WSDLReader() load = reader.loadFromFile if options.url is not None: load = reader.loadFromURL wsdl = None try: wsdl = load(location) except Exception, e: print "Error loading %s: \n\t%s" % (location, e) # exit code UNIX specific, Windows? sys.exit(os.EX_NOINPUT) if options.simple_naming: # Use a different client suffix WriteServiceModule.client_module_suffix = "_client" # Write messages definitions to a separate file. ServiceDescription.separate_messages = True # Use more simple type and element class names containers.SetTypeNameFunc( lambda n: '%s_' %(NC_to_CN(n)) ) containers.SetElementNameFunc( lambda n: '%s' %(NC_to_CN(n)) ) # Don't add "_" to the attribute name (remove when --aname works well) containers.ContainerBase.func_aname = lambda instnc,n: TextProtect(str(n)) # write out the modules with their names rather than their number. utility.namespace_name = lambda cls, ns: utility.Namespace2ModuleName(ns) if options.clientClassSuffix: from ZSI.generate.containers import ServiceContainerBase ServiceContainerBase.clientClassSuffix = options.clientClassSuffix if options.schema is True: wsdl = formatSchemaObject(location, wsdl) if options.aname is not None: args = options.aname.rsplit('.',1) assert len(args) == 2, 'expecting module.function' # The following exec causes a syntax error. #exec('from %s import %s as FUNC' %(args[0],args[1])) assert callable(FUNC),\ '%s must be a callable method with one string parameter' %options.aname from ZSI.generate.containers import TypecodeContainerBase TypecodeContainerBase.func_aname = staticmethod(FUNC) if options.pyclassMapModule != None: mod = __import__(options.pyclassMapModule) components = options.pyclassMapModule.split('.') for comp in components[1:]: mod = getattr(mod, comp) extPyClasses = mod.mapping else: extPyClasses = None wsm = WriteServiceModule(wsdl, addressing=options.address, do_extended=options.extended, extPyClasses=extPyClasses) if options.types != None: wsm.setTypesModuleName(options.types) if options.schema is False: fd = open(os.path.join(options.output_dir, '%s.py' %wsm.getClientModuleName()), 'w+') # simple naming writes the messages to a separate file if not options.simple_naming: wsm.writeClient(fd) else: # provide a separate file to store messages to. msg_fd = open(os.path.join(options.output_dir, '%s.py' %wsm.getMessagesModuleName()), 'w+') wsm.writeClient(fd, msg_fd=msg_fd) msg_fd.close() fd.close() fd = open( os.path.join(options.output_dir, '%s.py' %wsm.getTypesModuleName()), 'w+') wsm.writeTypes(fd) fd.close() def wsdl2dispatch(args=None): """ wsdl2dispatch A utility for automatically generating service skeleton code from a wsdl definition. """ op = optparse.OptionParser() op.add_option("-f", "--file", action="store", dest="file", default=None, type="string", help="file to load wsdl from") op.add_option("-u", "--url", action="store", dest="url", default=None, type="string", help="URL to load wsdl from") op.add_option("-a", "--address", action="store_true", dest="address", default=False, help="ws-addressing support, must include WS-Addressing schema.") op.add_option("-e", "--extended", action="store_true", dest="extended", default=False, help="Extended code generation.") op.add_option("-d", "--debug", action="callback", callback=SetDebugCallback, help="debug output") op.add_option("-t", "--types", action="store", dest="types", default=None, type="string", help="Write generated files to OUTPUT_DIR") op.add_option("-o", "--output-dir", action="store", dest="output_dir", default=".", type="string", help="file to load types from") op.add_option("-s", "--simple-naming", action="store_true", dest="simple_naming", default=False, help="Simplify generated naming.") if args is None: (options, args) = op.parse_args() else: (options, args) = op.parse_args(args) if options.simple_naming: ServiceDescription.server_module_suffix = '_interface' ServiceDescription.func_aname = lambda instnc,n: TextProtect(n) ServiceDescription.separate_messages = True # use module names rather than their number. utility.namespace_name = lambda cls, ns: utility.Namespace2ModuleName(ns) reader = WSDLTools.WSDLReader() wsdl = None if options.file is not None: wsdl = reader.loadFromFile(options.file) elif options.url is not None: wsdl = reader.loadFromURL(options.url) assert wsdl is not None, 'Must specify WSDL either with --file or --url' ss = None if options.address is True: if options.extended: ss = DelAuthServiceDescriptionWSA(do_extended=options.extended) else: ss = ServiceDescriptionWSA(do_extended=options.extended) else: if options.extended: ss = DelAuthServiceDescription(do_extended=options.extended) else: ss = ServiceDescription(do_extended=options.extended) ss.fromWSDL(wsdl) fd = open( os.path.join(options.output_dir, ss.getServiceModuleName()+'.py'), 'w+') ss.write(fd) fd.close() PKN¤Y5ŽcÁþþ§þ§ZSI/wstools/XMLSchema.py# Copyright (c) 2003, The Regents of the University of California, # through Lawrence Berkeley National Laboratory (subject to receipt of # any required approvals from the U.S. Dept. of Energy). All rights # reserved. # # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. ident = "$Id: XMLSchema.py 1207 2006-05-04 18:34:01Z boverhof $" import types, weakref, sys, warnings from Namespaces import SCHEMA, XMLNS from Utility import DOM, DOMException, Collection, SplitQName, basejoin from StringIO import StringIO # If we have no threading, this should be a no-op try: from threading import RLock except ImportError: class RLock: def acquire(): pass def release(): pass # # Collections in XMLSchema class # TYPES = 'types' ATTRIBUTE_GROUPS = 'attr_groups' ATTRIBUTES = 'attr_decl' ELEMENTS = 'elements' MODEL_GROUPS = 'model_groups' def GetSchema(component): """convience function for finding the parent XMLSchema instance. """ parent = component while not isinstance(parent, XMLSchema): parent = parent._parent() return parent class SchemaReader: """A SchemaReader creates XMLSchema objects from urls and xml data. """ namespaceToSchema = {} def __init__(self, domReader=None, base_url=None): """domReader -- class must implement DOMAdapterInterface base_url -- base url string """ self.__base_url = base_url self.__readerClass = domReader if not self.__readerClass: self.__readerClass = DOMAdapter self._includes = {} self._imports = {} def __setImports(self, schema): """Add dictionary of imports to schema instance. schema -- XMLSchema instance """ for ns,val in schema.imports.items(): if self._imports.has_key(ns): schema.addImportSchema(self._imports[ns]) def __setIncludes(self, schema): """Add dictionary of includes to schema instance. schema -- XMLSchema instance """ for schemaLocation, val in schema.includes.items(): if self._includes.has_key(schemaLocation): schema.addIncludeSchema(self._imports[schemaLocation]) def addSchemaByLocation(self, location, schema): """provide reader with schema document for a location. """ self._includes[location] = schema def addSchemaByNamespace(self, schema): """provide reader with schema document for a targetNamespace. """ self._imports[schema.targetNamespace] = schema def loadFromNode(self, parent, element): """element -- DOM node or document parent -- WSDLAdapter instance """ reader = self.__readerClass(element) schema = XMLSchema(parent) #HACK to keep a reference schema.wsdl = parent schema.setBaseUrl(self.__base_url) schema.load(reader) return schema def loadFromStream(self, file, url=None): """Return an XMLSchema instance loaded from a file object. file -- file object url -- base location for resolving imports/includes. """ reader = self.__readerClass() reader.loadDocument(file) schema = XMLSchema() if url is not None: schema.setBaseUrl(url) schema.load(reader) self.__setIncludes(schema) self.__setImports(schema) return schema def loadFromString(self, data): """Return an XMLSchema instance loaded from an XML string. data -- XML string """ return self.loadFromStream(StringIO(data)) def loadFromURL(self, url, schema=None): """Return an XMLSchema instance loaded from the given url. url -- URL to dereference schema -- Optional XMLSchema instance. """ reader = self.__readerClass() if self.__base_url: url = basejoin(self.__base_url,url) reader.loadFromURL(url) schema = schema or XMLSchema() schema.setBaseUrl(url) schema.load(reader) self.__setIncludes(schema) self.__setImports(schema) return schema def loadFromFile(self, filename): """Return an XMLSchema instance loaded from the given file. filename -- name of file to open """ if self.__base_url: filename = basejoin(self.__base_url,filename) file = open(filename, 'rb') try: schema = self.loadFromStream(file, filename) finally: file.close() return schema class SchemaError(Exception): pass ########################### # DOM Utility Adapters ########################## class DOMAdapterInterface: def hasattr(self, attr, ns=None): """return true if node has attribute attr -- attribute to check for ns -- namespace of attribute, by default None """ raise NotImplementedError, 'adapter method not implemented' def getContentList(self, *contents): """returns an ordered list of child nodes *contents -- list of node names to return """ raise NotImplementedError, 'adapter method not implemented' def setAttributeDictionary(self, attributes): """set attribute dictionary """ raise NotImplementedError, 'adapter method not implemented' def getAttributeDictionary(self): """returns a dict of node's attributes """ raise NotImplementedError, 'adapter method not implemented' def getNamespace(self, prefix): """returns namespace referenced by prefix. """ raise NotImplementedError, 'adapter method not implemented' def getTagName(self): """returns tagName of node """ raise NotImplementedError, 'adapter method not implemented' def getParentNode(self): """returns parent element in DOMAdapter or None """ raise NotImplementedError, 'adapter method not implemented' def loadDocument(self, file): """load a Document from a file object file -- """ raise NotImplementedError, 'adapter method not implemented' def loadFromURL(self, url): """load a Document from an url url -- URL to dereference """ raise NotImplementedError, 'adapter method not implemented' class DOMAdapter(DOMAdapterInterface): """Adapter for ZSI.Utility.DOM """ def __init__(self, node=None): """Reset all instance variables. element -- DOM document, node, or None """ if hasattr(node, 'documentElement'): self.__node = node.documentElement else: self.__node = node self.__attributes = None def getNode(self): return self.__node def hasattr(self, attr, ns=None): """attr -- attribute ns -- optional namespace, None means unprefixed attribute. """ if not self.__attributes: self.setAttributeDictionary() if ns: return self.__attributes.get(ns,{}).has_key(attr) return self.__attributes.has_key(attr) def getContentList(self, *contents): nodes = [] ELEMENT_NODE = self.__node.ELEMENT_NODE for child in DOM.getElements(self.__node, None): if child.nodeType == ELEMENT_NODE and\ SplitQName(child.tagName)[1] in contents: nodes.append(child) return map(self.__class__, nodes) def setAttributeDictionary(self): self.__attributes = {} for v in self.__node._attrs.values(): self.__attributes[v.nodeName] = v.nodeValue def getAttributeDictionary(self): if not self.__attributes: self.setAttributeDictionary() return self.__attributes def getTagName(self): return self.__node.tagName def getParentNode(self): if self.__node.parentNode.nodeType == self.__node.ELEMENT_NODE: return DOMAdapter(self.__node.parentNode) return None def getNamespace(self, prefix): """prefix -- deference namespace prefix in node's context. Ascends parent nodes until found. """ namespace = None if prefix == 'xmlns': namespace = DOM.findDefaultNS(prefix, self.__node) else: try: namespace = DOM.findNamespaceURI(prefix, self.__node) except DOMException, ex: if prefix != 'xml': raise SchemaError, '%s namespace not declared for %s'\ %(prefix, self.__node._get_tagName()) namespace = XMLNS.XML return namespace def loadDocument(self, file): self.__node = DOM.loadDocument(file) if hasattr(self.__node, 'documentElement'): self.__node = self.__node.documentElement def loadFromURL(self, url): self.__node = DOM.loadFromURL(url) if hasattr(self.__node, 'documentElement'): self.__node = self.__node.documentElement class XMLBase: """ These class variables are for string indentation. """ tag = None __indent = 0 __rlock = RLock() def __str__(self): XMLBase.__rlock.acquire() XMLBase.__indent += 1 tmp = "<" + str(self.__class__) + '>\n' for k,v in self.__dict__.items(): tmp += "%s* %s = %s\n" %(XMLBase.__indent*' ', k, v) XMLBase.__indent -= 1 XMLBase.__rlock.release() return tmp """Marker Interface: can determine something about an instances properties by using the provided convenience functions. """ class DefinitionMarker: """marker for definitions """ pass class DeclarationMarker: """marker for declarations """ pass class AttributeMarker: """marker for attributes """ pass class AttributeGroupMarker: """marker for attribute groups """ pass class WildCardMarker: """marker for wildcards """ pass class ElementMarker: """marker for wildcards """ pass class ReferenceMarker: """marker for references """ pass class ModelGroupMarker: """marker for model groups """ pass class AllMarker(ModelGroupMarker): """marker for all model group """ pass class ChoiceMarker(ModelGroupMarker): """marker for choice model group """ pass class SequenceMarker(ModelGroupMarker): """marker for sequence model group """ pass class ExtensionMarker: """marker for extensions """ pass class RestrictionMarker: """marker for restrictions """ facets = ['enumeration', 'length', 'maxExclusive', 'maxInclusive',\ 'maxLength', 'minExclusive', 'minInclusive', 'minLength',\ 'pattern', 'fractionDigits', 'totalDigits', 'whiteSpace'] class SimpleMarker: """marker for simple type information """ pass class ListMarker: """marker for simple type list """ pass class UnionMarker: """marker for simple type Union """ pass class ComplexMarker: """marker for complex type information """ pass class LocalMarker: """marker for complex type information """ pass class MarkerInterface: def isDefinition(self): return isinstance(self, DefinitionMarker) def isDeclaration(self): return isinstance(self, DeclarationMarker) def isAttribute(self): return isinstance(self, AttributeMarker) def isAttributeGroup(self): return isinstance(self, AttributeGroupMarker) def isElement(self): return isinstance(self, ElementMarker) def isReference(self): return isinstance(self, ReferenceMarker) def isWildCard(self): return isinstance(self, WildCardMarker) def isModelGroup(self): return isinstance(self, ModelGroupMarker) def isAll(self): return isinstance(self, AllMarker) def isChoice(self): return isinstance(self, ChoiceMarker) def isSequence(self): return isinstance(self, SequenceMarker) def isExtension(self): return isinstance(self, ExtensionMarker) def isRestriction(self): return isinstance(self, RestrictionMarker) def isSimple(self): return isinstance(self, SimpleMarker) def isComplex(self): return isinstance(self, ComplexMarker) def isLocal(self): return isinstance(self, LocalMarker) def isList(self): return isinstance(self, ListMarker) def isUnion(self): return isinstance(self, UnionMarker) ########################################################## # Schema Components ######################################################### class XMLSchemaComponent(XMLBase, MarkerInterface): """ class variables: required -- list of required attributes attributes -- dict of default attribute values, including None. Value can be a function for runtime dependencies. contents -- dict of namespace keyed content lists. 'xsd' content of xsd namespace. xmlns_key -- key for declared xmlns namespace. xmlns -- xmlns is special prefix for namespace dictionary xml -- special xml prefix for xml namespace. """ required = [] attributes = {} contents = {} xmlns_key = '' xmlns = 'xmlns' xml = 'xml' def __init__(self, parent=None): """parent -- parent instance instance variables: attributes -- dictionary of node's attributes """ self.attributes = None self._parent = parent if self._parent: self._parent = weakref.ref(parent) if not self.__class__ == XMLSchemaComponent\ and not (type(self.__class__.required) == type(XMLSchemaComponent.required)\ and type(self.__class__.attributes) == type(XMLSchemaComponent.attributes)\ and type(self.__class__.contents) == type(XMLSchemaComponent.contents)): raise RuntimeError, 'Bad type for a class variable in %s' %self.__class__ def getItemTrace(self): """Returns a node trace up to the item. """ item, path, name, ref = self, [], 'name', 'ref' while not isinstance(item,XMLSchema) and not isinstance(item,WSDLToolsAdapter): attr = item.getAttribute(name) if attr is None: attr = item.getAttribute(ref) if attr is None: path.append('<%s>' %(item.tag)) else: path.append('<%s ref="%s">' %(item.tag, attr)) else: path.append('<%s name="%s">' %(item.tag,attr)) item = item._parent() try: tns = item.getTargetNamespace() except: tns = '' path.append('<%s targetNamespace="%s">' %(item.tag, tns)) path.reverse() return ''.join(path) def getTargetNamespace(self): """return targetNamespace """ parent = self targetNamespace = 'targetNamespace' tns = self.attributes.get(targetNamespace) while not tns: parent = parent._parent() tns = parent.attributes.get(targetNamespace) return tns def getAttributeDeclaration(self, attribute): """attribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance """ return self.getQNameAttribute(ATTRIBUTES, attribute) def getAttributeGroup(self, attribute): """attribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance """ return self.getQNameAttribute(ATTRIBUTE_GROUPS, attribute) def getTypeDefinition(self, attribute): """attribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance """ return self.getQNameAttribute(TYPES, attribute) def getElementDeclaration(self, attribute): """attribute -- attribute with a QName value (eg. element). collection -- check elements collection in parent Schema instance. """ return self.getQNameAttribute(ELEMENTS, attribute) def getModelGroup(self, attribute): """attribute -- attribute with a QName value (eg. ref). collection -- check model_group collection in parent Schema instance. """ return self.getQNameAttribute(MODEL_GROUPS, attribute) def getQNameAttribute(self, collection, attribute): """returns object instance representing QName --> (namespace,name), or if does not exist return None. attribute -- an information item attribute, with a QName value. collection -- collection in parent Schema instance to search. """ obj = None tdc = self.getAttributeQName(attribute) if tdc: obj = self.getSchemaItem(collection, tdc.getTargetNamespace(), tdc.getName()) return obj def getSchemaItem(self, collection, namespace, name): """returns object instance representing namespace, name, or if does not exist return None. namespace -- namespace item defined in. name -- name of item. collection -- collection in parent Schema instance to search. """ parent = GetSchema(self) if parent.targetNamespace == namespace: try: obj = getattr(parent, collection)[name] except KeyError, ex: raise KeyError, 'targetNamespace(%s) collection(%s) has no item(%s)'\ %(namespace, collection, name) return obj if not parent.imports.has_key(namespace): return None # Lazy Eval schema = parent.imports[namespace] if not isinstance(schema, XMLSchema): schema = schema.getSchema() if schema is not None: parent.imports[namespace] = schema if schema is None: raise SchemaError, 'no schema instance for imported namespace (%s).'\ %(namespace) if not isinstance(schema, XMLSchema): raise TypeError, 'expecting XMLSchema instance not "%r"' %schema try: obj = getattr(schema, collection)[name] except KeyError, ex: raise KeyError, 'targetNamespace(%s) collection(%s) has no item(%s)'\ %(namespace, collection, name) return obj def getXMLNS(self, prefix=None): """deference prefix or by default xmlns, returns namespace. """ if prefix == XMLSchemaComponent.xml: return XMLNS.XML parent = self ns = self.attributes[XMLSchemaComponent.xmlns].get(prefix or\ XMLSchemaComponent.xmlns_key) while not ns: parent = parent._parent() ns = parent.attributes[XMLSchemaComponent.xmlns].get(prefix or\ XMLSchemaComponent.xmlns_key) if not ns and isinstance(parent, WSDLToolsAdapter): if prefix is None: return '' raise SchemaError, 'unknown prefix %s' %prefix return ns def getAttribute(self, attribute): """return requested attribute value or None """ if type(attribute) in (list, tuple): if len(attribute) != 2: raise LookupError, 'To access attributes must use name or (namespace,name)' return self.attributes.get(attribute[0]).get(attribute[1]) return self.attributes.get(attribute) def getAttributeQName(self, attribute): """return requested attribute value as (namespace,name) or None """ qname = self.getAttribute(attribute) if isinstance(qname, TypeDescriptionComponent) is True: return qname if qname is None: return None prefix,ncname = SplitQName(qname) namespace = self.getXMLNS(prefix) return TypeDescriptionComponent((namespace,ncname)) def getAttributeName(self): """return attribute name or None """ return self.getAttribute('name') def setAttributes(self, node): """Sets up attribute dictionary, checks for required attributes and sets default attribute values. attr is for default attribute values determined at runtime. structure of attributes dictionary ['xmlns'][xmlns_key] -- xmlns namespace ['xmlns'][prefix] -- declared namespace prefix [namespace][prefix] -- attributes declared in a namespace [attribute] -- attributes w/o prefix, default namespaces do not directly apply to attributes, ie Name can't collide with QName. """ self.attributes = {XMLSchemaComponent.xmlns:{}} for k,v in node.getAttributeDictionary().items(): prefix,value = SplitQName(k) if value == XMLSchemaComponent.xmlns: self.attributes[value][prefix or XMLSchemaComponent.xmlns_key] = v elif prefix: ns = node.getNamespace(prefix) if not ns: raise SchemaError, 'no namespace for attribute prefix %s'\ %prefix if not self.attributes.has_key(ns): self.attributes[ns] = {} elif self.attributes[ns].has_key(value): raise SchemaError, 'attribute %s declared multiple times in %s'\ %(value, ns) self.attributes[ns][value] = v elif not self.attributes.has_key(value): self.attributes[value] = v else: raise SchemaError, 'attribute %s declared multiple times' %value if not isinstance(self, WSDLToolsAdapter): self.__checkAttributes() self.__setAttributeDefaults() #set QNames for k in ['type', 'element', 'base', 'ref', 'substitutionGroup', 'itemType']: if self.attributes.has_key(k): prefix, value = SplitQName(self.attributes.get(k)) self.attributes[k] = \ TypeDescriptionComponent((self.getXMLNS(prefix), value)) #Union, memberTypes is a whitespace separated list of QNames for k in ['memberTypes']: if self.attributes.has_key(k): qnames = self.attributes[k] self.attributes[k] = [] for qname in qnames.split(): prefix, value = SplitQName(qname) self.attributes['memberTypes'].append(\ TypeDescriptionComponent(\ (self.getXMLNS(prefix), value))) def getContents(self, node): """retrieve xsd contents """ return node.getContentList(*self.__class__.contents['xsd']) def __setAttributeDefaults(self): """Looks for default values for unset attributes. If class variable representing attribute is None, then it must be defined as an instance variable. """ for k,v in self.__class__.attributes.items(): if v is not None and self.attributes.has_key(k) is False: if isinstance(v, types.FunctionType): self.attributes[k] = v(self) else: self.attributes[k] = v def __checkAttributes(self): """Checks that required attributes have been defined, attributes w/default cannot be required. Checks all defined attributes are legal, attribute references are not subject to this test. """ for a in self.__class__.required: if not self.attributes.has_key(a): raise SchemaError,\ 'class instance %s, missing required attribute %s'\ %(self.__class__, a) for a,v in self.attributes.items(): # attribute #other, ie. not in empty namespace if type(v) is dict: continue # predefined prefixes xmlns, xml if a in (XMLSchemaComponent.xmlns, XMLNS.XML): continue if (a not in self.__class__.attributes.keys()) and not\ (self.isAttribute() and self.isReference()): raise SchemaError, '%s, unknown attribute(%s,%s)' \ %(self.getItemTrace(), a, self.attributes[a]) class WSDLToolsAdapter(XMLSchemaComponent): """WSDL Adapter to grab the attributes from the wsdl document node. """ attributes = {'name':None, 'targetNamespace':None} tag = 'definitions' def __init__(self, wsdl): XMLSchemaComponent.__init__(self, parent=wsdl) self.setAttributes(DOMAdapter(wsdl.document)) def getImportSchemas(self): """returns WSDLTools.WSDL types Collection """ return self._parent().types class Notation(XMLSchemaComponent): """ parent: schema attributes: id -- ID name -- NCName, Required public -- token, Required system -- anyURI contents: annotation? """ required = ['name', 'public'] attributes = {'id':None, 'name':None, 'public':None, 'system':None} contents = {'xsd':('annotation')} tag = 'notation' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class Annotation(XMLSchemaComponent): """ parent: all,any,anyAttribute,attribute,attributeGroup,choice,complexContent, complexType,element,extension,field,group,import,include,key,keyref, list,notation,redefine,restriction,schema,selector,simpleContent, simpleType,union,unique attributes: id -- ID contents: (documentation | appinfo)* """ attributes = {'id':None} contents = {'xsd':('documentation', 'appinfo')} tag = 'annotation' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] for i in contents: component = SplitQName(i.getTagName())[1] if component == 'documentation': #print_debug('class %s, documentation skipped' %self.__class__, 5) continue elif component == 'appinfo': #print_debug('class %s, appinfo skipped' %self.__class__, 5) continue else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.content = tuple(content) class Documentation(XMLSchemaComponent): """ parent: annotation attributes: source, anyURI xml:lang, language contents: mixed, any """ attributes = {'source':None, 'xml:lang':None} contents = {'xsd':('mixed', 'any')} tag = 'documentation' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] for i in contents: component = SplitQName(i.getTagName())[1] if component == 'mixed': #print_debug('class %s, mixed skipped' %self.__class__, 5) continue elif component == 'any': #print_debug('class %s, any skipped' %self.__class__, 5) continue else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.content = tuple(content) class Appinfo(XMLSchemaComponent): """ parent: annotation attributes: source, anyURI contents: mixed, any """ attributes = {'source':None, 'anyURI':None} contents = {'xsd':('mixed', 'any')} tag = 'appinfo' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] for i in contents: component = SplitQName(i.getTagName())[1] if component == 'mixed': #print_debug('class %s, mixed skipped' %self.__class__, 5) continue elif component == 'any': #print_debug('class %s, any skipped' %self.__class__, 5) continue else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.content = tuple(content) class XMLSchemaFake: # This is temporary, for the benefit of WSDL until the real thing works. def __init__(self, element): self.targetNamespace = DOM.getAttr(element, 'targetNamespace') self.element = element class XMLSchema(XMLSchemaComponent): """A schema is a collection of schema components derived from one or more schema documents, that is, one or more element information items. It represents the abstract notion of a schema rather than a single schema document (or other representation). parent: ROOT attributes: id -- ID version -- token xml:lang -- language targetNamespace -- anyURI attributeFormDefault -- 'qualified' | 'unqualified', 'unqualified' elementFormDefault -- 'qualified' | 'unqualified', 'unqualified' blockDefault -- '#all' | list of ('substitution | 'extension' | 'restriction') finalDefault -- '#all' | list of ('extension' | 'restriction' | 'list' | 'union') contents: ((include | import | redefine | annotation)*, (attribute, attributeGroup, complexType, element, group, notation, simpleType)*, annotation*)* attributes -- schema attributes imports -- import statements includes -- include statements redefines -- types -- global simpleType, complexType definitions elements -- global element declarations attr_decl -- global attribute declarations attr_groups -- attribute Groups model_groups -- model Groups notations -- global notations """ attributes = {'id':None, 'version':None, 'xml:lang':None, 'targetNamespace':None, 'attributeFormDefault':'unqualified', 'elementFormDefault':'unqualified', 'blockDefault':None, 'finalDefault':None} contents = {'xsd':('include', 'import', 'redefine', 'annotation', 'attribute', 'attributeGroup', 'complexType', 'element', 'group', 'notation', 'simpleType', 'annotation')} empty_namespace = '' tag = 'schema' def __init__(self, parent=None): """parent -- instance variables: targetNamespace -- schema's declared targetNamespace, or empty string. _imported_schemas -- namespace keyed dict of schema dependencies, if a schema is provided instance will not resolve import statement. _included_schemas -- schemaLocation keyed dict of component schemas, if schema is provided instance will not resolve include statement. _base_url -- needed for relative URLs support, only works with URLs relative to initial document. includes -- collection of include statements imports -- collection of import statements elements -- collection of global element declarations types -- collection of global type definitions attr_decl -- collection of global attribute declarations attr_groups -- collection of global attribute group definitions model_groups -- collection of model group definitions notations -- collection of notations """ self.__node = None self.targetNamespace = None XMLSchemaComponent.__init__(self, parent) f = lambda k: k.attributes['name'] ns = lambda k: k.attributes['namespace'] sl = lambda k: k.attributes['schemaLocation'] self.includes = Collection(self, key=sl) self.imports = Collection(self, key=ns) self.elements = Collection(self, key=f) self.types = Collection(self, key=f) self.attr_decl = Collection(self, key=f) self.attr_groups = Collection(self, key=f) self.model_groups = Collection(self, key=f) self.notations = Collection(self, key=f) self._imported_schemas = {} self._included_schemas = {} self._base_url = None def getNode(self): """ Interacting with the underlying DOM tree. """ return self.__node def addImportSchema(self, schema): """for resolving import statements in Schema instance schema -- schema instance _imported_schemas """ if not isinstance(schema, XMLSchema): raise TypeError, 'expecting a Schema instance' if schema.targetNamespace != self.targetNamespace: self._imported_schemas[schema.targetNamespace] = schema else: raise SchemaError, 'import schema bad targetNamespace' def addIncludeSchema(self, schemaLocation, schema): """for resolving include statements in Schema instance schemaLocation -- schema location schema -- schema instance _included_schemas """ if not isinstance(schema, XMLSchema): raise TypeError, 'expecting a Schema instance' if not schema.targetNamespace or\ schema.targetNamespace == self.targetNamespace: self._included_schemas[schemaLocation] = schema else: raise SchemaError, 'include schema bad targetNamespace' def setImportSchemas(self, schema_dict): """set the import schema dictionary, which is used to reference depedent schemas. """ self._imported_schemas = schema_dict def getImportSchemas(self): """get the import schema dictionary, which is used to reference depedent schemas. """ return self._imported_schemas def getSchemaNamespacesToImport(self): """returns tuple of namespaces the schema instance has declared itself to be depedent upon. """ return tuple(self.includes.keys()) def setIncludeSchemas(self, schema_dict): """set the include schema dictionary, which is keyed with schemaLocation (uri). This is a means of providing schemas to the current schema for content inclusion. """ self._included_schemas = schema_dict def getIncludeSchemas(self): """get the include schema dictionary, which is keyed with schemaLocation (uri). """ return self._included_schemas def getBaseUrl(self): """get base url, used for normalizing all relative uri's """ return self._base_url def setBaseUrl(self, url): """set base url, used for normalizing all relative uri's """ self._base_url = url def getElementFormDefault(self): """return elementFormDefault attribute """ return self.attributes.get('elementFormDefault') def isElementFormDefaultQualified(self): return self.attributes.get('elementFormDefault') == 'qualified' def getAttributeFormDefault(self): """return attributeFormDefault attribute """ return self.attributes.get('attributeFormDefault') def getBlockDefault(self): """return blockDefault attribute """ return self.attributes.get('blockDefault') def getFinalDefault(self): """return finalDefault attribute """ return self.attributes.get('finalDefault') def load(self, node, location=None): self.__node = node pnode = node.getParentNode() if pnode: pname = SplitQName(pnode.getTagName())[1] if pname == 'types': attributes = {} self.setAttributes(pnode) attributes.update(self.attributes) self.setAttributes(node) for k,v in attributes['xmlns'].items(): if not self.attributes['xmlns'].has_key(k): self.attributes['xmlns'][k] = v else: self.setAttributes(node) else: self.setAttributes(node) self.targetNamespace = self.getTargetNamespace() for childNode in self.getContents(node): component = SplitQName(childNode.getTagName())[1] if component == 'include': tp = self.__class__.Include(self) tp.fromDom(childNode) sl = tp.attributes['schemaLocation'] schema = tp.getSchema() if not self.getIncludeSchemas().has_key(sl): self.addIncludeSchema(sl, schema) self.includes[sl] = tp pn = childNode.getParentNode().getNode() pn.removeChild(childNode.getNode()) for child in schema.getNode().getNode().childNodes: pn.appendChild(child.cloneNode(1)) for collection in ['imports','elements','types', 'attr_decl','attr_groups','model_groups', 'notations']: for k,v in getattr(schema,collection).items(): if not getattr(self,collection).has_key(k): v._parent = weakref.ref(self) getattr(self,collection)[k] = v else: warnings.warn("Not keeping schema component.") elif component == 'import': slocd = SchemaReader.namespaceToSchema tp = self.__class__.Import(self) tp.fromDom(childNode) import_ns = tp.getAttribute('namespace') or\ self.__class__.empty_namespace schema = slocd.get(import_ns) if schema is None: schema = XMLSchema() slocd[import_ns] = schema try: tp.loadSchema(schema) except SchemaError: # Dependency declaration, hopefully implementation # is aware of this namespace (eg. SOAP,WSDL,?) #warnings.warn(\ # ', %s'\ # %(import_ns, 'failed to load schema instance') #) del slocd[import_ns] class LazyEval(str): '''Lazy evaluation of import, replace entry in self.imports.''' def getSchema(namespace): schema = slocd.get(namespace) if schema is None: parent = self._parent() wstypes = parent if isinstance(parent, WSDLToolsAdapter): wstypes = parent.getImportSchemas() schema = wstypes.get(namespace) if isinstance(schema, XMLSchema): self.imports[namespace] = schema return schema return None self.imports[import_ns] = LazyEval(import_ns) continue else: tp._schema = schema if self.getImportSchemas().has_key(import_ns): warnings.warn(\ 'Detected multiple imports of the namespace "%s" '\ %import_ns) self.addImportSchema(schema) # spec says can have multiple imports of same namespace # but purpose of import is just dependency declaration. self.imports[import_ns] = tp elif component == 'redefine': warnings.warn('redefine is ignored') elif component == 'annotation': warnings.warn('annotation is ignored') elif component == 'attribute': tp = AttributeDeclaration(self) tp.fromDom(childNode) self.attr_decl[tp.getAttribute('name')] = tp elif component == 'attributeGroup': tp = AttributeGroupDefinition(self) tp.fromDom(childNode) self.attr_groups[tp.getAttribute('name')] = tp elif component == 'element': tp = ElementDeclaration(self) tp.fromDom(childNode) self.elements[tp.getAttribute('name')] = tp elif component == 'group': tp = ModelGroupDefinition(self) tp.fromDom(childNode) self.model_groups[tp.getAttribute('name')] = tp elif component == 'notation': tp = Notation(self) tp.fromDom(childNode) self.notations[tp.getAttribute('name')] = tp elif component == 'complexType': tp = ComplexType(self) tp.fromDom(childNode) self.types[tp.getAttribute('name')] = tp elif component == 'simpleType': tp = SimpleType(self) tp.fromDom(childNode) self.types[tp.getAttribute('name')] = tp else: break class Import(XMLSchemaComponent): """ parent: schema attributes: id -- ID namespace -- anyURI schemaLocation -- anyURI contents: annotation? """ attributes = {'id':None, 'namespace':None, 'schemaLocation':None} contents = {'xsd':['annotation']} tag = 'import' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self._schema = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) if self.attributes['namespace'] == self.getTargetNamespace(): raise SchemaError, 'namespace of schema and import match' for i in contents: component = SplitQName(i.getTagName())[1] if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) def getSchema(self): """if schema is not defined, first look for a Schema class instance in parent Schema. Else if not defined resolve schemaLocation and create a new Schema class instance, and keep a hard reference. """ if not self._schema: ns = self.attributes['namespace'] schema = self._parent().getImportSchemas().get(ns) if not schema and self._parent()._parent: schema = self._parent()._parent().getImportSchemas().get(ns) if not schema: url = self.attributes.get('schemaLocation') if not url: raise SchemaError, 'namespace(%s) is unknown' %ns base_url = self._parent().getBaseUrl() reader = SchemaReader(base_url=base_url) reader._imports = self._parent().getImportSchemas() reader._includes = self._parent().getIncludeSchemas() self._schema = reader.loadFromURL(url) return self._schema or schema def loadSchema(self, schema): """ """ base_url = self._parent().getBaseUrl() reader = SchemaReader(base_url=base_url) reader._imports = self._parent().getImportSchemas() reader._includes = self._parent().getIncludeSchemas() self._schema = schema if not self.attributes.has_key('schemaLocation'): raise SchemaError, 'no schemaLocation' reader.loadFromURL(self.attributes.get('schemaLocation'), schema) class Include(XMLSchemaComponent): """ parent: schema attributes: id -- ID schemaLocation -- anyURI, required contents: annotation? """ required = ['schemaLocation'] attributes = {'id':None, 'schemaLocation':None} contents = {'xsd':['annotation']} tag = 'include' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self._schema = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) def getSchema(self): """if schema is not defined, first look for a Schema class instance in parent Schema. Else if not defined resolve schemaLocation and create a new Schema class instance. """ if not self._schema: schema = self._parent() self._schema = schema.getIncludeSchemas().get(\ self.attributes['schemaLocation'] ) if not self._schema: url = self.attributes['schemaLocation'] reader = SchemaReader(base_url=schema.getBaseUrl()) reader._imports = schema.getImportSchemas() reader._includes = schema.getIncludeSchemas() # create schema before loading so chameleon include # will evalute targetNamespace correctly. self._schema = XMLSchema(schema) reader.loadFromURL(url, self._schema) return self._schema class AttributeDeclaration(XMLSchemaComponent,\ AttributeMarker,\ DeclarationMarker): """ parent: schema attributes: id -- ID name -- NCName, required type -- QName default -- string fixed -- string contents: annotation?, simpleType? """ required = ['name'] attributes = {'id':None, 'name':None, 'type':None, 'default':None, 'fixed':None} contents = {'xsd':['annotation','simpleType']} tag = 'attribute' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None def fromDom(self, node): """ No list or union support """ self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) elif component == 'simpleType': self.content = AnonymousSimpleType(self) self.content.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class LocalAttributeDeclaration(AttributeDeclaration,\ AttributeMarker,\ LocalMarker,\ DeclarationMarker): """ parent: complexType, restriction, extension, attributeGroup attributes: id -- ID name -- NCName, required type -- QName form -- ('qualified' | 'unqualified'), schema.attributeFormDefault use -- ('optional' | 'prohibited' | 'required'), optional default -- string fixed -- string contents: annotation?, simpleType? """ required = ['name'] attributes = {'id':None, 'name':None, 'type':None, 'form':lambda self: GetSchema(self).getAttributeFormDefault(), 'use':'optional', 'default':None, 'fixed':None} contents = {'xsd':['annotation','simpleType']} def __init__(self, parent): AttributeDeclaration.__init__(self, parent) self.annotation = None self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) elif component == 'simpleType': self.content = AnonymousSimpleType(self) self.content.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class AttributeWildCard(XMLSchemaComponent,\ AttributeMarker,\ DeclarationMarker,\ WildCardMarker): """ parents: complexType, restriction, extension, attributeGroup attributes: id -- ID namespace -- '##any' | '##other' | (anyURI* | '##targetNamespace' | '##local'), ##any processContents -- 'lax' | 'skip' | 'strict', strict contents: annotation? """ attributes = {'id':None, 'namespace':'##any', 'processContents':'strict'} contents = {'xsd':['annotation']} tag = 'anyAttribute' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class AttributeReference(XMLSchemaComponent,\ AttributeMarker,\ ReferenceMarker): """ parents: complexType, restriction, extension, attributeGroup attributes: id -- ID ref -- QName, required use -- ('optional' | 'prohibited' | 'required'), optional default -- string fixed -- string contents: annotation? """ required = ['ref'] attributes = {'id':None, 'ref':None, 'use':'optional', 'default':None, 'fixed':None} contents = {'xsd':['annotation']} tag = 'attribute' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None def getAttributeDeclaration(self, attribute='ref'): return XMLSchemaComponent.getAttributeDeclaration(self, attribute) def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class AttributeGroupDefinition(XMLSchemaComponent,\ AttributeGroupMarker,\ DefinitionMarker): """ parents: schema, redefine attributes: id -- ID name -- NCName, required contents: annotation?, (attribute | attributeGroup)*, anyAttribute? """ required = ['name'] attributes = {'id':None, 'name':None} contents = {'xsd':['annotation', 'attribute', 'attributeGroup', 'anyAttribute']} tag = 'attributeGroup' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.attr_content = None def getAttributeContent(self): return self.attr_content def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] for indx in range(len(contents)): component = SplitQName(contents[indx].getTagName())[1] if (component == 'annotation') and (not indx): self.annotation = Annotation(self) self.annotation.fromDom(contents[indx]) elif component == 'attribute': if contents[indx].hasattr('name'): content.append(LocalAttributeDeclaration(self)) elif contents[indx].hasattr('ref'): content.append(AttributeReference(self)) else: raise SchemaError, 'Unknown attribute type' content[-1].fromDom(contents[indx]) elif component == 'attributeGroup': content.append(AttributeGroupReference(self)) content[-1].fromDom(contents[indx]) elif component == 'anyAttribute': if len(contents) != indx+1: raise SchemaError, 'anyAttribute is out of order in %s' %self.getItemTrace() content.append(AttributeWildCard(self)) content[-1].fromDom(contents[indx]) else: raise SchemaError, 'Unknown component (%s)' %(contents[indx].getTagName()) self.attr_content = tuple(content) class AttributeGroupReference(XMLSchemaComponent,\ AttributeGroupMarker,\ ReferenceMarker): """ parents: complexType, restriction, extension, attributeGroup attributes: id -- ID ref -- QName, required contents: annotation? """ required = ['ref'] attributes = {'id':None, 'ref':None} contents = {'xsd':['annotation']} tag = 'attributeGroup' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None def getAttributeGroup(self, attribute='ref'): """attribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance """ return XMLSchemaComponent.getAttributeGroup(self, attribute) def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) ###################################################### # Elements ##################################################### class IdentityConstrants(XMLSchemaComponent): """Allow one to uniquely identify nodes in a document and ensure the integrity of references between them. attributes -- dictionary of attributes selector -- XPath to selected nodes fields -- list of XPath to key field """ def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.selector = None self.fields = None self.annotation = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) fields = [] for i in contents: component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) elif component == 'selector': self.selector = self.Selector(self) self.selector.fromDom(i) continue elif component == 'field': fields.append(self.Field(self)) fields[-1].fromDom(i) continue else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.fields = tuple(fields) class Constraint(XMLSchemaComponent): def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class Selector(Constraint): """ parent: unique, key, keyref attributes: id -- ID xpath -- XPath subset, required contents: annotation? """ required = ['xpath'] attributes = {'id':None, 'xpath':None} contents = {'xsd':['annotation']} tag = 'selector' class Field(Constraint): """ parent: unique, key, keyref attributes: id -- ID xpath -- XPath subset, required contents: annotation? """ required = ['xpath'] attributes = {'id':None, 'xpath':None} contents = {'xsd':['annotation']} tag = 'field' class Unique(IdentityConstrants): """ Enforce fields are unique w/i a specified scope. parent: element attributes: id -- ID name -- NCName, required contents: annotation?, selector, field+ """ required = ['name'] attributes = {'id':None, 'name':None} contents = {'xsd':['annotation', 'selector', 'field']} tag = 'unique' class Key(IdentityConstrants): """ Enforce fields are unique w/i a specified scope, and all field values are present w/i document. Fields cannot be nillable. parent: element attributes: id -- ID name -- NCName, required contents: annotation?, selector, field+ """ required = ['name'] attributes = {'id':None, 'name':None} contents = {'xsd':['annotation', 'selector', 'field']} tag = 'key' class KeyRef(IdentityConstrants): """ Ensure a match between two sets of values in an instance. parent: element attributes: id -- ID name -- NCName, required refer -- QName, required contents: annotation?, selector, field+ """ required = ['name', 'refer'] attributes = {'id':None, 'name':None, 'refer':None} contents = {'xsd':['annotation', 'selector', 'field']} tag = 'keyref' class ElementDeclaration(XMLSchemaComponent,\ ElementMarker,\ DeclarationMarker): """ parents: schema attributes: id -- ID name -- NCName, required type -- QName default -- string fixed -- string nillable -- boolean, false abstract -- boolean, false substitutionGroup -- QName block -- ('#all' | ('substition' | 'extension' | 'restriction')*), schema.blockDefault final -- ('#all' | ('extension' | 'restriction')*), schema.finalDefault contents: annotation?, (simpleType,complexType)?, (key | keyref | unique)* """ required = ['name'] attributes = {'id':None, 'name':None, 'type':None, 'default':None, 'fixed':None, 'nillable':0, 'abstract':0, 'substitutionGroup':None, 'block':lambda self: self._parent().getBlockDefault(), 'final':lambda self: self._parent().getFinalDefault()} contents = {'xsd':['annotation', 'simpleType', 'complexType', 'key',\ 'keyref', 'unique']} tag = 'element' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None self.constraints = () def isQualified(self): """Global elements are always qualified. """ return True def getAttribute(self, attribute): """return attribute. If attribute is type and it's None, and no simple or complex content, return the default type "xsd:anyType" """ value = XMLSchemaComponent.getAttribute(self, attribute) if attribute != 'type' or value is not None: return value if self.content is not None: return None parent = self while 1: nsdict = parent.attributes[XMLSchemaComponent.xmlns] for k,v in nsdict.items(): if v not in SCHEMA.XSD_LIST: continue return TypeDescriptionComponent((v, 'anyType')) if isinstance(parent, WSDLToolsAdapter)\ or not hasattr(parent, '_parent'): break parent = parent._parent() raise SchemaError, 'failed to locate the XSD namespace' def getElementDeclaration(self, attribute): raise Warning, 'invalid operation for <%s>' %self.tag def getTypeDefinition(self, attribute=None): """If attribute is None, "type" is assumed, return the corresponding representation of the global type definition (TypeDefinition), or the local definition if don't find "type". To maintain backwards compat, if attribute is provided call base class method. """ if attribute: return XMLSchemaComponent.getTypeDefinition(self, attribute) gt = XMLSchemaComponent.getTypeDefinition(self, 'type') if gt: return gt return self.content def getConstraints(self): return self._constraints def setConstraints(self, constraints): self._constraints = tuple(constraints) constraints = property(getConstraints, setConstraints, None, "tuple of key, keyref, unique constraints") def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) constraints = [] for i in contents: component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) elif component == 'simpleType' and not self.content: self.content = AnonymousSimpleType(self) self.content.fromDom(i) elif component == 'complexType' and not self.content: self.content = LocalComplexType(self) self.content.fromDom(i) elif component == 'key': constraints.append(Key(self)) constraints[-1].fromDom(i) elif component == 'keyref': constraints.append(KeyRef(self)) constraints[-1].fromDom(i) elif component == 'unique': constraints.append(Unique(self)) constraints[-1].fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.constraints = constraints class LocalElementDeclaration(ElementDeclaration,\ LocalMarker): """ parents: all, choice, sequence attributes: id -- ID name -- NCName, required form -- ('qualified' | 'unqualified'), schema.elementFormDefault type -- QName minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 default -- string fixed -- string nillable -- boolean, false block -- ('#all' | ('extension' | 'restriction')*), schema.blockDefault contents: annotation?, (simpleType,complexType)?, (key | keyref | unique)* """ required = ['name'] attributes = {'id':None, 'name':None, 'form':lambda self: GetSchema(self).getElementFormDefault(), 'type':None, 'minOccurs':'1', 'maxOccurs':'1', 'default':None, 'fixed':None, 'nillable':0, 'abstract':0, 'block':lambda self: GetSchema(self).getBlockDefault()} contents = {'xsd':['annotation', 'simpleType', 'complexType', 'key',\ 'keyref', 'unique']} def isQualified(self): """ Local elements can be qualified or unqualifed according to the attribute form, or the elementFormDefault. By default local elements are unqualified. """ form = self.getAttribute('form') if form == 'qualified': return True if form == 'unqualified': return False raise SchemaError, 'Bad form (%s) for element: %s' %(form, self.getItemTrace()) class ElementReference(XMLSchemaComponent,\ ElementMarker,\ ReferenceMarker): """ parents: all, choice, sequence attributes: id -- ID ref -- QName, required minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation? """ required = ['ref'] attributes = {'id':None, 'ref':None, 'minOccurs':'1', 'maxOccurs':'1'} contents = {'xsd':['annotation']} tag = 'element' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None def getElementDeclaration(self, attribute=None): """If attribute is None, "ref" is assumed, return the corresponding representation of the global element declaration (ElementDeclaration), To maintain backwards compat, if attribute is provided call base class method. """ if attribute: return XMLSchemaComponent.getElementDeclaration(self, attribute) return XMLSchemaComponent.getElementDeclaration(self, 'ref') def fromDom(self, node): self.annotation = None self.setAttributes(node) for i in self.getContents(node): component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class ElementWildCard(LocalElementDeclaration, WildCardMarker): """ parents: choice, sequence attributes: id -- ID minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 namespace -- '##any' | '##other' | (anyURI* | '##targetNamespace' | '##local'), ##any processContents -- 'lax' | 'skip' | 'strict', strict contents: annotation? """ required = [] attributes = {'id':None, 'minOccurs':'1', 'maxOccurs':'1', 'namespace':'##any', 'processContents':'strict'} contents = {'xsd':['annotation']} tag = 'any' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None def isQualified(self): """ Global elements are always qualified, but if processContents are not strict could have dynamically generated local elements. """ return GetSchema(self).isElementFormDefaultQualified() def getAttribute(self, attribute): """return attribute. """ return XMLSchemaComponent.getAttribute(self, attribute) def getTypeDefinition(self, attribute): raise Warning, 'invalid operation for <%s>' % self.tag def fromDom(self, node): self.annotation = None self.setAttributes(node) for i in self.getContents(node): component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) ###################################################### # Model Groups ##################################################### class Sequence(XMLSchemaComponent,\ SequenceMarker): """ parents: complexType, extension, restriction, group, choice, sequence attributes: id -- ID minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation?, (element | group | choice | sequence | any)* """ attributes = {'id':None, 'minOccurs':'1', 'maxOccurs':'1'} contents = {'xsd':['annotation', 'element', 'group', 'choice', 'sequence',\ 'any']} tag = 'sequence' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] for i in contents: component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) continue elif component == 'element': if i.hasattr('ref'): content.append(ElementReference(self)) else: content.append(LocalElementDeclaration(self)) elif component == 'group': content.append(ModelGroupReference(self)) elif component == 'choice': content.append(Choice(self)) elif component == 'sequence': content.append(Sequence(self)) elif component == 'any': content.append(ElementWildCard(self)) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) content[-1].fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.content = tuple(content) class All(XMLSchemaComponent,\ AllMarker): """ parents: complexType, extension, restriction, group attributes: id -- ID minOccurs -- '0' | '1', 1 maxOccurs -- '1', 1 contents: annotation?, element* """ attributes = {'id':None, 'minOccurs':'1', 'maxOccurs':'1'} contents = {'xsd':['annotation', 'element']} tag = 'all' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] for i in contents: component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) continue elif component == 'element': if i.hasattr('ref'): content.append(ElementReference(self)) else: content.append(LocalElementDeclaration(self)) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) content[-1].fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.content = tuple(content) class Choice(XMLSchemaComponent,\ ChoiceMarker): """ parents: complexType, extension, restriction, group, choice, sequence attributes: id -- ID minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation?, (element | group | choice | sequence | any)* """ attributes = {'id':None, 'minOccurs':'1', 'maxOccurs':'1'} contents = {'xsd':['annotation', 'element', 'group', 'choice', 'sequence',\ 'any']} tag = 'choice' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] for i in contents: component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) continue elif component == 'element': if i.hasattr('ref'): content.append(ElementReference(self)) else: content.append(LocalElementDeclaration(self)) elif component == 'group': content.append(ModelGroupReference(self)) elif component == 'choice': content.append(Choice(self)) elif component == 'sequence': content.append(Sequence(self)) elif component == 'any': content.append(ElementWildCard(self)) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) content[-1].fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.content = tuple(content) class ModelGroupDefinition(XMLSchemaComponent,\ ModelGroupMarker,\ DefinitionMarker): """ parents: redefine, schema attributes: id -- ID name -- NCName, required contents: annotation?, (all | choice | sequence)? """ required = ['name'] attributes = {'id':None, 'name':None} contents = {'xsd':['annotation', 'all', 'choice', 'sequence']} tag = 'group' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) continue elif component == 'all' and not self.content: self.content = All(self) elif component == 'choice' and not self.content: self.content = Choice(self) elif component == 'sequence' and not self.content: self.content = Sequence(self) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.content.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class ModelGroupReference(XMLSchemaComponent,\ ModelGroupMarker,\ ReferenceMarker): """ parents: choice, complexType, extension, restriction, sequence attributes: id -- ID ref -- NCName, required minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation? """ required = ['ref'] attributes = {'id':None, 'ref':None, 'minOccurs':'1', 'maxOccurs':'1'} contents = {'xsd':['annotation']} tag = 'group' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None def getModelGroupReference(self): return self.getModelGroup('ref') def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class ComplexType(XMLSchemaComponent,\ DefinitionMarker,\ ComplexMarker): """ parents: redefine, schema attributes: id -- ID name -- NCName, required mixed -- boolean, false abstract -- boolean, false block -- ('#all' | ('extension' | 'restriction')*), schema.blockDefault final -- ('#all' | ('extension' | 'restriction')*), schema.finalDefault contents: annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute?)) """ required = ['name'] attributes = {'id':None, 'name':None, 'mixed':0, 'abstract':0, 'block':lambda self: self._parent().getBlockDefault(), 'final':lambda self: self._parent().getFinalDefault()} contents = {'xsd':['annotation', 'simpleContent', 'complexContent',\ 'group', 'all', 'choice', 'sequence', 'attribute', 'attributeGroup',\ 'anyAttribute', 'any']} tag = 'complexType' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None self.attr_content = None def isMixed(self): m = self.getAttribute('mixed') if m == 0 or m == False: return False if isinstance(m, basestring) is True: if m in ('false', '0'): return False if m in ('true', '1'): return True raise SchemaError, 'invalid value for attribute mixed(%s): %s'\ %(m, self.getItemTrace()) def getAttributeContent(self): return self.attr_content def getElementDeclaration(self, attribute): raise Warning, 'invalid operation for <%s>' %self.tag def getTypeDefinition(self, attribute): raise Warning, 'invalid operation for <%s>' %self.tag def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) indx = 0 num = len(contents) if not num: return component = SplitQName(contents[indx].getTagName())[1] if component == 'annotation': self.annotation = Annotation(self) self.annotation.fromDom(contents[indx]) indx += 1 component = SplitQName(contents[indx].getTagName())[1] self.content = None if component == 'simpleContent': self.content = self.__class__.SimpleContent(self) self.content.fromDom(contents[indx]) elif component == 'complexContent': self.content = self.__class__.ComplexContent(self) self.content.fromDom(contents[indx]) else: if component == 'all': self.content = All(self) elif component == 'choice': self.content = Choice(self) elif component == 'sequence': self.content = Sequence(self) elif component == 'group': self.content = ModelGroupReference(self) if self.content: self.content.fromDom(contents[indx]) indx += 1 self.attr_content = [] while indx < num: component = SplitQName(contents[indx].getTagName())[1] if component == 'attribute': if contents[indx].hasattr('ref'): self.attr_content.append(AttributeReference(self)) else: self.attr_content.append(LocalAttributeDeclaration(self)) elif component == 'attributeGroup': self.attr_content.append(AttributeGroupReference(self)) elif component == 'anyAttribute': self.attr_content.append(AttributeWildCard(self)) else: raise SchemaError, 'Unknown component (%s): %s' \ %(contents[indx].getTagName(),self.getItemTrace()) self.attr_content[-1].fromDom(contents[indx]) indx += 1 class _DerivedType(XMLSchemaComponent): def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None # XXX remove attribute derivation, inconsistent self.derivation = None self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for i in contents: component = SplitQName(i.getTagName())[1] if component in self.__class__.contents['xsd']: if component == 'annotation' and not self.annotation: self.annotation = Annotation(self) self.annotation.fromDom(i) continue elif component == 'restriction' and not self.derivation: self.derivation = self.__class__.Restriction(self) elif component == 'extension' and not self.derivation: self.derivation = self.__class__.Extension(self) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.derivation.fromDom(i) self.content = self.derivation class ComplexContent(_DerivedType,\ ComplexMarker): """ parents: complexType attributes: id -- ID mixed -- boolean, false contents: annotation?, (restriction | extension) """ attributes = {'id':None, 'mixed':0} contents = {'xsd':['annotation', 'restriction', 'extension']} tag = 'complexContent' def isMixed(self): m = self.getAttribute('mixed') if m == 0 or m == False: return False if isinstance(m, basestring) is True: if m in ('false', '0'): return False if m in ('true', '1'): return True raise SchemaError, 'invalid value for attribute mixed(%s): %s'\ %(m, self.getItemTrace()) class _DerivationBase(XMLSchemaComponent): """, parents: complexContent attributes: id -- ID base -- QName, required contents: annotation?, (group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute? """ required = ['base'] attributes = {'id':None, 'base':None } contents = {'xsd':['annotation', 'group', 'all', 'choice',\ 'sequence', 'attribute', 'attributeGroup', 'anyAttribute']} def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None self.attr_content = None def getAttributeContent(self): return self.attr_content def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) indx = 0 num = len(contents) #XXX ugly if not num: return component = SplitQName(contents[indx].getTagName())[1] if component == 'annotation': self.annotation = Annotation(self) self.annotation.fromDom(contents[indx]) indx += 1 component = SplitQName(contents[indx].getTagName())[1] if component == 'all': self.content = All(self) self.content.fromDom(contents[indx]) indx += 1 elif component == 'choice': self.content = Choice(self) self.content.fromDom(contents[indx]) indx += 1 elif component == 'sequence': self.content = Sequence(self) self.content.fromDom(contents[indx]) indx += 1 elif component == 'group': self.content = ModelGroupReference(self) self.content.fromDom(contents[indx]) indx += 1 else: self.content = None self.attr_content = [] while indx < num: component = SplitQName(contents[indx].getTagName())[1] if component == 'attribute': if contents[indx].hasattr('ref'): self.attr_content.append(AttributeReference(self)) else: self.attr_content.append(LocalAttributeDeclaration(self)) elif component == 'attributeGroup': if contents[indx].hasattr('ref'): self.attr_content.append(AttributeGroupReference(self)) else: self.attr_content.append(AttributeGroupDefinition(self)) elif component == 'anyAttribute': self.attr_content.append(AttributeWildCard(self)) else: raise SchemaError, 'Unknown component (%s)' %(contents[indx].getTagName()) self.attr_content[-1].fromDom(contents[indx]) indx += 1 class Extension(_DerivationBase, ExtensionMarker): """ parents: complexContent attributes: id -- ID base -- QName, required contents: annotation?, (group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute? """ tag = 'extension' class Restriction(_DerivationBase,\ RestrictionMarker): """ parents: complexContent attributes: id -- ID base -- QName, required contents: annotation?, (group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute? """ tag = 'restriction' class SimpleContent(_DerivedType,\ SimpleMarker): """ parents: complexType attributes: id -- ID contents: annotation?, (restriction | extension) """ attributes = {'id':None} contents = {'xsd':['annotation', 'restriction', 'extension']} tag = 'simpleContent' class Extension(XMLSchemaComponent,\ ExtensionMarker): """ parents: simpleContent attributes: id -- ID base -- QName, required contents: annotation?, (attribute | attributeGroup)*, anyAttribute? """ required = ['base'] attributes = {'id':None, 'base':None } contents = {'xsd':['annotation', 'attribute', 'attributeGroup', 'anyAttribute']} tag = 'extension' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.attr_content = None def getAttributeContent(self): return self.attr_content def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) indx = 0 num = len(contents) if num: component = SplitQName(contents[indx].getTagName())[1] if component == 'annotation': self.annotation = Annotation(self) self.annotation.fromDom(contents[indx]) indx += 1 component = SplitQName(contents[indx].getTagName())[1] content = [] while indx < num: component = SplitQName(contents[indx].getTagName())[1] if component == 'attribute': if contents[indx].hasattr('ref'): content.append(AttributeReference(self)) else: content.append(LocalAttributeDeclaration(self)) elif component == 'attributeGroup': content.append(AttributeGroupReference(self)) elif component == 'anyAttribute': content.append(AttributeWildCard(self)) else: raise SchemaError, 'Unknown component (%s)'\ %(contents[indx].getTagName()) content[-1].fromDom(contents[indx]) indx += 1 self.attr_content = tuple(content) class Restriction(XMLSchemaComponent,\ RestrictionMarker): """ parents: simpleContent attributes: id -- ID base -- QName, required contents: annotation?, simpleType?, (enumeration | length | maxExclusive | maxInclusive | maxLength | minExclusive | minInclusive | minLength | pattern | fractionDigits | totalDigits | whiteSpace)*, (attribute | attributeGroup)*, anyAttribute? """ required = ['base'] attributes = {'id':None, 'base':None } contents = {'xsd':['annotation', 'simpleType', 'attribute',\ 'attributeGroup', 'anyAttribute'] + RestrictionMarker.facets} tag = 'restriction' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None self.attr_content = None def getAttributeContent(self): return self.attr_content def fromDom(self, node): self.content = [] self.setAttributes(node) contents = self.getContents(node) indx = 0 num = len(contents) component = SplitQName(contents[indx].getTagName())[1] if component == 'annotation': self.annotation = Annotation(self) self.annotation.fromDom(contents[indx]) indx += 1 component = SplitQName(contents[indx].getTagName())[1] content = [] while indx < num: component = SplitQName(contents[indx].getTagName())[1] if component == 'attribute': if contents[indx].hasattr('ref'): content.append(AttributeReference(self)) else: content.append(LocalAttributeDeclaration(self)) elif component == 'attributeGroup': content.append(AttributeGroupReference(self)) elif component == 'anyAttribute': content.append(AttributeWildCard(self)) elif component == 'simpleType': self.content.append(AnonymousSimpleType(self)) self.content[-1].fromDom(contents[indx]) else: raise SchemaError, 'Unknown component (%s)'\ %(contents[indx].getTagName()) content[-1].fromDom(contents[indx]) indx += 1 self.attr_content = tuple(content) class LocalComplexType(ComplexType,\ LocalMarker): """ parents: element attributes: id -- ID mixed -- boolean, false contents: annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute?)) """ required = [] attributes = {'id':None, 'mixed':0} tag = 'complexType' class SimpleType(XMLSchemaComponent,\ DefinitionMarker,\ SimpleMarker): """ parents: redefine, schema attributes: id -- ID name -- NCName, required final -- ('#all' | ('extension' | 'restriction' | 'list' | 'union')*), schema.finalDefault contents: annotation?, (restriction | list | union) """ required = ['name'] attributes = {'id':None, 'name':None, 'final':lambda self: self._parent().getFinalDefault()} contents = {'xsd':['annotation', 'restriction', 'list', 'union']} tag = 'simpleType' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None def getElementDeclaration(self, attribute): raise Warning, 'invalid operation for <%s>' %self.tag def getTypeDefinition(self, attribute): raise Warning, 'invalid operation for <%s>' %self.tag def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for child in contents: component = SplitQName(child.getTagName())[1] if component == 'annotation': self.annotation = Annotation(self) self.annotation.fromDom(child) continue break else: return if component == 'restriction': self.content = self.__class__.Restriction(self) elif component == 'list': self.content = self.__class__.List(self) elif component == 'union': self.content = self.__class__.Union(self) else: raise SchemaError, 'Unknown component (%s)' %(component) self.content.fromDom(child) class Restriction(XMLSchemaComponent,\ RestrictionMarker): """ parents: simpleType attributes: id -- ID base -- QName, required or simpleType child contents: annotation?, simpleType?, (enumeration | length | maxExclusive | maxInclusive | maxLength | minExclusive | minInclusive | minLength | pattern | fractionDigits | totalDigits | whiteSpace)* """ attributes = {'id':None, 'base':None } contents = {'xsd':['annotation', 'simpleType']+RestrictionMarker.facets} tag = 'restriction' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None self.facets = None def getAttributeBase(self): return XMLSchemaComponent.getAttribute(self, 'base') def getTypeDefinition(self, attribute='base'): return XMLSchemaComponent.getTypeDefinition(self, attribute) def getSimpleTypeContent(self): for el in self.content: if el.isSimple(): return el return None def fromDom(self, node): self.facets = [] self.setAttributes(node) contents = self.getContents(node) content = [] for indx in range(len(contents)): component = SplitQName(contents[indx].getTagName())[1] if (component == 'annotation') and (not indx): self.annotation = Annotation(self) self.annotation.fromDom(contents[indx]) continue elif (component == 'simpleType') and (not indx or indx == 1): content.append(AnonymousSimpleType(self)) content[-1].fromDom(contents[indx]) elif component in RestrictionMarker.facets: self.facets.append(contents[indx]) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.content = tuple(content) class Union(XMLSchemaComponent, UnionMarker): """ parents: simpleType attributes: id -- ID memberTypes -- list of QNames, required or simpleType child. contents: annotation?, simpleType* """ attributes = {'id':None, 'memberTypes':None } contents = {'xsd':['annotation', 'simpleType']} tag = 'union' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] for indx in range(len(contents)): component = SplitQName(contents[indx].getTagName())[1] if (component == 'annotation') and (not indx): self.annotation = Annotation(self) self.annotation.fromDom(contents[indx]) elif (component == 'simpleType'): content.append(AnonymousSimpleType(self)) content[-1].fromDom(contents[indx]) else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) self.content = tuple(content) class List(XMLSchemaComponent, ListMarker): """ parents: simpleType attributes: id -- ID itemType -- QName, required or simpleType child. contents: annotation?, simpleType? """ attributes = {'id':None, 'itemType':None } contents = {'xsd':['annotation', 'simpleType']} tag = 'list' def __init__(self, parent): XMLSchemaComponent.__init__(self, parent) self.annotation = None self.content = None def getItemType(self): return self.attributes.get('itemType') def getTypeDefinition(self, attribute='itemType'): """ return the type refered to by itemType attribute or the simpleType content. If returns None, then the type refered to by itemType is primitive. """ tp = XMLSchemaComponent.getTypeDefinition(self, attribute) return tp or self.content def fromDom(self, node): self.annotation = None self.content = None self.setAttributes(node) contents = self.getContents(node) for indx in range(len(contents)): component = SplitQName(contents[indx].getTagName())[1] if (component == 'annotation') and (not indx): self.annotation = Annotation(self) self.annotation.fromDom(contents[indx]) elif (component == 'simpleType'): self.content = AnonymousSimpleType(self) self.content.fromDom(contents[indx]) break else: raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) class AnonymousSimpleType(SimpleType,\ SimpleMarker,\ LocalMarker): """ parents: attribute, element, list, restriction, union attributes: id -- ID contents: annotation?, (restriction | list | union) """ required = [] attributes = {'id':None} tag = 'simpleType' class Redefine: """ parents: attributes: contents: """ tag = 'redefine' ########################### ########################### if sys.version_info[:2] >= (2, 2): tupleClass = tuple else: import UserTuple tupleClass = UserTuple.UserTuple class TypeDescriptionComponent(tupleClass): """Tuple of length 2, consisting of a namespace and unprefixed name. """ def __init__(self, args): """args -- (namespace, name) Remove the name's prefix, irrelevant. """ if len(args) != 2: raise TypeError, 'expecting tuple (namespace, name), got %s' %args elif args[1].find(':') >= 0: args = (args[0], SplitQName(args[1])[1]) tuple.__init__(self, args) return def getTargetNamespace(self): return self[0] def getName(self): return self[1] PK¨58‘ [oAoAZSI/wstools/c14n.pyo;ò •@Ec@s dZdZdkZdklZydklZWndfd„ƒYZnXydkZeZWne j odkZnXd„Z d„Z d „Z d „Z ed ƒ\ZZZd „Zd „Zd„Zd„Zd„Zdfd„ƒYZed„ZdS(s‰XML Canonicalization Patches Applied to xml.dom.ext.c14n: http://sourceforge.net/projects/pyxml/ [ 1444526 ] c14n.py: http://www.w3.org/TR/xml-exc-c14n/ fix -- includes [ 829905 ] c14n.py fix for bug #825115, Date Submitted: 2003-10-24 23:43 -- include dependent namespace declarations declared in ancestor nodes (checking attributes and tags), -- handle InclusiveNamespaces PrefixList parameter This module generates canonical XML of a document or element. http://www.w3.org/TR/2001/REC-xml-c14n-20010315 and includes a prototype of exclusive canonicalization http://www.w3.org/Signature/Drafts/xml-exc-c14n Requires PyXML 0.7.0 or later. Known issues if using Ft.Lib.pDomlette: 1. Unicode 2. does not white space normalize attributes of type NMTOKEN and ID? 3. seems to be include " " after importing external entities? Note, this version processes a DOM tree, and consequently it processes namespace nodes as attributes, not from a node's namespace axis. This permits simple document and element canonicalization without XPath. When XPath is used, the XPath result node list is passed and used to determine if the node is in the XPath result list, but little else. Authors: "Joseph M. Reagle Jr." "Rich Salz" $Date: 2006-03-30 15:47:16 -0800 (Thu, 30 Mar 2006) $ by $Author: boverhof $ s*Copyright 2001, Zolera Systems Inc. All Rights Reserved. Copyright 2001, MIT. All Rights Reserved. Distributed under the terms of: Python 2.0 License or later. http://www.python.org/2.0.1/license.html or W3C Software License http://www.w3.org/Consortium/Legal/copyright-software-19980720 N(sNode(sXMLNSsXMLNScBstZdZdZRS(Nshttp://www.w3.org/2000/xmlns/s$http://www.w3.org/XML/1998/namespace(s__name__s __module__sBASEsXML(((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pysXMLNS7scCs|io |iiƒpgS(N(sEs attributessvalues(sE((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys@scCs|ipgS(N(sEs childNodes(sE((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pysAscCs|iidƒS(Nsxmlns(snsnames startswith(sn((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pysBscCs |itjS(N(snsunsuppressedPrefixessNone(sn((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pysCsicCs;t|i|iƒ}|o|Snt|i|iƒSdS(sB_sorter(n1,n2) -> int Sorting predicate for non-NS attributes.N(scmpsn1s namespaceURIsn2sis localName(sn1sn2si((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_sorterJs cCsK|ddjodSn|ddjodSnt|d|dƒSdS(sY_sorter_ns((n,v),(n,v)) -> int "(an empty namespace URI is lexicographically least)."isxmlnsiÿÿÿÿiN(sn1sn2scmp(sn1sn2((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _sorter_nsSs cCsõ|idƒo|d}n|idƒo|d}n|djo|idtgjp||ijp ||jodSnx&|D]}||ijodSq‹q‹W|tj o3x0t|ƒD]}||ijodSqÇqÇWndSd S( s~_utilized(n, node, other_attrs, unsuppressedPrefixes) -> boolean Return true if that nodespace is utilized within the nodesxmlns:isxmlnsiss#defaultiiN( sns startswithsnodesprefixsNonesunsuppressedPrefixess other_attrssattrs_attrs(snsnodes other_attrssunsuppressedPrefixessattr((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _utilized[s"@   c Csog}|iod|ig}n dg}xMt|ƒD]?}|iidƒp|i oq:n|id|iƒq:Wh}xÛ|D]Ó}|i}||jo|i|ƒqŠ|idƒo|d|jo|i|ƒqŠ|idƒo|d|jo|i|ƒqŠ|i|jo|i|ƒqŠ|idƒo|i||Žss_implementationcBs°tZdZhZd„Zd„Zd„Zeeeit||i|ƒ|iƒ\}}|i||d |ƒq_|i|ƒ}|i||ƒn'|i tijontt|ƒ‚d S( s"Create and run the implementation.ssubsetscommentsisunsuppressedPrefixessnsdictsxmlsxmlnsssunusedN(swritesselfskwsgetssubsetscommentssunsuppressedPrefixessXMLNSsXMLsBASEsnsdictsstatesnodesnodeTypesNodes DOCUMENT_NODEs _do_documents ELEMENT_NODEs_Elements documentOrders _inclusives_inclusiveNamespacePrefixess_inherit_contexts inheritedsunuseds _do_elementsDOCUMENT_TYPE_NODEs TypeErrorsstr(sselfsnodeswriteskwsunuseds inheritedsnsdict((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys__init__˜s( * cCs±ttt|ƒƒ}g|if\}}x||o|it i joaxQttt|ƒƒD]:}|i }||jo|i|ƒ|i|ƒq]q]W|i}q-W|SdS(sÅ_inherit_context(self, node) -> list Scan ancestors of attribute and namespace context. Used only for single element node canonicalization, not for subset canonicalization.N(sfilters _IN_XML_NSs_attrssnodesxmlattrss parentNodes inheritedsparentsnodeTypesNodes ELEMENT_NODEsas localNamesnsappend(sselfsnodesparentsas inheritedsnsxmlattrs((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_inherit_context´s   cCsÅt|_xµ|iD]ª}|itijo#t |_|i |ƒt |_q|iti jo|i |ƒq|itijo|i|ƒq|itijoqtt|ƒ‚qWdS(sË_do_document(self, node) -> None Process a document node. documentOrder holds whether the document element has been encountered such that PIs/comments can be written as specified.N(s_LesserElementsselfs documentOrdersnodes childNodesschildsnodeTypesNodes ELEMENT_NODEs_Elements _do_elements_GreaterElementsPROCESSING_INSTRUCTION_NODEs_do_pis COMMENT_NODEs _do_commentsDOCUMENT_TYPE_NODEs TypeErrorsstr(sselfsnodeschild((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _do_documentÉs     cCst|i|ƒ odSnti|iddƒ}ti|ddƒ}ti|ddƒ}ti|dd ƒ}|o|i|ƒndS( s“_do_text(self, node) -> None Process a text or CDATA node. Render various special characters as their C14N entity representations.Ns&s&ss>s s ( s _in_subsetsselfssubsetsnodesstringsreplacesdatassswrite(sselfsnodess((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_do_textàscCs®t|i|ƒ odSn|i}|itjo|dƒn|dƒ||iƒ|i }|o|dƒ||ƒn|dƒ|it jo|dƒndS(sÎ_do_pi(self, node) -> None Process a PI node. Render a leading or trailing #xA if the document order of the PI is greater or lesser (respectively) than the document element. Ns s( s _in_subsetsselfssubsetsnodeswritesWs documentOrders_GreaterElementsnodeNamesdatasss_LesserElement(sselfsnodesssW((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_do_piîs      cCs”t|i|ƒ odSn|ioj|i}|itjo|dƒn|dƒ||i ƒ|dƒ|it jo|dƒqndS(sÝ_do_comment(self, node) -> None Process a comment node. Render a leading or trailing #xA if the document order of the comment is greater or lesser (respectively) than the document element. Ns s( s _in_subsetsselfssubsetsnodescommentsswritesWs documentOrders_GreaterElementsdatas_LesserElement(sselfsnodesW((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _do_comments     cCs½|i}|dƒ||ƒ|dƒti|ddƒ}ti|ddƒ}ti|ddƒ}ti|d d ƒ}ti|d d ƒ}ti|d dƒ}||ƒ|dƒdS(s;'_do_attr(self, node) -> None Process an attribute.s s="s&s&s None Process an element (and its children).iiiisxmlns:sxmlnssxmlns:%ss3For exclusive c14n, unable to map prefix "%s" in %sssN(7sselfsstatescopys ns_parents ns_rendereds xml_attrssunusedsns_unused_inheritedsNonesns_locals _inclusives inclusivesxml_attrs_locals other_attrss _in_subsetssubsetsnodes in_subsetsinitial_other_attrss_attrssas namespaceURIsXMLNSsBASEsnodeNamesns nodeValuesXMLsappendsupdateswritesWsnamesprefixshas_keys RuntimeErrors ns_to_rendersitemssvsgets _utilizedsunsuppressedPrefixesssorts _sorter_nss_do_attrs parentNodesextendsvaluess_sortersvalues _childrenscs_implementationshandlerssnodeType(sselfsnodesinitial_other_attrssunuseds inclusives xml_attrssprefixs ns_parents in_subsetsstates ns_rendereds ns_to_rendersxml_attrs_localsWsascsnames other_attrssnsvsns_unused_inheritedsns_local((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _do_element%sŠ 9     ! "   E#    $  (s__name__s __module__s__doc__shandlerss__init__s_inherit_contexts _do_documentsNodes DOCUMENT_NODEs_do_texts TEXT_NODEsCDATA_SECTION_NODEs_do_pisPROCESSING_INSTRUCTION_NODEs _do_comments COMMENT_NODEs_do_attrsNones _do_elements ELEMENT_NODE(((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_implementation‘s            ucKsW|ott||if|ƒn0tiƒ}tt||if|ƒ|iƒSdS(s™Canonicalize(node, output=None, **kw) -> UTF-8 Canonicalize a DOM document/element node and all descendents. Return the text; if output is specified then output.write will be called to output the text and None will be returned Keyword parameters: nsdict: a dictionary of prefix:uri namespace entries assumed to exist in the surrounding context comments: keep comments if non-zero (default is 0) subset: Canonical XML subsetting resulting from XPath (default is []) unsuppressedPrefixes: do exclusive C14N, and this specifies the prefixes that should be inherited. N( soutputsapplys_implementationsnodeswriteskwsStringIOsssgetvalue(snodesoutputskwss((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys Canonicalizes  (s__doc__s _copyrightsstringsxml.domsNodesxml.nssXMLNSs cStringIOsStringIOs ImportErrors_attrss _childrens _IN_XML_NSs _inclusivesranges_LesserElements_Elements_GreaterElements_sorters _sorter_nss _utilizeds_inclusiveNamespacePrefixess _in_subsets_implementationsNones Canonicalize(s cStringIOs _childrens _sorter_nss _copyrightsNodes _utilizeds_attrssXMLNSsstrings_Elements _in_subsets_sorters _inclusives_implementations _IN_XML_NSsStringIOs_inclusiveNamespacePrefixess Canonicalizes_LesserElements_GreaterElement((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys?%s2            ÿ PK¨58Ô½ö‰®®ZSI/wstools/TimeoutSocket.pyo;ò •@Ec@sodZdZdkZdkZdkZdkZeeddƒZdfd„ƒYZde fd„ƒYZ dS( sBased on code from timeout_socket.py, with some tweaks for compatibility. These tweaks should really be rolled back into timeout_socket, but it's not totally clear who is maintaining it at this point. In the meantime, we'll use a different module name for our tweaked version to avoid any confusion. The original timeout_socket is by: Scott Cotton Lloyd Zusman Phil Mayes Piers Lauder Radovan Garabik s7$Id: TimeoutSocket.py 237 2003-05-20 21:10:14Z warnes $Ns WSAEINVALi&'s TimeoutSocketcBsªtZdZded„Zd„Zd„Zdd„Zdd„ZdZ d Z d d d „Z d „Z d d„Z d d„Zdd„Zd„Zd„Zd„ZRS(s/A socket imposter that supports timeout limits.icCspt|ƒ|_d|_|tjotititiƒ}n||_|ii dƒd|_ d|_ dS(Nsi( sfloatstimeoutsselfsinbufssocksNonessocketsAF_INETs SOCK_STREAMs setblockings_rbufs_wbuf(sselfstimeoutssock((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys__init__s    cCst|i|ƒSdS(N(sgetattrsselfssocksname(sselfsname((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys __getattr__$sc Gs’|i}|i}y8|idƒt|i|ƒ|i|djƒdSWn5tij o&}| o‚n|idƒt |i ƒdjo d}n |\}}|t it it ifjo‚ntig|gg|ƒ\}}}|o„yt|i|ƒdSWq}tij oV}t |i ƒdjo d}n |\}}|t itfjodSn‚q}Xq‚nXtdƒ‚dS(Niissocket connect() timeout.(sselfstimeoutssocks setblockingsapplysconnectsaddrssocketserrorswhyslensargsscodeserrnos EINPROGRESSsEALREADYs EWOULDBLOCKsselectsrswsesEISCONNs WSAEINVALs TimeoutError( sselfsaddrscodesessockswsrstimeoutswhy((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysconnect(s:      $  ic Cs®t|ƒ}d}x•notig|igg|iƒ\}}}|oL|||d!} |ii | |ƒ}||}||jo|Sqqntdƒ‚qWdS(Niii ssocket send() timeout.(slensdatastotalsnextsselectsselfssockstimeoutsrswsesbuffssendsflagsssents TimeoutError( sselfsdatasflagssesnextsrssentswstotalsbuff((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pyssendLs *  cCsMti|iggg|iƒdo|ii||ƒSntdƒ‚dS(Nissocket recv() timeout.(sselectsselfssockstimeoutsrecvsamtsflagss TimeoutError(sselfsamtsflags((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysrecvZs&iisriÿÿÿÿcCs!|id|_||_|SdS(Ni(sselfshandlessmode(sselfsmodesbuffsize((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysmakefilebs cCsK|id|_|idjo|iiƒdjo|iiƒndS(Nii(sselfshandlesssocksfilenosclose(sself((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysclosegs&cCs¶t|tdƒƒ o d}n|djot|iƒ}||jo%|i| }|i||_|Sn||}|ig}d|_x|djo|i t ||i ƒƒ}| oPnt|ƒ}||jo#|i || ƒ|||_Pn|i |ƒ||}q‘Wdi|ƒSnt d|i ƒ}|ig}d|_xLnoD|i |ƒ}| oPn|i |ƒt|dddƒ}q`Wdi|ƒSdS(Niiÿÿÿÿisiii(s isinstancesnstypeslensselfs_rbufsksdatasLsrecvsmaxsbuffsizesnewsappendsjoinsmin(sselfsnsdatasLsnewsk((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysreadlsF               cCs=d}|iidƒ}xœ|djo%d|jot|iƒjn of|i|iƒ}| oPn|idƒ}|djo|t|iƒ}n|i||_qW|djot|iƒ}n |d}d|jot|iƒjno |}n|i| |i|f\}|_|SdS(Nss ii( sdatasselfs_rbufsfindsislimitslensrecvsbuffsizesnew(sselfslimitsisnewsdata((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysreadlines$5   ' #cCsrd}g}x[noS|iƒ}| oPn|i|ƒ|t|ƒ7}|o ||joPqqW|SdS(Nii(stotalslistsselfsreadlineslinesappendslenssizehint(sselfssizehintslistslinestotal((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys readlinesœs   cCs|idi|ƒƒdS(Ns(sselfssendsjoinslist(sselfslist((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys writelines¨scCs|i|ƒdS(N(sselfssendsdata(sselfsdata((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pyswrite«scCsdS(N((sself((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysflush®s(s__name__s __module__s__doc__sNones__init__s __getattr__sconnectssendsrecvsbuffsizeshandlessmakefilesclosesreadsreadlines readliness writelinesswritesflush(((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys TimeoutSockets   $    !   s TimeoutErrorcBstZRS(N(s__name__s __module__(((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys TimeoutError²s( s__doc__sidentsstringssocketsselectserrnosgetattrs WSAEINVALs TimeoutSockets Exceptions TimeoutError(sidentsstringserrnos TimeoutSockets TimeoutErrors WSAEINVALsselectssocket((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys?s $›PKN¤Y5¨$WhÈÈZSI/wstools/__init__.py#! /usr/bin/env python """WSDL parsing services package for Web Services for Python.""" ident = "$Id: __init__.py 840 2004-12-07 15:54:53Z blunck2 $" import WSDLTools import XMLname import logging PK†¨58‘ [oAoAZSI/wstools/c14n.pyc;ò •@Ec@s dZdZdkZdklZydklZWndfd„ƒYZnXydkZeZWne j odkZnXd„Z d„Z d „Z d „Z ed ƒ\ZZZd „Zd „Zd„Zd„Zd„Zdfd„ƒYZed„ZdS(s‰XML Canonicalization Patches Applied to xml.dom.ext.c14n: http://sourceforge.net/projects/pyxml/ [ 1444526 ] c14n.py: http://www.w3.org/TR/xml-exc-c14n/ fix -- includes [ 829905 ] c14n.py fix for bug #825115, Date Submitted: 2003-10-24 23:43 -- include dependent namespace declarations declared in ancestor nodes (checking attributes and tags), -- handle InclusiveNamespaces PrefixList parameter This module generates canonical XML of a document or element. http://www.w3.org/TR/2001/REC-xml-c14n-20010315 and includes a prototype of exclusive canonicalization http://www.w3.org/Signature/Drafts/xml-exc-c14n Requires PyXML 0.7.0 or later. Known issues if using Ft.Lib.pDomlette: 1. Unicode 2. does not white space normalize attributes of type NMTOKEN and ID? 3. seems to be include " " after importing external entities? Note, this version processes a DOM tree, and consequently it processes namespace nodes as attributes, not from a node's namespace axis. This permits simple document and element canonicalization without XPath. When XPath is used, the XPath result node list is passed and used to determine if the node is in the XPath result list, but little else. Authors: "Joseph M. Reagle Jr." "Rich Salz" $Date: 2006-03-30 15:47:16 -0800 (Thu, 30 Mar 2006) $ by $Author: boverhof $ s*Copyright 2001, Zolera Systems Inc. All Rights Reserved. Copyright 2001, MIT. All Rights Reserved. Distributed under the terms of: Python 2.0 License or later. http://www.python.org/2.0.1/license.html or W3C Software License http://www.w3.org/Consortium/Legal/copyright-software-19980720 N(sNode(sXMLNSsXMLNScBstZdZdZRS(Nshttp://www.w3.org/2000/xmlns/s$http://www.w3.org/XML/1998/namespace(s__name__s __module__sBASEsXML(((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pysXMLNS7scCs|io |iiƒpgS(N(sEs attributessvalues(sE((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys@scCs|ipgS(N(sEs childNodes(sE((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pysAscCs|iidƒS(Nsxmlns(snsnames startswith(sn((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pysBscCs |itjS(N(snsunsuppressedPrefixessNone(sn((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pysCsicCs;t|i|iƒ}|o|Snt|i|iƒSdS(sB_sorter(n1,n2) -> int Sorting predicate for non-NS attributes.N(scmpsn1s namespaceURIsn2sis localName(sn1sn2si((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_sorterJs cCsK|ddjodSn|ddjodSnt|d|dƒSdS(sY_sorter_ns((n,v),(n,v)) -> int "(an empty namespace URI is lexicographically least)."isxmlnsiÿÿÿÿiN(sn1sn2scmp(sn1sn2((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _sorter_nsSs cCsõ|idƒo|d}n|idƒo|d}n|djo|idtgjp||ijp ||jodSnx&|D]}||ijodSq‹q‹W|tj o3x0t|ƒD]}||ijodSqÇqÇWndSd S( s~_utilized(n, node, other_attrs, unsuppressedPrefixes) -> boolean Return true if that nodespace is utilized within the nodesxmlns:isxmlnsiss#defaultiiN( sns startswithsnodesprefixsNonesunsuppressedPrefixess other_attrssattrs_attrs(snsnodes other_attrssunsuppressedPrefixessattr((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _utilized[s"@   c Csog}|iod|ig}n dg}xMt|ƒD]?}|iidƒp|i oq:n|id|iƒq:Wh}xÛ|D]Ó}|i}||jo|i|ƒqŠ|idƒo|d|jo|i|ƒqŠ|idƒo|d|jo|i|ƒqŠ|i|jo|i|ƒqŠ|idƒo|i||Žss_implementationcBs°tZdZhZd„Zd„Zd„Zeeeit||i|ƒ|iƒ\}}|i||d |ƒq_|i|ƒ}|i||ƒn'|i tijontt|ƒ‚d S( s"Create and run the implementation.ssubsetscommentsisunsuppressedPrefixessnsdictsxmlsxmlnsssunusedN(swritesselfskwsgetssubsetscommentssunsuppressedPrefixessXMLNSsXMLsBASEsnsdictsstatesnodesnodeTypesNodes DOCUMENT_NODEs _do_documents ELEMENT_NODEs_Elements documentOrders _inclusives_inclusiveNamespacePrefixess_inherit_contexts inheritedsunuseds _do_elementsDOCUMENT_TYPE_NODEs TypeErrorsstr(sselfsnodeswriteskwsunuseds inheritedsnsdict((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys__init__˜s( * cCs±ttt|ƒƒ}g|if\}}x||o|it i joaxQttt|ƒƒD]:}|i }||jo|i|ƒ|i|ƒq]q]W|i}q-W|SdS(sÅ_inherit_context(self, node) -> list Scan ancestors of attribute and namespace context. Used only for single element node canonicalization, not for subset canonicalization.N(sfilters _IN_XML_NSs_attrssnodesxmlattrss parentNodes inheritedsparentsnodeTypesNodes ELEMENT_NODEsas localNamesnsappend(sselfsnodesparentsas inheritedsnsxmlattrs((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_inherit_context´s   cCsÅt|_xµ|iD]ª}|itijo#t |_|i |ƒt |_q|iti jo|i |ƒq|itijo|i|ƒq|itijoqtt|ƒ‚qWdS(sË_do_document(self, node) -> None Process a document node. documentOrder holds whether the document element has been encountered such that PIs/comments can be written as specified.N(s_LesserElementsselfs documentOrdersnodes childNodesschildsnodeTypesNodes ELEMENT_NODEs_Elements _do_elements_GreaterElementsPROCESSING_INSTRUCTION_NODEs_do_pis COMMENT_NODEs _do_commentsDOCUMENT_TYPE_NODEs TypeErrorsstr(sselfsnodeschild((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _do_documentÉs     cCst|i|ƒ odSnti|iddƒ}ti|ddƒ}ti|ddƒ}ti|dd ƒ}|o|i|ƒndS( s“_do_text(self, node) -> None Process a text or CDATA node. Render various special characters as their C14N entity representations.Ns&s&ss>s s ( s _in_subsetsselfssubsetsnodesstringsreplacesdatassswrite(sselfsnodess((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_do_textàscCs®t|i|ƒ odSn|i}|itjo|dƒn|dƒ||iƒ|i }|o|dƒ||ƒn|dƒ|it jo|dƒndS(sÎ_do_pi(self, node) -> None Process a PI node. Render a leading or trailing #xA if the document order of the PI is greater or lesser (respectively) than the document element. Ns s( s _in_subsetsselfssubsetsnodeswritesWs documentOrders_GreaterElementsnodeNamesdatasss_LesserElement(sselfsnodesssW((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_do_piîs      cCs”t|i|ƒ odSn|ioj|i}|itjo|dƒn|dƒ||i ƒ|dƒ|it jo|dƒqndS(sÝ_do_comment(self, node) -> None Process a comment node. Render a leading or trailing #xA if the document order of the comment is greater or lesser (respectively) than the document element. Ns s( s _in_subsetsselfssubsetsnodescommentsswritesWs documentOrders_GreaterElementsdatas_LesserElement(sselfsnodesW((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _do_comments     cCs½|i}|dƒ||ƒ|dƒti|ddƒ}ti|ddƒ}ti|ddƒ}ti|d d ƒ}ti|d d ƒ}ti|d dƒ}||ƒ|dƒdS(s;'_do_attr(self, node) -> None Process an attribute.s s="s&s&s None Process an element (and its children).iiiisxmlns:sxmlnssxmlns:%ss3For exclusive c14n, unable to map prefix "%s" in %sssN(7sselfsstatescopys ns_parents ns_rendereds xml_attrssunusedsns_unused_inheritedsNonesns_locals _inclusives inclusivesxml_attrs_locals other_attrss _in_subsetssubsetsnodes in_subsetsinitial_other_attrss_attrssas namespaceURIsXMLNSsBASEsnodeNamesns nodeValuesXMLsappendsupdateswritesWsnamesprefixshas_keys RuntimeErrors ns_to_rendersitemssvsgets _utilizedsunsuppressedPrefixesssorts _sorter_nss_do_attrs parentNodesextendsvaluess_sortersvalues _childrenscs_implementationshandlerssnodeType(sselfsnodesinitial_other_attrssunuseds inclusives xml_attrssprefixs ns_parents in_subsetsstates ns_rendereds ns_to_rendersxml_attrs_localsWsascsnames other_attrssnsvsns_unused_inheritedsns_local((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys _do_element%sŠ 9     ! "   E#    $  (s__name__s __module__s__doc__shandlerss__init__s_inherit_contexts _do_documentsNodes DOCUMENT_NODEs_do_texts TEXT_NODEsCDATA_SECTION_NODEs_do_pisPROCESSING_INSTRUCTION_NODEs _do_comments COMMENT_NODEs_do_attrsNones _do_elements ELEMENT_NODE(((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys_implementation‘s            ucKsW|ott||if|ƒn0tiƒ}tt||if|ƒ|iƒSdS(s™Canonicalize(node, output=None, **kw) -> UTF-8 Canonicalize a DOM document/element node and all descendents. Return the text; if output is specified then output.write will be called to output the text and None will be returned Keyword parameters: nsdict: a dictionary of prefix:uri namespace entries assumed to exist in the surrounding context comments: keep comments if non-zero (default is 0) subset: Canonical XML subsetting resulting from XPath (default is []) unsuppressedPrefixes: do exclusive C14N, and this specifies the prefixes that should be inherited. N( soutputsapplys_implementationsnodeswriteskwsStringIOsssgetvalue(snodesoutputskwss((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys Canonicalizes  (s__doc__s _copyrightsstringsxml.domsNodesxml.nssXMLNSs cStringIOsStringIOs ImportErrors_attrss _childrens _IN_XML_NSs _inclusivesranges_LesserElements_Elements_GreaterElements_sorters _sorter_nss _utilizeds_inclusiveNamespacePrefixess _in_subsets_implementationsNones Canonicalize(s cStringIOs _childrens _sorter_nss _copyrightsNodes _utilizeds_attrssXMLNSsstrings_Elements _in_subsets_sorters _inclusives_implementations _IN_XML_NSsStringIOs_inclusiveNamespacePrefixess Canonicalizes_LesserElements_GreaterElement((s4build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/c14n.pys?%s2            ÿ PKN¤Y5wƒö½  ZSI/wstools/logging.py# Copyright (c) 2003, The Regents of the University of California, # through Lawrence Berkeley National Laboratory (subject to receipt of # any required approvals from the U.S. Dept. of Energy). All rights # reserved. # """Logging""" ident = "$Id: logging.py 1204 2006-05-03 00:13:47Z boverhof $" import sys WARN = 1 DEBUG = 2 class ILogger: '''Logger interface, by default this class will be used and logging calls are no-ops. ''' level = 0 def __init__(self, msg): return def warning(self, *args): return def debug(self, *args): return def error(self, *args): return def setLevel(cls, level): cls.level = level setLevel = classmethod(setLevel) debugOn = lambda self: self.level >= DEBUG warnOn = lambda self: self.level >= WARN class BasicLogger(ILogger): last = '' def __init__(self, msg, out=sys.stdout): self.msg, self.out = msg, out def warning(self, msg, *args): if self.warnOn() is False: return if BasicLogger.last != self.msg: BasicLogger.last = self.msg print >>self, "---- ", self.msg, " ----" print >>self, " %s " %BasicLogger.WARN, print >>self, msg %args WARN = '[WARN]' def debug(self, msg, *args): if self.debugOn() is False: return if BasicLogger.last != self.msg: BasicLogger.last = self.msg print >>self, "---- ", self.msg, " ----" print >>self, " %s " %BasicLogger.DEBUG, print >>self, msg %args DEBUG = '[DEBUG]' def error(self, msg, *args): if BasicLogger.last != self.msg: BasicLogger.last = self.msg print >>self, "---- ", self.msg, " ----" print >>self, " %s " %BasicLogger.ERROR, print >>self, msg %args ERROR = '[ERROR]' def write(self, *args): '''Write convenience function; writes strings. ''' for s in args: self.out.write(s) _LoggerClass = BasicLogger def setBasicLogger(): '''Use Basic Logger. ''' setLoggerClass(BasicLogger) BasicLogger.setLevel(0) def setBasicLoggerWARN(): '''Use Basic Logger. ''' setLoggerClass(BasicLogger) BasicLogger.setLevel(WARN) def setBasicLoggerDEBUG(): '''Use Basic Logger. ''' setLoggerClass(BasicLogger) BasicLogger.setLevel(DEBUG) def setLoggerClass(loggingClass): '''Set Logging Class. ''' assert issubclass(loggingClass, ILogger), 'loggingClass must subclass ILogger' global _LoggerClass _LoggerClass = loggingClass def setLevel(level=0): '''Set Global Logging Level. ''' ILogger.level = level def getLevel(): return ILogger.level def getLogger(msg): '''Return instance of Logging class. ''' return _LoggerClass(msg) PKN¤Y5”â¤gK@K@ZSI/wstools/c14n.py#! /usr/bin/env python '''XML Canonicalization Patches Applied to xml.dom.ext.c14n: http://sourceforge.net/projects/pyxml/ [ 1444526 ] c14n.py: http://www.w3.org/TR/xml-exc-c14n/ fix -- includes [ 829905 ] c14n.py fix for bug #825115, Date Submitted: 2003-10-24 23:43 -- include dependent namespace declarations declared in ancestor nodes (checking attributes and tags), -- handle InclusiveNamespaces PrefixList parameter This module generates canonical XML of a document or element. http://www.w3.org/TR/2001/REC-xml-c14n-20010315 and includes a prototype of exclusive canonicalization http://www.w3.org/Signature/Drafts/xml-exc-c14n Requires PyXML 0.7.0 or later. Known issues if using Ft.Lib.pDomlette: 1. Unicode 2. does not white space normalize attributes of type NMTOKEN and ID? 3. seems to be include "\n" after importing external entities? Note, this version processes a DOM tree, and consequently it processes namespace nodes as attributes, not from a node's namespace axis. This permits simple document and element canonicalization without XPath. When XPath is used, the XPath result node list is passed and used to determine if the node is in the XPath result list, but little else. Authors: "Joseph M. Reagle Jr." "Rich Salz" $Date: 2006-03-30 15:47:16 -0800 (Thu, 30 Mar 2006) $ by $Author: boverhof $ ''' _copyright = '''Copyright 2001, Zolera Systems Inc. All Rights Reserved. Copyright 2001, MIT. All Rights Reserved. Distributed under the terms of: Python 2.0 License or later. http://www.python.org/2.0.1/license.html or W3C Software License http://www.w3.org/Consortium/Legal/copyright-software-19980720 ''' import string from xml.dom import Node try: from xml.ns import XMLNS except: class XMLNS: BASE = "http://www.w3.org/2000/xmlns/" XML = "http://www.w3.org/XML/1998/namespace" try: import cStringIO StringIO = cStringIO except ImportError: import StringIO _attrs = lambda E: (E.attributes and E.attributes.values()) or [] _children = lambda E: E.childNodes or [] _IN_XML_NS = lambda n: n.name.startswith("xmlns") _inclusive = lambda n: n.unsuppressedPrefixes == None # Does a document/PI has lesser/greater document order than the # first element? _LesserElement, _Element, _GreaterElement = range(3) def _sorter(n1,n2): '''_sorter(n1,n2) -> int Sorting predicate for non-NS attributes.''' i = cmp(n1.namespaceURI, n2.namespaceURI) if i: return i return cmp(n1.localName, n2.localName) def _sorter_ns(n1,n2): '''_sorter_ns((n,v),(n,v)) -> int "(an empty namespace URI is lexicographically least)."''' if n1[0] == 'xmlns': return -1 if n2[0] == 'xmlns': return 1 return cmp(n1[0], n2[0]) def _utilized(n, node, other_attrs, unsuppressedPrefixes): '''_utilized(n, node, other_attrs, unsuppressedPrefixes) -> boolean Return true if that nodespace is utilized within the node''' if n.startswith('xmlns:'): n = n[6:] elif n.startswith('xmlns'): n = n[5:] if (n=="" and node.prefix in ["#default", None]) or \ n == node.prefix or n in unsuppressedPrefixes: return 1 for attr in other_attrs: if n == attr.prefix: return 1 # For exclusive need to look at attributes if unsuppressedPrefixes is not None: for attr in _attrs(node): if n == attr.prefix: return 1 return 0 def _inclusiveNamespacePrefixes(node, context, unsuppressedPrefixes): '''http://www.w3.org/TR/xml-exc-c14n/ InclusiveNamespaces PrefixList parameter, which lists namespace prefixes that are handled in the manner described by the Canonical XML Recommendation''' inclusive = [] if node.prefix: usedPrefixes = ['xmlns:%s' %node.prefix] else: usedPrefixes = ['xmlns'] for a in _attrs(node): if a.nodeName.startswith('xmlns') or not a.prefix: continue usedPrefixes.append('xmlns:%s' %a.prefix) unused_namespace_dict = {} for attr in context: n = attr.nodeName if n in unsuppressedPrefixes: inclusive.append(attr) elif n.startswith('xmlns:') and n[6:] in unsuppressedPrefixes: inclusive.append(attr) elif n.startswith('xmlns') and n[5:] in unsuppressedPrefixes: inclusive.append(attr) elif attr.nodeName in usedPrefixes: inclusive.append(attr) elif n.startswith('xmlns:'): unused_namespace_dict[n] = attr.value return inclusive, unused_namespace_dict #_in_subset = lambda subset, node: not subset or node in subset _in_subset = lambda subset, node: subset is None or node in subset # rich's tweak class _implementation: '''Implementation class for C14N. This accompanies a node during it's processing and includes the parameters and processing state.''' # Handler for each node type; populated during module instantiation. handlers = {} def __init__(self, node, write, **kw): '''Create and run the implementation.''' self.write = write self.subset = kw.get('subset') self.comments = kw.get('comments', 0) self.unsuppressedPrefixes = kw.get('unsuppressedPrefixes') nsdict = kw.get('nsdict', { 'xml': XMLNS.XML, 'xmlns': XMLNS.BASE }) # Processing state. self.state = (nsdict, {'xml':''}, {}, {}) #0422 if node.nodeType == Node.DOCUMENT_NODE: self._do_document(node) elif node.nodeType == Node.ELEMENT_NODE: self.documentOrder = _Element # At document element if not _inclusive(self): inherited,unused = _inclusiveNamespacePrefixes(node, self._inherit_context(node), self.unsuppressedPrefixes) self._do_element(node, inherited, unused=unused) else: inherited = self._inherit_context(node) self._do_element(node, inherited) elif node.nodeType == Node.DOCUMENT_TYPE_NODE: pass else: raise TypeError, str(node) def _inherit_context(self, node): '''_inherit_context(self, node) -> list Scan ancestors of attribute and namespace context. Used only for single element node canonicalization, not for subset canonicalization.''' # Collect the initial list of xml:foo attributes. xmlattrs = filter(_IN_XML_NS, _attrs(node)) # Walk up and get all xml:XXX attributes we inherit. inherited, parent = [], node.parentNode while parent and parent.nodeType == Node.ELEMENT_NODE: for a in filter(_IN_XML_NS, _attrs(parent)): n = a.localName if n not in xmlattrs: xmlattrs.append(n) inherited.append(a) parent = parent.parentNode return inherited def _do_document(self, node): '''_do_document(self, node) -> None Process a document node. documentOrder holds whether the document element has been encountered such that PIs/comments can be written as specified.''' self.documentOrder = _LesserElement for child in node.childNodes: if child.nodeType == Node.ELEMENT_NODE: self.documentOrder = _Element # At document element self._do_element(child) self.documentOrder = _GreaterElement # After document element elif child.nodeType == Node.PROCESSING_INSTRUCTION_NODE: self._do_pi(child) elif child.nodeType == Node.COMMENT_NODE: self._do_comment(child) elif child.nodeType == Node.DOCUMENT_TYPE_NODE: pass else: raise TypeError, str(child) handlers[Node.DOCUMENT_NODE] = _do_document def _do_text(self, node): '''_do_text(self, node) -> None Process a text or CDATA node. Render various special characters as their C14N entity representations.''' if not _in_subset(self.subset, node): return s = string.replace(node.data, "&", "&") s = string.replace(s, "<", "<") s = string.replace(s, ">", ">") s = string.replace(s, "\015", " ") if s: self.write(s) handlers[Node.TEXT_NODE] = _do_text handlers[Node.CDATA_SECTION_NODE] = _do_text def _do_pi(self, node): '''_do_pi(self, node) -> None Process a PI node. Render a leading or trailing #xA if the document order of the PI is greater or lesser (respectively) than the document element. ''' if not _in_subset(self.subset, node): return W = self.write if self.documentOrder == _GreaterElement: W('\n') W('') if self.documentOrder == _LesserElement: W('\n') handlers[Node.PROCESSING_INSTRUCTION_NODE] = _do_pi def _do_comment(self, node): '''_do_comment(self, node) -> None Process a comment node. Render a leading or trailing #xA if the document order of the comment is greater or lesser (respectively) than the document element. ''' if not _in_subset(self.subset, node): return if self.comments: W = self.write if self.documentOrder == _GreaterElement: W('\n') W('') if self.documentOrder == _LesserElement: W('\n') handlers[Node.COMMENT_NODE] = _do_comment def _do_attr(self, n, value): ''''_do_attr(self, node) -> None Process an attribute.''' W = self.write W(' ') W(n) W('="') s = string.replace(value, "&", "&") s = string.replace(s, "<", "<") s = string.replace(s, '"', '"') s = string.replace(s, '\011', ' ') s = string.replace(s, '\012', ' ') s = string.replace(s, '\015', ' ') W(s) W('"') def _do_element(self, node, initial_other_attrs = [], unused = None): '''_do_element(self, node, initial_other_attrs = [], unused = {}) -> None Process an element (and its children).''' # Get state (from the stack) make local copies. # ns_parent -- NS declarations in parent # ns_rendered -- NS nodes rendered by ancestors # ns_local -- NS declarations relevant to this element # xml_attrs -- Attributes in XML namespace from parent # xml_attrs_local -- Local attributes in XML namespace. # ns_unused_inherited -- not rendered namespaces, used for exclusive ns_parent, ns_rendered, xml_attrs = \ self.state[0], self.state[1].copy(), self.state[2].copy() #0422 ns_unused_inherited = unused if unused is None: ns_unused_inherited = self.state[3].copy() ns_local = ns_parent.copy() inclusive = _inclusive(self) xml_attrs_local = {} # Divide attributes into NS, XML, and others. other_attrs = [] in_subset = _in_subset(self.subset, node) for a in initial_other_attrs + _attrs(node): if a.namespaceURI == XMLNS.BASE: n = a.nodeName if n == "xmlns:": n = "xmlns" # DOM bug workaround ns_local[n] = a.nodeValue elif a.namespaceURI == XMLNS.XML: if inclusive or (in_subset and _in_subset(self.subset, a)): #020925 Test to see if attribute node in subset xml_attrs_local[a.nodeName] = a #0426 else: if _in_subset(self.subset, a): #020925 Test to see if attribute node in subset other_attrs.append(a) # # TODO: exclusive, might need to define xmlns:prefix here # if not inclusive and a.prefix is not None and not ns_rendered.has_key('xmlns:%s' %a.prefix): # ns_local['xmlns:%s' %a.prefix] = ?? #add local xml:foo attributes to ancestor's xml:foo attributes xml_attrs.update(xml_attrs_local) # Render the node W, name = self.write, None if in_subset: name = node.nodeName if not inclusive: if node.prefix is not None: prefix = 'xmlns:%s' %node.prefix else: prefix = 'xmlns' if not ns_rendered.has_key(prefix) and not ns_local.has_key(prefix): if not ns_unused_inherited.has_key(prefix): raise RuntimeError,\ 'For exclusive c14n, unable to map prefix "%s" in %s' %( prefix, node) ns_local[prefix] = ns_unused_inherited[prefix] del ns_unused_inherited[prefix] W('<') W(name) # Create list of NS attributes to render. ns_to_render = [] for n,v in ns_local.items(): # If default namespace is XMLNS.BASE or empty, # and if an ancestor was the same if n == "xmlns" and v in [ XMLNS.BASE, '' ] \ and ns_rendered.get('xmlns') in [ XMLNS.BASE, '', None ]: continue # "omit namespace node with local name xml, which defines # the xml prefix, if its string value is # http://www.w3.org/XML/1998/namespace." if n in ["xmlns:xml", "xml"] \ and v in [ 'http://www.w3.org/XML/1998/namespace' ]: continue # If not previously rendered # and it's inclusive or utilized if (n,v) not in ns_rendered.items(): if inclusive or _utilized(n, node, other_attrs, self.unsuppressedPrefixes): ns_to_render.append((n, v)) elif not inclusive: ns_unused_inherited[n] = v # Sort and render the ns, marking what was rendered. ns_to_render.sort(_sorter_ns) for n,v in ns_to_render: self._do_attr(n, v) ns_rendered[n]=v #0417 # If exclusive or the parent is in the subset, add the local xml attributes # Else, add all local and ancestor xml attributes # Sort and render the attributes. if not inclusive or _in_subset(self.subset,node.parentNode): #0426 other_attrs.extend(xml_attrs_local.values()) else: other_attrs.extend(xml_attrs.values()) other_attrs.sort(_sorter) for a in other_attrs: self._do_attr(a.nodeName, a.value) W('>') # Push state, recurse, pop state. state, self.state = self.state, (ns_local, ns_rendered, xml_attrs, ns_unused_inherited) for c in _children(node): _implementation.handlers[c.nodeType](self, c) self.state = state if name: W('' % name) handlers[Node.ELEMENT_NODE] = _do_element def Canonicalize(node, output=None, **kw): '''Canonicalize(node, output=None, **kw) -> UTF-8 Canonicalize a DOM document/element node and all descendents. Return the text; if output is specified then output.write will be called to output the text and None will be returned Keyword parameters: nsdict: a dictionary of prefix:uri namespace entries assumed to exist in the surrounding context comments: keep comments if non-zero (default is 0) subset: Canonical XML subsetting resulting from XPath (default is []) unsuppressedPrefixes: do exclusive C14N, and this specifies the prefixes that should be inherited. ''' if output: apply(_implementation, (node, output.write), kw) else: s = StringIO.StringIO() apply(_implementation, (node, s.write), kw) return s.getvalue() PKN¤Y5ÛiÒ8Æ8ÆZSI/wstools/Utility.py# Copyright (c) 2003, The Regents of the University of California, # through Lawrence Berkeley National Laboratory (subject to receipt of # any required approvals from the U.S. Dept. of Energy). All rights # reserved. # # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. ident = "$Id: Utility.py 1116 2006-01-24 20:51:57Z boverhof $" import sys, types, httplib, smtplib, urllib, socket, weakref from os.path import isfile from string import join, strip, split from UserDict import UserDict from cStringIO import StringIO from TimeoutSocket import TimeoutSocket, TimeoutError from urlparse import urlparse from httplib import HTTPConnection, HTTPSConnection from exceptions import Exception try: from ZSI import _get_idstr except: def _get_idstr(pyobj): '''Python 2.3.x generates a FutureWarning for negative IDs, so we use a different prefix character to ensure uniqueness, and call abs() to avoid the warning.''' x = id(pyobj) if x < 0: return 'x%x' % abs(x) return 'o%x' % x import xml.dom.minidom from xml.dom import Node import logging from c14n import Canonicalize from Namespaces import SCHEMA, SOAP, XMLNS, ZSI_SCHEMA_URI try: from xml.dom.ext import SplitQName except: def SplitQName(qname): '''SplitQName(qname) -> (string, string) Split Qualified Name into a tuple of len 2, consisting of the prefix and the local name. (prefix, localName) Special Cases: xmlns -- (localName, 'xmlns') None -- (None, localName) ''' l = qname.split(':') if len(l) == 1: l.insert(0, None) elif len(l) == 2: if l[0] == 'xmlns': l.reverse() else: return return tuple(l) # # python2.3 urllib.basejoin does not remove current directory ./ # from path and this causes problems on subsequent basejoins. # basejoin = urllib.basejoin if sys.version_info[0:2] < (2, 4, 0, 'final', 0)[0:2]: #basejoin = lambda base,url: urllib.basejoin(base,url.lstrip('./')) token = './' def basejoin(base, url): if url.startswith(token) is True: return urllib.basejoin(base,url[2:]) return urllib.basejoin(base,url) class NamespaceError(Exception): """Used to indicate a Namespace Error.""" class RecursionError(Exception): """Used to indicate a HTTP redirect recursion.""" class ParseError(Exception): """Used to indicate a XML parsing error.""" class DOMException(Exception): """Used to indicate a problem processing DOM.""" class Base: """Base class for instance level Logging""" def __init__(self, module=__name__): self.logger = logging.getLogger('%s-%s(%s)' %(module, self.__class__, _get_idstr(self))) class HTTPResponse: """Captures the information in an HTTP response message.""" def __init__(self, response): self.status = response.status self.reason = response.reason self.headers = response.msg self.body = response.read() or None response.close() class TimeoutHTTP(HTTPConnection): """A custom http connection object that supports socket timeout.""" def __init__(self, host, port=None, timeout=20): HTTPConnection.__init__(self, host, port) self.timeout = timeout def connect(self): self.sock = TimeoutSocket(self.timeout) self.sock.connect((self.host, self.port)) class TimeoutHTTPS(HTTPSConnection): """A custom https object that supports socket timeout. Note that this is not really complete. The builtin SSL support in the Python socket module requires a real socket (type) to be passed in to be hooked to SSL. That means our fake socket won't work and our timeout hacks are bypassed for send and recv calls. Since our hack _is_ in place at connect() time, it should at least provide some timeout protection.""" def __init__(self, host, port=None, timeout=20, **kwargs): HTTPSConnection.__init__(self, str(host), port, **kwargs) self.timeout = timeout def connect(self): sock = TimeoutSocket(self.timeout) sock.connect((self.host, self.port)) realsock = getattr(sock.sock, '_sock', sock.sock) ssl = socket.ssl(realsock, self.key_file, self.cert_file) self.sock = httplib.FakeSocket(sock, ssl) def urlopen(url, timeout=20, redirects=None): """A minimal urlopen replacement hack that supports timeouts for http. Note that this supports GET only.""" scheme, host, path, params, query, frag = urlparse(url) if not scheme in ('http', 'https'): return urllib.urlopen(url) if params: path = '%s;%s' % (path, params) if query: path = '%s?%s' % (path, query) if frag: path = '%s#%s' % (path, frag) if scheme == 'https': # If ssl is not compiled into Python, you will not get an exception # until a conn.endheaders() call. We need to know sooner, so use # getattr. if hasattr(socket, 'ssl'): conn = TimeoutHTTPS(host, None, timeout) else: import M2Crypto ctx = M2Crypto.SSL.Context() ctx.set_session_timeout(timeout) conn = M2Crypto.httpslib.HTTPSConnection(host, ssl_context=ctx) #conn.set_debuglevel(1) else: conn = TimeoutHTTP(host, None, timeout) conn.putrequest('GET', path) conn.putheader('Connection', 'close') conn.endheaders() response = None while 1: response = conn.getresponse() if response.status != 100: break conn._HTTPConnection__state = httplib._CS_REQ_SENT conn._HTTPConnection__response = None status = response.status # If we get an HTTP redirect, we will follow it automatically. if status >= 300 and status < 400: location = response.msg.getheader('location') if location is not None: response.close() if redirects is not None and redirects.has_key(location): raise RecursionError( 'Circular HTTP redirection detected.' ) if redirects is None: redirects = {} redirects[location] = 1 return urlopen(location, timeout, redirects) raise HTTPResponse(response) if not (status >= 200 and status < 300): raise HTTPResponse(response) body = StringIO(response.read()) response.close() return body class DOM: """The DOM singleton defines a number of XML related constants and provides a number of utility methods for DOM related tasks. It also provides some basic abstractions so that the rest of the package need not care about actual DOM implementation in use.""" # Namespace stuff related to the SOAP specification. NS_SOAP_ENV_1_1 = 'http://schemas.xmlsoap.org/soap/envelope/' NS_SOAP_ENC_1_1 = 'http://schemas.xmlsoap.org/soap/encoding/' NS_SOAP_ENV_1_2 = 'http://www.w3.org/2001/06/soap-envelope' NS_SOAP_ENC_1_2 = 'http://www.w3.org/2001/06/soap-encoding' NS_SOAP_ENV_ALL = (NS_SOAP_ENV_1_1, NS_SOAP_ENV_1_2) NS_SOAP_ENC_ALL = (NS_SOAP_ENC_1_1, NS_SOAP_ENC_1_2) NS_SOAP_ENV = NS_SOAP_ENV_1_1 NS_SOAP_ENC = NS_SOAP_ENC_1_1 _soap_uri_mapping = { NS_SOAP_ENV_1_1 : '1.1', NS_SOAP_ENV_1_2 : '1.2', } SOAP_ACTOR_NEXT_1_1 = 'http://schemas.xmlsoap.org/soap/actor/next' SOAP_ACTOR_NEXT_1_2 = 'http://www.w3.org/2001/06/soap-envelope/actor/next' SOAP_ACTOR_NEXT_ALL = (SOAP_ACTOR_NEXT_1_1, SOAP_ACTOR_NEXT_1_2) def SOAPUriToVersion(self, uri): """Return the SOAP version related to an envelope uri.""" value = self._soap_uri_mapping.get(uri) if value is not None: return value raise ValueError( 'Unsupported SOAP envelope uri: %s' % uri ) def GetSOAPEnvUri(self, version): """Return the appropriate SOAP envelope uri for a given human-friendly SOAP version string (e.g. '1.1').""" attrname = 'NS_SOAP_ENV_%s' % join(split(version, '.'), '_') value = getattr(self, attrname, None) if value is not None: return value raise ValueError( 'Unsupported SOAP version: %s' % version ) def GetSOAPEncUri(self, version): """Return the appropriate SOAP encoding uri for a given human-friendly SOAP version string (e.g. '1.1').""" attrname = 'NS_SOAP_ENC_%s' % join(split(version, '.'), '_') value = getattr(self, attrname, None) if value is not None: return value raise ValueError( 'Unsupported SOAP version: %s' % version ) def GetSOAPActorNextUri(self, version): """Return the right special next-actor uri for a given human-friendly SOAP version string (e.g. '1.1').""" attrname = 'SOAP_ACTOR_NEXT_%s' % join(split(version, '.'), '_') value = getattr(self, attrname, None) if value is not None: return value raise ValueError( 'Unsupported SOAP version: %s' % version ) # Namespace stuff related to XML Schema. NS_XSD_99 = 'http://www.w3.org/1999/XMLSchema' NS_XSI_99 = 'http://www.w3.org/1999/XMLSchema-instance' NS_XSD_00 = 'http://www.w3.org/2000/10/XMLSchema' NS_XSI_00 = 'http://www.w3.org/2000/10/XMLSchema-instance' NS_XSD_01 = 'http://www.w3.org/2001/XMLSchema' NS_XSI_01 = 'http://www.w3.org/2001/XMLSchema-instance' NS_XSD_ALL = (NS_XSD_99, NS_XSD_00, NS_XSD_01) NS_XSI_ALL = (NS_XSI_99, NS_XSI_00, NS_XSI_01) NS_XSD = NS_XSD_01 NS_XSI = NS_XSI_01 _xsd_uri_mapping = { NS_XSD_99 : NS_XSI_99, NS_XSD_00 : NS_XSI_00, NS_XSD_01 : NS_XSI_01, } for key, value in _xsd_uri_mapping.items(): _xsd_uri_mapping[value] = key def InstanceUriForSchemaUri(self, uri): """Return the appropriate matching XML Schema instance uri for the given XML Schema namespace uri.""" return self._xsd_uri_mapping.get(uri) def SchemaUriForInstanceUri(self, uri): """Return the appropriate matching XML Schema namespace uri for the given XML Schema instance namespace uri.""" return self._xsd_uri_mapping.get(uri) # Namespace stuff related to WSDL. NS_WSDL_1_1 = 'http://schemas.xmlsoap.org/wsdl/' NS_WSDL_ALL = (NS_WSDL_1_1,) NS_WSDL = NS_WSDL_1_1 NS_SOAP_BINDING_1_1 = 'http://schemas.xmlsoap.org/wsdl/soap/' NS_HTTP_BINDING_1_1 = 'http://schemas.xmlsoap.org/wsdl/http/' NS_MIME_BINDING_1_1 = 'http://schemas.xmlsoap.org/wsdl/mime/' NS_SOAP_BINDING_ALL = (NS_SOAP_BINDING_1_1,) NS_HTTP_BINDING_ALL = (NS_HTTP_BINDING_1_1,) NS_MIME_BINDING_ALL = (NS_MIME_BINDING_1_1,) NS_SOAP_BINDING = NS_SOAP_BINDING_1_1 NS_HTTP_BINDING = NS_HTTP_BINDING_1_1 NS_MIME_BINDING = NS_MIME_BINDING_1_1 NS_SOAP_HTTP_1_1 = 'http://schemas.xmlsoap.org/soap/http' NS_SOAP_HTTP_ALL = (NS_SOAP_HTTP_1_1,) NS_SOAP_HTTP = NS_SOAP_HTTP_1_1 _wsdl_uri_mapping = { NS_WSDL_1_1 : '1.1', } def WSDLUriToVersion(self, uri): """Return the WSDL version related to a WSDL namespace uri.""" value = self._wsdl_uri_mapping.get(uri) if value is not None: return value raise ValueError( 'Unsupported SOAP envelope uri: %s' % uri ) def GetWSDLUri(self, version): attr = 'NS_WSDL_%s' % join(split(version, '.'), '_') value = getattr(self, attr, None) if value is not None: return value raise ValueError( 'Unsupported WSDL version: %s' % version ) def GetWSDLSoapBindingUri(self, version): attr = 'NS_SOAP_BINDING_%s' % join(split(version, '.'), '_') value = getattr(self, attr, None) if value is not None: return value raise ValueError( 'Unsupported WSDL version: %s' % version ) def GetWSDLHttpBindingUri(self, version): attr = 'NS_HTTP_BINDING_%s' % join(split(version, '.'), '_') value = getattr(self, attr, None) if value is not None: return value raise ValueError( 'Unsupported WSDL version: %s' % version ) def GetWSDLMimeBindingUri(self, version): attr = 'NS_MIME_BINDING_%s' % join(split(version, '.'), '_') value = getattr(self, attr, None) if value is not None: return value raise ValueError( 'Unsupported WSDL version: %s' % version ) def GetWSDLHttpTransportUri(self, version): attr = 'NS_SOAP_HTTP_%s' % join(split(version, '.'), '_') value = getattr(self, attr, None) if value is not None: return value raise ValueError( 'Unsupported WSDL version: %s' % version ) # Other xml namespace constants. NS_XMLNS = 'http://www.w3.org/2000/xmlns/' def isElement(self, node, name, nsuri=None): """Return true if the given node is an element with the given name and optional namespace uri.""" if node.nodeType != node.ELEMENT_NODE: return 0 return node.localName == name and \ (nsuri is None or self.nsUriMatch(node.namespaceURI, nsuri)) def getElement(self, node, name, nsuri=None, default=join): """Return the first child of node with a matching name and namespace uri, or the default if one is provided.""" nsmatch = self.nsUriMatch ELEMENT_NODE = node.ELEMENT_NODE for child in node.childNodes: if child.nodeType == ELEMENT_NODE: if ((child.localName == name or name is None) and (nsuri is None or nsmatch(child.namespaceURI, nsuri)) ): return child if default is not join: return default raise KeyError, name def getElementById(self, node, id, default=join): """Return the first child of node matching an id reference.""" attrget = self.getAttr ELEMENT_NODE = node.ELEMENT_NODE for child in node.childNodes: if child.nodeType == ELEMENT_NODE: if attrget(child, 'id') == id: return child if default is not join: return default raise KeyError, name def getMappingById(self, document, depth=None, element=None, mapping=None, level=1): """Create an id -> element mapping of those elements within a document that define an id attribute. The depth of the search may be controlled by using the (1-based) depth argument.""" if document is not None: element = document.documentElement mapping = {} attr = element._attrs.get('id', None) if attr is not None: mapping[attr.value] = element if depth is None or depth > level: level = level + 1 ELEMENT_NODE = element.ELEMENT_NODE for child in element.childNodes: if child.nodeType == ELEMENT_NODE: self.getMappingById(None, depth, child, mapping, level) return mapping def getElements(self, node, name, nsuri=None): """Return a sequence of the child elements of the given node that match the given name and optional namespace uri.""" nsmatch = self.nsUriMatch result = [] ELEMENT_NODE = node.ELEMENT_NODE for child in node.childNodes: if child.nodeType == ELEMENT_NODE: if ((child.localName == name or name is None) and ( (nsuri is None) or nsmatch(child.namespaceURI, nsuri))): result.append(child) return result def hasAttr(self, node, name, nsuri=None): """Return true if element has attribute with the given name and optional nsuri. If nsuri is not specified, returns true if an attribute exists with the given name with any namespace.""" if nsuri is None: if node.hasAttribute(name): return True return False return node.hasAttributeNS(nsuri, name) def getAttr(self, node, name, nsuri=None, default=join): """Return the value of the attribute named 'name' with the optional nsuri, or the default if one is specified. If nsuri is not specified, an attribute that matches the given name will be returned regardless of namespace.""" if nsuri is None: result = node._attrs.get(name, None) if result is None: for item in node._attrsNS.keys(): if item[1] == name: result = node._attrsNS[item] break else: result = node._attrsNS.get((nsuri, name), None) if result is not None: return result.value if default is not join: return default return '' def getAttrs(self, node): """Return a Collection of all attributes """ attrs = {} for k,v in node._attrs.items(): attrs[k] = v.value return attrs def getElementText(self, node, preserve_ws=None): """Return the text value of an xml element node. Leading and trailing whitespace is stripped from the value unless the preserve_ws flag is passed with a true value.""" result = [] for child in node.childNodes: nodetype = child.nodeType if nodetype == child.TEXT_NODE or \ nodetype == child.CDATA_SECTION_NODE: result.append(child.nodeValue) value = join(result, '') if preserve_ws is None: value = strip(value) return value def findNamespaceURI(self, prefix, node): """Find a namespace uri given a prefix and a context node.""" attrkey = (self.NS_XMLNS, prefix) DOCUMENT_NODE = node.DOCUMENT_NODE ELEMENT_NODE = node.ELEMENT_NODE while 1: if node is None: raise DOMException('Value for prefix %s not found.' % prefix) if node.nodeType != ELEMENT_NODE: node = node.parentNode continue result = node._attrsNS.get(attrkey, None) if result is not None: return result.value if hasattr(node, '__imported__'): raise DOMException('Value for prefix %s not found.' % prefix) node = node.parentNode if node.nodeType == DOCUMENT_NODE: raise DOMException('Value for prefix %s not found.' % prefix) def findDefaultNS(self, node): """Return the current default namespace uri for the given node.""" attrkey = (self.NS_XMLNS, 'xmlns') DOCUMENT_NODE = node.DOCUMENT_NODE ELEMENT_NODE = node.ELEMENT_NODE while 1: if node.nodeType != ELEMENT_NODE: node = node.parentNode continue result = node._attrsNS.get(attrkey, None) if result is not None: return result.value if hasattr(node, '__imported__'): raise DOMException('Cannot determine default namespace.') node = node.parentNode if node.nodeType == DOCUMENT_NODE: raise DOMException('Cannot determine default namespace.') def findTargetNS(self, node): """Return the defined target namespace uri for the given node.""" attrget = self.getAttr attrkey = (self.NS_XMLNS, 'xmlns') DOCUMENT_NODE = node.DOCUMENT_NODE ELEMENT_NODE = node.ELEMENT_NODE while 1: if node.nodeType != ELEMENT_NODE: node = node.parentNode continue result = attrget(node, 'targetNamespace', default=None) if result is not None: return result node = node.parentNode if node.nodeType == DOCUMENT_NODE: raise DOMException('Cannot determine target namespace.') def getTypeRef(self, element): """Return (namespaceURI, name) for a type attribue of the given element, or None if the element does not have a type attribute.""" typeattr = self.getAttr(element, 'type', default=None) if typeattr is None: return None parts = typeattr.split(':', 1) if len(parts) == 2: nsuri = self.findNamespaceURI(parts[0], element) else: nsuri = self.findDefaultNS(element) return (nsuri, parts[1]) def importNode(self, document, node, deep=0): """Implements (well enough for our purposes) DOM node import.""" nodetype = node.nodeType if nodetype in (node.DOCUMENT_NODE, node.DOCUMENT_TYPE_NODE): raise DOMException('Illegal node type for importNode') if nodetype == node.ENTITY_REFERENCE_NODE: deep = 0 clone = node.cloneNode(deep) self._setOwnerDoc(document, clone) clone.__imported__ = 1 return clone def _setOwnerDoc(self, document, node): node.ownerDocument = document for child in node.childNodes: self._setOwnerDoc(document, child) def nsUriMatch(self, value, wanted, strict=0, tt=type(())): """Return a true value if two namespace uri values match.""" if value == wanted or (type(wanted) is tt) and value in wanted: return 1 if not strict and value is not None: wanted = type(wanted) is tt and wanted or (wanted,) value = value[-1:] != '/' and value or value[:-1] for item in wanted: if item == value or item[:-1] == value: return 1 return 0 def createDocument(self, nsuri, qname, doctype=None): """Create a new writable DOM document object.""" impl = xml.dom.minidom.getDOMImplementation() return impl.createDocument(nsuri, qname, doctype) def loadDocument(self, data): """Load an xml file from a file-like object and return a DOM document instance.""" return xml.dom.minidom.parse(data) def loadFromURL(self, url): """Load an xml file from a URL and return a DOM document.""" if isfile(url) is True: file = open(url, 'r') else: file = urlopen(url) try: result = self.loadDocument(file) except Exception, ex: file.close() raise ParseError(('Failed to load document %s' %url,) + ex.args) else: file.close() return result DOM = DOM() class MessageInterface: '''Higher Level Interface, delegates to DOM singleton, must be subclassed and implement all methods that throw NotImplementedError. ''' def __init__(self, sw): '''Constructor, May be extended, do not override. sw -- soapWriter instance ''' self.sw = None if type(sw) != weakref.ReferenceType and sw is not None: self.sw = weakref.ref(sw) else: self.sw = sw def AddCallback(self, func, *arglist): self.sw().AddCallback(func, *arglist) def Known(self, obj): return self.sw().Known(obj) def Forget(self, obj): return self.sw().Forget(obj) def canonicalize(self): '''canonicalize the underlying DOM, and return as string. ''' raise NotImplementedError, '' def createDocument(self, namespaceURI=SOAP.ENV, localName='Envelope'): '''create Document ''' raise NotImplementedError, '' def createAppendElement(self, namespaceURI, localName): '''create and append element(namespaceURI,localName), and return the node. ''' raise NotImplementedError, '' def findNamespaceURI(self, qualifiedName): raise NotImplementedError, '' def resolvePrefix(self, prefix): raise NotImplementedError, '' def setAttributeNS(self, namespaceURI, localName, value): '''set attribute (namespaceURI, localName)=value ''' raise NotImplementedError, '' def setAttributeType(self, namespaceURI, localName): '''set attribute xsi:type=(namespaceURI, localName) ''' raise NotImplementedError, '' def setNamespaceAttribute(self, namespaceURI, prefix): '''set namespace attribute xmlns:prefix=namespaceURI ''' raise NotImplementedError, '' class ElementProxy(Base, MessageInterface): ''' ''' _soap_env_prefix = 'SOAP-ENV' _soap_enc_prefix = 'SOAP-ENC' _zsi_prefix = 'ZSI' _xsd_prefix = 'xsd' _xsi_prefix = 'xsi' _xml_prefix = 'xml' _xmlns_prefix = 'xmlns' _soap_env_nsuri = SOAP.ENV _soap_enc_nsuri = SOAP.ENC _zsi_nsuri = ZSI_SCHEMA_URI _xsd_nsuri = SCHEMA.XSD3 _xsi_nsuri = SCHEMA.XSI3 _xml_nsuri = XMLNS.XML _xmlns_nsuri = XMLNS.BASE standard_ns = {\ _xml_prefix:_xml_nsuri, _xmlns_prefix:_xmlns_nsuri } reserved_ns = {\ _soap_env_prefix:_soap_env_nsuri, _soap_enc_prefix:_soap_enc_nsuri, _zsi_prefix:_zsi_nsuri, _xsd_prefix:_xsd_nsuri, _xsi_prefix:_xsi_nsuri, } name = None namespaceURI = None def __init__(self, sw, message=None): '''Initialize. sw -- SoapWriter ''' self._indx = 0 MessageInterface.__init__(self, sw) Base.__init__(self) self._dom = DOM self.node = None if type(message) in (types.StringType,types.UnicodeType): self.loadFromString(message) elif isinstance(message, ElementProxy): self.node = message._getNode() else: self.node = message self.processorNss = self.standard_ns.copy() self.processorNss.update(self.reserved_ns) def __str__(self): return self.toString() def evaluate(self, expression, processorNss=None): '''expression -- XPath compiled expression ''' from Ft.Xml import XPath if not processorNss: context = XPath.Context.Context(self.node, processorNss=self.processorNss) else: context = XPath.Context.Context(self.node, processorNss=processorNss) nodes = expression.evaluate(context) return map(lambda node: ElementProxy(self.sw,node), nodes) ############################################# # Methods for checking/setting the # classes (namespaceURI,name) node. ############################################# def checkNode(self, namespaceURI=None, localName=None): ''' namespaceURI -- namespace of element localName -- local name of element ''' namespaceURI = namespaceURI or self.namespaceURI localName = localName or self.name check = False if localName and self.node: check = self._dom.isElement(self.node, localName, namespaceURI) if not check: raise NamespaceError, 'unexpected node type %s, expecting %s' %(self.node, localName) def setNode(self, node=None): if node: if isinstance(node, ElementProxy): self.node = node._getNode() else: self.node = node elif self.node: node = self._dom.getElement(self.node, self.name, self.namespaceURI, default=None) if not node: raise NamespaceError, 'cant find element (%s,%s)' %(self.namespaceURI,self.name) self.node = node else: #self.node = self._dom.create(self.node, self.name, self.namespaceURI, default=None) self.createDocument(self.namespaceURI, localName=self.name, doctype=None) self.checkNode() ############################################# # Wrapper Methods for direct DOM Element Node access ############################################# def _getNode(self): return self.node def _getElements(self): return self._dom.getElements(self.node, name=None) def _getOwnerDocument(self): return self.node.ownerDocument or self.node def _getUniquePrefix(self): '''I guess we need to resolve all potential prefixes because when the current node is attached it copies the namespaces into the parent node. ''' while 1: self._indx += 1 prefix = 'ns%d' %self._indx try: self._dom.findNamespaceURI(prefix, self._getNode()) except DOMException, ex: break return prefix def _getPrefix(self, node, nsuri): ''' Keyword arguments: node -- DOM Element Node nsuri -- namespace of attribute value ''' try: if node and (node.nodeType == node.ELEMENT_NODE) and \ (nsuri == self._dom.findDefaultNS(node)): return None except DOMException, ex: pass if nsuri == XMLNS.XML: return self._xml_prefix if node.nodeType == Node.ELEMENT_NODE: for attr in node.attributes.values(): if attr.namespaceURI == XMLNS.BASE \ and nsuri == attr.value: return attr.localName else: if node.parentNode: return self._getPrefix(node.parentNode, nsuri) raise NamespaceError, 'namespaceURI "%s" is not defined' %nsuri def _appendChild(self, node): ''' Keyword arguments: node -- DOM Element Node ''' if node is None: raise TypeError, 'node is None' self.node.appendChild(node) def _insertBefore(self, newChild, refChild): ''' Keyword arguments: child -- DOM Element Node to insert refChild -- DOM Element Node ''' self.node.insertBefore(newChild, refChild) def _setAttributeNS(self, namespaceURI, qualifiedName, value): ''' Keyword arguments: namespaceURI -- namespace of attribute qualifiedName -- qualified name of new attribute value value -- value of attribute ''' self.node.setAttributeNS(namespaceURI, qualifiedName, value) ############################################# #General Methods ############################################# def isFault(self): '''check to see if this is a soap:fault message. ''' return False def getPrefix(self, namespaceURI): try: prefix = self._getPrefix(node=self.node, nsuri=namespaceURI) except NamespaceError, ex: prefix = self._getUniquePrefix() self.setNamespaceAttribute(prefix, namespaceURI) return prefix def getDocument(self): return self._getOwnerDocument() def setDocument(self, document): self.node = document def importFromString(self, xmlString): doc = self._dom.loadDocument(StringIO(xmlString)) node = self._dom.getElement(doc, name=None) clone = self.importNode(node) self._appendChild(clone) def importNode(self, node): if isinstance(node, ElementProxy): node = node._getNode() return self._dom.importNode(self._getOwnerDocument(), node, deep=1) def loadFromString(self, data): self.node = self._dom.loadDocument(StringIO(data)) def canonicalize(self): return Canonicalize(self.node) def toString(self): return self.canonicalize() def createDocument(self, namespaceURI, localName, doctype=None): '''If specified must be a SOAP envelope, else may contruct an empty document. ''' prefix = self._soap_env_prefix if namespaceURI == self.reserved_ns[prefix]: qualifiedName = '%s:%s' %(prefix,localName) elif namespaceURI is localName is None: self.node = self._dom.createDocument(None,None,None) return else: raise KeyError, 'only support creation of document in %s' %self.reserved_ns[prefix] document = self._dom.createDocument(nsuri=namespaceURI, qname=qualifiedName, doctype=doctype) self.node = document.childNodes[0] #set up reserved namespace attributes for prefix,nsuri in self.reserved_ns.items(): self._setAttributeNS(namespaceURI=self._xmlns_nsuri, qualifiedName='%s:%s' %(self._xmlns_prefix,prefix), value=nsuri) ############################################# #Methods for attributes ############################################# def hasAttribute(self, namespaceURI, localName): return self._dom.hasAttr(self._getNode(), name=localName, nsuri=namespaceURI) def setAttributeType(self, namespaceURI, localName): '''set xsi:type Keyword arguments: namespaceURI -- namespace of attribute value localName -- name of new attribute value ''' self.logger.debug('setAttributeType: (%s,%s)', namespaceURI, localName) value = localName if namespaceURI: value = '%s:%s' %(self.getPrefix(namespaceURI),localName) xsi_prefix = self.getPrefix(self._xsi_nsuri) self._setAttributeNS(self._xsi_nsuri, '%s:type' %xsi_prefix, value) def createAttributeNS(self, namespace, name, value): document = self._getOwnerDocument() attrNode = document.createAttributeNS(namespace, name, value) def setAttributeNS(self, namespaceURI, localName, value): ''' Keyword arguments: namespaceURI -- namespace of attribute to create, None is for attributes in no namespace. localName -- local name of new attribute value -- value of new attribute ''' prefix = None if namespaceURI: try: prefix = self.getPrefix(namespaceURI) except KeyError, ex: prefix = 'ns2' self.setNamespaceAttribute(prefix, namespaceURI) qualifiedName = localName if prefix: qualifiedName = '%s:%s' %(prefix, localName) self._setAttributeNS(namespaceURI, qualifiedName, value) def setNamespaceAttribute(self, prefix, namespaceURI): ''' Keyword arguments: prefix -- xmlns prefix namespaceURI -- value of prefix ''' self._setAttributeNS(XMLNS.BASE, 'xmlns:%s' %prefix, namespaceURI) ############################################# #Methods for elements ############################################# def createElementNS(self, namespace, qname): ''' Keyword arguments: namespace -- namespace of element to create qname -- qualified name of new element ''' document = self._getOwnerDocument() node = document.createElementNS(namespace, qname) return ElementProxy(self.sw, node) def createAppendSetElement(self, namespaceURI, localName, prefix=None): '''Create a new element (namespaceURI,name), append it to current node, then set it to be the current node. Keyword arguments: namespaceURI -- namespace of element to create localName -- local name of new element prefix -- if namespaceURI is not defined, declare prefix. defaults to 'ns1' if left unspecified. ''' node = self.createAppendElement(namespaceURI, localName, prefix=None) node=node._getNode() self._setNode(node._getNode()) def createAppendElement(self, namespaceURI, localName, prefix=None): '''Create a new element (namespaceURI,name), append it to current node, and return the newly created node. Keyword arguments: namespaceURI -- namespace of element to create localName -- local name of new element prefix -- if namespaceURI is not defined, declare prefix. defaults to 'ns1' if left unspecified. ''' declare = False qualifiedName = localName if namespaceURI: try: prefix = self.getPrefix(namespaceURI) except: declare = True prefix = prefix or self._getUniquePrefix() if prefix: qualifiedName = '%s:%s' %(prefix, localName) node = self.createElementNS(namespaceURI, qualifiedName) if declare: node._setAttributeNS(XMLNS.BASE, 'xmlns:%s' %prefix, namespaceURI) self._appendChild(node=node._getNode()) return node def createInsertBefore(self, namespaceURI, localName, refChild): qualifiedName = localName prefix = self.getPrefix(namespaceURI) if prefix: qualifiedName = '%s:%s' %(prefix, localName) node = self.createElementNS(namespaceURI, qualifiedName) self._insertBefore(newChild=node._getNode(), refChild=refChild._getNode()) return node def getElement(self, namespaceURI, localName): ''' Keyword arguments: namespaceURI -- namespace of element localName -- local name of element ''' node = self._dom.getElement(self.node, localName, namespaceURI, default=None) if node: return ElementProxy(self.sw, node) return None def getAttributeValue(self, namespaceURI, localName): ''' Keyword arguments: namespaceURI -- namespace of attribute localName -- local name of attribute ''' if self.hasAttribute(namespaceURI, localName): attr = self.node.getAttributeNodeNS(namespaceURI,localName) return attr.value return None def getValue(self): return self._dom.getElementText(self.node, preserve_ws=True) ############################################# #Methods for text nodes ############################################# def createAppendTextNode(self, pyobj): node = self.createTextNode(pyobj) self._appendChild(node=node._getNode()) return node def createTextNode(self, pyobj): document = self._getOwnerDocument() node = document.createTextNode(pyobj) return ElementProxy(self.sw, node) ############################################# #Methods for retrieving namespaceURI's ############################################# def findNamespaceURI(self, qualifiedName): parts = SplitQName(qualifiedName) element = self._getNode() if len(parts) == 1: return (self._dom.findTargetNS(element), value) return self._dom.findNamespaceURI(parts[0], element) def resolvePrefix(self, prefix): element = self._getNode() return self._dom.findNamespaceURI(prefix, element) def getSOAPEnvURI(self): return self._soap_env_nsuri def isEmpty(self): return not self.node class Collection(UserDict): """Helper class for maintaining ordered named collections.""" default = lambda self,k: k.name def __init__(self, parent, key=None): UserDict.__init__(self) self.parent = weakref.ref(parent) self.list = [] self._func = key or self.default def __getitem__(self, key): if type(key) is type(1): return self.list[key] return self.data[key] def __setitem__(self, key, item): item.parent = weakref.ref(self) self.list.append(item) self.data[key] = item def keys(self): return map(lambda i: self._func(i), self.list) def items(self): return map(lambda i: (self._func(i), i), self.list) def values(self): return self.list class CollectionNS(UserDict): """Helper class for maintaining ordered named collections.""" default = lambda self,k: k.name def __init__(self, parent, key=None): UserDict.__init__(self) self.parent = weakref.ref(parent) self.targetNamespace = None self.list = [] self._func = key or self.default def __getitem__(self, key): self.targetNamespace = self.parent().targetNamespace if type(key) is types.IntType: return self.list[key] elif self.__isSequence(key): nsuri,name = key return self.data[nsuri][name] return self.data[self.parent().targetNamespace][key] def __setitem__(self, key, item): item.parent = weakref.ref(self) self.list.append(item) targetNamespace = getattr(item, 'targetNamespace', self.parent().targetNamespace) if not self.data.has_key(targetNamespace): self.data[targetNamespace] = {} self.data[targetNamespace][key] = item def __isSequence(self, key): return (type(key) in (types.TupleType,types.ListType) and len(key) == 2) def keys(self): keys = [] for tns in self.data.keys(): keys.append(map(lambda i: (tns,self._func(i)), self.data[tns].values())) return keys def items(self): return map(lambda i: (self._func(i), i), self.list) def values(self): return self.list # This is a runtime guerilla patch for pulldom (used by minidom) so # that xml namespace declaration attributes are not lost in parsing. # We need them to do correct QName linking for XML Schema and WSDL. # The patch has been submitted to SF for the next Python version. from xml.dom.pulldom import PullDOM, START_ELEMENT if 1: def startPrefixMapping(self, prefix, uri): if not hasattr(self, '_xmlns_attrs'): self._xmlns_attrs = [] self._xmlns_attrs.append((prefix or 'xmlns', uri)) self._ns_contexts.append(self._current_context.copy()) self._current_context[uri] = prefix or '' PullDOM.startPrefixMapping = startPrefixMapping def startElementNS(self, name, tagName , attrs): # Retrieve xml namespace declaration attributes. xmlns_uri = 'http://www.w3.org/2000/xmlns/' xmlns_attrs = getattr(self, '_xmlns_attrs', None) if xmlns_attrs is not None: for aname, value in xmlns_attrs: attrs._attrs[(xmlns_uri, aname)] = value self._xmlns_attrs = [] uri, localname = name if uri: # When using namespaces, the reader may or may not # provide us with the original name. If not, create # *a* valid tagName from the current context. if tagName is None: prefix = self._current_context[uri] if prefix: tagName = prefix + ":" + localname else: tagName = localname if self.document: node = self.document.createElementNS(uri, tagName) else: node = self.buildDocument(uri, tagName) else: # When the tagname is not prefixed, it just appears as # localname if self.document: node = self.document.createElement(localname) else: node = self.buildDocument(None, localname) for aname,value in attrs.items(): a_uri, a_localname = aname if a_uri == xmlns_uri: if a_localname == 'xmlns': qname = a_localname else: qname = 'xmlns:' + a_localname attr = self.document.createAttributeNS(a_uri, qname) node.setAttributeNodeNS(attr) elif a_uri: prefix = self._current_context[a_uri] if prefix: qname = prefix + ":" + a_localname else: qname = a_localname attr = self.document.createAttributeNS(a_uri, qname) node.setAttributeNodeNS(attr) else: attr = self.document.createAttribute(a_localname) node.setAttributeNode(attr) attr.value = value self.lastEvent[1] = [(START_ELEMENT, node), None] self.lastEvent = self.lastEvent[1] self.push(node) PullDOM.startElementNS = startElementNS # # This is a runtime guerilla patch for minidom so # that xmlns prefixed attributes dont raise AttributeErrors # during cloning. # # Namespace declarations can appear in any start-tag, must look for xmlns # prefixed attribute names during cloning. # # key (attr.namespaceURI, tag) # ('http://www.w3.org/2000/xmlns/', u'xsd') # ('http://www.w3.org/2000/xmlns/', 'xmlns') # # xml.dom.minidom.Attr.nodeName = xmlns:xsd # xml.dom.minidom.Attr.value = = http://www.w3.org/2001/XMLSchema if 1: def _clone_node(node, deep, newOwnerDocument): """ Clone a node and give it the new owner document. Called by Node.cloneNode and Document.importNode """ if node.ownerDocument.isSameNode(newOwnerDocument): operation = xml.dom.UserDataHandler.NODE_CLONED else: operation = xml.dom.UserDataHandler.NODE_IMPORTED if node.nodeType == xml.dom.minidom.Node.ELEMENT_NODE: clone = newOwnerDocument.createElementNS(node.namespaceURI, node.nodeName) for attr in node.attributes.values(): clone.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.value) prefix, tag = xml.dom.minidom._nssplit(attr.nodeName) if prefix == 'xmlns': a = clone.getAttributeNodeNS(attr.namespaceURI, tag) elif prefix: a = clone.getAttributeNodeNS(attr.namespaceURI, tag) else: a = clone.getAttributeNodeNS(attr.namespaceURI, attr.nodeName) a.specified = attr.specified if deep: for child in node.childNodes: c = xml.dom.minidom._clone_node(child, deep, newOwnerDocument) clone.appendChild(c) elif node.nodeType == xml.dom.minidom.Node.DOCUMENT_FRAGMENT_NODE: clone = newOwnerDocument.createDocumentFragment() if deep: for child in node.childNodes: c = xml.dom.minidom._clone_node(child, deep, newOwnerDocument) clone.appendChild(c) elif node.nodeType == xml.dom.minidom.Node.TEXT_NODE: clone = newOwnerDocument.createTextNode(node.data) elif node.nodeType == xml.dom.minidom.Node.CDATA_SECTION_NODE: clone = newOwnerDocument.createCDATASection(node.data) elif node.nodeType == xml.dom.minidom.Node.PROCESSING_INSTRUCTION_NODE: clone = newOwnerDocument.createProcessingInstruction(node.target, node.data) elif node.nodeType == xml.dom.minidom.Node.COMMENT_NODE: clone = newOwnerDocument.createComment(node.data) elif node.nodeType == xml.dom.minidom.Node.ATTRIBUTE_NODE: clone = newOwnerDocument.createAttributeNS(node.namespaceURI, node.nodeName) clone.specified = True clone.value = node.value elif node.nodeType == xml.dom.minidom.Node.DOCUMENT_TYPE_NODE: assert node.ownerDocument is not newOwnerDocument operation = xml.dom.UserDataHandler.NODE_IMPORTED clone = newOwnerDocument.implementation.createDocumentType( node.name, node.publicId, node.systemId) clone.ownerDocument = newOwnerDocument if deep: clone.entities._seq = [] clone.notations._seq = [] for n in node.notations._seq: notation = xml.dom.minidom.Notation(n.nodeName, n.publicId, n.systemId) notation.ownerDocument = newOwnerDocument clone.notations._seq.append(notation) if hasattr(n, '_call_user_data_handler'): n._call_user_data_handler(operation, n, notation) for e in node.entities._seq: entity = xml.dom.minidom.Entity(e.nodeName, e.publicId, e.systemId, e.notationName) entity.actualEncoding = e.actualEncoding entity.encoding = e.encoding entity.version = e.version entity.ownerDocument = newOwnerDocument clone.entities._seq.append(entity) if hasattr(e, '_call_user_data_handler'): e._call_user_data_handler(operation, n, entity) else: # Note the cloning of Document and DocumentType nodes is # implemenetation specific. minidom handles those cases # directly in the cloneNode() methods. raise xml.dom.NotSupportedErr("Cannot clone node %s" % repr(node)) # Check for _call_user_data_handler() since this could conceivably # used with other DOM implementations (one of the FourThought # DOMs, perhaps?). if hasattr(node, '_call_user_data_handler'): node._call_user_data_handler(operation, node, clone) return clone xml.dom.minidom._clone_node = _clone_node PK‡¨58î4xxZSI/wstools/XMLname.pyc;ò •@Ec@sMdZdZdkTd„Zd„Zd„Zd„Zd„Zd„Zd S( sÕTranslate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2: Adjuncts", W3C Working Draft 17, December 2001, Also see . Author: Gregory R. Warnes Date:: 2002-04-25 Version 0.9.0 s1$Id: XMLname.py 954 2005-02-16 14:45:37Z warnes $(s*cCsB|iƒp1|iƒp$|djp|djp |djSdS(Ns.s-s_(sxsisalphasisdigit(sx((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys _NCNameCharscCs|iƒp |djSdS(Ns_(sxsisalpha(sx((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys_NCNameStartCharscCstt|dƒƒd}t|ƒ}|djod|}nÇ|djod|}n¬|djod|}n‘|djod |}nv|d jod|}n[|d jod|}n@|d jod|}n%|d jod |}n td‚d|dSdS(Niiis000s00is0isiiiis'Illegal Value returned from hex(ord(x))s_xs_(shexsordsxshexvalslenshexlens Exception(sxshexlenshexval((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys _toUnicodeHexs(          cCstd|dd!dƒSdS(Nsu"\uiiÿÿÿÿs"(sevalsx(sx((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys_fromUnicodeHex.scCsä|idƒdjo|iddƒ\}}n t}|}t|ƒ}t|ƒ}g}xRt |ƒD]D}||djo#||djo||ddjo|i dƒqi|djop|djoc|ddjp|dd joA|dd jp|dd jo|d d jp|d djo|i d|dƒqit||ƒ p|djot||ƒ o|i t||ƒƒqi|i ||ƒqiW|od|di|ƒfSndi|ƒSdS(sConvert string to a XML name.s:iÿÿÿÿiu_uxu_x005F_iiuXumuMiuluLu_xFFFF_s%s:%suN(sstringsfindssplitsprefixs localnamesNonesunicodesTslensNsXsrangesisappends _NCNameChars_NCNameStartChars _toUnicodeHexsjoin(sstringsisNsprefixsTsXs localname((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys toXMLname2s(   7€1cCs5tdd|ƒ}d„}td||ƒ}|SdS(s#Convert XML name to unicode string.s_xFFFF_scCst|idƒƒSdS(Ni(s_fromUnicodeHexsmatchobjsgroup(smatchobj((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pysfunUss_x[0-9A-Za-z]+_N(ssubsstringsretvalsfun(sstringsfunsretval((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys fromXMLnamePs  N( s__doc__sidentsres _NCNameChars_NCNameStartChars _toUnicodeHexs_fromUnicodeHexs toXMLnames fromXMLname(sidents_NCNameStartChars _NCNameChars_fromUnicodeHexs toXMLnames fromXMLnames _toUnicodeHex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys?s     PK¨58ú&ÂZSI/wstools/UserTuple.pyo;ò •@Ec@sdZdfd„ƒYZdS(s÷ A more or less complete user-defined wrapper around tuple objects. Adapted version of the standard library's UserList. Taken from Stefan Schwarzer's ftputil library, available at , and used under this license: Copyright (C) 1999, Stefan Schwarzer 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 above author nor the names of the contributors to the software 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 REGENTS 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. s UserTuplecBs¡tZed„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„ZeZRS(NcCswf|_|tj o]t|ƒt|iƒjo ||_qst|tƒo|i|_qst|ƒ|_ndS(N(sselfsdatas inittuplesNonestypes isinstances UserTuplestuple(sselfs inittuple((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__init__7s   cCst|iƒSdS(N(sreprsselfsdata(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__repr__FscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__lt__GscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__le__HscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__eq__IscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__ne__JscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__gt__KscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__ge__LscCs#t|tƒo |iSn|SdS(N(s isinstancesothers UserTuplesdata(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__castMs cCst|i|i|ƒƒSdS(N(scmpsselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__cmp__PscCs||ijSdS(N(sitemsselfsdata(sselfsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys __contains__RscCst|iƒSdS(N(slensselfsdata(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__len__SscCs|i|SdS(N(sselfsdatasi(sselfsi((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys __getitem__TscCs9t|dƒ}t|dƒ}|i|i||!ƒSdS(Ni(smaxsisjsselfs __class__sdata(sselfsisj((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys __getslice__UscCszt|tƒo|i|i|iƒSnLt|t|iƒƒo|i|i|ƒSn|i|it|ƒƒSdS(N(s isinstancesothers UserTuplesselfs __class__sdatastypestuple(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__add__Xs cCs|i|i|ƒSdS(N(sselfs __class__sdatasn(sselfsn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__mul__`s(s__name__s __module__sNones__init__s__repr__s__lt__s__le__s__eq__s__ne__s__gt__s__ge__s_UserTuple__casts__cmp__s __contains__s__len__s __getitem__s __getslice__s__add__s__mul__s__rmul__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys UserTuple6s"                N(s__doc__s UserTuple(s UserTuple((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys?*s PKލ58ï³ímššZSI/wstools/__init__.pyo;ò •@Ec@s+dZdZdkZdkZdkZdS(s:WSDL parsing services package for Web Services for Python.s3$Id: __init__.py 840 2004-12-07 15:54:53Z blunck2 $N(s__doc__sidents WSDLToolssXMLnameslogging(sXMLnamesidentsloggings WSDLTools((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/__init__.pys?s  PK…¨58ù<Œ44ZSI/wstools/XMLSchema.pyc;ò •@Ec@sîdZdkZdkZdkZdkZdklZlZdkl Z l Z l Z l Z l Z dklZydklZWn&ej odfd„ƒYZnXdZd Zd Zd Zd Zd „Zdfd„ƒYZdefd„ƒYZdfd„ƒYZdefd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZ dfd„ƒYZ!d fd!„ƒYZ"d"fd#„ƒYZ#d$fd%„ƒYZ$d&fd'„ƒYZ%d(e%fd)„ƒYZ&d*e%fd+„ƒYZ'd,e%fd-„ƒYZ(d.fd/„ƒYZ)d0fd1„ƒYZ*d2fd3„ƒYZ+d4fd5„ƒYZ,d6fd7„ƒYZ-d8fd9„ƒYZ.d:fd;„ƒYZ/d<fd=„ƒYZ0d>ee0fd?„ƒYZ1d@e1fdA„ƒYZ2dBe1fdC„ƒYZ3dDe1fdE„ƒYZ4dFfdG„ƒYZ5dHe1fdI„ƒYZ6dJe1e efdK„ƒYZ7dLe7e e/efdM„ƒYZ8dNe1e ee"fdO„ƒYZ9dPe1e e$fdQ„ƒYZ:dRe1e!efdS„ƒYZ;dTe1e!e$fdU„ƒYZ<dVe1fdW„ƒYZ=dXe=fdY„ƒYZ>dZe=fd[„ƒYZ?d\e=fd]„ƒYZ@d^e1e#efd_„ƒYZAd`eAe/fda„ƒYZBdbe1e#e$fdc„ƒYZCddeBe"fde„ƒYZDdfe1e(fdg„ƒYZEdhe1e&fdi„ƒYZFdje1e'fdk„ƒYZGdle1e%efdm„ƒYZHdne1e%e$fdo„ƒYZIdpe1ee.fdq„ƒYZJdreJe/fds„ƒYZKdte1ee+fdu„ƒYZLdveLe+e/fdw„ƒYZMdxfdy„ƒYZNeiOdz dzdzfjo ePZQndkRZReRiRZQd{eQfd|„ƒYZSdS(}s6$Id: XMLSchema.py 1207 2006-05-04 18:34:01Z boverhof $N(sSCHEMAsXMLNS(sDOMs DOMExceptions Collections SplitQNamesbasejoin(sStringIO(sRLocksRLockcBstZd„Zd„ZRS(NcCsdS(N((((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysacquirescCsdS(N((((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysreleases(s__name__s __module__sacquiresrelease(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysRLocks stypess attr_groupss attr_declselementss model_groupscCs3|}x"t|tƒ o|iƒ}q W|SdS(sBconvience function for finding the parent XMLSchema instance. N(s componentsparents isinstances XMLSchemas_parent(s componentsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys GetSchema*s s SchemaReadercBsztZdZhZeed„Zd„Zd„Zd„Zd„Z d„Z ed„Z d„Z ed „Z d „ZRS( sEA SchemaReader creates XMLSchema objects from urls and xml data. cCs@||_||_|i o t|_nh|_h|_dS(sedomReader -- class must implement DOMAdapterInterface base_url -- base url string N(sbase_urlsselfs_SchemaReader__base_urls domReaders_SchemaReader__readerClasss DOMAdapters _includess_imports(sselfs domReadersbase_url((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__8s     cCsOxH|iiƒD]7\}}|ii|ƒo|i|i|ƒqqWdS(s^Add dictionary of imports to schema instance. schema -- XMLSchema instance N( sschemasimportssitemssnssvalsselfs_importsshas_keysaddImportSchema(sselfsschemasnssval((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys __setImportsCs  cCsOxH|iiƒD]7\}}|ii|ƒo|i|i |ƒqqWdS(s_Add dictionary of includes to schema instance. schema -- XMLSchema instance N( sschemasincludessitemssschemaLocationsvalsselfs _includesshas_keysaddIncludeSchemas_imports(sselfsschemasschemaLocationsval((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys __setIncludesKs  cCs||i|load a Document from a file object file -- sadapter method not implementedN(sNotImplementedError(sselfsfile((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys loadDocumentÍscCs td‚dS(sIload a Document from an url url -- URL to dereference sadapter method not implementedN(sNotImplementedError(sselfsurl((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys loadFromURLÓs( s__name__s __module__sNoneshasattrsgetContentListssetAttributeDictionarysgetAttributeDictionarys getNamespaces getTagNames getParentNodes loadDocuments loadFromURL(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysDOMAdapterInterface¥s        s DOMAdaptercBswtZdZed„Zd„Zed„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „ZRS( s Adapter for ZSI.Utility.DOM cCs6t|dƒo|i|_n ||_t|_dS(sXReset all instance variables. element -- DOM document, node, or None sdocumentElementN(shasattrsnodesdocumentElementsselfs_DOMAdapter__nodesNones_DOMAdapter__attributes(sselfsnode((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Ýs  cCs |iSdS(N(sselfs_DOMAdapter__node(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetNodeçscCsT|i o|iƒn|o |ii|hƒi|ƒSn|ii|ƒSdS(saattr -- attribute ns -- optional namespace, None means unprefixed attribute. N(sselfs_DOMAdapter__attributesssetAttributeDictionarysnssgetshas_keysattr(sselfsattrsns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pyshasattrês   cGsg}|ii}xXti|itƒD]A}|i|jot |i ƒd|jo|i |ƒq(q(Wt |i|ƒSdS(Ni(snodessselfs_DOMAdapter__nodes ELEMENT_NODEsDOMs getElementssNoneschildsnodeTypes SplitQNamestagNamescontentssappendsmaps __class__(sselfscontentss ELEMENT_NODEschildsnodes((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetContentListôs *cCs=h|_x-|iiiƒD]}|i|i|i s %s* %s = %s s ( sXMLBases_XMLBase__rlocksacquires_XMLBase__indentsstrsselfs __class__stmps__dict__sitemssksvsrelease(sselfstmpsvsk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__str__2s  " ( s__name__s __module__s__doc__sNonestags_XMLBase__indentsRLocks_XMLBase__rlocks__str__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysXMLBase+s  sDefinitionMarkercBstZdZRS(smarker for definitions (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysDefinitionMarkerAs sDeclarationMarkercBstZdZRS(smarker for declarations (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysDeclarationMarkerFs sAttributeMarkercBstZdZRS(smarker for attributes (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeMarkerKs sAttributeGroupMarkercBstZdZRS(s marker for attribute groups (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeGroupMarkerPs sWildCardMarkercBstZdZRS(smarker for wildcards (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysWildCardMarkerUs s ElementMarkercBstZdZRS(smarker for wildcards (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ElementMarkerZs sReferenceMarkercBstZdZRS(smarker for references (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysReferenceMarker_s sModelGroupMarkercBstZdZRS(smarker for model groups (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysModelGroupMarkerds s AllMarkercBstZdZRS(smarker for all model group (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys AllMarkeris s ChoiceMarkercBstZdZRS(s"marker for choice model group (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ChoiceMarkerns sSequenceMarkercBstZdZRS(s$marker for sequence model group (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysSequenceMarkerss sExtensionMarkercBstZdZRS(smarker for extensions (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysExtensionMarkerxs sRestrictionMarkerc Bs8tZdZddddddddd d d d g ZRS( smarker for restrictions s enumerationslengths maxExclusives maxInclusives maxLengths minExclusives minInclusives minLengthspatternsfractionDigitss totalDigitss whiteSpace(s__name__s __module__s__doc__sfacets(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysRestrictionMarker}s s SimpleMarkercBstZdZRS(s'marker for simple type information (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys SimpleMarker„s s ListMarkercBstZdZRS(s marker for simple type list (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ListMarker‰s s UnionMarkercBstZdZRS(s!marker for simple type Union (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys UnionMarkerŽs s ComplexMarkercBstZdZRS(s(marker for complex type information (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ComplexMarker”s s LocalMarkercBstZdZRS(s(marker for complex type information (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys LocalMarker™s sMarkerInterfacecBsªtZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zd„ZRS(NcCst|tƒSdS(N(s isinstancesselfsDefinitionMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isDefinition scCst|tƒSdS(N(s isinstancesselfsDeclarationMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isDeclaration£scCst|tƒSdS(N(s isinstancesselfsAttributeMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isAttribute¦scCst|tƒSdS(N(s isinstancesselfsAttributeGroupMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisAttributeGroup©scCst|tƒSdS(N(s isinstancesselfs ElementMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isElement¬scCst|tƒSdS(N(s isinstancesselfsReferenceMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isReference¯scCst|tƒSdS(N(s isinstancesselfsWildCardMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isWildCard²scCst|tƒSdS(N(s isinstancesselfsModelGroupMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isModelGroupµscCst|tƒSdS(N(s isinstancesselfs AllMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisAll¸scCst|tƒSdS(N(s isinstancesselfs ChoiceMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisChoice»scCst|tƒSdS(N(s isinstancesselfsSequenceMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isSequence¾scCst|tƒSdS(N(s isinstancesselfsExtensionMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isExtensionÁscCst|tƒSdS(N(s isinstancesselfsRestrictionMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isRestrictionÄscCst|tƒSdS(N(s isinstancesselfs SimpleMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisSimpleÇscCst|tƒSdS(N(s isinstancesselfs ComplexMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isComplexÊscCst|tƒSdS(N(s isinstancesselfs LocalMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisLocalÍscCst|tƒSdS(N(s isinstancesselfs ListMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisListÐscCst|tƒSdS(N(s isinstancesselfs UnionMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisUnionÓs(s__name__s __module__s isDefinitions isDeclarations isAttributesisAttributeGroups isElements isReferences isWildCards isModelGroupsisAllsisChoices isSequences isExtensions isRestrictionsisSimples isComplexsisLocalsisListsisUnion(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysMarkerInterfaceŸs$                 sXMLSchemaComponentcBsÚtZdZgZhZhZdZdZdZe d„Z d„Z d„Z d„Z d„Zd „Zd „Zd „Zd „Zd „Ze d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s class variables: required -- list of required attributes attributes -- dict of default attribute values, including None. Value can be a function for runtime dependencies. contents -- dict of namespace keyed content lists. 'xsd' content of xsd namespace. xmlns_key -- key for declared xmlns namespace. xmlns -- xmlns is special prefix for namespace dictionary xml -- special xml prefix for xml namespace. ssxmlnssxmlcCsÂt|_||_|ioti|ƒ|_n|itj odt |ii ƒt ti ƒjoAt |iiƒt tiƒjot |ii ƒt ti ƒj ot d|i‚ndS(s~parent -- parent instance instance variables: attributes -- dictionary of node's attributes s#Bad type for a class variable in %sN( sNonesselfs attributessparents_parentsweakrefsrefs __class__sXMLSchemaComponentstypesrequiredscontentss RuntimeError(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ís   xcCs1|gddf\}}}}x»t|tƒ ot|tƒ o˜|i|ƒ}|t joR|i|ƒ}|t jo|i d|i ƒqË|i d|i |fƒn|i d|i |fƒ|i ƒ}q!Wy|iƒ}Wn d}nX|i d|i |fƒ|iƒdi|ƒSdS( s6Returns a node trace up to the item. snamesrefs<%s>s <%s ref="%s">s<%s name="%s">ss<%s targetNamespace="%s">N(sselfsitemspathsnamesrefs isinstances XMLSchemasWSDLToolsAdapters getAttributesattrsNonesappendstags_parentsgetTargetNamespacestnssreversesjoin(sselfsnamestnssitemspathsrefsattr((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getItemTraceýs&"    cCsT|}d}|ii|ƒ}x+| o"|iƒ}|ii|ƒ}q!W|SdS(sreturn targetNamespace stargetNamespaceN(sselfsparentstargetNamespaces attributessgetstnss_parent(sselfstargetNamespacestnssparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTargetNamespaces cCs|it|ƒSdS(sˆattribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance N(sselfsgetQNameAttributes ATTRIBUTESs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeDeclarationscCs|it|ƒSdS(sˆattribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance N(sselfsgetQNameAttributesATTRIBUTE_GROUPSs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeGroup#scCs|it|ƒSdS(sˆattribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance N(sselfsgetQNameAttributesTYPESs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinition)scCs|it|ƒSdS(sattribute -- attribute with a QName value (eg. element). collection -- check elements collection in parent Schema instance. N(sselfsgetQNameAttributesELEMENTSs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclaration/scCs|it|ƒSdS(sŽattribute -- attribute with a QName value (eg. ref). collection -- check model_group collection in parent Schema instance. N(sselfsgetQNameAttributes MODEL_GROUPSs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getModelGroup5scCsIt}|i|ƒ}|o%|i||iƒ|i ƒƒ}n|SdS(s returns object instance representing QName --> (namespace,name), or if does not exist return None. attribute -- an information item attribute, with a QName value. collection -- collection in parent Schema instance to search. N( sNonesobjsselfsgetAttributeQNames attributestdcs getSchemaItems collectionsgetTargetNamespacesgetName(sselfs collections attributesobjstdc((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetQNameAttribute;s %cCs^t|ƒ}|i|joMyt||ƒ|}Wn+t j o}t d|||f‚nX|Sn|i i |ƒ ot Sn|i |}t|tƒ o.|iƒ}|t j o||i |tZdZhde<de parent: schema attributes: id -- ID name -- NCName, Required public -- token, Required system -- anyURI contents: annotation? snamespublicsidssystemsxsds annotationsnotationcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__%scCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom)s ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysNotations  * s AnnotationcBsvtZdZhde parent: all,any,anyAttribute,attribute,attributeGroup,choice,complexContent, complexType,element,extension,field,group,import,include,key,keyref, list,notation,redefine,restriction,schema,selector,simpleContent, simpleType,union,unique attributes: id -- ID contents: (documentation | appinfo)* sidsxsds documentationsappinfos annotationcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNonescontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__FscCs—|i|ƒ|i|ƒ}g}x_|D]W}t|iƒƒd}|djoq)q)|djoq)q)t d|iƒ‚q)Wt |ƒ|_dS(Nis documentationsappinfosUnknown component (%s)( sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomJs   s DocumentationcBsStZdZhde<de parent: annotation attributes: source, anyURI xml:lang, language contents: mixed, any ssourcesxml:langsxsdsmixedsanys documentationcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNonescontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__jscCs—|i|ƒ|i|ƒ}g}x_|D]W}t|iƒƒd}|djoq)q)|djoq)q)t d|iƒ‚q)Wt |ƒ|_dS(NismixedsanysUnknown component (%s)( sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomns   ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Documentation\s  sAppinfocBsStZdZhde<de parent: annotation attributes: source, anyURI contents: mixed, any ssourcesanyURIsxsdsmixedsanysappinfocCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNonescontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__scCs—|i|ƒ|i|ƒ}g}x_|D]W}t|iƒƒd}|djoq)q)|djoq)q)t d|iƒ‚q)Wt |ƒ|_dS(NismixedsanysUnknown component (%s)( sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom‘s   ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAppinfo€s  ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDomsXMLSchemaComponents DocumentationsAppinfo(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Annotation6s   $s XMLSchemaFakecBstZd„ZRS(NcCs"ti|dƒ|_||_dS(NstargetNamespace(sDOMsgetAttrselementsselfstargetNamespace(sselfselement((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__¥s(s__name__s __module__s__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys XMLSchemaFake£ss XMLSchemacBsftZdZhde<de<de<de<dd<dd<de<d e element information items. It represents the abstract notion of a schema rather than a single schema document (or other representation). parent: ROOT attributes: id -- ID version -- token xml:lang -- language targetNamespace -- anyURI attributeFormDefault -- 'qualified' | 'unqualified', 'unqualified' elementFormDefault -- 'qualified' | 'unqualified', 'unqualified' blockDefault -- '#all' | list of ('substitution | 'extension' | 'restriction') finalDefault -- '#all' | list of ('extension' | 'restriction' | 'list' | 'union') contents: ((include | import | redefine | annotation)*, (attribute, attributeGroup, complexType, element, group, notation, simpleType)*, annotation*)* attributes -- schema attributes imports -- import statements includes -- include statements redefines -- types -- global simpleType, complexType definitions elements -- global element declarations attr_decl -- global attribute declarations attr_groups -- attribute Groups model_groups -- model Groups notations -- global notations sidsversionsxml:langstargetNamespacesattributeFormDefaults unqualifiedselementFormDefaults blockDefaults finalDefaultsxsdsincludesimportsredefines annotations attributesattributeGroups complexTypeselementsgroupsnotations simpleTypessschemacCst|_t|_ti||ƒd„}d„}d„}t |d|ƒ|_ t |d|ƒ|_ t |d|ƒ|_ t |d|ƒ|_t |d|ƒ|_t |d|ƒ|_t |d|ƒ|_t |d|ƒ|_h|_h|_t|_dS(s,parent -- instance variables: targetNamespace -- schema's declared targetNamespace, or empty string. _imported_schemas -- namespace keyed dict of schema dependencies, if a schema is provided instance will not resolve import statement. _included_schemas -- schemaLocation keyed dict of component schemas, if schema is provided instance will not resolve include statement. _base_url -- needed for relative URLs support, only works with URLs relative to initial document. includes -- collection of include statements imports -- collection of import statements elements -- collection of global element declarations types -- collection of global type definitions attr_decl -- collection of global attribute declarations attr_groups -- collection of global attribute group definitions model_groups -- collection of model group definitions notations -- collection of notations cCs |idS(Nsname(sks attributes(sk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysõscCs |idS(Ns namespace(sks attributes(sk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysöscCs |idS(NsschemaLocation(sks attributes(sk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys÷sskeyN(sNonesselfs_XMLSchema__nodestargetNamespacesXMLSchemaComponents__init__sparentsfsnsssls Collectionsincludessimportsselementsstypess attr_decls attr_groupss model_groupss notationss_imported_schemass_included_schemass _base_url(sselfsparentsfsslsns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Þs$       cCs |iSdS(s; Interacting with the underlying DOM tree. N(sselfs_XMLSchema__node(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetNodescCsRt|tƒ o td‚n|i|ijo||i|iˆƒ}|i|ƒ|ˆi?|i0dƒ parent: schema attributes: id -- ID namespace -- anyURI schemaLocation -- anyURI contents: annotation? sids namespacesschemaLocationsxsds annotationsimportcCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations_schema(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ÿs cCs¼|i|ƒ|i|ƒ}|id|iƒjo td‚nxr|D]j}t |i ƒƒd}|djo|i o#t |ƒ|_ |i i|ƒqJtd|i ƒ‚qJWdS(Ns namespaces$namespace of schema and import matchis annotationsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentss attributessgetTargetNamespaces SchemaErrorsis SplitQNames getTagNames components annotations AnnotationsfromDom(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDoms  cCs|i oý|id}|iƒiƒi|ƒ}| o |iƒio%|iƒiƒiƒi|ƒ}n| oŒ|iidƒ}| ot d|‚n|iƒi ƒ}t d|ƒ}|iƒiƒ|_|iƒiƒ|_|i|ƒ|_qn|ip|SdS(síif schema is not defined, first look for a Schema class instance in parent Schema. Else if not defined resolve schemaLocation and create a new Schema class instance, and keep a hard reference. s namespacesschemaLocationsnamespace(%s) is unknownsbase_urlN(sselfs_schemas attributessnss_parentsgetImportSchemassgetsschemasurls SchemaErrors getBaseUrlsbase_urls SchemaReadersreaders_importssgetIncludeSchemass _includess loadFromURL(sselfsurlsbase_urlsreadersnssschema((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getSchemas   %cCs•|iƒiƒ}td|ƒ}|iƒiƒ|_|iƒiƒ|_ ||_ |i i dƒ o td‚n|i|i idƒ|ƒdS(s sbase_urlsschemaLocationsno schemaLocationN(sselfs_parents getBaseUrlsbase_urls SchemaReadersreadersgetImportSchemass_importssgetIncludeSchemass _includessschemas_schemas attributesshas_keys SchemaErrors loadFromURLsget(sselfsschemasbase_urlsreader((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys loadSchema)s  ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDoms getSchemas loadSchema(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysImportîs !   sIncludecBsbtZdZdgZhde<de parent: schema attributes: id -- ID schemaLocation -- anyURI, required contents: annotation? sschemaLocationsidsxsds annotationsincludecCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations_schema(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Gs cCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomLs cCs¶|i o |iƒ}|iƒi|idƒ|_|i of|id}td|i ƒƒ}|i ƒ|_ |iƒ|_ t|ƒ|_|i||iƒq«n|iSdS(sÓif schema is not defined, first look for a Schema class instance in parent Schema. Else if not defined resolve schemaLocation and create a new Schema class instance. sschemaLocationsbase_urlN(sselfs_schemas_parentsschemasgetIncludeSchemassgets attributessurls SchemaReaders getBaseUrlsreadersgetImportSchemass_importss _includess XMLSchemas loadFromURL(sselfsurlsreadersschema((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getSchemaXs    ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sfromDoms getSchema(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysInclude7s    (s__name__s __module__s__doc__sNones attributesscontentssempty_namespacestags__init__sgetNodesaddImportSchemasaddIncludeSchemassetImportSchemassgetImportSchemassgetSchemaNamespacesToImportssetIncludeSchemassgetIncludeSchemass getBaseUrls setBaseUrlsgetElementFormDefaultsisElementFormDefaultQualifiedsgetAttributeFormDefaultsgetBlockDefaultsgetFinalDefaultsloadsXMLSchemaComponentsImportsInclude(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys XMLSchema©s0 %N3 '               ˆIsAttributeDeclarationcBswtZdZdgZhde<de<de<de<de parent: schema attributes: id -- ID name -- NCName, required type -- QName default -- string fixed -- string contents: annotation?, simpleType? snamesidstypesdefaultsfixedsxsds annotations simpleTypes attributecCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ˆs cCsÅ|i|ƒ|i|ƒ}x¢|D]š}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#|djo#t |ƒ|_ |i i |ƒq#td|iƒ‚q#WdS(s" No list or union support is annotations simpleTypesUnknown component (%s)N(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDomsAnonymousSimpleTypescontents SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDoms  ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeDeclarationps  3 sLocalAttributeDeclarationcBs†tZdZdgZhde<de<de<dd„<dd<de<d e parent: complexType, restriction, extension, attributeGroup attributes: id -- ID name -- NCName, required type -- QName form -- ('qualified' | 'unqualified'), schema.attributeFormDefault use -- ('optional' | 'prohibited' | 'required'), optional default -- string fixed -- string contents: annotation?, simpleType? snamesidstypesformcCst|ƒiƒS(N(s GetSchemasselfsgetAttributeFormDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysµssusesoptionalsdefaultsfixedsxsds annotations simpleTypecCs&ti||ƒt|_t|_dS(N(sAttributeDeclarations__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__»s cCsÅ|i|ƒ|i|ƒ}x¢|D]š}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#|djo#t |ƒ|_ |i i |ƒq#td|iƒ‚q#WdS(Nis annotations simpleTypesUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDomsAnonymousSimpleTypescontents SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomÀs  ( s__name__s __module__s__doc__srequiredsNones attributesscontentss__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysLocalAttributeDeclarationŸs  H sAttributeWildCardcBsYtZdZhde<dd<dd parents: complexType, restriction, extension, attributeGroup attributes: id -- ID namespace -- '##any' | '##other' | (anyURI* | '##targetNamespace' | '##local'), ##any processContents -- 'lax' | 'skip' | 'strict', strict contents: annotation? sids namespaces##anysprocessContentssstrictsxsds annotations anyAttributecCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__åscCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomés ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeWildCardÐs ! sAttributeReferencecBs€tZdZdgZhde<de<dd<de<de parents: complexType, restriction, extension, attributeGroup attributes: id -- ID ref -- QName, required use -- ('optional' | 'prohibited' | 'required'), optional default -- string fixed -- string contents: annotation? srefsidsusesoptionalsdefaultsfixedsxsds annotations attributecCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__scCsti||ƒSdS(N(sXMLSchemaComponentsgetAttributeDeclarationsselfs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeDeclarationscCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDoms ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetAttributeDeclarationsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeReferenceös  3  sAttributeGroupDefinitioncBsktZdZdgZhde<de parents: schema, redefine attributes: id -- ID name -- NCName, required contents: annotation?, (attribute | attributeGroup)*, anyAttribute? snamesidsxsds annotations attributesattributeGroups anyAttributecCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__4s cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContent9scCsä|i|ƒ|i|ƒ}g}x¬tt|ƒƒD]˜}t ||i ƒƒd}|djo| o't |ƒ|_ |i i||ƒq5|djox||idƒo|it|ƒƒn5||idƒo|it|ƒƒn td‚|di||ƒq5|djo,|it|ƒƒ|di||ƒq5|d joZt|ƒ|djotd |iƒ‚n|it|ƒƒ|di||ƒq5td ||i ƒ‚q5Wt|ƒ|_dS( Nis annotations attributesnamesrefsUnknown attribute typeiÿÿÿÿsattributeGroups anyAttributes"anyAttribute is out of order in %ssUnknown component (%s)(sselfs setAttributessnodes getContentsscontentsscontentsrangeslensindxs SplitQNames getTagNames components Annotations annotationsfromDomshasattrsappendsLocalAttributeDeclarationsAttributeReferences SchemaErrorsAttributeGroupReferences getItemTracesAttributeWildCardstuples attr_content(sselfsnodes componentsindxscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom<s4     ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetAttributeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeGroupDefinition"s    sAttributeGroupReferencecBsetZdZdgZhde<de parents: complexType, restriction, extension, attributeGroup attributes: id -- ID ref -- QName, required contents: annotation? srefsidsxsds annotationsattributeGroupcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__mscCsti||ƒSdS(sˆattribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance N(sXMLSchemaComponentsgetAttributeGroupsselfs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeGroupqscCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomws ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetAttributeGroupsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeGroupReference[s    sIdentityConstrantscBsbtZdZd„Zd„Zdefd„ƒYZdefd„ƒYZdefd„ƒYZRS( súAllow one to uniquely identify nodes in a document and ensure the integrity of references between them. attributes -- dictionary of attributes selector -- XPath to selected nodes fields -- list of XPath to key field cCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNonesselectorsfieldss annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__s  cCsI|i|ƒ|i|ƒ}g}x |D]}t|iƒƒd}||i idjoÃ|djo|i o#t |ƒ|_ |i i |ƒq2|djo)|i|ƒ|_|ii |ƒq)q2|djo.|i|i|ƒƒ|di |ƒq)q2td|iƒ‚ntd|iƒ‚t|ƒ|_q)WdS(Nisxsds annotationsselectorsfieldiÿÿÿÿsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssfieldssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomsSelectorsselectorsappendsFields SchemaErrorstuple(sselfsnodesisfieldss componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom–s*   s ConstraintcBstZd„Zd„ZRS(NcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__±scCsÃ|i|ƒ|i|ƒ}x |D]˜}t|iƒƒd}||i idjoR|djo|i o#t |ƒ|_ |i i |ƒq»t d|iƒ‚q#t d|iƒ‚q#WdS(Nisxsds annotationsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomµs (s__name__s __module__s__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Constraint°s sSelectorcBsGtZdZdgZhde<de parent: unique, key, keyref attributes: id -- ID xpath -- XPath subset, required contents: annotation? sxpathsidsxsds annotationsselector(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysSelectorÄs  sFieldcBsGtZdZdgZhde<de parent: unique, key, keyref attributes: id -- ID xpath -- XPath subset, required contents: annotation? sxpathsidsxsds annotationsfield(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysFieldÔs  ( s__name__s __module__s__doc__s__init__sfromDomsXMLSchemaComponents ConstraintsSelectorsField(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysIdentityConstrantsˆs   sUniquecBsMtZdZdgZhde<de Enforce fields are unique w/i a specified scope. parent: element attributes: id -- ID name -- NCName, required contents: annotation?, selector, field+ snamesidsxsds annotationsselectorsfieldsunique(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysUniqueås  sKeycBsMtZdZdgZhde<de Enforce fields are unique w/i a specified scope, and all field values are present w/i document. Fields cannot be nillable. parent: element attributes: id -- ID name -- NCName, required contents: annotation?, selector, field+ snamesidsxsds annotationsselectorsfieldskey(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysKey÷s  sKeyRefcBsYtZdZddgZhde<de<de Ensure a match between two sets of values in an instance. parent: element attributes: id -- ID name -- NCName, required refer -- QName, required contents: annotation?, selector, field+ snamesrefersidsxsds annotationsselectorsfieldskeyref(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysKeyRef s  !sElementDeclarationc BstZdZdgZhde<de<de<de<de<dd<dd<d e<d d „<d d „ parents: schema attributes: id -- ID name -- NCName, required type -- QName default -- string fixed -- string nillable -- boolean, false abstract -- boolean, false substitutionGroup -- QName block -- ('#all' | ('substition' | 'extension' | 'restriction')*), schema.blockDefault final -- ('#all' | ('extension' | 'restriction')*), schema.finalDefault contents: annotation?, (simpleType,complexType)?, (key | keyref | unique)* snamesidstypesdefaultsfixedsnillableisabstractssubstitutionGroupsblockcCs|iƒiƒS(N(sselfs_parentsgetBlockDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys?ssfinalcCs|iƒiƒS(N(sselfs_parentsgetFinalDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys@ssxsds annotations simpleTypes complexTypeskeyskeyrefsuniqueselementcCs/ti||ƒt|_t|_f|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontents constraints(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Es  cCstSdS(s.Global elements are always qualified. N(sTrue(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isQualifiedKscCsôti||ƒ}|djp |tj o|Sn|itj otSn|}x’noŠ|iti }xA|i ƒD]3\}}|tijoqynt|dfƒSqyWt|tƒpt|dƒ oPn|iƒ}q\Wtd‚dS(s—return attribute. If attribute is type and it's None, and no simple or complex content, return the default type "xsd:anyType" stypeisanyTypes_parents"failed to locate the XSD namespaceN(sXMLSchemaComponents getAttributesselfs attributesvaluesNonescontentsparents attributessxmlnssnsdictsitemssksvsSCHEMAsXSD_LISTsTypeDescriptionComponents isinstancesWSDLToolsAdaptershasattrs_parents SchemaError(sselfs attributesparentsvaluesvsksnsdict((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getAttributePs& !cCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclarationkscCsG|oti||ƒSnti|dƒ}|o|Sn|iSdS(sIf attribute is None, "type" is assumed, return the corresponding representation of the global type definition (TypeDefinition), or the local definition if don't find "type". To maintain backwards compat, if attribute is provided call base class method. stypeN(s attributesXMLSchemaComponentsgetTypeDefinitionsselfsgtscontent(sselfs attributesgt((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinitionnscCs |iSdS(N(sselfs _constraints(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetConstraints{scCst|ƒ|_dS(N(stuples constraintssselfs _constraints(sselfs constraints((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pyssetConstraints}ss(tuple of key, keyref, unique constraintscCsç|i|ƒ|i|ƒ}g}xµ|D]­}t|iƒƒd}||i idjog|djo|i o#t |ƒ|_ |i i |ƒqÖ|djo|i o#t|ƒ|_|ii |ƒqÖ|djo|i o#t|ƒ|_|ii |ƒqÖ|djo(|it|ƒƒ|di |ƒqÖ|djo(|it|ƒƒ|di |ƒqÖ|d jo(|it|ƒƒ|di |ƒqÖtd |iƒ‚q)td |iƒ‚q)W||_dS( Nisxsds annotations simpleTypes complexTypeskeyiÿÿÿÿskeyrefsuniquesUnknown component (%s)(sselfs setAttributessnodes getContentsscontentss constraintssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomscontentsAnonymousSimpleTypesLocalComplexTypesappendsKeysKeyRefsUniques SchemaError(sselfsnodesis componentscontentss constraints((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDoms8    (s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__s isQualifieds getAttributesgetElementDeclarationsgetTypeDefinitionsgetConstraintsssetConstraintsspropertys constraintssfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysElementDeclarations  f !      sLocalElementDeclarationc Bs°tZdZdgZhde<de<dd„<de<dd<dd<d e<d e<d d <d d <dd„ parents: all, choice, sequence attributes: id -- ID name -- NCName, required form -- ('qualified' | 'unqualified'), schema.elementFormDefault type -- QName minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 default -- string fixed -- string nillable -- boolean, false block -- ('#all' | ('extension' | 'restriction')*), schema.blockDefault contents: annotation?, (simpleType,complexType)?, (key | keyref | unique)* snamesidsformcCst|ƒiƒS(N(s GetSchemasselfsgetElementFormDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys¸sstypes minOccurss1s maxOccurssdefaultsfixedsnillableisabstractsblockcCst|ƒiƒS(N(s GetSchemasselfsgetBlockDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysÀssxsds annotations simpleTypes complexTypeskeyskeyrefsuniquecCsV|idƒ}|djotSn|djotSntd||iƒf‚dS(s¯ Local elements can be qualified or unqualifed according to the attribute form, or the elementFormDefault. By default local elements are unqualified. sforms qualifieds unqualifiedsBad form (%s) for element: %sN(sselfs getAttributesformsTruesFalses SchemaErrors getItemTrace(sselfsform((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isQualifiedÄs  (s__name__s __module__s__doc__srequiredsNones attributesscontentss isQualified(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysLocalElementDeclaration¢s  o !sElementReferencecBswtZdZdgZhde<de<dd<dd parents: all, choice, sequence attributes: id -- ID ref -- QName, required minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation? srefsids minOccurss1s maxOccurssxsds annotationselementcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__èscCs/|oti||ƒSnti|dƒSdS(sïIf attribute is None, "ref" is assumed, return the corresponding representation of the global element declaration (ElementDeclaration), To maintain backwards compat, if attribute is provided call base class method. srefN(s attributesXMLSchemaComponentsgetElementDeclarationsself(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclarationìscCs³t|_|i|ƒx–|i|ƒD]…}t|iƒƒd}||i i djoR|djo|i o#t |ƒ|_|ii |ƒq«td|iƒ‚q&q&WdS(Nisxsds annotationsUnknown component (%s)(sNonesselfs annotations setAttributessnodes getContentssis SplitQNames getTagNames components __class__scontentss AnnotationsfromDoms SchemaError(sselfsnodesis component((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomõs  ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetElementDeclarationsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysElementReferenceÒs  *  sElementWildCardcBsŒtZdZgZhde<dd<dd<dd<dd parents: choice, sequence attributes: id -- ID minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 namespace -- '##any' | '##other' | (anyURI* | '##targetNamespace' | '##local'), ##any processContents -- 'lax' | 'skip' | 'strict', strict contents: annotation? sids minOccurss1s maxOccurss namespaces##anysprocessContentssstrictsxsds annotationsanycCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__scCst|ƒiƒSdS(s– Global elements are always qualified, but if processContents are not strict could have dynamically generated local elements. N(s GetSchemasselfsisElementFormDefaultQualified(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isQualifiedscCsti||ƒSdS(sreturn attribute. N(sXMLSchemaComponents getAttributesselfs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getAttribute$scCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinition)scCs³t|_|i|ƒx–|i|ƒD]…}t|iƒƒd}||i i djoR|djo|i o#t |ƒ|_|ii |ƒq«td|iƒ‚q&q&WdS(Nisxsds annotationsUnknown component (%s)(sNonesselfs annotations setAttributessnodes getContentssis SplitQNames getTagNames components __class__scontentss AnnotationsfromDoms SchemaError(sselfsnodesis component((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom,s  ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__s isQualifieds getAttributesgetTypeDefinitionsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysElementWildCards 3    sSequencec BshtZdZhde<dd<dd parents: complexType, extension, restriction, group, choice, sequence attributes: id -- ID minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation?, (element | group | choice | sequence | any)* sids minOccurss1s maxOccurssxsds annotationselementsgroupschoicessequencesanycCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Ps cCsÇ|i|ƒ|i|ƒ}g}x|D]‡}t|iƒƒd}||i idjoA|djo|i o&t |ƒ|_ |i i |ƒq)nï|djo>|idƒo|it|ƒƒqˆ|it|ƒƒn¤|djo|it|ƒƒn€|djo|it|ƒƒn\|djo|it|ƒƒn8|d jo|it|ƒƒntd |iƒ‚|d i |ƒq)td |iƒ‚q)Wt|ƒ|_dS( Nisxsds annotationselementsrefsgroupschoicessequencesanysUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomshasattrsappendsElementReferencesLocalElementDeclarationsModelGroupReferencesChoicesSequencesElementWildCards SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomUs6      ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysSequence<s !! sAllcBs\tZdZhde<dd<dd parents: complexType, extension, restriction, group attributes: id -- ID minOccurs -- '0' | '1', 1 maxOccurs -- '1', 1 contents: annotation?, element* sids minOccurss1s maxOccurssxsds annotationselementsallcCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__‰s cCs7|i|ƒ|i|ƒ}g}xÿ|D]÷}t|iƒƒd}||i idjo±|djo|i o&t |ƒ|_ |i i |ƒq)n_|djo>|idƒo|it|ƒƒqø|it|ƒƒntd|iƒ‚|di |ƒq)td|iƒ‚q)Wt|ƒ|_dS(Nisxsds annotationselementsrefsUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomshasattrsappendsElementReferencesLocalElementDeclarations SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomŽs&  ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAllvs ! sChoicec BshtZdZhde<dd<dd parents: complexType, extension, restriction, group, choice, sequence attributes: id -- ID minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation?, (element | group | choice | sequence | any)* sids minOccurss1s maxOccurssxsds annotationselementsgroupschoicessequencesanycCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__»s cCsÇ|i|ƒ|i|ƒ}g}x|D]‡}t|iƒƒd}||i idjoA|djo|i o&t |ƒ|_ |i i |ƒq)nï|djo>|idƒo|it|ƒƒqˆ|it|ƒƒn¤|djo|it|ƒƒn€|djo|it|ƒƒn\|djo|it|ƒƒn8|d jo|it|ƒƒntd |iƒ‚|d i |ƒq)td |iƒ‚q)Wt|ƒ|_dS( Nisxsds annotationselementsrefsgroupschoicessequencesanysUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomshasattrsappendsElementReferencesLocalElementDeclarationsModelGroupReferencesChoicesSequencesElementWildCards SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomÀs6      ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysChoice§s !! sModelGroupDefinitioncBsbtZdZdgZhde<de parents: redefine, schema attributes: id -- ID name -- NCName, required contents: annotation?, (all | choice | sequence)? snamesidsxsds annotationsallschoicessequencesgroupcCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ôs cCsW|i|ƒ|i|ƒ}x4|D],}t|iƒƒd}||i idjoæ|djo|i o&t |ƒ|_ |i i |ƒq#n•|djo|i ot|ƒ|_ nj|djo|i ot|ƒ|_ n?|djo|i ot|ƒ|_ ntd|iƒ‚|i i |ƒq#td|iƒ‚q#WdS(Nisxsds annotationsallschoicessequencesUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomscontentsAllsChoicesSequences SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomùs& ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysModelGroupDefinitionás   sModelGroupReferencecBsttZdZdgZhde<de<dd<dd parents: choice, complexType, extension, restriction, sequence attributes: id -- ID ref -- NCName, required minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation? srefsids minOccurss1s maxOccurssxsds annotationsgroupcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__( scCs|idƒSdS(Nsref(sselfs getModelGroup(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetModelGroupReference, scCsÃ|i|ƒ|i|ƒ}x |D]˜}t|iƒƒd}||i idjoR|djo|i o#t |ƒ|_ |i i |ƒq»t d|iƒ‚q#t d|iƒ‚q#WdS(Nisxsds annotationsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom/ s ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetModelGroupReferencesfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysModelGroupReference s  *  s ComplexTypecBs tZdZdgZhde<de<dd<dd<dd„<dd „ parents: redefine, schema attributes: id -- ID name -- NCName, required mixed -- boolean, false abstract -- boolean, false block -- ('#all' | ('extension' | 'restriction')*), schema.blockDefault final -- ('#all' | ('extension' | 'restriction')*), schema.finalDefault contents: annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute?)) snamesidsmixedisabstractsblockcCs|iƒiƒS(N(sselfs_parentsgetBlockDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysW ssfinalcCs|iƒiƒS(N(sselfs_parentsgetFinalDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysX ssxsds annotations simpleContentscomplexContentsgroupsallschoicessequences attributesattributeGroups anyAttributesanys complexTypecCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontents attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__^ s  cCsž|idƒ}|djp |tjotSnt|tƒtjo:|ddfjotSn|ddfjotSqntd||iƒf‚dS(Nsmixedisfalses0strues1s)invalid value for attribute mixed(%s): %s( sselfs getAttributesmsFalses isinstances basestringsTrues SchemaErrors getItemTrace(sselfsm((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisMixedd s cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContentq scCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclarationt scCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinitionw scCsý|i|ƒ|i|ƒ}d}t|ƒ}| odSnt||i ƒƒd}|djoKt |ƒ|_ |i i ||ƒ|d7}t||i ƒƒd}nt|_|djo-|ii|ƒ|_|ii ||ƒn|djo-|ii|ƒ|_|ii ||ƒnÍ|djot|ƒ|_na|djot|ƒ|_nA|djot|ƒ|_n!|d jot|ƒ|_n|io"|ii ||ƒ|d7}ng|_x||jot||i ƒƒd}|d joH||id ƒo|iit|ƒƒqÒ|iit|ƒƒnr|d jo|iit|ƒƒnK|d jo|iit|ƒƒn$td||i ƒ|iƒf‚|idi ||ƒ|d7}qåWdS(Niis annotations simpleContentscomplexContentsallschoicessequencesgroups attributesrefsattributeGroups anyAttributesUnknown component (%s): %siÿÿÿÿ( sselfs setAttributessnodes getContentsscontentssindxslensnums SplitQNames getTagNames components Annotations annotationsfromDomsNonescontents __class__s SimpleContentsComplexContentsAllsChoicesSequencesModelGroupReferences attr_contentshasattrsappendsAttributeReferencesLocalAttributeDeclarationsAttributeGroupReferencesAttributeWildCards SchemaErrors getItemTrace(sselfsnodes componentsindxsnumscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomz sZ                 #s _DerivedTypecBstZd„Zd„ZRS(NcCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations derivationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__² s  cCsD|i|ƒ|i|ƒ}x|D] }t|iƒƒd}||i idjo·|djo|i o&t |ƒ|_ |i i |ƒq#q |djo|i o|i i|ƒ|_ q |djo|i o|i i|ƒ|_ q td|iƒ‚ntd|iƒ‚|i i |ƒq#W|i |_dS(Nisxsds annotations restrictions extensionsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDoms derivations Restrictions Extensions SchemaErrorscontent(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom¹ s$ (s__name__s __module__s__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys _DerivedType± s sComplexContentcBs•tZdZhde<dd parents: complexType attributes: id -- ID mixed -- boolean, false contents: annotation?, (restriction | extension) sidsmixedisxsds annotations restrictions extensionscomplexContentcCsž|idƒ}|djp |tjotSnt|tƒtjo:|ddfjotSn|ddfjotSqntd||iƒf‚dS(Nsmixedisfalses0strues1s)invalid value for attribute mixed(%s): %s( sselfs getAttributesmsFalses isinstances basestringsTrues SchemaErrors getItemTrace(sselfsm((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisMixedà s s_DerivationBasec BsqtZdZdgZhde<de, parents: complexContent attributes: id -- ID base -- QName, required contents: annotation?, (group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute? sbasesidsxsds annotationsgroupsallschoicessequences attributesattributeGroups anyAttributecCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontents attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__þ s  cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContent scCs÷|i|ƒ|i|ƒ}d}t|ƒ}| odSnt||i ƒƒd}|djoKt |ƒ|_ |i i ||ƒ|d7}t||i ƒƒd}n|djo1t|ƒ|_|ii ||ƒ|d7}nÄ|djo1t|ƒ|_|ii ||ƒ|d7}n†|djo1t|ƒ|_|ii ||ƒ|d7}nH|djo1t|ƒ|_|ii ||ƒ|d7}n t|_g|_x6||jo(t||i ƒƒd}|djoH||id ƒo|iit|ƒƒqÌ|iit|ƒƒn”|d joH||id ƒo|iit|ƒƒqÌ|iit|ƒƒn?|d jo|iit|ƒƒntd ||i ƒ‚|id i ||ƒ|d7}q½WdS(Niis annotationsallschoicessequencesgroups attributesrefsattributeGroups anyAttributesUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentssindxslensnums SplitQNames getTagNames components Annotations annotationsfromDomsAllscontentsChoicesSequencesModelGroupReferencesNones attr_contentshasattrsappendsAttributeReferencesLocalAttributeDeclarationsAttributeGroupReferencesAttributeGroupDefinitionsAttributeWildCards SchemaError(sselfsnodes componentsindxsnumscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom s\              ( s__name__s __module__s__doc__srequiredsNones attributesscontentss__init__sgetAttributeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys_DerivationBaseì s  '  s ExtensioncBstZdZdZRS(s\ parents: complexContent attributes: id -- ID base -- QName, required contents: annotation?, (group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute? s extension(s__name__s __module__s__doc__stag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Extension> s s RestrictioncBstZdZdZRS(s^ parents: complexContent attributes: id -- ID base -- QName, required contents: annotation?, (group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute? s restriction(s__name__s __module__s__doc__stag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys RestrictionM s (s__name__s __module__s__doc__sNones attributesscontentsstagsisMixedsXMLSchemaComponents_DerivationBasesExtensionMarkers ExtensionsRestrictionMarkers Restriction(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysComplexContentÏ s  Rs SimpleContentcBsmtZdZhde parents: complexType attributes: id -- ID contents: annotation?, (restriction | extension) sidsxsds annotations restrictions extensions simpleContents ExtensioncBsktZdZdgZhde<de parents: simpleContent attributes: id -- ID base -- QName, required contents: annotation?, (attribute | attributeGroup)*, anyAttribute? sbasesidsxsds annotations attributesattributeGroups anyAttributes extensioncCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ s cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContent„ scCsÀ|i|ƒ|i|ƒ}d}t|ƒ}|ovt||i ƒƒd}|djoKt |ƒ|_ |i i ||ƒ|d7}t||i ƒƒd}q«ng}xù||joët||i ƒƒd}|djoB||idƒo|it|ƒƒq‰|it|ƒƒn`|djo|it|ƒƒn<|djo|it|ƒƒntd||i ƒ‚|d i ||ƒ|d7}q´Wt|ƒ|_dS( Niis annotations attributesrefsattributeGroups anyAttributesUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentssindxslensnums SplitQNames getTagNames components Annotations annotationsfromDomscontentshasattrsappendsAttributeReferencesLocalAttributeDeclarationsAttributeGroupReferencesAttributeWildCards SchemaErrorstuples attr_content(sselfsnodes componentsindxscontentsnumscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom‡ s6    "    ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetAttributeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Extensionl s    s RestrictioncBsutZdZdgZhde<de parents: simpleContent attributes: id -- ID base -- QName, required contents: annotation?, simpleType?, (enumeration | length | maxExclusive | maxInclusive | maxLength | minExclusive | minInclusive | minLength | pattern | fractionDigits | totalDigits | whiteSpace)*, (attribute | attributeGroup)*, anyAttribute? sbasesidsxsds annotations simpleTypes attributesattributeGroups anyAttributes restrictioncCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontents attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Á s  cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContentÇ scCsýg|_|i|ƒ|i|ƒ}d}t|ƒ}t ||i ƒƒd}|djoKt |ƒ|_ |i i||ƒ|d7}t ||i ƒƒd}ng}x8||jo*t ||i ƒƒd}|djoB||idƒo|it|ƒƒqÆ|it|ƒƒnŸ|djo|it|ƒƒn{|djo|it|ƒƒnW|djo2|iit|ƒƒ|id i||ƒntd ||i ƒ‚|d i||ƒ|d7}q²Wt|ƒ|_dS( Niis annotations attributesrefsattributeGroups anyAttributes simpleTypeiÿÿÿÿsUnknown component (%s)(sselfscontents setAttributessnodes getContentsscontentssindxslensnums SplitQNames getTagNames components Annotations annotationsfromDomshasattrsappendsAttributeReferencesLocalAttributeDeclarationsAttributeGroupReferencesAttributeWildCardsAnonymousSimpleTypes SchemaErrorstuples attr_content(sselfsnodes componentsindxscontentsnumscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomÊ s<          ( s__name__s __module__s__doc__srequiredsNones attributessRestrictionMarkersfacetsscontentsstags__init__sgetAttributeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Restrictionª s  %  ( s__name__s __module__s__doc__sNones attributesscontentsstagsXMLSchemaComponentsExtensionMarkers ExtensionsRestrictionMarkers Restriction(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys SimpleContent] s >(s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sisMixedsgetAttributeContentsgetElementDeclarationsgetTypeDefinitionsfromDomsXMLSchemaComponents _DerivedTypes ComplexMarkersComplexContents SimpleMarkers SimpleContent(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ComplexType@ s  B0     7ŽsLocalComplexTypecBs2tZdZgZhde<dd parents: element attributes: id -- ID mixed -- boolean, false contents: annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute?)) sidsmixedis complexType(s__name__s __module__s__doc__srequiredsNones attributesstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysLocalComplexTypeï s s SimpleTypecBsËtZdZdgZhde<de<dd„ parents: redefine, schema attributes: id -- ID name -- NCName, required final -- ('#all' | ('extension' | 'restriction' | 'list' | 'union')*), schema.finalDefault contents: annotation?, (restriction | list | union) snamesidsfinalcCs|iƒiƒS(N(sselfs_parentsgetFinalDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ssxsds annotations restrictionslistsunions simpleTypecCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ s cCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclaration scCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinition scCs|i|ƒ|i|ƒ}x\|D]P}t|iƒƒd}|djo&t |ƒ|_ |i i |ƒq#nPq#WdS|djo|i i |ƒ|_nZ|djo|i i|ƒ|_n4|djo|i i|ƒ|_ntd|‚|ii |ƒdS(Nis annotations restrictionslistsunionsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentsschilds SplitQNames getTagNames components Annotations annotationsfromDoms __class__s RestrictionscontentsListsUnions SchemaError(sselfsnodes componentschildscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom# s&      s RestrictioncBsxtZdZhde<de parents: simpleType attributes: id -- ID base -- QName, required or simpleType child contents: annotation?, simpleType?, (enumeration | length | maxExclusive | maxInclusive | maxLength | minExclusive | minInclusive | minLength | pattern | fractionDigits | totalDigits | whiteSpace)* sidsbasesxsds annotations simpleTypes restrictioncCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontentsfacets(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__M s  cCsti|dƒSdS(Nsbase(sXMLSchemaComponents getAttributesself(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeBaseS scCsti||ƒSdS(N(sXMLSchemaComponentsgetTypeDefinitionsselfs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinitionV scCs1x&|iD]}|iƒo|Sq q WtSdS(N(sselfscontentselsisSimplesNone(sselfsel((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetSimpleTypeContentY s   cCs=g|_|i|ƒ|i|ƒ}g}xütt|ƒƒD]è}t ||i ƒƒd}|djo| o*t |ƒ|_|ii||ƒq>q>|djo| p |djo,|it|ƒƒ|di||ƒq>|tijo|ii||ƒq>tdti ƒ‚q>Wt|ƒ|_dS(Nis annotations simpleTypeiÿÿÿÿsUnknown component (%s)(sselfsfacetss setAttributessnodes getContentsscontentsscontentsrangeslensindxs SplitQNames getTagNames components Annotations annotationsfromDomsappendsAnonymousSimpleTypesRestrictionMarkers SchemaErrorsistuple(sselfsnodes componentsindxscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom^ s$  "(s__name__s __module__s__doc__sNones attributessRestrictionMarkersfacetsscontentsstags__init__sgetAttributeBasesgetTypeDefinitionsgetSimpleTypeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Restriction9 s     sUnioncBsStZdZhde<de parents: simpleType attributes: id -- ID memberTypes -- list of QNames, required or simpleType child. contents: annotation?, simpleType* sids memberTypessxsds annotations simpleTypesunioncCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__… s cCsô|i|ƒ|i|ƒ}g}x¼tt|ƒƒD]¨}t ||i ƒƒd}|djo| o't |ƒ|_ |i i||ƒq5|djo,|it|ƒƒ|di||ƒq5tdti ƒ‚q5Wt|ƒ|_dS(Nis annotations simpleTypeiÿÿÿÿsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentsscontentsrangeslensindxs SplitQNames getTagNames components Annotations annotationsfromDomsappendsAnonymousSimpleTypes SchemaErrorsistuple(sselfsnodes componentsindxscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomŠ s  ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysUniont s  sListcBshtZdZhde<de parents: simpleType attributes: id -- ID itemType -- QName, required or simpleType child. contents: annotation?, simpleType? sidsitemTypesxsds annotations simpleTypeslistcCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__¬ s cCs|iidƒSdS(NsitemType(sselfs attributessget(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getItemType± scCs$ti||ƒ}|p|iSdS(sà return the type refered to by itemType attribute or the simpleType content. If returns None, then the type refered to by itemType is primitive. N(sXMLSchemaComponentsgetTypeDefinitionsselfs attributestpscontent(sselfs attributestp((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinition´ scCsít|_t|_|i|ƒ|i|ƒ}x¸tt |ƒƒD]¤}t ||i ƒƒd}|djo| o't|ƒ|_|ii||ƒqA|djo(t|ƒ|_|ii||ƒPqAtdti ƒ‚qAWdS(Nis annotations simpleTypesUnknown component (%s)(sNonesselfs annotationscontents setAttributessnodes getContentsscontentssrangeslensindxs SplitQNames getTagNames components AnnotationsfromDomsAnonymousSimpleTypes SchemaErrorsi(sselfsnodes componentsindxscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom½ s    ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__s getItemTypesgetTypeDefinitionsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysList› s    (s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetElementDeclarationsgetTypeDefinitionsfromDomsXMLSchemaComponentsRestrictionMarkers Restrictions UnionMarkersUnions ListMarkersList(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys SimpleType s  $    ;'sAnonymousSimpleTypecBs)tZdZgZhde parents: attribute, element, list, restriction, union attributes: id -- ID contents: annotation?, (restriction | list | union) sids simpleType(s__name__s __module__s__doc__srequiredsNones attributesstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAnonymousSimpleTypeÏ s sRedefinecBstZdZdZRS(sD parents: attributes: contents: sredefine(s__name__s __module__s__doc__stag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysRedefineà s isTypeDescriptionComponentcBs)tZdZd„Zd„Zd„ZRS(sMTuple of length 2, consisting of a namespace and unprefixed name. cCsxt|ƒdjotd|‚n=|didƒdjo"|dt|dƒdf}nti||ƒdSdS(sSargs -- (namespace, name) Remove the name's prefix, irrelevant. is)expecting tuple (namespace, name), got %sis:iN(slensargss TypeErrorsfinds SplitQNamestuples__init__sself(sselfsargs((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ø s"cCs |dSdS(Ni(sself(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTargetNamespace scCs |dSdS(Ni(sself(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetName s(s__name__s __module__s__doc__s__init__sgetTargetNamespacesgetName(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysTypeDescriptionComponentô s  (Tsidentstypessweakrefssysswarningss NamespacessSCHEMAsXMLNSsUtilitysDOMs DOMExceptions Collections SplitQNamesbasejoinsStringIOs threadingsRLocks ImportErrorsTYPESsATTRIBUTE_GROUPSs ATTRIBUTESsELEMENTSs MODEL_GROUPSs GetSchemas SchemaReaders Exceptions SchemaErrorsDOMAdapterInterfaces DOMAdaptersXMLBasesDefinitionMarkersDeclarationMarkersAttributeMarkersAttributeGroupMarkersWildCardMarkers ElementMarkersReferenceMarkersModelGroupMarkers AllMarkers ChoiceMarkersSequenceMarkersExtensionMarkersRestrictionMarkers SimpleMarkers ListMarkers UnionMarkers ComplexMarkers LocalMarkersMarkerInterfacesXMLSchemaComponentsWSDLToolsAdaptersNotations Annotations XMLSchemaFakes XMLSchemasAttributeDeclarationsLocalAttributeDeclarationsAttributeWildCardsAttributeReferencesAttributeGroupDefinitionsAttributeGroupReferencesIdentityConstrantssUniquesKeysKeyRefsElementDeclarationsLocalElementDeclarationsElementReferencesElementWildCardsSequencesAllsChoicesModelGroupDefinitionsModelGroupReferences ComplexTypesLocalComplexTypes SimpleTypesAnonymousSimpleTypesRedefines version_infostuples tupleClasss UserTuplesTypeDescriptionComponent(MsModelGroupReferences tupleClasss DOMExceptionsDOMAdapterInterfaces MODEL_GROUPSsDOMs ListMarkersbasejoinsAttributeWildCardsAttributeMarkersELEMENTSsMarkerInterfacesExtensionMarkers DOMAdaptersWSDLToolsAdapters AnnotationsModelGroupDefinitionsXMLSchemaComponents AllMarkersLocalAttributeDeclarationsNotations ElementMarkers SimpleMarkersChoices CollectionsAttributeReferences GetSchemasKeysATTRIBUTE_GROUPSsElementReferences XMLSchemaFakesXMLBases UnionMarkersRestrictionMarkersTYPESsSCHEMAsModelGroupMarkersXMLNSsUniquesElementDeclarationswarningssAttributeDeclarationsSequenceMarkersRedefinesRLockssyssDefinitionMarkersAttributeGroupDefinitionsTypeDescriptionComponentsLocalElementDeclarations XMLSchemas SimpleTypesDeclarationMarkersReferenceMarkerstypessAttributeGroupReferences SchemaReadersAllsidentsAnonymousSimpleTypesKeyRefsStringIOs LocalMarkersElementWildCardsSequences ComplexMarkersweakrefs SplitQNamesIdentityConstrantss ComplexTypes UserTuples ATTRIBUTESs SchemaErrors ChoiceMarkersLocalComplexTypesWildCardMarkersAttributeGroupMarker((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys?sš$%   l5Q;ÿ+"mÿÈ/1&,9-]ƒ00::1:0/ÿ°Í   PKN¤Y5 þþZSI/wstools/UserTuple.py""" A more or less complete user-defined wrapper around tuple objects. Adapted version of the standard library's UserList. Taken from Stefan Schwarzer's ftputil library, available at , and used under this license: Copyright (C) 1999, Stefan Schwarzer 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 above author nor the names of the contributors to the software 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 REGENTS 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. """ # $Id: UserTuple.py 277 2003-07-21 14:18:54Z warnes $ #XXX tuple instances (in Python 2.2) contain also: # __class__, __delattr__, __getattribute__, __hash__, __new__, # __reduce__, __setattr__, __str__ # What about these? class UserTuple: def __init__(self, inittuple=None): self.data = () if inittuple is not None: # XXX should this accept an arbitrary sequence? if type(inittuple) == type(self.data): self.data = inittuple elif isinstance(inittuple, UserTuple): # this results in # self.data is inittuple.data # but that's ok for tuples because they are # immutable. (Builtin tuples behave the same.) self.data = inittuple.data[:] else: # the same applies here; (t is tuple(t)) == 1 self.data = tuple(inittuple) def __repr__(self): return repr(self.data) def __lt__(self, other): return self.data < self.__cast(other) def __le__(self, other): return self.data <= self.__cast(other) def __eq__(self, other): return self.data == self.__cast(other) def __ne__(self, other): return self.data != self.__cast(other) def __gt__(self, other): return self.data > self.__cast(other) def __ge__(self, other): return self.data >= self.__cast(other) def __cast(self, other): if isinstance(other, UserTuple): return other.data else: return other def __cmp__(self, other): return cmp(self.data, self.__cast(other)) def __contains__(self, item): return item in self.data def __len__(self): return len(self.data) def __getitem__(self, i): return self.data[i] def __getslice__(self, i, j): i = max(i, 0); j = max(j, 0) return self.__class__(self.data[i:j]) def __add__(self, other): if isinstance(other, UserTuple): return self.__class__(self.data + other.data) elif isinstance(other, type(self.data)): return self.__class__(self.data + other) else: return self.__class__(self.data + tuple(other)) # dir( () ) contains no __radd__ (at least in Python 2.2) def __mul__(self, n): return self.__class__(self.data*n) __rmul__ = __mul__ PK†¨58%ûcCCZSI/wstools/WSDLTools.pyc;ò •@Ec@sÄdZdkZdklZdklZlZlZlZl Z l Z dk l Z l Z lZlZlZdklZlZlZdfd„ƒYZdfd „ƒYZd fd „ƒYZd efd „ƒYZde fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ d efd!„ƒYZ!d"efd#„ƒYZ"d$fd%„ƒYZ#d&fd'„ƒYZ$d(fd)„ƒYZ%d*fd+„ƒYZ&d,fd-„ƒYZ'd.fd/„ƒYZ(d0e(fd1„ƒYZ)d2fd3„ƒYZ*d4fd5„ƒYZ+d6fd7„ƒYZ,d8fd9„ƒYZ-d:fd;„ƒYZ.d<fd=„ƒYZ/d>fd?„ƒYZ0d@fdA„ƒYZ1dBfdC„ƒYZ2dDe3fdE„ƒYZ4dF„Z5dG„Z6dH„Z7dI„Z8dJ„Z9dK„Z:dL„Z;dM„Z<e=fƒdN„Z>e=fƒdO„Z?dPfdQ„ƒYZ@dRfdS„ƒYZAdTeAfdU„ƒYZBdV„ZCdS(Ws6$Id: WSDLTools.py 1122 2006-02-04 01:24:50Z boverhof $N(sStringIO(sOASISsXMLNSsWSAsWSA_LISTs WSRF_V1_2sWSRF(s Collections CollectionNSsDOMs ElementProxysbasejoin(s XMLSchemas SchemaReadersWSDLToolsAdapters WSDLReadercBs5tZdZed„Zd„Zd„Zd„ZRS(s;A WSDLReader creates WSDL instances from urls and xml data.cCsati|ƒ}tƒ}|o ||_n!t|dƒo|i|_n|i |ƒ|SdS(s3Return a WSDL instance loaded from a stream object.snameN( sDOMs loadDocumentsstreamsdocumentsWSDLswsdlsnameslocationshasattrsload(sselfsstreamsnameswsdlsdocument((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysloadFromStreams   cCs6ti|ƒ}tƒ}||_|i|ƒ|SdS(s1Return a WSDL instance loaded from the given url.N(sDOMs loadFromURLsurlsdocumentsWSDLswsdlslocationsload(sselfsurlsdocumentswsdl((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys loadFromURL%s    cCs|it|ƒƒSdS(s1Return a WSDL instance loaded from an xml string.N(sselfsloadFromStreamsStringIOsdata(sselfsdata((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysloadFromString-scCs8t|dƒ}z|i|ƒ}Wd|iƒX|SdS(s2Return a WSDL instance loaded from the given file.srbN(sopensfilenamesfilesselfsloadFromStreamswsdlsclose(sselfsfilenameswsdlsfile((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys loadFromFile1s (s__name__s __module__s__doc__sNonesloadFromStreams loadFromURLsloadFromStrings loadFromFile(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys WSDLReaders   sWSDLcBstZdZedd„Zd„ZdZded„Zded„Zded„Z ded „Z d „Z d „Z d „Z ed „ZRS(s¥A WSDL object models a WSDL service description. WSDL objects may be created manually or loaded from an xml representation using a WSDLReader instance.icCs¤|pd|_d|_t|_t|_t|_t|ƒ|_t|ƒ|_ t|ƒ|_ t|ƒ|_ t |ƒ|_ t|ƒ|_g|_||_dS(Nsurn:this-document.wsdls(stargetNamespacesselfs documentationsNoneslocationsdocumentsnames CollectionNSsservicessmessagess portTypessbindingss CollectionsimportssTypesstypess extensionssstrict(sselfstargetNamespacesstrict((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__?s     cCs%|itj o|iiƒndS(N(sselfsdocumentsNonesunlink(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__del__Nss1.1scCs_|ii|ƒotd|ƒ‚nt||ƒ}|o ||_n||i|<|SdS(NsDuplicate service element: %s( sselfsservicesshas_keysnames WSDLErrorsServices documentationsitemstargetNamespace(sselfsnames documentationstargetNamespacesitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addServiceTs  cCs_|ii|ƒotd|ƒ‚nt||ƒ}|o ||_n||i|<|SdS(NsDuplicate message element: %s.( sselfsmessagesshas_keysnames WSDLErrorsMessages documentationsitemstargetNamespace(sselfsnames documentationstargetNamespacesitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addMessage_s  cCs[|ii|ƒotdƒ‚nt||ƒ}|o ||_n||i|<|SdS(Ns Duplicate portType element: name( sselfs portTypesshas_keysnames WSDLErrorsPortTypes documentationsitemstargetNamespace(sselfsnames documentationstargetNamespacesitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addPortTypejs  cCsb|ii|ƒotd|ƒ‚nt|||ƒ}|o ||_ n||i|<|SdS(NsDuplicate binding element: %s( sselfsbindingsshas_keysnames WSDLErrorsBindingstypes documentationsitemstargetNamespace(sselfsnamestypes documentationstargetNamespacesitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addBindingus  cCs$t||ƒ}||i|<|SdS(N(s ImportElements namespaceslocationsitemsselfsimports(sselfs namespaceslocationsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addImport€s cCskti|iƒ}ti|dƒ|_ti|itƒ}|i td|i ƒ|i t i d|ƒ|i t i ddƒ|i t i ddƒ|i t i d|i ƒ|io|i td |iƒnx|iD]}|iƒqÛWx|iD]}|iƒqùWx|iD]}|iƒqWx|iD]}|iƒq5Wx|iD]}|iƒqSWd S( s  Generate a DOM representation of the WSDL instance. Not dealing with generating XML Schema, thus the targetNamespace of all XML Schema elements or types used by WSDL message parts needs to be specified via import information items. swsdl:definitionsstargetNamespaces xmlns:wsdls xmlns:xsds http://www.w3.org/1999/XMLSchemas xmlns:soaps%http://schemas.xmlsoap.org/wsdl/soap/s xmlns:tnssnameN(sDOMs GetWSDLUrisselfsversions namespaceURIscreateDocumentsdocuments getElementsNoneschildssetAttributeNSstargetNamespacesXMLNSsBASEsnamesimportssitemstoDomsmessagess portTypessbindingssservices(sselfs namespaceURIsitemschild((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom…s4      cCs)||_ti|dttƒ}|tjotdƒ‚nti|iƒ|_ ti |i ƒ}ti |dttƒ|_ ti |dttƒ|_t|ƒ|_g}|i}t}x®|o¦t}x“ti|d|ƒD]|}ti |dƒ} |tj ot|| ƒ} n| |jo*t}|i|||ƒ|i| ƒqå|i|ƒqåWt}qÂWx²ti|ttƒD]›}ti |dƒ}|i}ti|i|ƒ o{|djoWti |dƒ}t d|i!|iƒ} | i#t$|ƒ|ƒ}|i&i'|ƒq†|i(i|ƒq†q†|d jo\ti |dƒ}t|ƒ}|i*|||ƒ}ti|d |ƒ} |i-| ƒq†q†|d joGti |dƒ}t|ƒ}|i.|||ƒ}|i-|ƒq†q†|d joºti |dƒ}ti |d dtƒ}|tjotd|ƒ‚nt1||ƒ}t|ƒ}|i2||||ƒ}ti|d|ƒ}|i-|ƒ|i5t6|ƒƒq†q†|djooti |dƒ}t|ƒ}|i7|||ƒ}ti|d|ƒ} |i-| ƒ|i5t6|ƒƒq†q†|djoÛt|ƒ|i&_ti |dƒ}|o|i:dƒn|p|i}t d|ƒ} xvti|ttƒD]_} | idjo9| i#t$|ƒ| ƒ}|i<|ƒ|i&i'|ƒq·|i&i=| ƒq·Wq†q†q†WdS(Ns definitionssMissing element.stargetNamespacesnamesimportslocationsschemasbase_urlsmessagespartsportTypesbindingstypesdefaults&Missing type attribute for binding %s.s operationsservicesportstypess base-location(>sdocumentsselfsDOMs getElementsNones definitionss WSDLErrorsWSDLUriToVersions namespaceURIsversions GetWSDLUrisNS_WSDLsgetAttrstargetNamespacesnamesGetDocumentations documentationsimportedslocations base_locationsTruesdo_itsFalses getElementsselementsbasejoins_importsappends removeChilds localNames nsUriMatchstnss SchemaReadersimportssreaders loadFromNodesWSDLToolsAdaptersschemastypess addSchemas extensionssdocss addMessagesmessagespartssloads addPortTypesptypestypes ParseQNames addBindingsbindings operationssload_exs GetExtensionss addServicesservicesportssremoveAttributesitems setBaseUrls addExtension(sselfsdocuments operationssbindingsptypesmessagestargetNamespacesimportedsservicesitemsportsspartsslocationsreaders localNamesschemasdocssnamestnsstypes base_locationselementsdo_its definitionssNS_WSDL((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysload©s°                          cCs²ti|ddtƒ} ti|ddtƒ} | tjp | tjotdƒ‚n|o&t|| ƒ} |i td| ƒn|i | | ƒ}d|_ ti| ƒ}zë| idƒdjo)| idƒd}ti||ƒ}n |i}|tjotd| ƒ‚nti|ƒ}|| jod Sn|id jo |i}n |g}|i} | i|ƒx|D]} | i| i joq„nti!|| dƒ}| i$|ƒ|i%d | ƒ|i&} xL| i(ƒD]>}|d ti*jo$| |i+dƒ}|i-|ƒqìqìW|id jo5|i.tdƒ}t| |ƒ}|i%d|ƒq„|idjo|i%d| ƒq„q„WWd |i1ƒX| Sd S(sŠAlgo take element's children, clone them, and add them to the main document. Support for relative locations is a bit complicated. The orig document context is lost, so we need to store base location in DOM elements representing , by creating a special temporary "base-location" attribute, and , by resolving the relative "location" and storing it as "location". document -- document we are loading element -- DOM Element representing base_location -- location of document from which this was gleaned. s namespacesdefaultslocations7Invalid import element (missing namespace or location).is#iÿÿÿÿs'Import target element not found for: %sNs definitionsstargetNamespaceisimportstypess base-location(2sDOMsgetAttrselementsNones namespaceslocations WSDLErrors base_locationsbasejoinssetAttributeNSsselfs addImportsobimports_loadeds loadFromURLs importdocsfindssplitsidrefsgetElementByIdsimportedsdocumentElements findTargetNSs imported_tnss localNames childNodessimported_nodess parentNodesparents removeChildsnodesnodeTypes ELEMENT_NODEs importNodesdocumentschilds appendChilds setAttributes_attrsNSsattrsNSskeyssattrkeysNS_XMLNSs cloneNodesattrssetAttributeNodesgetAttributeNSs rlocations alocationsunlink(sselfsdocumentselements base_locationsimported_nodess alocations rlocationsimporteds importdocs namespacesattrsNSslocationsnodesparentsattrkeysobimportschildsidrefsattrs imported_tns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys_import)s`             (s__name__s __module__s__doc__sNones__init__s__del__sversions addServices addMessages addPortTypes addBindings addImportstoDomsloads_import(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysWSDL:s       $ €sElementcBs/tZdZedd„Zd„Zd„ZRS(s@A class that provides common functions for WSDL element classes.scCs||_||_g|_dS(N(snamesselfs documentations extensions(sselfsnames documentation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__vs  cCs&ti|ƒ|_|ii|ƒdS(N(sweakrefsrefsselfsitemsparents extensionssappend(sselfsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addExtension{scCsP|}x?no7t|tƒo|Sny|iƒ}Wq Pq XqWtSdS(s;Return the WSDL object that contains this information item.iN(sselfsparents isinstancesWSDLsNone(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDLs (s__name__s __module__s__doc__sNones__init__s addExtensionsgetWSDL(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysElementts  s ImportElementcBs tZd„Zd„ZeZRS(NcCs||_||_dS(N(s namespacesselfslocation(sselfs namespaceslocation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__s cCsx|iƒ}ttti|itƒƒ}|i ti |i ƒdƒ}|i td|iƒ|i td|iƒdS(Nsimports namespaceslocation(sselfsgetWSDLswsdls ElementProxysNonesDOMs getElementsdocumentsepscreateAppendElements GetWSDLUrisversionsepcssetAttributeNSs namespaceslocation(sselfsepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom•s  (s__name__s __module__s__init__stoDomsNones_loaded(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys ImportElementŒs  sTypescBs,tZd„Zd„Zd„Zd„ZRS(NcCs|iS(N(skstargetNamespace(sselfsk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys scCs&ti||ƒd|_g|_dS(Ns(s Collections__init__sselfsparents documentations extensions(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__¡s cCs|i}|||<|SdS(N(sschemastargetNamespacesnamesself(sselfsschemasname((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addSchema¦s  cCs|ii|ƒdS(N(sselfs extensionssappendsitem(sselfsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addExtension«s(s__name__s __module__sdefaults__init__s addSchemas addExtension(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysTypesŸs   sMessagecBs5tZdd„Zeed„Zd„Zd„ZRS(NscCs&ti|||ƒt|ƒ|_dS(N(sElements__init__sselfsnames documentations Collectionsparts(sselfsnames documentation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__°scCsˆ|ii|ƒotd|ƒ‚n|tjo |tjotd|ƒ‚nt|ƒ}||_||_||i|<|SdS(Ns"Duplicate message part element: %ss.Missing type or element attribute for part: %s( sselfspartsshas_keysnames WSDLErrorstypesNoneselements MessagePartsitem(sselfsnamestypeselementsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddPart´s    cCsäxÝ|D]Õ}ti|dƒ}t|ƒ}||i|scCs|iƒiƒSdS(s4Return the Service object associated with this port.N(sselfsparent(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getServiceEscCs$|iƒiƒ}|i|iSdS(s:Return the Binding object that is referenced by this port.N(sselfs getServicesgetWSDLswsdlsbindingssbinding(sselfswsdl((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getBindingIscCs4|iƒiƒ}|i|i}|i|iSdS(s;Return the PortType object that is referenced by this port.N(sselfs getServicesgetWSDLswsdlsbindingssbindings portTypesstype(sselfsbindingswsdl((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getPortTypeNscCsLx9|iD].}t|tƒp t|tƒo|Sq q Wtdƒ‚dS(siA convenience method to obtain the extension element used as the address binding for the port.s!No address binding found in port.N(sselfs extensionssitems isinstancesSoapAddressBindingsHttpAddressBindings WSDLError(sselfsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetAddressBindingTs    cCsäxÝ|D]Õ}|i|if\}}|tijo |djo8ti|ddt ƒ}t |ƒ}|i|ƒqq|tijo |djo8ti|ddt ƒ}t|ƒ}|i|ƒqq|i|ƒqWdS(Nsaddressslocationsdefault(selementsses namespaceURIs localNamesnssnamesDOMsNS_SOAP_BINDING_ALLsgetAttrsNoneslocationsSoapAddressBindingsobsselfs addExtensionsNS_HTTP_BINDING_ALLsHttpAddressBinding(sselfselementssesnamesobslocationsns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysload_ex_s    c Cs»|iƒ}tt|ƒ}|iti |i ƒdƒ}|i td|i ƒ|i\}}|i|ƒ}|i tdd||fƒ|iƒ}x|iD]}|i|ƒq WdS(Nsportsnamesbindings%s:%s(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMs GetWSDLUrisversionsepcssetAttributeNSsnamesbindingsnss getPrefixsprefixs_getNodes extensionssextstoDom( sselfsnodesnamesextsepcsprefixswsdlsnssep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDomos   ( s__name__s __module__s__init__s getServices getBindings getPortTypesgetAddressBindingsload_exstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysPort=s     s SoapBindingcBs&tZdd„Zd„Zd„ZRS(NsrpccCs||_||_dS(N(s transportsselfsstyle(sselfs transportsstyle((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__s cCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDLƒscCs…|iƒ}tt|ƒ}|iti |i ƒdƒ}|i o|i td|i ƒn|io|i td|iƒndS(Nsbindings transportsstyle(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcs transportssetAttributeNSsstyle(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom†s   (s__name__s __module__s__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys SoapBinding~s  sSoapAddressBindingcBs#tZd„Zd„Zd„ZRS(NcCs ||_dS(N(slocationsself(sselfslocation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__scCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDL“scCsS|iƒ}tt|ƒ}|iti |i ƒdƒ}|i td|i ƒdS(Nsaddressslocation(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcssetAttributeNSslocation(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom–s (s__name__s __module__s__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapAddressBindings  sSoapOperationBindingcBs)tZeed„Zd„Zd„ZRS(NcCs||_||_dS(N(s soapActionsselfsstyle(sselfs soapActionsstyle((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__žs cCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDL¢scCs…|iƒ}tt|ƒ}|iti |i ƒdƒ}|i o|i td|i ƒn|io|i td|iƒndS(Ns operations soapActionsstyle(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcs soapActionssetAttributeNSsstyle(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom¥s   (s__name__s __module__sNones__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapOperationBindings sSoapBodyBindingcBs,tZeeed„Zd„Zd„ZRS(NcCs…|ddfj otd|ƒ‚n||_||_t|ƒtdƒtdƒfjo|iƒ}n||_||_dS(NsliteralsencodedsInvalid use attribute value: %ssu(suses WSDLErrors encodingStylesselfs namespacestypespartsssplit(sselfsuses namespaces encodingStylesparts((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__°s  % cCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDL¼scCsi|iƒ}tt|ƒ}|iti |i ƒdƒ}|i td|i ƒ|i td|iƒdS(Nsbodysuses namespace(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcssetAttributeNSsuses namespace(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom¿s  (s__name__s __module__sNones__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapBodyBinding¯s sSoapFaultBindingcBs)tZeed„Zd„Zd„ZRS(NcCsP|ddfj otd|ƒ‚n||_||_||_||_dS(NsliteralsencodedsInvalid use attribute value: %s(suses WSDLErrors encodingStylesselfs namespacesname(sselfsnamesuses namespaces encodingStyle((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__Ès    cCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDLÒscCs½|iƒ}tt|ƒ}|iti |i ƒdƒ}|i td|i ƒ|i td|iƒ|itj o|i td|iƒn|itj o|i td|iƒndS(Nsbodysusesnames namespaces encodingStyle(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcssetAttributeNSsusesnames namespaces encodingStyle(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDomÕs (s__name__s __module__sNones__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapFaultBindingÇs sSoapHeaderBindingcBstZeed„ZdZRS(NcCsY|ddfj otd|ƒ‚n||_||_||_||_||_dS(NsliteralsencodedsInvalid use attribute value: %s(suses WSDLErrors encodingStylesselfs namespacesmessagespart(sselfsmessagespartsuses namespaces encodingStyle((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__âs    sheader(s__name__s __module__sNones__init__stagname(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapHeaderBindingás sSoapHeaderFaultBindingcBstZdZRS(Ns headerfault(s__name__s __module__stagname(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapHeaderFaultBindingïss HttpBindingcBstZd„ZRS(NcCs ||_dS(N(sverbsself(sselfsverb((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ôs(s__name__s __module__s__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys HttpBindingóssHttpAddressBindingcBstZd„ZRS(NcCs ||_dS(N(slocationsself(sselfslocation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__øs(s__name__s __module__s__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysHttpAddressBinding÷ssHttpOperationBindingcBstZd„ZRS(NcCs ||_dS(N(slocationsself(sselfslocation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ýs(s__name__s __module__s__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysHttpOperationBindingüssHttpUrlReplacementBindingcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysHttpUrlReplacementBindingssHttpUrlEncodedBindingcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysHttpUrlEncodedBindingssMimeContentBindingcBstZeed„ZRS(NcCs||_||_dS(N(spartsselfstype(sselfspartstype((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ s (s__name__s __module__sNones__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysMimeContentBindingssMimeXmlBindingcBstZed„ZRS(NcCs ||_dS(N(spartsself(sselfspart((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__s(s__name__s __module__sNones__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysMimeXmlBindingssMimeMultipartRelatedBindingcBstZd„Zd„ZRS(NcCs g|_dS(N(sselfsparts(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__scCsdx]|D]U}|i|if\}}|tijo |djo|i i t ƒƒqqqWdS(Nspart( selementsses namespaceURIs localNamesnssnamesDOMsNS_MIME_BINDING_ALLsselfspartssappendsMimePartBinding(sselfselementssesnamesns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysload_exs (s__name__s __module__s__init__sload_ex(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysMimeMultipartRelatedBindings sMimePartBindingcBstZd„Zd„ZRS(NcCs g|_dS(N(sselfsitems(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ sc Cs¾x·|D]¯}|i|if\} }| tijo |djoVti|ddt ƒ} ti|ddt ƒ} t | | ƒ}|ii|ƒqq| tijo |djo;ti|ddt ƒ} t| ƒ}|ii|ƒqq| tijo |djo©ti|ddt ƒ}ti|ddt ƒ}ti|d dt ƒ}ti|d dt ƒ}|t jotd ƒ‚nt||||ƒ}|ii|ƒqqqWdS( NscontentspartsdefaultstypesmimeXmlsbodys encodingStyles namespacespartssuses"Invalid soap:body binding element.(selementsses namespaceURIs localNamesnssnamesDOMsNS_MIME_BINDING_ALLsgetAttrsNonespartstypesMimeContentBindingsobsselfsitemssappendsMimeXmlBindingsNS_SOAP_BINDING_ALLsencstyles namespacespartssuses WSDLErrorsSoapBodyBinding( sselfselementssesnamesuses namespacesobsencstylespartsspartsnsstype((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysload_ex#s0  (s__name__s __module__s__init__sload_ex(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysMimePartBindings s WSDLErrorcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys WSDLErrorAscCs,|i|ƒodSn|i||ƒdS(N(swriters hasNSPrefixsnsurisdeclareNSPrefixsprefix(swritersprefixsnsuri((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysDeclareNSPrefixFscCsd|iddƒ}t|ƒdjoti|ƒ|fSnti|d|ƒ}||dfSdS(Ns:ii( svaluessplitspartsslensDOMs findTargetNSselementsfindNamespaceURIsnsuri(svalueselementspartssnsuri((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys ParseTypeRefKs cCsp|iddƒ}t|ƒdjo$ti|d|ƒ}|d}nti |ƒ}|d}||fSdS(Ns:iiiiÿÿÿÿ( svaluessplitsnamerefslensDOMsfindNamespaceURIselementsnsurisnames findTargetNS(svalueselementsnamerefsnamesnsuri((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys ParseQNameRs cCs>ti|dttƒ}|tj oti|ƒSndSdS(Ns documentations(sDOMs getElementselementsNonesdocnodesgetElementText(selementsdocnode((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysGetDocumentation\s cCsOgi}ti|ttƒD]'}|itijo||ƒqq~SdS(N( sappends_[1]sDOMs getElementsselementsNonesitems namespaceURIsNS_WSDL(selements_[1]sitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys GetExtensionsbscCs0|i|i}|tj o|SntiSdS(sUFind wsa:Action attribute, and return value or WSA.FAULT for the default. N(s operationsfaultssnamesactionsattrsNonesWSAsFAULT(s operationsnamesattr((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysGetWSAActionFaultfs  cCs¡|ii}|tj o|Sn|iƒ}|iƒ}|i }|ii }| o|i d}n|i dƒod|||fSnd|||fSdS(s;Find wsa:Action attribute, and return value or the default.sRequests/s%s%s/%ss%s/%s/%sN( s operationsinputsactionsattrsNones getPortTypesportTypesgetTargetNamespacestargetNamespacesnamesptNamesmsgNamesendswith(s operationsattrsmsgNamesptNamesportTypestargetNamespace((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysGetWSAActionInputos      cCs¡|ii}|tj o|Sn|iƒiƒ}|iƒi}|ii}| o|id}n|i dƒod|||fSnd|||fSdS(s;Find wsa:Action attribute, and return value or the default.sResponses/s%s%s/%ss%s/%s/%sN( s operationsoutputsactionsattrsNones getPortTypesgetTargetNamespacestargetNamespacesnamesptNamesmsgNamesendswith(s operationsattrsmsgNamesptNamestargetNamespace((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysGetWSAActionOutput~s   cCsÈt||ƒoxg}|\}}gi}|i D]J}t |dƒo#t i ||iƒo |i|jo||ƒq3q3~Sngi}|i D]$}t||ƒo||ƒq™q™~SdS(NsnodeType(s isinstanceskindst_typesresults namespaceURIsnamesappends_[1]sobjects extensionssitemshasattrsDOMs nsUriMatch(sobjectskindst_typesnamesitems_[1]s namespaceURIsresult((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysFindExtensionsŒs  fcCs¦t||ƒob|\}}x|iD]D}t|dƒo#t i ||iƒo |i|jo|Sq&q&Wn-x)|iD]}t||ƒo|Sq|q|Wt SdS(NsnodeType( s isinstanceskindst_types namespaceURIsnamesobjects extensionssitemshasattrsDOMs nsUriMatchsNone(sobjectskindst_typesnamesitems namespaceURI((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys FindExtension–s  6  s SOAPCallInfocBsÂtZdZd„ZeiZdZeZ eZ eZ eZ dZ dZedd„Zedd„Zedd„Zddd „Zddd „Zd „Zd „Zd „Zd„Zd„ZRS(s£SOAPCallInfo captures the important binding information about a SOAP operation, in a structure that is easier to work with than raw WSDL structures.cCs:||_g|_g|_g|_g|_t|_dS(N(s methodNamesselfs inheaderss outheaderssinparamss outparamssNonesretval(sselfs methodName((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ªs      ssencodedsrpcicCs-t||||ƒ}|ii|ƒ|SdS(s4Add an input parameter description to the call info.N( s ParameterInfosnamestypes namespaces element_types parametersselfsinparamssappend(sselfsnamestypes namespaces element_types parameter((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddInParameter»scCs-t||||ƒ}|ii|ƒ|SdS(s5Add an output parameter description to the call info.N( s ParameterInfosnamestypes namespaces element_types parametersselfs outparamssappend(sselfsnamestypes namespaces element_types parameter((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddOutParameterÁscCs&t||||ƒ}||_|SdS(s7Set the return parameter description for the call info.N(s ParameterInfosnamestypes namespaces element_types parametersselfsretval(sselfsnamestypes namespaces element_types parameter((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pyssetReturnParameterÇs cCsAt||||ƒ}|o d|_n|ii |ƒ|SdS(s6Add an input SOAP header description to the call info.iN( s HeaderInfosnamestypes namespaces element_types headerinfosmustUnderstandsselfs inheaderssappend(sselfsnamestypes namespaces element_typesmustUnderstands headerinfo((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddInHeaderInfoÍs  cCsAt||||ƒ}|o d|_n|ii |ƒ|SdS(s7Add an output SOAP header description to the call info.iN( s HeaderInfosnamestypes namespaces element_types headerinfosmustUnderstandsselfs outheaderssappend(sselfsnamestypes namespaces element_typesmustUnderstands headerinfo((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddOutHeaderInfoÖs  cCs |iSdS(s5Return a sequence of the in parameters of the method.N(sselfsinparams(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetInParametersßscCs |iSdS(s6Return a sequence of the out parameters of the method.N(sselfs outparams(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetOutParametersãscCs |iSdS(s7Return param info about the return value of the method.N(sselfsretval(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetReturnParameterçscCs |iSdS(s2Return a sequence of the in headers of the method.N(sselfs inheaders(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getInHeadersëscCs |iSdS(s3Return a sequence of the out headers of the method.N(sselfs outheaders(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getOutHeadersïs(s__name__s __module__s__doc__s__init__sDOMs NS_SOAP_ENCs encodingStyles documentationsNones soapActions transports namespaceslocationsusesstylesaddInParametersaddOutParameterssetReturnParametersaddInHeaderInfosaddOutHeaderInfosgetInParameterssgetOutParameterssgetReturnParameters getInHeaderss getOutHeaders(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys SOAPCallInfo¥s(        s ParameterInfocBs/tZdZedd„ZdZeZeZRS(s>A ParameterInfo object captures parameter binding information.icCsD|o d|_n|tj o ||_n||_||_dS(Ni(s element_typesselfs namespacesNonesnamestype(sselfsnamestypes namespaces element_type((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ös     (s__name__s __module__s__doc__sNones__init__s element_types namespacesdefault(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys ParameterInfoôs s HeaderInfocBs&tZdZed„ZdZeZRS(s=A HeaderInfo object captures SOAP header binding information.cCsti|||||ƒdS(N(s ParameterInfos__init__sselfsnamestypes namespaces element_type(sselfsnamestypes namespaces element_type((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__si(s__name__s __module__s__doc__sNones__init__smustUnderstandsactor(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys HeaderInfos  cCs|iƒiƒ}|iƒ}|iƒ} | i|}|i|}|i }t |ƒ}|iƒ}t|tƒ o td‚n|i|_|itƒ}|tjo td‚n|i|_|ipd|_|itƒ}|tj o&|i|_|ip|i|_n|i} |itj o¨||ii }|i} | it"ƒ}|tj o td‚qÚxy| i$t%ƒD]h}||i i'|i(}|i)|i |i*p|i+|i,d|i*odpdƒ}|i.|_.q„W| it/ƒ} | tjo td‚n| i.|_.| i,|_,| i1|_1| i'tj o2g} x8| i'D]}| i2|i'|ƒq]Wn|i'i3ƒ} xI| D]=}|i4|i |i*p|i+d|i*odpdƒq•Wn|i5tj o"y||i5i }Wnht6j o\t7i8ot9d |i5i ƒ‚qi|i:|i5i ƒ}d Gd Gd GHd G|i5i GHnX|i5} | it"ƒ}|tj o td‚q xy| i$t%ƒD]h}||i i'|i(}|i;|i |i*p|i+|i,d|i*odpdƒ}|i.|_.q«W| it/ƒ} | tjo td‚n| i.|_.| i,|_,| i1|_1| i'tj o2g} x8| i'D]}| i2|i'|ƒq„Wn|i'i3ƒ} | oLxI| D]=}|i<|i |i*p|i+d|i*odpdƒqÃWq n|SdS(s;Return a SOAPCallInfo given a WSDL port and operation name.sUnsupported binding type.sMissing soap:binding element.sdocuments Mime bindings are not supported.s element_typeiisMissing soap:body binding.s3Recieved message not defined in the WSDL schema: %ssWarning:s0Recieved message not defined in the WSDL schema.s Adding it.sMessage:N(=sports getServicesgetWSDLswsdls getBindingsbindings getPortTypesportTypes operationssnames operations opbindingsmessagess SOAPCallInfoscallinfosgetAddressBindings addrbindings isinstancesSoapAddressBindings ValueErrorslocations findBindings SoapBindings soapbindingsNones transportsstylesSoapOperationBindingssoap_op_bindings soapActionsparameterOrdersinputsmessagesmsgrolesMimeMultipartRelatedBindingsmimes findBindingssSoapHeaderBindingsitemspartsspartsaddInHeaderInfoselementstypes namespacesheaders encodingStylesSoapBodyBindingsbodysusesappendsvaluessaddInParametersoutputsKeyErrorsselfsstricts RuntimeErrors addMessagesaddOutHeaderInfosaddOutParameter(sportsnamessoap_op_bindingsbindingsheaders operationscallinfosmessages opbindingspartssparameterOrdersmsgrolesportTypesbodyspartsmimeswsdls addrbindingsmessagessitems soapbinding((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pyscallInfoFromWSDL sº                          #             '(Dsidentsweakrefs cStringIOsStringIOs NamespacessOASISsXMLNSsWSAsWSA_LISTs WSRF_V1_2sWSRFsUtilitys Collections CollectionNSsDOMs ElementProxysbasejoins XMLSchemas SchemaReadersWSDLToolsAdapters WSDLReadersWSDLsElements ImportElementsTypessMessages MessagePartsPortTypes Operations MessageRolesBindingsOperationBindingsMessageRoleBindingsServicesPorts SoapBindingsSoapAddressBindingsSoapOperationBindingsSoapBodyBindingsSoapFaultBindingsSoapHeaderBindingsSoapHeaderFaultBindings HttpBindingsHttpAddressBindingsHttpOperationBindingsHttpUrlReplacementBindingsHttpUrlEncodedBindingsMimeContentBindingsMimeXmlBindingsMimeMultipartRelatedBindingsMimePartBindings Exceptions WSDLErrorsDeclareNSPrefixs ParseTypeRefs ParseQNamesGetDocumentations GetExtensionssGetWSAActionFaultsGetWSAActionInputsGetWSAActionOutputstypesFindExtensionss FindExtensions SOAPCallInfos ParameterInfos HeaderInfoscallInfoFromWSDL(?sWSAs HttpBindingsMimeXmlBindingsServicesDOMs ImportElementsbasejoinsHttpUrlEncodedBindings HeaderInfos SOAPCallInfosGetWSAActionOutputs MessageParts ParseTypeRefsWSDLToolsAdaptersOperationBindingsFindExtensionss MessageRolesSoapFaultBindingsWSA_LISTs Collections GetExtensionssOASISs FindExtensions SoapBindings CollectionNSsMimeMultipartRelatedBindingsTypessSoapHeaderFaultBindings WSRF_V1_2sXMLNSsMimeContentBindingsGetDocumentationsSoapOperationBindingsHttpAddressBindings WSDLErrorsElementsGetWSAActionFaults ElementProxysGetWSAActionInputs XMLSchemasPortTypesWSDLs Operations SchemaReaderscallInfoFromWSDLsidents ParameterInfosMessageRoleBindingsStringIOsSoapAddressBindingsSoapBodyBindingsBindingsHttpUrlReplacementBindingsDeclareNSPrefixsPortsweakrefs ParseQNamesWSRFsMimePartBindingsMessagesSoapHeaderBindings WSDLReadersHttpOperationBinding((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys? sh  +%'ÿ;F'fM-^Tf)A "       O PKN¤Y5縋äìäìZSI/wstools/WSDLTools.py# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. ident = "$Id: WSDLTools.py 1122 2006-02-04 01:24:50Z boverhof $" import weakref from cStringIO import StringIO from Namespaces import OASIS, XMLNS, WSA, WSA_LIST, WSRF_V1_2, WSRF from Utility import Collection, CollectionNS, DOM, ElementProxy, basejoin from XMLSchema import XMLSchema, SchemaReader, WSDLToolsAdapter class WSDLReader: """A WSDLReader creates WSDL instances from urls and xml data.""" # Custom subclasses of WSDLReader may wish to implement a caching # strategy or other optimizations. Because application needs vary # so widely, we don't try to provide any caching by default. def loadFromStream(self, stream, name=None): """Return a WSDL instance loaded from a stream object.""" document = DOM.loadDocument(stream) wsdl = WSDL() if name: wsdl.location = name elif hasattr(stream, 'name'): wsdl.location = stream.name wsdl.load(document) return wsdl def loadFromURL(self, url): """Return a WSDL instance loaded from the given url.""" document = DOM.loadFromURL(url) wsdl = WSDL() wsdl.location = url wsdl.load(document) return wsdl def loadFromString(self, data): """Return a WSDL instance loaded from an xml string.""" return self.loadFromStream(StringIO(data)) def loadFromFile(self, filename): """Return a WSDL instance loaded from the given file.""" file = open(filename, 'rb') try: wsdl = self.loadFromStream(file) finally: file.close() return wsdl class WSDL: """A WSDL object models a WSDL service description. WSDL objects may be created manually or loaded from an xml representation using a WSDLReader instance.""" def __init__(self, targetNamespace=None, strict=1): self.targetNamespace = targetNamespace or 'urn:this-document.wsdl' self.documentation = '' self.location = None self.document = None self.name = None self.services = CollectionNS(self) self.messages = CollectionNS(self) self.portTypes = CollectionNS(self) self.bindings = CollectionNS(self) self.imports = Collection(self) self.types = Types(self) self.extensions = [] self.strict = strict def __del__(self): if self.document is not None: self.document.unlink() version = '1.1' def addService(self, name, documentation='', targetNamespace=None): if self.services.has_key(name): raise WSDLError( 'Duplicate service element: %s' % name ) item = Service(name, documentation) if targetNamespace: item.targetNamespace = targetNamespace self.services[name] = item return item def addMessage(self, name, documentation='', targetNamespace=None): if self.messages.has_key(name): raise WSDLError( 'Duplicate message element: %s.' % name ) item = Message(name, documentation) if targetNamespace: item.targetNamespace = targetNamespace self.messages[name] = item return item def addPortType(self, name, documentation='', targetNamespace=None): if self.portTypes.has_key(name): raise WSDLError( 'Duplicate portType element: name' ) item = PortType(name, documentation) if targetNamespace: item.targetNamespace = targetNamespace self.portTypes[name] = item return item def addBinding(self, name, type, documentation='', targetNamespace=None): if self.bindings.has_key(name): raise WSDLError( 'Duplicate binding element: %s' % name ) item = Binding(name, type, documentation) if targetNamespace: item.targetNamespace = targetNamespace self.bindings[name] = item return item def addImport(self, namespace, location): item = ImportElement(namespace, location) self.imports[namespace] = item return item def toDom(self): """ Generate a DOM representation of the WSDL instance. Not dealing with generating XML Schema, thus the targetNamespace of all XML Schema elements or types used by WSDL message parts needs to be specified via import information items. """ namespaceURI = DOM.GetWSDLUri(self.version) self.document = DOM.createDocument(namespaceURI ,'wsdl:definitions') # Set up a couple prefixes for easy reading. child = DOM.getElement(self.document, None) child.setAttributeNS(None, 'targetNamespace', self.targetNamespace) child.setAttributeNS(XMLNS.BASE, 'xmlns:wsdl', namespaceURI) child.setAttributeNS(XMLNS.BASE, 'xmlns:xsd', 'http://www.w3.org/1999/XMLSchema') child.setAttributeNS(XMLNS.BASE, 'xmlns:soap', 'http://schemas.xmlsoap.org/wsdl/soap/') child.setAttributeNS(XMLNS.BASE, 'xmlns:tns', self.targetNamespace) if self.name: child.setAttributeNS(None, 'name', self.name) # wsdl:import for item in self.imports: item.toDom() # wsdl:message for item in self.messages: item.toDom() # wsdl:portType for item in self.portTypes: item.toDom() # wsdl:binding for item in self.bindings: item.toDom() # wsdl:service for item in self.services: item.toDom() def load(self, document): # We save a reference to the DOM document to ensure that elements # saved as "extensions" will continue to have a meaningful context # for things like namespace references. The lifetime of the DOM # document is bound to the lifetime of the WSDL instance. self.document = document definitions = DOM.getElement(document, 'definitions', None, None) if definitions is None: raise WSDLError( 'Missing element.' ) self.version = DOM.WSDLUriToVersion(definitions.namespaceURI) NS_WSDL = DOM.GetWSDLUri(self.version) self.targetNamespace = DOM.getAttr(definitions, 'targetNamespace', None, None) self.name = DOM.getAttr(definitions, 'name', None, None) self.documentation = GetDocumentation(definitions) # # Retrieve all 's, append all children of imported # document to main document. First iteration grab all original # 's from document, second iteration grab all # "imported" from document, etc break out when # no more 's. # imported = [] base_location = self.location do_it = True while do_it: do_it = False for element in DOM.getElements(definitions, 'import', NS_WSDL): location = DOM.getAttr(element, 'location') if base_location is not None: location = basejoin(base_location, location) if location not in imported: do_it = True self._import(document, element, base_location) imported.append(location) else: definitions.removeChild(element) base_location = None # # No more 's, now load up all other # WSDL information items. # for element in DOM.getElements(definitions, None, None): targetNamespace = DOM.getAttr(element, 'targetNamespace') localName = element.localName if not DOM.nsUriMatch(element.namespaceURI, NS_WSDL): if localName == 'schema': tns = DOM.getAttr(element, 'targetNamespace') reader = SchemaReader(base_url=self.imports[tns].location) schema = reader.loadFromNode(WSDLToolsAdapter(self), element) # schema.setBaseUrl(self.location) self.types.addSchema(schema) else: self.extensions.append(element) continue elif localName == 'message': name = DOM.getAttr(element, 'name') docs = GetDocumentation(element) message = self.addMessage(name, docs, targetNamespace) parts = DOM.getElements(element, 'part', NS_WSDL) message.load(parts) continue elif localName == 'portType': name = DOM.getAttr(element, 'name') docs = GetDocumentation(element) ptype = self.addPortType(name, docs, targetNamespace) #operations = DOM.getElements(element, 'operation', NS_WSDL) #ptype.load(operations) ptype.load(element) continue elif localName == 'binding': name = DOM.getAttr(element, 'name') type = DOM.getAttr(element, 'type', default=None) if type is None: raise WSDLError( 'Missing type attribute for binding %s.' % name ) type = ParseQName(type, element) docs = GetDocumentation(element) binding = self.addBinding(name, type, docs, targetNamespace) operations = DOM.getElements(element, 'operation', NS_WSDL) binding.load(operations) binding.load_ex(GetExtensions(element)) continue elif localName == 'service': name = DOM.getAttr(element, 'name') docs = GetDocumentation(element) service = self.addService(name, docs, targetNamespace) ports = DOM.getElements(element, 'port', NS_WSDL) service.load(ports) service.load_ex(GetExtensions(element)) continue elif localName == 'types': self.types.documentation = GetDocumentation(element) base_location = DOM.getAttr(element, 'base-location') if base_location: element.removeAttribute('base-location') base_location = base_location or self.location reader = SchemaReader(base_url=base_location) for item in DOM.getElements(element, None, None): if item.localName == 'schema': schema = reader.loadFromNode(WSDLToolsAdapter(self), item) # XXX could have been imported #schema.setBaseUrl(self.location) schema.setBaseUrl(base_location) self.types.addSchema(schema) else: self.types.addExtension(item) # XXX remove the attribute # element.removeAttribute('base-location') continue def _import(self, document, element, base_location=None): '''Algo take element's children, clone them, and add them to the main document. Support for relative locations is a bit complicated. The orig document context is lost, so we need to store base location in DOM elements representing , by creating a special temporary "base-location" attribute, and , by resolving the relative "location" and storing it as "location". document -- document we are loading element -- DOM Element representing base_location -- location of document from which this was gleaned. ''' namespace = DOM.getAttr(element, 'namespace', default=None) location = DOM.getAttr(element, 'location', default=None) if namespace is None or location is None: raise WSDLError( 'Invalid import element (missing namespace or location).' ) if base_location: location = basejoin(base_location, location) element.setAttributeNS(None, 'location', location) obimport = self.addImport(namespace, location) obimport._loaded = 1 importdoc = DOM.loadFromURL(location) try: if location.find('#') > -1: idref = location.split('#')[-1] imported = DOM.getElementById(importdoc, idref) else: imported = importdoc.documentElement if imported is None: raise WSDLError( 'Import target element not found for: %s' % location ) imported_tns = DOM.findTargetNS(imported) if imported_tns != namespace: return if imported.localName == 'definitions': imported_nodes = imported.childNodes else: imported_nodes = [imported] parent = element.parentNode parent.removeChild(element) for node in imported_nodes: if node.nodeType != node.ELEMENT_NODE: continue child = DOM.importNode(document, node, 1) parent.appendChild(child) child.setAttribute('targetNamespace', namespace) attrsNS = imported._attrsNS for attrkey in attrsNS.keys(): if attrkey[0] == DOM.NS_XMLNS: attr = attrsNS[attrkey].cloneNode(1) child.setAttributeNode(attr) #XXX Quick Hack, should be in WSDL Namespace. if child.localName == 'import': rlocation = child.getAttributeNS(None, 'location') alocation = basejoin(location, rlocation) child.setAttribute('location', alocation) elif child.localName == 'types': child.setAttribute('base-location', location) finally: importdoc.unlink() return location class Element: """A class that provides common functions for WSDL element classes.""" def __init__(self, name=None, documentation=''): self.name = name self.documentation = documentation self.extensions = [] def addExtension(self, item): item.parent = weakref.ref(self) self.extensions.append(item) def getWSDL(self): """Return the WSDL object that contains this information item.""" parent = self while 1: # skip any collections if isinstance(parent, WSDL): return parent try: parent = parent.parent() except: break return None class ImportElement(Element): def __init__(self, namespace, location): self.namespace = namespace self.location = location # def getWSDL(self): # """Return the WSDL object that contains this Message Part.""" # return self.parent().parent() def toDom(self): wsdl = self.getWSDL() ep = ElementProxy(None, DOM.getElement(wsdl.document, None)) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), 'import') epc.setAttributeNS(None, 'namespace', self.namespace) epc.setAttributeNS(None, 'location', self.location) _loaded = None class Types(Collection): default = lambda self,k: k.targetNamespace def __init__(self, parent): Collection.__init__(self, parent) self.documentation = '' self.extensions = [] def addSchema(self, schema): name = schema.targetNamespace self[name] = schema return schema def addExtension(self, item): self.extensions.append(item) class Message(Element): def __init__(self, name, documentation=''): Element.__init__(self, name, documentation) self.parts = Collection(self) def addPart(self, name, type=None, element=None): if self.parts.has_key(name): raise WSDLError( 'Duplicate message part element: %s' % name ) if type is None and element is None: raise WSDLError( 'Missing type or element attribute for part: %s' % name ) item = MessagePart(name) item.element = element item.type = type self.parts[name] = item return item def load(self, elements): for element in elements: name = DOM.getAttr(element, 'name') part = MessagePart(name) self.parts[name] = part elemref = DOM.getAttr(element, 'element', default=None) typeref = DOM.getAttr(element, 'type', default=None) if typeref is None and elemref is None: raise WSDLError( 'No type or element attribute for part: %s' % name ) if typeref is not None: part.type = ParseTypeRef(typeref, element) if elemref is not None: part.element = ParseTypeRef(elemref, element) # def getElementDeclaration(self): # """Return the XMLSchema.ElementDeclaration instance or None""" # element = None # if self.element: # nsuri,name = self.element # wsdl = self.getWSDL() # if wsdl.types.has_key(nsuri) and wsdl.types[nsuri].elements.has_key(name): # element = wsdl.types[nsuri].elements[name] # return element # # def getTypeDefinition(self): # """Return the XMLSchema.TypeDefinition instance or None""" # type = None # if self.type: # nsuri,name = self.type # wsdl = self.getWSDL() # if wsdl.types.has_key(nsuri) and wsdl.types[nsuri].types.has_key(name): # type = wsdl.types[nsuri].types[name] # return type # def getWSDL(self): # """Return the WSDL object that contains this Message Part.""" # return self.parent().parent() def toDom(self): wsdl = self.getWSDL() ep = ElementProxy(None, DOM.getElement(wsdl.document, None)) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), 'message') epc.setAttributeNS(None, 'name', self.name) for part in self.parts: part.toDom(epc._getNode()) class MessagePart(Element): def __init__(self, name): Element.__init__(self, name, '') self.element = None self.type = None # def getWSDL(self): # """Return the WSDL object that contains this Message Part.""" # return self.parent().parent().parent().parent() def getTypeDefinition(self): wsdl = self.getWSDL() nsuri,name = self.type schema = wsdl.types.get(nsuri, {}) return schema.get(name) def getElementDeclaration(self): wsdl = self.getWSDL() nsuri,name = self.element schema = wsdl.types.get(nsuri, {}) return schema.get(name) def toDom(self, node): """node -- node representing message""" wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), 'part') epc.setAttributeNS(None, 'name', self.name) if self.element is not None: ns,name = self.element prefix = epc.getPrefix(ns) epc.setAttributeNS(None, 'element', '%s:%s'%(prefix,name)) elif self.type is not None: ns,name = self.type prefix = epc.getPrefix(ns) epc.setAttributeNS(None, 'type', '%s:%s'%(prefix,name)) class PortType(Element): '''PortType has a anyAttribute, thus must provide for an extensible mechanism for supporting such attributes. ResourceProperties is specified in WS-ResourceProperties. wsa:Action is specified in WS-Address. Instance Data: name -- name attribute resourceProperties -- optional. wsr:ResourceProperties attribute, value is a QName this is Parsed into a (namespaceURI, name) that represents a Global Element Declaration. operations ''' def __init__(self, name, documentation=''): Element.__init__(self, name, documentation) self.operations = Collection(self) self.resourceProperties = None # def getWSDL(self): # return self.parent().parent() def getTargetNamespace(self): return self.targetNamespace or self.getWSDL().targetNamespace def getResourceProperties(self): return self.resourceProperties def addOperation(self, name, documentation='', parameterOrder=None): item = Operation(name, documentation, parameterOrder) self.operations[name] = item return item def load(self, element): self.name = DOM.getAttr(element, 'name') self.documentation = GetDocumentation(element) self.targetNamespace = DOM.getAttr(element, 'targetNamespace') for nsuri in WSRF_V1_2.PROPERTIES.XSD_LIST: if DOM.hasAttr(element, 'ResourceProperties', nsuri): rpref = DOM.getAttr(element, 'ResourceProperties', nsuri) self.resourceProperties = ParseQName(rpref, element) NS_WSDL = DOM.GetWSDLUri(self.getWSDL().version) elements = DOM.getElements(element, 'operation', NS_WSDL) for element in elements: name = DOM.getAttr(element, 'name') docs = GetDocumentation(element) param_order = DOM.getAttr(element, 'parameterOrder', default=None) if param_order is not None: param_order = param_order.split(' ') operation = self.addOperation(name, docs, param_order) item = DOM.getElement(element, 'input', None, None) if item is not None: name = DOM.getAttr(item, 'name') docs = GetDocumentation(item) msgref = DOM.getAttr(item, 'message') message = ParseQName(msgref, item) for WSA in WSA_LIST: action = DOM.getAttr(item, 'Action', WSA.ADDRESS, None) if action: break operation.setInput(message, name, docs, action) item = DOM.getElement(element, 'output', None, None) if item is not None: name = DOM.getAttr(item, 'name') docs = GetDocumentation(item) msgref = DOM.getAttr(item, 'message') message = ParseQName(msgref, item) for WSA in WSA_LIST: action = DOM.getAttr(item, 'Action', WSA.ADDRESS, None) if action: break operation.setOutput(message, name, docs, action) for item in DOM.getElements(element, 'fault', None): name = DOM.getAttr(item, 'name') docs = GetDocumentation(item) msgref = DOM.getAttr(item, 'message') message = ParseQName(msgref, item) for WSA in WSA_LIST: action = DOM.getAttr(item, 'Action', WSA.ADDRESS, None) if action: break operation.addFault(message, name, docs, action) def toDom(self): wsdl = self.getWSDL() ep = ElementProxy(None, DOM.getElement(wsdl.document, None)) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), 'portType') epc.setAttributeNS(None, 'name', self.name) if self.resourceProperties: ns,name = self.resourceProperties prefix = epc.getPrefix(ns) epc.setAttributeNS(WSRF.PROPERTIES.LATEST, 'ResourceProperties', '%s:%s'%(prefix,name)) for op in self.operations: op.toDom(epc._getNode()) class Operation(Element): def __init__(self, name, documentation='', parameterOrder=None): Element.__init__(self, name, documentation) self.parameterOrder = parameterOrder self.faults = Collection(self) self.input = None self.output = None def getWSDL(self): """Return the WSDL object that contains this Operation.""" return self.parent().parent().parent().parent() def getPortType(self): return self.parent().parent() def getInputAction(self): """wsa:Action attribute""" return GetWSAActionInput(self) def getInputMessage(self): if self.input is None: return None wsdl = self.getPortType().getWSDL() return wsdl.messages[self.input.message] def getOutputAction(self): """wsa:Action attribute""" return GetWSAActionOutput(self) def getOutputMessage(self): if self.output is None: return None wsdl = self.getPortType().getWSDL() return wsdl.messages[self.output.message] def getFaultAction(self, name): """wsa:Action attribute""" return GetWSAActionFault(self, name) def getFaultMessage(self, name): wsdl = self.getPortType().getWSDL() return wsdl.messages[self.faults[name].message] def addFault(self, message, name, documentation='', action=None): if self.faults.has_key(name): raise WSDLError( 'Duplicate fault element: %s' % name ) item = MessageRole('fault', message, name, documentation, action) self.faults[name] = item return item def setInput(self, message, name='', documentation='', action=None): self.input = MessageRole('input', message, name, documentation, action) self.input.parent = weakref.ref(self) return self.input def setOutput(self, message, name='', documentation='', action=None): self.output = MessageRole('output', message, name, documentation, action) self.output.parent = weakref.ref(self) return self.output def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), 'operation') epc.setAttributeNS(None, 'name', self.name) node = epc._getNode() if self.input: self.input.toDom(node) if self.output: self.output.toDom(node) for fault in self.faults: fault.toDom(node) class MessageRole(Element): def __init__(self, type, message, name='', documentation='', action=None): Element.__init__(self, name, documentation) self.message = message self.type = type self.action = action def getWSDL(self): """Return the WSDL object that contains this information item.""" parent = self while 1: # skip any collections if isinstance(parent, WSDL): return parent try: parent = parent.parent() except: break return None def getMessage(self): """Return the WSDL object that represents the attribute message (namespaceURI, name) tuple """ wsdl = self.getWSDL() return wsdl.messages[self.message] def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), self.type) if not isinstance(self.message, basestring) and len(self.message) == 2: ns,name = self.message prefix = epc.getPrefix(ns) epc.setAttributeNS(None, 'message', '%s:%s' %(prefix,name)) else: epc.setAttributeNS(None, 'message', self.message) if self.action: epc.setAttributeNS(WSA.ADDRESS, 'Action', self.action) if self.name: epc.setAttributeNS(None, 'name', self.name) class Binding(Element): def __init__(self, name, type, documentation=''): Element.__init__(self, name, documentation) self.operations = Collection(self) self.type = type # def getWSDL(self): # """Return the WSDL object that contains this binding.""" # return self.parent().parent() def getPortType(self): """Return the PortType object associated with this binding.""" return self.getWSDL().portTypes[self.type] def findBinding(self, kind): for item in self.extensions: if isinstance(item, kind): return item return None def findBindings(self, kind): return [ item for item in self.extensions if isinstance(item, kind) ] def addOperationBinding(self, name, documentation=''): item = OperationBinding(name, documentation) self.operations[name] = item return item def load(self, elements): for element in elements: name = DOM.getAttr(element, 'name') docs = GetDocumentation(element) opbinding = self.addOperationBinding(name, docs) opbinding.load_ex(GetExtensions(element)) item = DOM.getElement(element, 'input', None, None) if item is not None: #TODO: addInputBinding? mbinding = MessageRoleBinding('input') mbinding.documentation = GetDocumentation(item) opbinding.input = mbinding mbinding.load_ex(GetExtensions(item)) mbinding.parent = weakref.ref(opbinding) item = DOM.getElement(element, 'output', None, None) if item is not None: mbinding = MessageRoleBinding('output') mbinding.documentation = GetDocumentation(item) opbinding.output = mbinding mbinding.load_ex(GetExtensions(item)) mbinding.parent = weakref.ref(opbinding) for item in DOM.getElements(element, 'fault', None): name = DOM.getAttr(item, 'name') mbinding = MessageRoleBinding('fault', name) mbinding.documentation = GetDocumentation(item) opbinding.faults[name] = mbinding mbinding.load_ex(GetExtensions(item)) mbinding.parent = weakref.ref(opbinding) def load_ex(self, elements): for e in elements: ns, name = e.namespaceURI, e.localName if ns in DOM.NS_SOAP_BINDING_ALL and name == 'binding': transport = DOM.getAttr(e, 'transport', default=None) style = DOM.getAttr(e, 'style', default='document') ob = SoapBinding(transport, style) self.addExtension(ob) continue elif ns in DOM.NS_HTTP_BINDING_ALL and name == 'binding': verb = DOM.getAttr(e, 'verb') ob = HttpBinding(verb) self.addExtension(ob) continue else: self.addExtension(e) def toDom(self): wsdl = self.getWSDL() ep = ElementProxy(None, DOM.getElement(wsdl.document, None)) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), 'binding') epc.setAttributeNS(None, 'name', self.name) ns,name = self.type prefix = epc.getPrefix(ns) epc.setAttributeNS(None, 'type', '%s:%s' %(prefix,name)) node = epc._getNode() for ext in self.extensions: ext.toDom(node) for op_binding in self.operations: op_binding.toDom(node) class OperationBinding(Element): def __init__(self, name, documentation=''): Element.__init__(self, name, documentation) self.input = None self.output = None self.faults = Collection(self) # def getWSDL(self): # """Return the WSDL object that contains this binding.""" # return self.parent().parent().parent().parent() def getBinding(self): """Return the parent Binding object of the operation binding.""" return self.parent().parent() def getOperation(self): """Return the abstract Operation associated with this binding.""" return self.getBinding().getPortType().operations[self.name] def findBinding(self, kind): for item in self.extensions: if isinstance(item, kind): return item return None def findBindings(self, kind): return [ item for item in self.extensions if isinstance(item, kind) ] def addInputBinding(self, binding): if self.input is None: self.input = MessageRoleBinding('input') self.input.parent = weakref.ref(self) self.input.addExtension(binding) return binding def addOutputBinding(self, binding): if self.output is None: self.output = MessageRoleBinding('output') self.output.parent = weakref.ref(self) self.output.addExtension(binding) return binding def addFaultBinding(self, name, binding): fault = self.get(name, None) if fault is None: fault = MessageRoleBinding('fault', name) fault.addExtension(binding) return binding def load_ex(self, elements): for e in elements: ns, name = e.namespaceURI, e.localName if ns in DOM.NS_SOAP_BINDING_ALL and name == 'operation': soapaction = DOM.getAttr(e, 'soapAction', default=None) style = DOM.getAttr(e, 'style', default=None) ob = SoapOperationBinding(soapaction, style) self.addExtension(ob) continue elif ns in DOM.NS_HTTP_BINDING_ALL and name == 'operation': location = DOM.getAttr(e, 'location') ob = HttpOperationBinding(location) self.addExtension(ob) continue else: self.addExtension(e) def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), 'operation') epc.setAttributeNS(None, 'name', self.name) node = epc._getNode() for ext in self.extensions: ext.toDom(node) if self.input: self.input.toDom(node) if self.output: self.output.toDom(node) for fault in self.faults: fault.toDom(node) class MessageRoleBinding(Element): def __init__(self, type, name='', documentation=''): Element.__init__(self, name, documentation) self.type = type def findBinding(self, kind): for item in self.extensions: if isinstance(item, kind): return item return None def findBindings(self, kind): return [ item for item in self.extensions if isinstance(item, kind) ] def load_ex(self, elements): for e in elements: ns, name = e.namespaceURI, e.localName if ns in DOM.NS_SOAP_BINDING_ALL and name == 'body': encstyle = DOM.getAttr(e, 'encodingStyle', default=None) namespace = DOM.getAttr(e, 'namespace', default=None) parts = DOM.getAttr(e, 'parts', default=None) use = DOM.getAttr(e, 'use', default=None) if use is None: raise WSDLError( 'Invalid soap:body binding element.' ) ob = SoapBodyBinding(use, namespace, encstyle, parts) self.addExtension(ob) continue elif ns in DOM.NS_SOAP_BINDING_ALL and name == 'fault': encstyle = DOM.getAttr(e, 'encodingStyle', default=None) namespace = DOM.getAttr(e, 'namespace', default=None) name = DOM.getAttr(e, 'name', default=None) use = DOM.getAttr(e, 'use', default=None) if use is None or name is None: raise WSDLError( 'Invalid soap:fault binding element.' ) ob = SoapFaultBinding(name, use, namespace, encstyle) self.addExtension(ob) continue elif ns in DOM.NS_SOAP_BINDING_ALL and name in ( 'header', 'headerfault' ): encstyle = DOM.getAttr(e, 'encodingStyle', default=None) namespace = DOM.getAttr(e, 'namespace', default=None) message = DOM.getAttr(e, 'message') part = DOM.getAttr(e, 'part') use = DOM.getAttr(e, 'use') if name == 'header': _class = SoapHeaderBinding else: _class = SoapHeaderFaultBinding message = ParseQName(message, e) ob = _class(message, part, use, namespace, encstyle) self.addExtension(ob) continue elif ns in DOM.NS_HTTP_BINDING_ALL and name == 'urlReplacement': ob = HttpUrlReplacementBinding() self.addExtension(ob) continue elif ns in DOM.NS_HTTP_BINDING_ALL and name == 'urlEncoded': ob = HttpUrlEncodedBinding() self.addExtension(ob) continue elif ns in DOM.NS_MIME_BINDING_ALL and name == 'multipartRelated': ob = MimeMultipartRelatedBinding() self.addExtension(ob) ob.load_ex(GetExtensions(e)) continue elif ns in DOM.NS_MIME_BINDING_ALL and name == 'content': part = DOM.getAttr(e, 'part', default=None) type = DOM.getAttr(e, 'type', default=None) ob = MimeContentBinding(part, type) self.addExtension(ob) continue elif ns in DOM.NS_MIME_BINDING_ALL and name == 'mimeXml': part = DOM.getAttr(e, 'part', default=None) ob = MimeXmlBinding(part) self.addExtension(ob) continue else: self.addExtension(e) def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), self.type) node = epc._getNode() for item in self.extensions: if item: item.toDom(node) class Service(Element): def __init__(self, name, documentation=''): Element.__init__(self, name, documentation) self.ports = Collection(self) def getWSDL(self): return self.parent().parent() def addPort(self, name, binding, documentation=''): item = Port(name, binding, documentation) self.ports[name] = item return item def load(self, elements): for element in elements: name = DOM.getAttr(element, 'name', default=None) docs = GetDocumentation(element) binding = DOM.getAttr(element, 'binding', default=None) if name is None or binding is None: raise WSDLError( 'Invalid port element.' ) binding = ParseQName(binding, element) port = self.addPort(name, binding, docs) port.load_ex(GetExtensions(element)) def load_ex(self, elements): for e in elements: self.addExtension(e) def toDom(self): wsdl = self.getWSDL() ep = ElementProxy(None, DOM.getElement(wsdl.document, None)) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), "service") epc.setAttributeNS(None, "name", self.name) node = epc._getNode() for port in self.ports: port.toDom(node) class Port(Element): def __init__(self, name, binding, documentation=''): Element.__init__(self, name, documentation) self.binding = binding # def getWSDL(self): # return self.parent().parent().getWSDL() def getService(self): """Return the Service object associated with this port.""" return self.parent().parent() def getBinding(self): """Return the Binding object that is referenced by this port.""" wsdl = self.getService().getWSDL() return wsdl.bindings[self.binding] def getPortType(self): """Return the PortType object that is referenced by this port.""" wsdl = self.getService().getWSDL() binding = wsdl.bindings[self.binding] return wsdl.portTypes[binding.type] def getAddressBinding(self): """A convenience method to obtain the extension element used as the address binding for the port.""" for item in self.extensions: if isinstance(item, SoapAddressBinding) or \ isinstance(item, HttpAddressBinding): return item raise WSDLError( 'No address binding found in port.' ) def load_ex(self, elements): for e in elements: ns, name = e.namespaceURI, e.localName if ns in DOM.NS_SOAP_BINDING_ALL and name == 'address': location = DOM.getAttr(e, 'location', default=None) ob = SoapAddressBinding(location) self.addExtension(ob) continue elif ns in DOM.NS_HTTP_BINDING_ALL and name == 'address': location = DOM.getAttr(e, 'location', default=None) ob = HttpAddressBinding(location) self.addExtension(ob) continue else: self.addExtension(e) def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), "port") epc.setAttributeNS(None, "name", self.name) ns,name = self.binding prefix = epc.getPrefix(ns) epc.setAttributeNS(None, "binding", "%s:%s" %(prefix,name)) node = epc._getNode() for ext in self.extensions: ext.toDom(node) class SoapBinding: def __init__(self, transport, style='rpc'): self.transport = transport self.style = style def getWSDL(self): return self.parent().getWSDL() def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLSoapBindingUri(wsdl.version), 'binding') if self.transport: epc.setAttributeNS(None, "transport", self.transport) if self.style: epc.setAttributeNS(None, "style", self.style) class SoapAddressBinding: def __init__(self, location): self.location = location def getWSDL(self): return self.parent().getWSDL() def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLSoapBindingUri(wsdl.version), 'address') epc.setAttributeNS(None, "location", self.location) class SoapOperationBinding: def __init__(self, soapAction=None, style=None): self.soapAction = soapAction self.style = style def getWSDL(self): return self.parent().getWSDL() def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLSoapBindingUri(wsdl.version), 'operation') if self.soapAction: epc.setAttributeNS(None, 'soapAction', self.soapAction) if self.style: epc.setAttributeNS(None, 'style', self.style) class SoapBodyBinding: def __init__(self, use, namespace=None, encodingStyle=None, parts=None): if not use in ('literal', 'encoded'): raise WSDLError( 'Invalid use attribute value: %s' % use ) self.encodingStyle = encodingStyle self.namespace = namespace if type(parts) in (type(''), type(u'')): parts = parts.split() self.parts = parts self.use = use def getWSDL(self): return self.parent().getWSDL() def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLSoapBindingUri(wsdl.version), 'body') epc.setAttributeNS(None, "use", self.use) epc.setAttributeNS(None, "namespace", self.namespace) class SoapFaultBinding: def __init__(self, name, use, namespace=None, encodingStyle=None): if not use in ('literal', 'encoded'): raise WSDLError( 'Invalid use attribute value: %s' % use ) self.encodingStyle = encodingStyle self.namespace = namespace self.name = name self.use = use def getWSDL(self): return self.parent().getWSDL() def toDom(self, node): wsdl = self.getWSDL() ep = ElementProxy(None, node) epc = ep.createAppendElement(DOM.GetWSDLSoapBindingUri(wsdl.version), 'body') epc.setAttributeNS(None, "use", self.use) epc.setAttributeNS(None, "name", self.name) if self.namespace is not None: epc.setAttributeNS(None, "namespace", self.namespace) if self.encodingStyle is not None: epc.setAttributeNS(None, "encodingStyle", self.encodingStyle) class SoapHeaderBinding: def __init__(self, message, part, use, namespace=None, encodingStyle=None): if not use in ('literal', 'encoded'): raise WSDLError( 'Invalid use attribute value: %s' % use ) self.encodingStyle = encodingStyle self.namespace = namespace self.message = message self.part = part self.use = use tagname = 'header' class SoapHeaderFaultBinding(SoapHeaderBinding): tagname = 'headerfault' class HttpBinding: def __init__(self, verb): self.verb = verb class HttpAddressBinding: def __init__(self, location): self.location = location class HttpOperationBinding: def __init__(self, location): self.location = location class HttpUrlReplacementBinding: pass class HttpUrlEncodedBinding: pass class MimeContentBinding: def __init__(self, part=None, type=None): self.part = part self.type = type class MimeXmlBinding: def __init__(self, part=None): self.part = part class MimeMultipartRelatedBinding: def __init__(self): self.parts = [] def load_ex(self, elements): for e in elements: ns, name = e.namespaceURI, e.localName if ns in DOM.NS_MIME_BINDING_ALL and name == 'part': self.parts.append(MimePartBinding()) continue class MimePartBinding: def __init__(self): self.items = [] def load_ex(self, elements): for e in elements: ns, name = e.namespaceURI, e.localName if ns in DOM.NS_MIME_BINDING_ALL and name == 'content': part = DOM.getAttr(e, 'part', default=None) type = DOM.getAttr(e, 'type', default=None) ob = MimeContentBinding(part, type) self.items.append(ob) continue elif ns in DOM.NS_MIME_BINDING_ALL and name == 'mimeXml': part = DOM.getAttr(e, 'part', default=None) ob = MimeXmlBinding(part) self.items.append(ob) continue elif ns in DOM.NS_SOAP_BINDING_ALL and name == 'body': encstyle = DOM.getAttr(e, 'encodingStyle', default=None) namespace = DOM.getAttr(e, 'namespace', default=None) parts = DOM.getAttr(e, 'parts', default=None) use = DOM.getAttr(e, 'use', default=None) if use is None: raise WSDLError( 'Invalid soap:body binding element.' ) ob = SoapBodyBinding(use, namespace, encstyle, parts) self.items.append(ob) continue class WSDLError(Exception): pass def DeclareNSPrefix(writer, prefix, nsuri): if writer.hasNSPrefix(nsuri): return writer.declareNSPrefix(prefix, nsuri) def ParseTypeRef(value, element): parts = value.split(':', 1) if len(parts) == 1: return (DOM.findTargetNS(element), value) nsuri = DOM.findNamespaceURI(parts[0], element) return (nsuri, parts[1]) def ParseQName(value, element): nameref = value.split(':', 1) if len(nameref) == 2: nsuri = DOM.findNamespaceURI(nameref[0], element) name = nameref[-1] else: nsuri = DOM.findTargetNS(element) name = nameref[-1] return nsuri, name def GetDocumentation(element): docnode = DOM.getElement(element, 'documentation', None, None) if docnode is not None: return DOM.getElementText(docnode) return '' def GetExtensions(element): return [ item for item in DOM.getElements(element, None, None) if item.namespaceURI != DOM.NS_WSDL ] def GetWSAActionFault(operation, name): """Find wsa:Action attribute, and return value or WSA.FAULT for the default. """ attr = operation.faults[name].action if attr is not None: return attr return WSA.FAULT def GetWSAActionInput(operation): """Find wsa:Action attribute, and return value or the default.""" attr = operation.input.action if attr is not None: return attr portType = operation.getPortType() targetNamespace = portType.getTargetNamespace() ptName = portType.name msgName = operation.input.name if not msgName: msgName = operation.name + 'Request' if targetNamespace.endswith('/'): return '%s%s/%s' %(targetNamespace, ptName, msgName) return '%s/%s/%s' %(targetNamespace, ptName, msgName) def GetWSAActionOutput(operation): """Find wsa:Action attribute, and return value or the default.""" attr = operation.output.action if attr is not None: return attr targetNamespace = operation.getPortType().getTargetNamespace() ptName = operation.getPortType().name msgName = operation.output.name if not msgName: msgName = operation.name + 'Response' if targetNamespace.endswith('/'): return '%s%s/%s' %(targetNamespace, ptName, msgName) return '%s/%s/%s' %(targetNamespace, ptName, msgName) def FindExtensions(object, kind, t_type=type(())): if isinstance(kind, t_type): result = [] namespaceURI, name = kind return [ item for item in object.extensions if hasattr(item, 'nodeType') \ and DOM.nsUriMatch(namespaceURI, item.namespaceURI) \ and item.name == name ] return [ item for item in object.extensions if isinstance(item, kind) ] def FindExtension(object, kind, t_type=type(())): if isinstance(kind, t_type): namespaceURI, name = kind for item in object.extensions: if hasattr(item, 'nodeType') \ and DOM.nsUriMatch(namespaceURI, item.namespaceURI) \ and item.name == name: return item else: for item in object.extensions: if isinstance(item, kind): return item return None class SOAPCallInfo: """SOAPCallInfo captures the important binding information about a SOAP operation, in a structure that is easier to work with than raw WSDL structures.""" def __init__(self, methodName): self.methodName = methodName self.inheaders = [] self.outheaders = [] self.inparams = [] self.outparams = [] self.retval = None encodingStyle = DOM.NS_SOAP_ENC documentation = '' soapAction = None transport = None namespace = None location = None use = 'encoded' style = 'rpc' def addInParameter(self, name, type, namespace=None, element_type=0): """Add an input parameter description to the call info.""" parameter = ParameterInfo(name, type, namespace, element_type) self.inparams.append(parameter) return parameter def addOutParameter(self, name, type, namespace=None, element_type=0): """Add an output parameter description to the call info.""" parameter = ParameterInfo(name, type, namespace, element_type) self.outparams.append(parameter) return parameter def setReturnParameter(self, name, type, namespace=None, element_type=0): """Set the return parameter description for the call info.""" parameter = ParameterInfo(name, type, namespace, element_type) self.retval = parameter return parameter def addInHeaderInfo(self, name, type, namespace, element_type=0, mustUnderstand=0): """Add an input SOAP header description to the call info.""" headerinfo = HeaderInfo(name, type, namespace, element_type) if mustUnderstand: headerinfo.mustUnderstand = 1 self.inheaders.append(headerinfo) return headerinfo def addOutHeaderInfo(self, name, type, namespace, element_type=0, mustUnderstand=0): """Add an output SOAP header description to the call info.""" headerinfo = HeaderInfo(name, type, namespace, element_type) if mustUnderstand: headerinfo.mustUnderstand = 1 self.outheaders.append(headerinfo) return headerinfo def getInParameters(self): """Return a sequence of the in parameters of the method.""" return self.inparams def getOutParameters(self): """Return a sequence of the out parameters of the method.""" return self.outparams def getReturnParameter(self): """Return param info about the return value of the method.""" return self.retval def getInHeaders(self): """Return a sequence of the in headers of the method.""" return self.inheaders def getOutHeaders(self): """Return a sequence of the out headers of the method.""" return self.outheaders class ParameterInfo: """A ParameterInfo object captures parameter binding information.""" def __init__(self, name, type, namespace=None, element_type=0): if element_type: self.element_type = 1 if namespace is not None: self.namespace = namespace self.name = name self.type = type element_type = 0 namespace = None default = None class HeaderInfo(ParameterInfo): """A HeaderInfo object captures SOAP header binding information.""" def __init__(self, name, type, namespace, element_type=None): ParameterInfo.__init__(self, name, type, namespace, element_type) mustUnderstand = 0 actor = None def callInfoFromWSDL(port, name): """Return a SOAPCallInfo given a WSDL port and operation name.""" wsdl = port.getService().getWSDL() binding = port.getBinding() portType = binding.getPortType() operation = portType.operations[name] opbinding = binding.operations[name] messages = wsdl.messages callinfo = SOAPCallInfo(name) addrbinding = port.getAddressBinding() if not isinstance(addrbinding, SoapAddressBinding): raise ValueError, 'Unsupported binding type.' callinfo.location = addrbinding.location soapbinding = binding.findBinding(SoapBinding) if soapbinding is None: raise ValueError, 'Missing soap:binding element.' callinfo.transport = soapbinding.transport callinfo.style = soapbinding.style or 'document' soap_op_binding = opbinding.findBinding(SoapOperationBinding) if soap_op_binding is not None: callinfo.soapAction = soap_op_binding.soapAction callinfo.style = soap_op_binding.style or callinfo.style parameterOrder = operation.parameterOrder if operation.input is not None: message = messages[operation.input.message] msgrole = opbinding.input mime = msgrole.findBinding(MimeMultipartRelatedBinding) if mime is not None: raise ValueError, 'Mime bindings are not supported.' else: for item in msgrole.findBindings(SoapHeaderBinding): part = messages[item.message].parts[item.part] header = callinfo.addInHeaderInfo( part.name, part.element or part.type, item.namespace, element_type = part.element and 1 or 0 ) header.encodingStyle = item.encodingStyle body = msgrole.findBinding(SoapBodyBinding) if body is None: raise ValueError, 'Missing soap:body binding.' callinfo.encodingStyle = body.encodingStyle callinfo.namespace = body.namespace callinfo.use = body.use if body.parts is not None: parts = [] for name in body.parts: parts.append(message.parts[name]) else: parts = message.parts.values() for part in parts: callinfo.addInParameter( part.name, part.element or part.type, element_type = part.element and 1 or 0 ) if operation.output is not None: try: message = messages[operation.output.message] except KeyError: if self.strict: raise RuntimeError( "Recieved message not defined in the WSDL schema: %s" % operation.output.message) else: message = wsdl.addMessage(operation.output.message) print "Warning:", \ "Recieved message not defined in the WSDL schema.", \ "Adding it." print "Message:", operation.output.message msgrole = opbinding.output mime = msgrole.findBinding(MimeMultipartRelatedBinding) if mime is not None: raise ValueError, 'Mime bindings are not supported.' else: for item in msgrole.findBindings(SoapHeaderBinding): part = messages[item.message].parts[item.part] header = callinfo.addOutHeaderInfo( part.name, part.element or part.type, item.namespace, element_type = part.element and 1 or 0 ) header.encodingStyle = item.encodingStyle body = msgrole.findBinding(SoapBodyBinding) if body is None: raise ValueError, 'Missing soap:body binding.' callinfo.encodingStyle = body.encodingStyle callinfo.namespace = body.namespace callinfo.use = body.use if body.parts is not None: parts = [] for name in body.parts: parts.append(message.parts[name]) else: parts = message.parts.values() if parts: for part in parts: callinfo.addOutParameter( part.name, part.element or part.type, element_type = part.element and 1 or 0 ) return callinfo PK¨58˜dUßZSI/wstools/logging.pyo;ò •@Ec@s–dZdZdkZdZdZdfd„ƒYZdefd„ƒYZead „Zd „Z d „Z d „Z d d„Z d„Z d„ZdS(sLoggings4$Id: logging.py 1204 2006-05-03 00:13:47Z boverhof $NiisILoggercBs_tZdZdZd„Zd„Zd„Zd„Zd„Ze eƒZd„Z d„Z RS( s[Logger interface, by default this class will be used and logging calls are no-ops. icCsdSdS(N((sselfsmsg((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys__init__scGsdSdS(N((sselfsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyswarningscGsdSdS(N((sselfsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysdebugscGsdSdS(N((sselfsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyserrorscCs ||_dS(N(slevelscls(sclsslevel((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetLevelscCs |itjS(N(sselfslevelsDEBUG(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysscCs |itjS(N(sselfslevelsWARN(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys s( s__name__s __module__s__doc__slevels__init__swarningsdebugserrorssetLevels classmethodsdebugOnswarnOn(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysILoggers        s BasicLoggercBsStZdZeid„Zd„ZdZd„ZdZ d„Z dZ d „Z RS( NscCs||f\|_|_dS(N(smsgsoutsself(sselfsmsgsout((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys__init__&scGsz|iƒtjodSnti|ijo)|it_|dI|iIdIJn|dtiI|||IJdS(Ns---- s ----s %s (sselfswarnOnsFalses BasicLoggerslastsmsgsWARNsargs(sselfsmsgsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyswarning)s s[WARN]cGsz|iƒtjodSnti|ijo)|it_|dI|iIdIJn|dtiI|||IJdS(Ns---- s ----s %s (sselfsdebugOnsFalses BasicLoggerslastsmsgsDEBUGsargs(sselfsmsgsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysdebug1s s[DEBUG]cGs_ti|ijo)|it_|dI|iIdIJn|dtiI|||IJdS(Ns---- s ----s %s (s BasicLoggerslastsselfsmsgsERRORsargs(sselfsmsgsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyserror9s  s[ERROR]cGs%x|D]}|ii|ƒqWdS(s4Write convenience function; writes strings. N(sargssssselfsoutswrite(sselfsargsss((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyswriteAs( s__name__s __module__slastssyssstdouts__init__swarningsWARNsdebugsDEBUGserrorsERRORswrite(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys BasicLogger#s   cCsttƒtidƒdS(sUse Basic Logger. iN(ssetLoggerClasss BasicLoggerssetLevel(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetBasicLoggerHs cCsttƒtitƒdS(sUse Basic Logger. N(ssetLoggerClasss BasicLoggerssetLevelsWARN(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetBasicLoggerWARNNs cCsttƒtitƒdS(sUse Basic Logger. N(ssetLoggerClasss BasicLoggerssetLevelsDEBUG(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetBasicLoggerDEBUGTs cCs |adS(sSet Logging Class. N(s loggingClasss _LoggerClass(s loggingClass((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetLoggerClassZsicCs |t_dS(sSet Global Logging Level. N(slevelsILogger(slevel((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetLevelascCs tiSdS(N(sILoggerslevel(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysgetLevelfscCst|ƒSdS(s&Return instance of Logging class. N(s _LoggerClasssmsg(smsg((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys getLoggeris(s__doc__sidentssyssWARNsDEBUGsILoggers BasicLoggers _LoggerClassssetBasicLoggerssetBasicLoggerWARNssetBasicLoggerDEBUGssetLoggerClassssetLevelsgetLevels getLogger( sWARNsidentssetLoggerClassssetBasicLoggerDEBUGsgetLevelssyss getLoggers BasicLoggersILoggersDEBUGssetBasicLoggerssetBasicLoggerWARNssetLevel((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys?s #      PK¨58%ûcCCZSI/wstools/WSDLTools.pyo;ò •@Ec@sÄdZdkZdklZdklZlZlZlZl Z l Z dk l Z l Z lZlZlZdklZlZlZdfd„ƒYZdfd „ƒYZd fd „ƒYZd efd „ƒYZde fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ d efd!„ƒYZ!d"efd#„ƒYZ"d$fd%„ƒYZ#d&fd'„ƒYZ$d(fd)„ƒYZ%d*fd+„ƒYZ&d,fd-„ƒYZ'd.fd/„ƒYZ(d0e(fd1„ƒYZ)d2fd3„ƒYZ*d4fd5„ƒYZ+d6fd7„ƒYZ,d8fd9„ƒYZ-d:fd;„ƒYZ.d<fd=„ƒYZ/d>fd?„ƒYZ0d@fdA„ƒYZ1dBfdC„ƒYZ2dDe3fdE„ƒYZ4dF„Z5dG„Z6dH„Z7dI„Z8dJ„Z9dK„Z:dL„Z;dM„Z<e=fƒdN„Z>e=fƒdO„Z?dPfdQ„ƒYZ@dRfdS„ƒYZAdTeAfdU„ƒYZBdV„ZCdS(Ws6$Id: WSDLTools.py 1122 2006-02-04 01:24:50Z boverhof $N(sStringIO(sOASISsXMLNSsWSAsWSA_LISTs WSRF_V1_2sWSRF(s Collections CollectionNSsDOMs ElementProxysbasejoin(s XMLSchemas SchemaReadersWSDLToolsAdapters WSDLReadercBs5tZdZed„Zd„Zd„Zd„ZRS(s;A WSDLReader creates WSDL instances from urls and xml data.cCsati|ƒ}tƒ}|o ||_n!t|dƒo|i|_n|i |ƒ|SdS(s3Return a WSDL instance loaded from a stream object.snameN( sDOMs loadDocumentsstreamsdocumentsWSDLswsdlsnameslocationshasattrsload(sselfsstreamsnameswsdlsdocument((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysloadFromStreams   cCs6ti|ƒ}tƒ}||_|i|ƒ|SdS(s1Return a WSDL instance loaded from the given url.N(sDOMs loadFromURLsurlsdocumentsWSDLswsdlslocationsload(sselfsurlsdocumentswsdl((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys loadFromURL%s    cCs|it|ƒƒSdS(s1Return a WSDL instance loaded from an xml string.N(sselfsloadFromStreamsStringIOsdata(sselfsdata((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysloadFromString-scCs8t|dƒ}z|i|ƒ}Wd|iƒX|SdS(s2Return a WSDL instance loaded from the given file.srbN(sopensfilenamesfilesselfsloadFromStreamswsdlsclose(sselfsfilenameswsdlsfile((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys loadFromFile1s (s__name__s __module__s__doc__sNonesloadFromStreams loadFromURLsloadFromStrings loadFromFile(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys WSDLReaders   sWSDLcBstZdZedd„Zd„ZdZded„Zded„Zded„Z ded „Z d „Z d „Z d „Z ed „ZRS(s¥A WSDL object models a WSDL service description. WSDL objects may be created manually or loaded from an xml representation using a WSDLReader instance.icCs¤|pd|_d|_t|_t|_t|_t|ƒ|_t|ƒ|_ t|ƒ|_ t|ƒ|_ t |ƒ|_ t|ƒ|_g|_||_dS(Nsurn:this-document.wsdls(stargetNamespacesselfs documentationsNoneslocationsdocumentsnames CollectionNSsservicessmessagess portTypessbindingss CollectionsimportssTypesstypess extensionssstrict(sselfstargetNamespacesstrict((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__?s     cCs%|itj o|iiƒndS(N(sselfsdocumentsNonesunlink(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__del__Nss1.1scCs_|ii|ƒotd|ƒ‚nt||ƒ}|o ||_n||i|<|SdS(NsDuplicate service element: %s( sselfsservicesshas_keysnames WSDLErrorsServices documentationsitemstargetNamespace(sselfsnames documentationstargetNamespacesitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addServiceTs  cCs_|ii|ƒotd|ƒ‚nt||ƒ}|o ||_n||i|<|SdS(NsDuplicate message element: %s.( sselfsmessagesshas_keysnames WSDLErrorsMessages documentationsitemstargetNamespace(sselfsnames documentationstargetNamespacesitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addMessage_s  cCs[|ii|ƒotdƒ‚nt||ƒ}|o ||_n||i|<|SdS(Ns Duplicate portType element: name( sselfs portTypesshas_keysnames WSDLErrorsPortTypes documentationsitemstargetNamespace(sselfsnames documentationstargetNamespacesitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addPortTypejs  cCsb|ii|ƒotd|ƒ‚nt|||ƒ}|o ||_ n||i|<|SdS(NsDuplicate binding element: %s( sselfsbindingsshas_keysnames WSDLErrorsBindingstypes documentationsitemstargetNamespace(sselfsnamestypes documentationstargetNamespacesitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addBindingus  cCs$t||ƒ}||i|<|SdS(N(s ImportElements namespaceslocationsitemsselfsimports(sselfs namespaceslocationsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addImport€s cCskti|iƒ}ti|dƒ|_ti|itƒ}|i td|i ƒ|i t i d|ƒ|i t i ddƒ|i t i ddƒ|i t i d|i ƒ|io|i td |iƒnx|iD]}|iƒqÛWx|iD]}|iƒqùWx|iD]}|iƒqWx|iD]}|iƒq5Wx|iD]}|iƒqSWd S( s  Generate a DOM representation of the WSDL instance. Not dealing with generating XML Schema, thus the targetNamespace of all XML Schema elements or types used by WSDL message parts needs to be specified via import information items. swsdl:definitionsstargetNamespaces xmlns:wsdls xmlns:xsds http://www.w3.org/1999/XMLSchemas xmlns:soaps%http://schemas.xmlsoap.org/wsdl/soap/s xmlns:tnssnameN(sDOMs GetWSDLUrisselfsversions namespaceURIscreateDocumentsdocuments getElementsNoneschildssetAttributeNSstargetNamespacesXMLNSsBASEsnamesimportssitemstoDomsmessagess portTypessbindingssservices(sselfs namespaceURIsitemschild((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom…s4      cCs)||_ti|dttƒ}|tjotdƒ‚nti|iƒ|_ ti |i ƒ}ti |dttƒ|_ ti |dttƒ|_t|ƒ|_g}|i}t}x®|o¦t}x“ti|d|ƒD]|}ti |dƒ} |tj ot|| ƒ} n| |jo*t}|i|||ƒ|i| ƒqå|i|ƒqåWt}qÂWx²ti|ttƒD]›}ti |dƒ}|i}ti|i|ƒ o{|djoWti |dƒ}t d|i!|iƒ} | i#t$|ƒ|ƒ}|i&i'|ƒq†|i(i|ƒq†q†|d jo\ti |dƒ}t|ƒ}|i*|||ƒ}ti|d |ƒ} |i-| ƒq†q†|d joGti |dƒ}t|ƒ}|i.|||ƒ}|i-|ƒq†q†|d joºti |dƒ}ti |d dtƒ}|tjotd|ƒ‚nt1||ƒ}t|ƒ}|i2||||ƒ}ti|d|ƒ}|i-|ƒ|i5t6|ƒƒq†q†|djooti |dƒ}t|ƒ}|i7|||ƒ}ti|d|ƒ} |i-| ƒ|i5t6|ƒƒq†q†|djoÛt|ƒ|i&_ti |dƒ}|o|i:dƒn|p|i}t d|ƒ} xvti|ttƒD]_} | idjo9| i#t$|ƒ| ƒ}|i<|ƒ|i&i'|ƒq·|i&i=| ƒq·Wq†q†q†WdS(Ns definitionssMissing element.stargetNamespacesnamesimportslocationsschemasbase_urlsmessagespartsportTypesbindingstypesdefaults&Missing type attribute for binding %s.s operationsservicesportstypess base-location(>sdocumentsselfsDOMs getElementsNones definitionss WSDLErrorsWSDLUriToVersions namespaceURIsversions GetWSDLUrisNS_WSDLsgetAttrstargetNamespacesnamesGetDocumentations documentationsimportedslocations base_locationsTruesdo_itsFalses getElementsselementsbasejoins_importsappends removeChilds localNames nsUriMatchstnss SchemaReadersimportssreaders loadFromNodesWSDLToolsAdaptersschemastypess addSchemas extensionssdocss addMessagesmessagespartssloads addPortTypesptypestypes ParseQNames addBindingsbindings operationssload_exs GetExtensionss addServicesservicesportssremoveAttributesitems setBaseUrls addExtension(sselfsdocuments operationssbindingsptypesmessagestargetNamespacesimportedsservicesitemsportsspartsslocationsreaders localNamesschemasdocssnamestnsstypes base_locationselementsdo_its definitionssNS_WSDL((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysload©s°                          cCs²ti|ddtƒ} ti|ddtƒ} | tjp | tjotdƒ‚n|o&t|| ƒ} |i td| ƒn|i | | ƒ}d|_ ti| ƒ}zë| idƒdjo)| idƒd}ti||ƒ}n |i}|tjotd| ƒ‚nti|ƒ}|| jod Sn|id jo |i}n |g}|i} | i|ƒx|D]} | i| i joq„nti!|| dƒ}| i$|ƒ|i%d | ƒ|i&} xL| i(ƒD]>}|d ti*jo$| |i+dƒ}|i-|ƒqìqìW|id jo5|i.tdƒ}t| |ƒ}|i%d|ƒq„|idjo|i%d| ƒq„q„WWd |i1ƒX| Sd S(sŠAlgo take element's children, clone them, and add them to the main document. Support for relative locations is a bit complicated. The orig document context is lost, so we need to store base location in DOM elements representing , by creating a special temporary "base-location" attribute, and , by resolving the relative "location" and storing it as "location". document -- document we are loading element -- DOM Element representing base_location -- location of document from which this was gleaned. s namespacesdefaultslocations7Invalid import element (missing namespace or location).is#iÿÿÿÿs'Import target element not found for: %sNs definitionsstargetNamespaceisimportstypess base-location(2sDOMsgetAttrselementsNones namespaceslocations WSDLErrors base_locationsbasejoinssetAttributeNSsselfs addImportsobimports_loadeds loadFromURLs importdocsfindssplitsidrefsgetElementByIdsimportedsdocumentElements findTargetNSs imported_tnss localNames childNodessimported_nodess parentNodesparents removeChildsnodesnodeTypes ELEMENT_NODEs importNodesdocumentschilds appendChilds setAttributes_attrsNSsattrsNSskeyssattrkeysNS_XMLNSs cloneNodesattrssetAttributeNodesgetAttributeNSs rlocations alocationsunlink(sselfsdocumentselements base_locationsimported_nodess alocations rlocationsimporteds importdocs namespacesattrsNSslocationsnodesparentsattrkeysobimportschildsidrefsattrs imported_tns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys_import)s`             (s__name__s __module__s__doc__sNones__init__s__del__sversions addServices addMessages addPortTypes addBindings addImportstoDomsloads_import(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysWSDL:s       $ €sElementcBs/tZdZedd„Zd„Zd„ZRS(s@A class that provides common functions for WSDL element classes.scCs||_||_g|_dS(N(snamesselfs documentations extensions(sselfsnames documentation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__vs  cCs&ti|ƒ|_|ii|ƒdS(N(sweakrefsrefsselfsitemsparents extensionssappend(sselfsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addExtension{scCsP|}x?no7t|tƒo|Sny|iƒ}Wq Pq XqWtSdS(s;Return the WSDL object that contains this information item.iN(sselfsparents isinstancesWSDLsNone(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDLs (s__name__s __module__s__doc__sNones__init__s addExtensionsgetWSDL(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysElementts  s ImportElementcBs tZd„Zd„ZeZRS(NcCs||_||_dS(N(s namespacesselfslocation(sselfs namespaceslocation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__s cCsx|iƒ}ttti|itƒƒ}|i ti |i ƒdƒ}|i td|iƒ|i td|iƒdS(Nsimports namespaceslocation(sselfsgetWSDLswsdls ElementProxysNonesDOMs getElementsdocumentsepscreateAppendElements GetWSDLUrisversionsepcssetAttributeNSs namespaceslocation(sselfsepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom•s  (s__name__s __module__s__init__stoDomsNones_loaded(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys ImportElementŒs  sTypescBs,tZd„Zd„Zd„Zd„ZRS(NcCs|iS(N(skstargetNamespace(sselfsk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys scCs&ti||ƒd|_g|_dS(Ns(s Collections__init__sselfsparents documentations extensions(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__¡s cCs|i}|||<|SdS(N(sschemastargetNamespacesnamesself(sselfsschemasname((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addSchema¦s  cCs|ii|ƒdS(N(sselfs extensionssappendsitem(sselfsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys addExtension«s(s__name__s __module__sdefaults__init__s addSchemas addExtension(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysTypesŸs   sMessagecBs5tZdd„Zeed„Zd„Zd„ZRS(NscCs&ti|||ƒt|ƒ|_dS(N(sElements__init__sselfsnames documentations Collectionsparts(sselfsnames documentation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__°scCsˆ|ii|ƒotd|ƒ‚n|tjo |tjotd|ƒ‚nt|ƒ}||_||_||i|<|SdS(Ns"Duplicate message part element: %ss.Missing type or element attribute for part: %s( sselfspartsshas_keysnames WSDLErrorstypesNoneselements MessagePartsitem(sselfsnamestypeselementsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddPart´s    cCsäxÝ|D]Õ}ti|dƒ}t|ƒ}||i|scCs|iƒiƒSdS(s4Return the Service object associated with this port.N(sselfsparent(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getServiceEscCs$|iƒiƒ}|i|iSdS(s:Return the Binding object that is referenced by this port.N(sselfs getServicesgetWSDLswsdlsbindingssbinding(sselfswsdl((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getBindingIscCs4|iƒiƒ}|i|i}|i|iSdS(s;Return the PortType object that is referenced by this port.N(sselfs getServicesgetWSDLswsdlsbindingssbindings portTypesstype(sselfsbindingswsdl((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getPortTypeNscCsLx9|iD].}t|tƒp t|tƒo|Sq q Wtdƒ‚dS(siA convenience method to obtain the extension element used as the address binding for the port.s!No address binding found in port.N(sselfs extensionssitems isinstancesSoapAddressBindingsHttpAddressBindings WSDLError(sselfsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetAddressBindingTs    cCsäxÝ|D]Õ}|i|if\}}|tijo |djo8ti|ddt ƒ}t |ƒ}|i|ƒqq|tijo |djo8ti|ddt ƒ}t|ƒ}|i|ƒqq|i|ƒqWdS(Nsaddressslocationsdefault(selementsses namespaceURIs localNamesnssnamesDOMsNS_SOAP_BINDING_ALLsgetAttrsNoneslocationsSoapAddressBindingsobsselfs addExtensionsNS_HTTP_BINDING_ALLsHttpAddressBinding(sselfselementssesnamesobslocationsns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysload_ex_s    c Cs»|iƒ}tt|ƒ}|iti |i ƒdƒ}|i td|i ƒ|i\}}|i|ƒ}|i tdd||fƒ|iƒ}x|iD]}|i|ƒq WdS(Nsportsnamesbindings%s:%s(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMs GetWSDLUrisversionsepcssetAttributeNSsnamesbindingsnss getPrefixsprefixs_getNodes extensionssextstoDom( sselfsnodesnamesextsepcsprefixswsdlsnssep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDomos   ( s__name__s __module__s__init__s getServices getBindings getPortTypesgetAddressBindingsload_exstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysPort=s     s SoapBindingcBs&tZdd„Zd„Zd„ZRS(NsrpccCs||_||_dS(N(s transportsselfsstyle(sselfs transportsstyle((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__s cCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDLƒscCs…|iƒ}tt|ƒ}|iti |i ƒdƒ}|i o|i td|i ƒn|io|i td|iƒndS(Nsbindings transportsstyle(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcs transportssetAttributeNSsstyle(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom†s   (s__name__s __module__s__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys SoapBinding~s  sSoapAddressBindingcBs#tZd„Zd„Zd„ZRS(NcCs ||_dS(N(slocationsself(sselfslocation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__scCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDL“scCsS|iƒ}tt|ƒ}|iti |i ƒdƒ}|i td|i ƒdS(Nsaddressslocation(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcssetAttributeNSslocation(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom–s (s__name__s __module__s__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapAddressBindings  sSoapOperationBindingcBs)tZeed„Zd„Zd„ZRS(NcCs||_||_dS(N(s soapActionsselfsstyle(sselfs soapActionsstyle((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__žs cCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDL¢scCs…|iƒ}tt|ƒ}|iti |i ƒdƒ}|i o|i td|i ƒn|io|i td|iƒndS(Ns operations soapActionsstyle(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcs soapActionssetAttributeNSsstyle(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom¥s   (s__name__s __module__sNones__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapOperationBindings sSoapBodyBindingcBs,tZeeed„Zd„Zd„ZRS(NcCs…|ddfj otd|ƒ‚n||_||_t|ƒtdƒtdƒfjo|iƒ}n||_||_dS(NsliteralsencodedsInvalid use attribute value: %ssu(suses WSDLErrors encodingStylesselfs namespacestypespartsssplit(sselfsuses namespaces encodingStylesparts((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__°s  % cCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDL¼scCsi|iƒ}tt|ƒ}|iti |i ƒdƒ}|i td|i ƒ|i td|iƒdS(Nsbodysuses namespace(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcssetAttributeNSsuses namespace(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDom¿s  (s__name__s __module__sNones__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapBodyBinding¯s sSoapFaultBindingcBs)tZeed„Zd„Zd„ZRS(NcCsP|ddfj otd|ƒ‚n||_||_||_||_dS(NsliteralsencodedsInvalid use attribute value: %s(suses WSDLErrors encodingStylesselfs namespacesname(sselfsnamesuses namespaces encodingStyle((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__Ès    cCs|iƒiƒSdS(N(sselfsparentsgetWSDL(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetWSDLÒscCs½|iƒ}tt|ƒ}|iti |i ƒdƒ}|i td|i ƒ|i td|iƒ|itj o|i td|iƒn|itj o|i td|iƒndS(Nsbodysusesnames namespaces encodingStyle(sselfsgetWSDLswsdls ElementProxysNonesnodesepscreateAppendElementsDOMsGetWSDLSoapBindingUrisversionsepcssetAttributeNSsusesnames namespaces encodingStyle(sselfsnodesepcswsdlsep((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pystoDomÕs (s__name__s __module__sNones__init__sgetWSDLstoDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapFaultBindingÇs sSoapHeaderBindingcBstZeed„ZdZRS(NcCsY|ddfj otd|ƒ‚n||_||_||_||_||_dS(NsliteralsencodedsInvalid use attribute value: %s(suses WSDLErrors encodingStylesselfs namespacesmessagespart(sselfsmessagespartsuses namespaces encodingStyle((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__âs    sheader(s__name__s __module__sNones__init__stagname(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapHeaderBindingás sSoapHeaderFaultBindingcBstZdZRS(Ns headerfault(s__name__s __module__stagname(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysSoapHeaderFaultBindingïss HttpBindingcBstZd„ZRS(NcCs ||_dS(N(sverbsself(sselfsverb((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ôs(s__name__s __module__s__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys HttpBindingóssHttpAddressBindingcBstZd„ZRS(NcCs ||_dS(N(slocationsself(sselfslocation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__øs(s__name__s __module__s__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysHttpAddressBinding÷ssHttpOperationBindingcBstZd„ZRS(NcCs ||_dS(N(slocationsself(sselfslocation((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ýs(s__name__s __module__s__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysHttpOperationBindingüssHttpUrlReplacementBindingcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysHttpUrlReplacementBindingssHttpUrlEncodedBindingcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysHttpUrlEncodedBindingssMimeContentBindingcBstZeed„ZRS(NcCs||_||_dS(N(spartsselfstype(sselfspartstype((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ s (s__name__s __module__sNones__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysMimeContentBindingssMimeXmlBindingcBstZed„ZRS(NcCs ||_dS(N(spartsself(sselfspart((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__s(s__name__s __module__sNones__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysMimeXmlBindingssMimeMultipartRelatedBindingcBstZd„Zd„ZRS(NcCs g|_dS(N(sselfsparts(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__scCsdx]|D]U}|i|if\}}|tijo |djo|i i t ƒƒqqqWdS(Nspart( selementsses namespaceURIs localNamesnssnamesDOMsNS_MIME_BINDING_ALLsselfspartssappendsMimePartBinding(sselfselementssesnamesns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysload_exs (s__name__s __module__s__init__sload_ex(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysMimeMultipartRelatedBindings sMimePartBindingcBstZd„Zd„ZRS(NcCs g|_dS(N(sselfsitems(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ sc Cs¾x·|D]¯}|i|if\} }| tijo |djoVti|ddt ƒ} ti|ddt ƒ} t | | ƒ}|ii|ƒqq| tijo |djo;ti|ddt ƒ} t| ƒ}|ii|ƒqq| tijo |djo©ti|ddt ƒ}ti|ddt ƒ}ti|d dt ƒ}ti|d dt ƒ}|t jotd ƒ‚nt||||ƒ}|ii|ƒqqqWdS( NscontentspartsdefaultstypesmimeXmlsbodys encodingStyles namespacespartssuses"Invalid soap:body binding element.(selementsses namespaceURIs localNamesnssnamesDOMsNS_MIME_BINDING_ALLsgetAttrsNonespartstypesMimeContentBindingsobsselfsitemssappendsMimeXmlBindingsNS_SOAP_BINDING_ALLsencstyles namespacespartssuses WSDLErrorsSoapBodyBinding( sselfselementssesnamesuses namespacesobsencstylespartsspartsnsstype((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysload_ex#s0  (s__name__s __module__s__init__sload_ex(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysMimePartBindings s WSDLErrorcBstZRS(N(s__name__s __module__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys WSDLErrorAscCs,|i|ƒodSn|i||ƒdS(N(swriters hasNSPrefixsnsurisdeclareNSPrefixsprefix(swritersprefixsnsuri((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysDeclareNSPrefixFscCsd|iddƒ}t|ƒdjoti|ƒ|fSnti|d|ƒ}||dfSdS(Ns:ii( svaluessplitspartsslensDOMs findTargetNSselementsfindNamespaceURIsnsuri(svalueselementspartssnsuri((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys ParseTypeRefKs cCsp|iddƒ}t|ƒdjo$ti|d|ƒ}|d}nti |ƒ}|d}||fSdS(Ns:iiiiÿÿÿÿ( svaluessplitsnamerefslensDOMsfindNamespaceURIselementsnsurisnames findTargetNS(svalueselementsnamerefsnamesnsuri((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys ParseQNameRs cCs>ti|dttƒ}|tj oti|ƒSndSdS(Ns documentations(sDOMs getElementselementsNonesdocnodesgetElementText(selementsdocnode((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysGetDocumentation\s cCsOgi}ti|ttƒD]'}|itijo||ƒqq~SdS(N( sappends_[1]sDOMs getElementsselementsNonesitems namespaceURIsNS_WSDL(selements_[1]sitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys GetExtensionsbscCs0|i|i}|tj o|SntiSdS(sUFind wsa:Action attribute, and return value or WSA.FAULT for the default. N(s operationsfaultssnamesactionsattrsNonesWSAsFAULT(s operationsnamesattr((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysGetWSAActionFaultfs  cCs¡|ii}|tj o|Sn|iƒ}|iƒ}|i }|ii }| o|i d}n|i dƒod|||fSnd|||fSdS(s;Find wsa:Action attribute, and return value or the default.sRequests/s%s%s/%ss%s/%s/%sN( s operationsinputsactionsattrsNones getPortTypesportTypesgetTargetNamespacestargetNamespacesnamesptNamesmsgNamesendswith(s operationsattrsmsgNamesptNamesportTypestargetNamespace((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysGetWSAActionInputos      cCs¡|ii}|tj o|Sn|iƒiƒ}|iƒi}|ii}| o|id}n|i dƒod|||fSnd|||fSdS(s;Find wsa:Action attribute, and return value or the default.sResponses/s%s%s/%ss%s/%s/%sN( s operationsoutputsactionsattrsNones getPortTypesgetTargetNamespacestargetNamespacesnamesptNamesmsgNamesendswith(s operationsattrsmsgNamesptNamestargetNamespace((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysGetWSAActionOutput~s   cCsÈt||ƒoxg}|\}}gi}|i D]J}t |dƒo#t i ||iƒo |i|jo||ƒq3q3~Sngi}|i D]$}t||ƒo||ƒq™q™~SdS(NsnodeType(s isinstanceskindst_typesresults namespaceURIsnamesappends_[1]sobjects extensionssitemshasattrsDOMs nsUriMatch(sobjectskindst_typesnamesitems_[1]s namespaceURIsresult((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysFindExtensionsŒs  fcCs¦t||ƒob|\}}x|iD]D}t|dƒo#t i ||iƒo |i|jo|Sq&q&Wn-x)|iD]}t||ƒo|Sq|q|Wt SdS(NsnodeType( s isinstanceskindst_types namespaceURIsnamesobjects extensionssitemshasattrsDOMs nsUriMatchsNone(sobjectskindst_typesnamesitems namespaceURI((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys FindExtension–s  6  s SOAPCallInfocBsÂtZdZd„ZeiZdZeZ eZ eZ eZ dZ dZedd„Zedd„Zedd„Zddd „Zddd „Zd „Zd „Zd „Zd„Zd„ZRS(s£SOAPCallInfo captures the important binding information about a SOAP operation, in a structure that is easier to work with than raw WSDL structures.cCs:||_g|_g|_g|_g|_t|_dS(N(s methodNamesselfs inheaderss outheaderssinparamss outparamssNonesretval(sselfs methodName((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ªs      ssencodedsrpcicCs-t||||ƒ}|ii|ƒ|SdS(s4Add an input parameter description to the call info.N( s ParameterInfosnamestypes namespaces element_types parametersselfsinparamssappend(sselfsnamestypes namespaces element_types parameter((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddInParameter»scCs-t||||ƒ}|ii|ƒ|SdS(s5Add an output parameter description to the call info.N( s ParameterInfosnamestypes namespaces element_types parametersselfs outparamssappend(sselfsnamestypes namespaces element_types parameter((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddOutParameterÁscCs&t||||ƒ}||_|SdS(s7Set the return parameter description for the call info.N(s ParameterInfosnamestypes namespaces element_types parametersselfsretval(sselfsnamestypes namespaces element_types parameter((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pyssetReturnParameterÇs cCsAt||||ƒ}|o d|_n|ii |ƒ|SdS(s6Add an input SOAP header description to the call info.iN( s HeaderInfosnamestypes namespaces element_types headerinfosmustUnderstandsselfs inheaderssappend(sselfsnamestypes namespaces element_typesmustUnderstands headerinfo((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddInHeaderInfoÍs  cCsAt||||ƒ}|o d|_n|ii |ƒ|SdS(s7Add an output SOAP header description to the call info.iN( s HeaderInfosnamestypes namespaces element_types headerinfosmustUnderstandsselfs outheaderssappend(sselfsnamestypes namespaces element_typesmustUnderstands headerinfo((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysaddOutHeaderInfoÖs  cCs |iSdS(s5Return a sequence of the in parameters of the method.N(sselfsinparams(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetInParametersßscCs |iSdS(s6Return a sequence of the out parameters of the method.N(sselfs outparams(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetOutParametersãscCs |iSdS(s7Return param info about the return value of the method.N(sselfsretval(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pysgetReturnParameterçscCs |iSdS(s2Return a sequence of the in headers of the method.N(sselfs inheaders(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getInHeadersëscCs |iSdS(s3Return a sequence of the out headers of the method.N(sselfs outheaders(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys getOutHeadersïs(s__name__s __module__s__doc__s__init__sDOMs NS_SOAP_ENCs encodingStyles documentationsNones soapActions transports namespaceslocationsusesstylesaddInParametersaddOutParameterssetReturnParametersaddInHeaderInfosaddOutHeaderInfosgetInParameterssgetOutParameterssgetReturnParameters getInHeaderss getOutHeaders(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys SOAPCallInfo¥s(        s ParameterInfocBs/tZdZedd„ZdZeZeZRS(s>A ParameterInfo object captures parameter binding information.icCsD|o d|_n|tj o ||_n||_||_dS(Ni(s element_typesselfs namespacesNonesnamestype(sselfsnamestypes namespaces element_type((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__ös     (s__name__s __module__s__doc__sNones__init__s element_types namespacesdefault(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys ParameterInfoôs s HeaderInfocBs&tZdZed„ZdZeZRS(s=A HeaderInfo object captures SOAP header binding information.cCsti|||||ƒdS(N(s ParameterInfos__init__sselfsnamestypes namespaces element_type(sselfsnamestypes namespaces element_type((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys__init__si(s__name__s __module__s__doc__sNones__init__smustUnderstandsactor(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys HeaderInfos  cCs|iƒiƒ}|iƒ}|iƒ} | i|}|i|}|i }t |ƒ}|iƒ}t|tƒ o td‚n|i|_|itƒ}|tjo td‚n|i|_|ipd|_|itƒ}|tj o&|i|_|ip|i|_n|i} |itj o¨||ii }|i} | it"ƒ}|tj o td‚qÚxy| i$t%ƒD]h}||i i'|i(}|i)|i |i*p|i+|i,d|i*odpdƒ}|i.|_.q„W| it/ƒ} | tjo td‚n| i.|_.| i,|_,| i1|_1| i'tj o2g} x8| i'D]}| i2|i'|ƒq]Wn|i'i3ƒ} xI| D]=}|i4|i |i*p|i+d|i*odpdƒq•Wn|i5tj o"y||i5i }Wnht6j o\t7i8ot9d |i5i ƒ‚qi|i:|i5i ƒ}d Gd Gd GHd G|i5i GHnX|i5} | it"ƒ}|tj o td‚q xy| i$t%ƒD]h}||i i'|i(}|i;|i |i*p|i+|i,d|i*odpdƒ}|i.|_.q«W| it/ƒ} | tjo td‚n| i.|_.| i,|_,| i1|_1| i'tj o2g} x8| i'D]}| i2|i'|ƒq„Wn|i'i3ƒ} | oLxI| D]=}|i<|i |i*p|i+d|i*odpdƒqÃWq n|SdS(s;Return a SOAPCallInfo given a WSDL port and operation name.sUnsupported binding type.sMissing soap:binding element.sdocuments Mime bindings are not supported.s element_typeiisMissing soap:body binding.s3Recieved message not defined in the WSDL schema: %ssWarning:s0Recieved message not defined in the WSDL schema.s Adding it.sMessage:N(=sports getServicesgetWSDLswsdls getBindingsbindings getPortTypesportTypes operationssnames operations opbindingsmessagess SOAPCallInfoscallinfosgetAddressBindings addrbindings isinstancesSoapAddressBindings ValueErrorslocations findBindings SoapBindings soapbindingsNones transportsstylesSoapOperationBindingssoap_op_bindings soapActionsparameterOrdersinputsmessagesmsgrolesMimeMultipartRelatedBindingsmimes findBindingssSoapHeaderBindingsitemspartsspartsaddInHeaderInfoselementstypes namespacesheaders encodingStylesSoapBodyBindingsbodysusesappendsvaluessaddInParametersoutputsKeyErrorsselfsstricts RuntimeErrors addMessagesaddOutHeaderInfosaddOutParameter(sportsnamessoap_op_bindingsbindingsheaders operationscallinfosmessages opbindingspartssparameterOrdersmsgrolesportTypesbodyspartsmimeswsdls addrbindingsmessagessitems soapbinding((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pyscallInfoFromWSDL sº                          #             '(Dsidentsweakrefs cStringIOsStringIOs NamespacessOASISsXMLNSsWSAsWSA_LISTs WSRF_V1_2sWSRFsUtilitys Collections CollectionNSsDOMs ElementProxysbasejoins XMLSchemas SchemaReadersWSDLToolsAdapters WSDLReadersWSDLsElements ImportElementsTypessMessages MessagePartsPortTypes Operations MessageRolesBindingsOperationBindingsMessageRoleBindingsServicesPorts SoapBindingsSoapAddressBindingsSoapOperationBindingsSoapBodyBindingsSoapFaultBindingsSoapHeaderBindingsSoapHeaderFaultBindings HttpBindingsHttpAddressBindingsHttpOperationBindingsHttpUrlReplacementBindingsHttpUrlEncodedBindingsMimeContentBindingsMimeXmlBindingsMimeMultipartRelatedBindingsMimePartBindings Exceptions WSDLErrorsDeclareNSPrefixs ParseTypeRefs ParseQNamesGetDocumentations GetExtensionssGetWSAActionFaultsGetWSAActionInputsGetWSAActionOutputstypesFindExtensionss FindExtensions SOAPCallInfos ParameterInfos HeaderInfoscallInfoFromWSDL(?sWSAs HttpBindingsMimeXmlBindingsServicesDOMs ImportElementsbasejoinsHttpUrlEncodedBindings HeaderInfos SOAPCallInfosGetWSAActionOutputs MessageParts ParseTypeRefsWSDLToolsAdaptersOperationBindingsFindExtensionss MessageRolesSoapFaultBindingsWSA_LISTs Collections GetExtensionssOASISs FindExtensions SoapBindings CollectionNSsMimeMultipartRelatedBindingsTypessSoapHeaderFaultBindings WSRF_V1_2sXMLNSsMimeContentBindingsGetDocumentationsSoapOperationBindingsHttpAddressBindings WSDLErrorsElementsGetWSAActionFaults ElementProxysGetWSAActionInputs XMLSchemasPortTypesWSDLs Operations SchemaReaderscallInfoFromWSDLsidents ParameterInfosMessageRoleBindingsStringIOsSoapAddressBindingsSoapBodyBindingsBindingsHttpUrlReplacementBindingsDeclareNSPrefixsPortsweakrefs ParseQNamesWSRFsMimePartBindingsMessagesSoapHeaderBindings WSDLReadersHttpOperationBinding((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/WSDLTools.pys? sh  +%'ÿ;F'fM-^Tf)A "       O PK¨58î4xxZSI/wstools/XMLname.pyo;ò •@Ec@sMdZdZdkTd„Zd„Zd„Zd„Zd„Zd„Zd S( sÕTranslate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2: Adjuncts", W3C Working Draft 17, December 2001, Also see . Author: Gregory R. Warnes Date:: 2002-04-25 Version 0.9.0 s1$Id: XMLname.py 954 2005-02-16 14:45:37Z warnes $(s*cCsB|iƒp1|iƒp$|djp|djp |djSdS(Ns.s-s_(sxsisalphasisdigit(sx((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys _NCNameCharscCs|iƒp |djSdS(Ns_(sxsisalpha(sx((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys_NCNameStartCharscCstt|dƒƒd}t|ƒ}|djod|}nÇ|djod|}n¬|djod|}n‘|djod |}nv|d jod|}n[|d jod|}n@|d jod|}n%|d jod |}n td‚d|dSdS(Niiis000s00is0isiiiis'Illegal Value returned from hex(ord(x))s_xs_(shexsordsxshexvalslenshexlens Exception(sxshexlenshexval((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys _toUnicodeHexs(          cCstd|dd!dƒSdS(Nsu"\uiiÿÿÿÿs"(sevalsx(sx((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys_fromUnicodeHex.scCsä|idƒdjo|iddƒ\}}n t}|}t|ƒ}t|ƒ}g}xRt |ƒD]D}||djo#||djo||ddjo|i dƒqi|djop|djoc|ddjp|dd joA|dd jp|dd jo|d d jp|d djo|i d|dƒqit||ƒ p|djot||ƒ o|i t||ƒƒqi|i ||ƒqiW|od|di|ƒfSndi|ƒSdS(sConvert string to a XML name.s:iÿÿÿÿiu_uxu_x005F_iiuXumuMiuluLu_xFFFF_s%s:%suN(sstringsfindssplitsprefixs localnamesNonesunicodesTslensNsXsrangesisappends _NCNameChars_NCNameStartChars _toUnicodeHexsjoin(sstringsisNsprefixsTsXs localname((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys toXMLname2s(   7€1cCs5tdd|ƒ}d„}td||ƒ}|SdS(s#Convert XML name to unicode string.s_xFFFF_scCst|idƒƒSdS(Ni(s_fromUnicodeHexsmatchobjsgroup(smatchobj((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pysfunUss_x[0-9A-Za-z]+_N(ssubsstringsretvalsfun(sstringsfunsretval((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys fromXMLnamePs  N( s__doc__sidentsres _NCNameChars_NCNameStartChars _toUnicodeHexs_fromUnicodeHexs toXMLnames fromXMLname(sidents_NCNameStartChars _NCNameChars_fromUnicodeHexs toXMLnames fromXMLnames _toUnicodeHex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLname.pys?s     PK†¨58ú&ÂZSI/wstools/UserTuple.pyc;ò •@Ec@sdZdfd„ƒYZdS(s÷ A more or less complete user-defined wrapper around tuple objects. Adapted version of the standard library's UserList. Taken from Stefan Schwarzer's ftputil library, available at , and used under this license: Copyright (C) 1999, Stefan Schwarzer 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 above author nor the names of the contributors to the software 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 REGENTS 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. s UserTuplecBs¡tZed„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„ZeZRS(NcCswf|_|tj o]t|ƒt|iƒjo ||_qst|tƒo|i|_qst|ƒ|_ndS(N(sselfsdatas inittuplesNonestypes isinstances UserTuplestuple(sselfs inittuple((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__init__7s   cCst|iƒSdS(N(sreprsselfsdata(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__repr__FscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__lt__GscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__le__HscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__eq__IscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__ne__JscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__gt__KscCs|i|i|ƒjSdS(N(sselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__ge__LscCs#t|tƒo |iSn|SdS(N(s isinstancesothers UserTuplesdata(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__castMs cCst|i|i|ƒƒSdS(N(scmpsselfsdatas_UserTuple__castsother(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__cmp__PscCs||ijSdS(N(sitemsselfsdata(sselfsitem((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys __contains__RscCst|iƒSdS(N(slensselfsdata(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__len__SscCs|i|SdS(N(sselfsdatasi(sselfsi((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys __getitem__TscCs9t|dƒ}t|dƒ}|i|i||!ƒSdS(Ni(smaxsisjsselfs __class__sdata(sselfsisj((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys __getslice__UscCszt|tƒo|i|i|iƒSnLt|t|iƒƒo|i|i|ƒSn|i|it|ƒƒSdS(N(s isinstancesothers UserTuplesselfs __class__sdatastypestuple(sselfsother((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__add__Xs cCs|i|i|ƒSdS(N(sselfs __class__sdatasn(sselfsn((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys__mul__`s(s__name__s __module__sNones__init__s__repr__s__lt__s__le__s__eq__s__ne__s__gt__s__ge__s_UserTuple__casts__cmp__s __contains__s__len__s __getitem__s __getslice__s__add__s__mul__s__rmul__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys UserTuple6s"                N(s__doc__s UserTuple(s UserTuple((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/UserTuple.pys?*s PKN¤Y5 f§"¥"¥"ZSI/wstools/Namespaces.py# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. """Namespace module, so you don't need PyXML """ ident = "$Id: Namespaces.py 1160 2006-03-17 19:28:11Z boverhof $" try: from xml.ns import SOAP, SCHEMA, WSDL, XMLNS, DSIG, ENCRYPTION DSIG.C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315" except: class SOAP: ENV = "http://schemas.xmlsoap.org/soap/envelope/" ENC = "http://schemas.xmlsoap.org/soap/encoding/" ACTOR_NEXT = "http://schemas.xmlsoap.org/soap/actor/next" class SCHEMA: XSD1 = "http://www.w3.org/1999/XMLSchema" XSD2 = "http://www.w3.org/2000/10/XMLSchema" XSD3 = "http://www.w3.org/2001/XMLSchema" XSD_LIST = [ XSD1, XSD2, XSD3 ] XSI1 = "http://www.w3.org/1999/XMLSchema-instance" XSI2 = "http://www.w3.org/2000/10/XMLSchema-instance" XSI3 = "http://www.w3.org/2001/XMLSchema-instance" XSI_LIST = [ XSI1, XSI2, XSI3 ] BASE = XSD3 class WSDL: BASE = "http://schemas.xmlsoap.org/wsdl/" BIND_HTTP = "http://schemas.xmlsoap.org/wsdl/http/" BIND_MIME = "http://schemas.xmlsoap.org/wsdl/mime/" BIND_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/" BIND_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/" class XMLNS: BASE = "http://www.w3.org/2000/xmlns/" XML = "http://www.w3.org/XML/1998/namespace" HTML = "http://www.w3.org/TR/REC-html40" class DSIG: BASE = "http://www.w3.org/2000/09/xmldsig#" C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315" C14N_COMM = "http://www.w3.org/TR/2000/CR-xml-c14n-20010315#WithComments" C14N_EXCL = "http://www.w3.org/2001/10/xml-exc-c14n#" DIGEST_MD2 = "http://www.w3.org/2000/09/xmldsig#md2" DIGEST_MD5 = "http://www.w3.org/2000/09/xmldsig#md5" DIGEST_SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1" ENC_BASE64 = "http://www.w3.org/2000/09/xmldsig#base64" ENVELOPED = "http://www.w3.org/2000/09/xmldsig#enveloped-signature" HMAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1" SIG_DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1" SIG_RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116" XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116" class ENCRYPTION: BASE = "http://www.w3.org/2001/04/xmlenc#" BLOCK_3DES = "http://www.w3.org/2001/04/xmlenc#des-cbc" BLOCK_AES128 = "http://www.w3.org/2001/04/xmlenc#aes128-cbc" BLOCK_AES192 = "http://www.w3.org/2001/04/xmlenc#aes192-cbc" BLOCK_AES256 = "http://www.w3.org/2001/04/xmlenc#aes256-cbc" DIGEST_RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160" DIGEST_SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256" DIGEST_SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512" KA_DH = "http://www.w3.org/2001/04/xmlenc#dh" KT_RSA_1_5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5" KT_RSA_OAEP = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" STREAM_ARCFOUR = "http://www.w3.org/2001/04/xmlenc#arcfour" WRAP_3DES = "http://www.w3.org/2001/04/xmlenc#kw-3des" WRAP_AES128 = "http://www.w3.org/2001/04/xmlenc#kw-aes128" WRAP_AES192 = "http://www.w3.org/2001/04/xmlenc#kw-aes192" WRAP_AES256 = "http://www.w3.org/2001/04/xmlenc#kw-aes256" class WSRF_V1_2: '''OASIS WSRF Specifications Version 1.2 ''' class LIFETIME: XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd" XSD_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.xsd" WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl" WSDL_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.wsdl" LATEST = WSDL_DRAFT4 WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT4) XSD_LIST = (XSD_DRAFT1, XSD_DRAFT4) class PROPERTIES: XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd" XSD_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd" WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl" WSDL_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.wsdl" LATEST = WSDL_DRAFT5 WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT5) XSD_LIST = (XSD_DRAFT1, XSD_DRAFT5) class BASENOTIFICATION: XSD_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd" WSDL_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl" LATEST = WSDL_DRAFT1 WSDL_LIST = (WSDL_DRAFT1,) XSD_LIST = (XSD_DRAFT1,) class BASEFAULTS: XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd" XSD_DRAFT3 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-BaseFaults-1.2-draft-03.xsd" #LATEST = DRAFT3 #WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT3) XSD_LIST = (XSD_DRAFT1, XSD_DRAFT3) WSRF = WSRF_V1_2 WSRFLIST = (WSRF_V1_2,) class OASIS: '''URLs for Oasis specifications ''' WSSE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" UTILITY = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" class X509TOKEN: Base64Binary = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" STRTransform = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0" PKCS7 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#PKCS7" X509 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509" X509PKIPathv1 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1" X509v3SubjectKeyIdentifier = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3SubjectKeyIdentifier" LIFETIME = WSRF_V1_2.LIFETIME.XSD_DRAFT1 PROPERTIES = WSRF_V1_2.PROPERTIES.XSD_DRAFT1 BASENOTIFICATION = WSRF_V1_2.BASENOTIFICATION.XSD_DRAFT1 BASEFAULTS = WSRF_V1_2.BASEFAULTS.XSD_DRAFT1 class WSTRUST: BASE = "http://schemas.xmlsoap.org/ws/2004/04/trust" ISSUE = "http://schemas.xmlsoap.org/ws/2004/04/trust/Issue" class WSSE: BASE = "http://schemas.xmlsoap.org/ws/2002/04/secext" TRUST = WSTRUST.BASE class WSU: BASE = "http://schemas.xmlsoap.org/ws/2002/04/utility" UTILITY = "http://schemas.xmlsoap.org/ws/2002/07/utility" class WSR: PROPERTIES = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceProperties" LIFETIME = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime" class WSA200408: ADDRESS = "http://schemas.xmlsoap.org/ws/2004/08/addressing" ANONYMOUS = "%s/role/anonymous" %ADDRESS FAULT = "%s/fault" %ADDRESS class WSA200403: ADDRESS = "http://schemas.xmlsoap.org/ws/2004/03/addressing" ANONYMOUS = "%s/role/anonymous" %ADDRESS FAULT = "%s/fault" %ADDRESS class WSA200303: ADDRESS = "http://schemas.xmlsoap.org/ws/2003/03/addressing" ANONYMOUS = "%s/role/anonymous" %ADDRESS FAULT = None WSA = WSA200408 WSA_LIST = (WSA200408, WSA200403, WSA200303) class WSP: POLICY = "http://schemas.xmlsoap.org/ws/2002/12/policy" class BEA: SECCONV = "http://schemas.xmlsoap.org/ws/2004/04/sc" SCTOKEN = "http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct" class GLOBUS: SECCONV = "http://wsrf.globus.org/core/2004/07/security/secconv" CORE = "http://www.globus.org/namespaces/2004/06/core" SIG = "http://www.globus.org/2002/04/xmlenc#gssapi-sign" TOKEN = "http://www.globus.org/ws/2004/09/security/sc#GSSAPI_GSI_TOKEN" ZSI_SCHEMA_URI = 'http://www.zolera.com/schemas/ZSI/' PK¨58õŽ9££ZSI/wstools/Utility.pyo;ò •@Ec@s7dZdkZdkZdkZdkZdkZdkZdkZdkl Z dk l Z l Z l Z dklZdklZdklZlZdklZdklZlZd klZyd klZWnd „ZnXdkZd klZdkZd kl Z dk!l"Z"l#Z#l$Z$l%Z%ydk&l'Z'Wnd„Z'nXei(Z(ei)dd!dddddfdd!jodZ*d„Z(ndefd„ƒYZ+defd„ƒYZ,defd„ƒYZ-defd„ƒYZ.dfd „ƒYZ/d!fd"„ƒYZ0d#efd$„ƒYZ1d%efd&„ƒYZ2d'e3d(„Z4d)fd*„ƒYZ5e5ƒZ5d+fd,„ƒYZ6d-e/e6fd.„ƒYZ7d/efd0„ƒYZ8d1efd2„ƒYZ9d3k:l;Z;l<Z<no(d5„Z=e=e;_=d6„Z>e>e;_>nnod7„Z?e?ei@iA_?ndS(8s4$Id: Utility.py 1116 2006-01-24 20:51:57Z boverhof $N(sisfile(sjoinsstripssplit(sUserDict(sStringIO(s TimeoutSockets TimeoutError(surlparse(sHTTPConnectionsHTTPSConnection(s Exception(s _get_idstrcCs7t|ƒ}|djodt|ƒSnd|SdS(sªPython 2.3.x generates a FutureWarning for negative IDs, so we use a different prefix character to ensure uniqueness, and call abs() to avoid the warning.isx%xso%xN(sidspyobjsxsabs(spyobjsx((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _get_idstrs   (sNode(s Canonicalize(sSCHEMAsSOAPsXMLNSsZSI_SCHEMA_URI(s SplitQNamecCs~|idƒ}t|ƒdjo|idtƒn;t|ƒdjo#|ddjo|iƒqpndSt|ƒSdS(sFSplitQName(qname) -> (string, string) Split Qualified Name into a tuple of len 2, consisting of the prefix and the local name. (prefix, localName) Special Cases: xmlns -- (localName, 'xmlns') None -- (None, localName) s:iiisxmlnsN(sqnamessplitslslensinsertsNonesreversestuple(sqnamesl((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys SplitQName1s iiisfinals./cCsB|itƒtjoti||dƒSnti||ƒSdS(Ni(surls startswithstokensTruesurllibsbasejoinsbase(sbasesurl((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysbasejoinPssNamespaceErrorcBstZdZRS(s#Used to indicate a Namespace Error.(s__name__s __module__s__doc__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysNamespaceErrorUs sRecursionErrorcBstZdZRS(s+Used to indicate a HTTP redirect recursion.(s__name__s __module__s__doc__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysRecursionErrorYs s ParseErrorcBstZdZRS(s%Used to indicate a XML parsing error.(s__name__s __module__s__doc__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys ParseError]s s DOMExceptioncBstZdZRS(s*Used to indicate a problem processing DOM.(s__name__s __module__s__doc__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys DOMExceptionas sBasecBstZdZed„ZRS(s%Base class for instance level LoggingcCs,tid||it|ƒfƒ|_dS(Ns %s-%s(%s)(sloggings getLoggersmodulesselfs __class__s _get_idstrslogger(sselfsmodule((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__gs(s__name__s __module__s__doc__s__init__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysBasees s HTTPResponsecBstZdZd„ZRS(s5Captures the information in an HTTP response message.cCsH|i|_|i|_|i|_|iƒpt|_|i ƒdS(N( sresponsesstatussselfsreasonsmsgsheaderssreadsNonesbodysclose(sselfsresponse((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__ns    (s__name__s __module__s__doc__s__init__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys HTTPResponseks s TimeoutHTTPcBs&tZdZedd„Zd„ZRS(s=A custom http connection object that supports socket timeout.icCs ti|||ƒ||_dS(N(sHTTPConnections__init__sselfshostsportstimeout(sselfshostsportstimeout((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__wscCs2t|iƒ|_|ii|i|ifƒdS(N(s TimeoutSocketsselfstimeoutssocksconnectshostsport(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysconnect{s(s__name__s __module__s__doc__sNones__init__sconnect(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys TimeoutHTTPus s TimeoutHTTPScBs&tZdZedd„Zd„ZRS(sºA custom https object that supports socket timeout. Note that this is not really complete. The builtin SSL support in the Python socket module requires a real socket (type) to be passed in to be hooked to SSL. That means our fake socket won't work and our timeout hacks are bypassed for send and recv calls. Since our hack _is_ in place at connect() time, it should at least provide some timeout protection.icKs)ti|t|ƒ||||_dS(N(sHTTPSConnections__init__sselfsstrshostsportskwargsstimeout(sselfshostsportstimeoutskwargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__‡scCstt|iƒ}|i|i|ifƒt|id|iƒ}t i ||i |i ƒ}t i||ƒ|_dS(Ns_sock(s TimeoutSocketsselfstimeoutssocksconnectshostsportsgetattrsrealsockssocketssslskey_files cert_fileshttplibs FakeSocket(sselfssockssslsrealsock((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysconnect‹s (s__name__s __module__s__doc__sNones__init__sconnect(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys TimeoutHTTPS€s icCsœt|ƒ\}} } }}} |ddfj oti |ƒSn|od| |f} n|od| |f} n| od| | f} n|djogt t dƒot | t |ƒ}qdk}|iiƒ}|i|ƒ|ii| d|ƒ}nt| t |ƒ}|id | ƒ|id d ƒ|iƒt } xBno:|iƒ} | id joPnti|_ t |_!qTW| i}|djo |djo›| i"i#dƒ}|t j ol| i%ƒ|t j o |i'|ƒot(dƒ‚n|t jo h}nd ||e:e:e:d$d%„Z?e:d&„Z@e:d'„ZAe:e<d(„ZBd)„ZCe:d*„ZDd+„ZEd,„ZFd-„ZGd.„ZHd/d0„ZId1„ZJd/eKfƒd2„ZLe:d3„ZMd4„ZNd5„ZORS(6sThe DOM singleton defines a number of XML related constants and provides a number of utility methods for DOM related tasks. It also provides some basic abstractions so that the rest of the package need not care about actual DOM implementation in use.s)http://schemas.xmlsoap.org/soap/envelope/s)http://schemas.xmlsoap.org/soap/encoding/s'http://www.w3.org/2001/06/soap-envelopes'http://www.w3.org/2001/06/soap-encodings1.1s1.2s*http://schemas.xmlsoap.org/soap/actor/nexts2http://www.w3.org/2001/06/soap-envelope/actor/nextcCs;|ii|ƒ}|tj o|Sntd|ƒ‚dS(s3Return the SOAP version related to an envelope uri.s!Unsupported SOAP envelope uri: %sN(sselfs_soap_uri_mappingsgetsurisvaluesNones ValueError(sselfsurisvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysSOAPUriToVersionís  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(spReturn the appropriate SOAP envelope uri for a given human-friendly SOAP version string (e.g. '1.1').sNS_SOAP_ENV_%ss.s_sUnsupported SOAP version: %sN( sjoinssplitsversionsattrnamesgetattrsselfsNonesvalues ValueError(sselfsversionsvaluesattrname((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys GetSOAPEnvUriös  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(spReturn the appropriate SOAP encoding uri for a given human-friendly SOAP version string (e.g. '1.1').sNS_SOAP_ENC_%ss.s_sUnsupported SOAP version: %sN( sjoinssplitsversionsattrnamesgetattrsselfsNonesvalues ValueError(sselfsversionsvaluesattrname((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys GetSOAPEncUris  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(soReturn the right special next-actor uri for a given human-friendly SOAP version string (e.g. '1.1').sSOAP_ACTOR_NEXT_%ss.s_sUnsupported SOAP version: %sN( sjoinssplitsversionsattrnamesgetattrsselfsNonesvalues ValueError(sselfsversionsvaluesattrname((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetSOAPActorNextUri s  s http://www.w3.org/1999/XMLSchemas)http://www.w3.org/1999/XMLSchema-instances#http://www.w3.org/2000/10/XMLSchemas,http://www.w3.org/2000/10/XMLSchema-instances http://www.w3.org/2001/XMLSchemas)http://www.w3.org/2001/XMLSchema-instancecCs|ii|ƒSdS(sjReturn the appropriate matching XML Schema instance uri for the given XML Schema namespace uri.N(sselfs_xsd_uri_mappingsgetsuri(sselfsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysInstanceUriForSchemaUri3scCs|ii|ƒSdS(stReturn the appropriate matching XML Schema namespace uri for the given XML Schema instance namespace uri.N(sselfs_xsd_uri_mappingsgetsuri(sselfsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysSchemaUriForInstanceUri8ss http://schemas.xmlsoap.org/wsdl/s%http://schemas.xmlsoap.org/wsdl/soap/s%http://schemas.xmlsoap.org/wsdl/http/s%http://schemas.xmlsoap.org/wsdl/mime/s$http://schemas.xmlsoap.org/soap/httpcCs;|ii|ƒ}|tj o|Sntd|ƒ‚dS(s8Return the WSDL version related to a WSDL namespace uri.s!Unsupported SOAP envelope uri: %sN(sselfs_wsdl_uri_mappingsgetsurisvaluesNones ValueError(sselfsurisvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysWSDLUriToVersionYs  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(Ns NS_WSDL_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys GetWSDLUribs  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(NsNS_SOAP_BINDING_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetWSDLSoapBindingUriks  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(NsNS_HTTP_BINDING_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetWSDLHttpBindingUrits  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(NsNS_MIME_BINDING_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetWSDLMimeBindingUri}s  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(NsNS_SOAP_HTTP_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetWSDLHttpTransportUri†s  shttp://www.w3.org/2000/xmlns/cCsO|i|ijodSn|i|jo |tjp|i|i |ƒSdS(sfReturn true if the given node is an element with the given name and optional namespace uri.iN( snodesnodeTypes ELEMENT_NODEs localNamesnamesnsurisNonesselfs nsUriMatchs namespaceURI(sselfsnodesnamesnsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys isElement•scCs¡|i}|i}xj|iD]_}|i|joI|i|jp |t jo|t jp||i |ƒo|Sq{qqW|tj o|Snt|‚dS(stReturn the first child of node with a matching name and namespace uri, or the default if one is provided.N(sselfs nsUriMatchsnsmatchsnodes ELEMENT_NODEs childNodesschildsnodeTypes localNamesnamesNonesnsuris namespaceURIsdefaultsjoinsKeyError(sselfsnodesnamesnsurisdefaultsnsmatchs ELEMENT_NODEschild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getElements   = cCsz|i}|i}xC|iD]8}|i|jo"||dƒ|jo|SqTqqW|t j o|Snt t ‚dS(s8Return the first child of node matching an id reference.sidN( sselfsgetAttrsattrgetsnodes ELEMENT_NODEs childNodesschildsnodeTypesidsdefaultsjoinsKeyErrorsname(sselfsnodesidsdefaultsattrgets ELEMENT_NODEschild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetElementById¬s    ic CsÍ|tj o|i}h}n|iidtƒ}|tj o|||i element mapping of those elements within a document that define an id attribute. The depth of the search may be controlled by using the (1-based) depth argument.sidiN(sdocumentsNonesdocumentElementselementsmappings_attrssgetsattrsvaluesdepthslevels ELEMENT_NODEs childNodesschildsnodeTypesselfsgetMappingById( sselfsdocumentsdepthselementsmappingslevelsattrs ELEMENT_NODEschild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetMappingById¸s       %cCs–|i}g}|i}xs|iD]h}|i|joR|i |jp |t jo|t jp||i |ƒo|i|ƒqŠq"q"W|SdS(szReturn a sequence of the child elements of the given node that match the given name and optional namespace uri.N(sselfs nsUriMatchsnsmatchsresultsnodes ELEMENT_NODEs childNodesschildsnodeTypes localNamesnamesNonesnsuris namespaceURIsappend(sselfsnodesnamesnsurisnsmatchs ELEMENT_NODEsresultschild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getElementsËs   =cCsA|tjo |i|ƒotSntSn|i||ƒSdS(sÉReturn true if element has attribute with the given name and optional nsuri. If nsuri is not specified, returns true if an attribute exists with the given name with any namespace.N(snsurisNonesnodes hasAttributesnamesTruesFalseshasAttributeNS(sselfsnodesnamesnsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyshasAttrØs  cCsÄ|tjog|ii|tƒ}|tjoAx>|iiƒD])}|d|jo|i|}Pq?q?Wqn|ii||ftƒ}|tj o |i Sn|t j o|SndSdS(súReturn the value of the attribute named 'name' with the optional nsuri, or the default if one is specified. If nsuri is not specified, an attribute that matches the given name will be returned regardless of namespace.isN( snsurisNonesnodes_attrssgetsnamesresults_attrsNSskeyssitemsvaluesdefaultsjoin(sselfsnodesnamesnsurisdefaultsitemsresult((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetAttrâs      cCs;h}x*|iiƒD]\}}|i||d'„Z?d(„Z@d)„ZAd*„ZBd+„ZCd,„ZDd-„ZEd.„ZFd/„ZGd0„ZHRS(1s sSOAP-ENVsSOAP-ENCsZSIsxsdsxsisxmlsxmlnscCs½d|_ti||ƒti|ƒt|_t|_ t |ƒt i t ifjo|i|ƒn-t|tƒo|iƒ|_ n ||_ |iiƒ|_|ii|iƒdS(s1Initialize. sw -- SoapWriter iN(sselfs_indxsMessageInterfaces__init__sswsBasesDOMs_domsNonesnodestypesmessagestypess StringTypes UnicodeTypesloadFromStrings isinstances ElementProxys_getNodes standard_nsscopys processorNsssupdates reserved_ns(sselfsswsmessage((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__és     cCs|iƒSdS(N(sselfstoString(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__str__ûscsxdkl}| o"|iiˆidˆiƒ}n|iiˆid|ƒ}|i|ƒ}t ‡d†|ƒSdS(s0expression -- XPath compiled expression (sXPaths processorNsscstˆi|ƒS(N(s ElementProxysselfsswsnode(snode(sself(s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssN( sFt.XmlsXPaths processorNsssContextsselfsnodescontexts expressionsevaluatesnodessmap(sselfs expressions processorNsssXPathscontextsnodes((sselfs7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysevaluateþs "cCs||p|i}|p|i}t}|o|io|ii|i||ƒ}n| ot d|i|f‚ndS(si namespaceURI -- namespace of element localName -- local name of element s%unexpected node type %s, expecting %sN( s namespaceURIsselfs localNamesnamesFalseschecksnodes_doms isElementsNamespaceError(sselfs namespaceURIs localNamescheck((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys checkNode scCsÇ|o0t|tƒo|iƒ|_q¹||_nƒ|ioY|ii|i|i|idt ƒ}| ot d|i|if‚n||_n |i |id|idt ƒ|i ƒdS(Nsdefaultscant find element (%s,%s)s localNamesdoctype( snodes isinstances ElementProxys_getNodesselfs_doms getElementsnames namespaceURIsNonesNamespaceErrorscreateDocuments checkNode(sselfsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssetNodes  ' cCs |iSdS(N(sselfsnode(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys_getNode.scCs|ii|idtƒSdS(Nsname(sselfs_doms getElementssnodesNone(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _getElements1scCs|iip|iSdS(N(sselfsnodes ownerDocument(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys_getOwnerDocument4scCsix^noV|id7_d|i}y|ii||iƒƒWqtj o }PqXq W|SdS(s¤I guess we need to resolve all potential prefixes because when the current node is attached it copies the namespaces into the parent node. isns%dN(sselfs_indxsprefixs_domsfindNamespaceURIs_getNodes DOMExceptionsex(sselfsprefixsex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys_getUniquePrefix7s  cCsy?|o)|i|ijo||ii|ƒjotSnWntj o }nX|t i jo |i Sn|it ijomxj|iiƒD]4}|it ijo ||ijo |iSq•q•W|io|i|i|ƒSqòntd|‚dS(s{ Keyword arguments: node -- DOM Element Node nsuri -- namespace of attribute value s namespaceURI "%s" is not definedN(snodesnodeTypes ELEMENT_NODEsnsurisselfs_doms findDefaultNSsNones DOMExceptionsexsXMLNSsXMLs _xml_prefixsNodes attributessvaluessattrs namespaceURIsBASEsvalues localNames parentNodes _getPrefixsNamespaceError(sselfsnodesnsurisattrsex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _getPrefixEs 3  # cCs.|tjo td‚n|ii|ƒdS(sI Keyword arguments: node -- DOM Element Node s node is NoneN(snodesNones TypeErrorsselfs appendChild(sselfsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _appendChild]s  cCs|ii||ƒdS(s~ Keyword arguments: child -- DOM Element Node to insert refChild -- DOM Element Node N(sselfsnodes insertBeforesnewChildsrefChild(sselfsnewChildsrefChild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _insertBeforefscCs|ii|||ƒdS(s Keyword arguments: namespaceURI -- namespace of attribute qualifiedName -- qualified name of new attribute value value -- value of attribute N(sselfsnodessetAttributeNSs namespaceURIs qualifiedNamesvalue(sselfs namespaceURIs qualifiedNamesvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys_setAttributeNSnscCstSdS(s6check to see if this is a soap:fault message. N(sFalse(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysisFaultzscCs[y|id|id|ƒ}Wn1tj o%}|iƒ}|i||ƒnX|SdS(Nsnodesnsuri( sselfs _getPrefixsnodes namespaceURIsprefixsNamespaceErrorsexs_getUniquePrefixssetNamespaceAttribute(sselfs namespaceURIsprefixsex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getPrefixs  cCs|iƒSdS(N(sselfs_getOwnerDocument(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getDocument‡scCs ||_dS(N(sdocumentsselfsnode(sselfsdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys setDocumentŠscCsP|iit|ƒƒ}|ii|dtƒ}|i |ƒ}|i |ƒdS(Nsname( sselfs_doms loadDocumentsStringIOs xmlStringsdocs getElementsNonesnodes importNodesclones _appendChild(sselfs xmlStringsnodesdocsclone((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysimportFromStringscCsCt|tƒo|iƒ}n|ii|iƒ|ddƒSdS(Nsdeepi(s isinstancesnodes ElementProxys_getNodesselfs_doms importNodes_getOwnerDocument(sselfsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys importNode“scCs|iit|ƒƒ|_dS(N(sselfs_doms loadDocumentsStringIOsdatasnode(sselfsdata((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysloadFromString˜scCst|iƒSdS(N(s Canonicalizesselfsnode(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys canonicalize›scCs|iƒSdS(N(sselfs canonicalize(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pystoStringžscCs|i}||i|jod||f}nV||jo tjno#|ii tttƒ|_ dSnt d|i|‚|ii d|d|d|ƒ}|id|_ xI|iiƒD]8\}}|id|id d|i|fd |ƒqÇWdS( sSIf specified must be a SOAP envelope, else may contruct an empty document. s%s:%sNs'only support creation of document in %ssnsurisqnamesdoctypeis namespaceURIs qualifiedNamesvalue(sselfs_soap_env_prefixsprefixs namespaceURIs reserved_nss localNames qualifiedNamesNones_domscreateDocumentsnodesKeyErrorsdoctypesdocuments childNodessitemssnsuris_setAttributeNSs _xmlns_nsuris _xmlns_prefix(sselfs namespaceURIs localNamesdoctypes qualifiedNamesprefixsnsurisdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateDocument¡s ! cCs&|ii|iƒd|d|ƒSdS(Nsnamesnsuri(sselfs_domshasAttrs_getNodes localNames namespaceURI(sselfs namespaceURIs localName((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys hasAttributeºscCsp|iid||ƒ|}|od|i|ƒ|f}n|i|iƒ}|i |id||ƒdS(sŸset xsi:type Keyword arguments: namespaceURI -- namespace of attribute value localName -- name of new attribute value ssetAttributeType: (%s,%s)s%s:%ss%s:typeN( sselfsloggersdebugs namespaceURIs localNamesvalues getPrefixs _xsi_nsuris xsi_prefixs_setAttributeNS(sselfs namespaceURIs localNames xsi_prefixsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssetAttributeType½scCs%|iƒ}|i|||ƒ}dS(N(sselfs_getOwnerDocumentsdocumentscreateAttributeNSs namespacesnamesvaluesattrNode(sselfs namespacesnamesvaluesattrNodesdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateAttributeNSÌs cCsŠt}|oEy|i|ƒ}WqRtj o}d}|i||ƒqRXn|}|od||f}n|i |||ƒdS(sû Keyword arguments: namespaceURI -- namespace of attribute to create, None is for attributes in no namespace. localName -- local name of new attribute value -- value of new attribute sns2s%s:%sN( sNonesprefixs namespaceURIsselfs getPrefixsKeyErrorsexssetNamespaceAttributes localNames qualifiedNames_setAttributeNSsvalue(sselfs namespaceURIs localNamesvalues qualifiedNamesprefixsex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssetAttributeNSÐscCs|itid||ƒdS(ss Keyword arguments: prefix -- xmlns prefix namespaceURI -- value of prefix sxmlns:%sN(sselfs_setAttributeNSsXMLNSsBASEsprefixs namespaceURI(sselfsprefixs namespaceURI((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssetNamespaceAttributeäscCs2|iƒ}|i||ƒ}t|i|ƒSdS(s Keyword arguments: namespace -- namespace of element to create qname -- qualified name of new element N( sselfs_getOwnerDocumentsdocumentscreateElementNSs namespacesqnamesnodes ElementProxyssw(sselfs namespacesqnamesnodesdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateElementNSïs cCs;|i||dtƒ}|iƒ}|i|iƒƒdS(sƒCreate a new element (namespaceURI,name), append it to current node, then set it to be the current node. Keyword arguments: namespaceURI -- namespace of element to create localName -- local name of new element prefix -- if namespaceURI is not defined, declare prefix. defaults to 'ns1' if left unspecified. sprefixN(sselfscreateAppendElements namespaceURIs localNamesNonesnodes_getNodes_setNode(sselfs namespaceURIs localNamesprefixsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateAppendSetElementùs cCs½t}|}|oUy|i|ƒ}Wn t}|p |i ƒ}nX|od||f}qhn|i ||ƒ}|o|i t id||ƒn|id|iƒƒ|SdS(s‚Create a new element (namespaceURI,name), append it to current node, and return the newly created node. Keyword arguments: namespaceURI -- namespace of element to create localName -- local name of new element prefix -- if namespaceURI is not defined, declare prefix. defaults to 'ns1' if left unspecified. s%s:%ssxmlns:%ssnodeN(sFalsesdeclares localNames qualifiedNames namespaceURIsselfs getPrefixsprefixsTrues_getUniquePrefixscreateElementNSsnodes_setAttributeNSsXMLNSsBASEs _appendChilds_getNode(sselfs namespaceURIs localNamesprefixsnodes qualifiedNamesdeclare((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateAppendElements cCsl|}|i|ƒ}|od||f}n|i||ƒ}|id|i ƒd|i ƒƒ|SdS(Ns%s:%ssnewChildsrefChild( s localNames qualifiedNamesselfs getPrefixs namespaceURIsprefixscreateElementNSsnodes _insertBefores_getNodesrefChild(sselfs namespaceURIs localNamesrefChildsnodes qualifiedNamesprefix((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateInsertBefores"cCsD|ii|i||dtƒ}|ot|i|ƒSntSdS(s„ Keyword arguments: namespaceURI -- namespace of element localName -- local name of element sdefaultN( sselfs_doms getElementsnodes localNames namespaceURIsNones ElementProxyssw(sselfs namespaceURIs localNamesnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getElement(s !cCs;|i||ƒo |ii||ƒ}|iSntSdS(sˆ Keyword arguments: namespaceURI -- namespace of attribute localName -- local name of attribute N( sselfs hasAttributes namespaceURIs localNamesnodesgetAttributeNodeNSsattrsvaluesNone(sselfs namespaceURIs localNamesattr((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetAttributeValue3s  cCs|ii|idtƒSdS(Ns preserve_ws(sselfs_domsgetElementTextsnodesTrue(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetValue>scCs-|i|ƒ}|id|iƒƒ|SdS(Nsnode(sselfscreateTextNodespyobjsnodes _appendChilds_getNode(sselfspyobjsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateAppendTextNodeDscCs/|iƒ}|i|ƒ}t|i|ƒSdS(N(sselfs_getOwnerDocumentsdocumentscreateTextNodespyobjsnodes ElementProxyssw(sselfspyobjsnodesdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateTextNodeIs cCs`t|ƒ}|iƒ}t|ƒdjo|ii|ƒt fSn|ii |d|ƒSdS(Nii( s SplitQNames qualifiedNamespartssselfs_getNodeselementslens_doms findTargetNSsvaluesfindNamespaceURI(sselfs qualifiedNameselementsparts((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysfindNamespaceURIQs   cCs#|iƒ}|ii||ƒSdS(N(sselfs_getNodeselements_domsfindNamespaceURIsprefix(sselfsprefixselement((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys resolvePrefixXs cCs |iSdS(N(sselfs_soap_env_nsuri(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getSOAPEnvURI\scCs |i SdS(N(sselfsnode(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysisEmpty_s(Is__name__s __module__s__doc__s_soap_env_prefixs_soap_enc_prefixs _zsi_prefixs _xsd_prefixs _xsi_prefixs _xml_prefixs _xmlns_prefixsSOAPsENVs_soap_env_nsurisENCs_soap_enc_nsurisZSI_SCHEMA_URIs _zsi_nsurisSCHEMAsXSD3s _xsd_nsurisXSI3s _xsi_nsurisXMLNSsXMLs _xml_nsurisBASEs _xmlns_nsuris standard_nss reserved_nssNonesnames namespaceURIs__init__s__str__sevaluates checkNodessetNodes_getNodes _getElementss_getOwnerDocuments_getUniquePrefixs _getPrefixs _appendChilds _insertBefores_setAttributeNSsisFaults getPrefixs getDocuments setDocumentsimportFromStrings importNodesloadFromStrings canonicalizestoStringscreateDocuments hasAttributessetAttributeTypescreateAttributeNSssetAttributeNSssetNamespaceAttributescreateElementNSscreateAppendSetElementscreateAppendElementscreateInsertBefores getElementsgetAttributeValuesgetValuescreateAppendTextNodescreateTextNodesfindNamespaceURIs resolvePrefixs getSOAPEnvURIsisEmpty(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys ElementProxyÈsx       3                               s CollectioncBsPtZdZd„Zed„Zd„Zd„Zd„Zd„Z d„Z RS(s7Helper class for maintaining ordered named collections.cCs|iS(N(sksname(sselfsk((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysfscCs?ti|ƒti|ƒ|_g|_|p|i|_ dS(N( sUserDicts__init__sselfsweakrefsrefsparentslistskeysdefaults_func(sselfsparentskey((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__gs  cCs7t|ƒtdƒjo|i|Sn|i|SdS(Ni(stypeskeysselfslistsdata(sselfskey((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys __getitem__mscCs3ti|ƒ|_|ii|ƒ||i|xs(smapsselfslist(sself((sselfs7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyskeyswscst‡d†ˆiƒSdS(Ncsˆi|ƒ|fS(N(sselfs_funcsi(si(sself(s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys{s(smapsselfslist(sself((sselfs7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysitemszscCs |iSdS(N(sselfslist(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysvalues}s( s__name__s __module__s__doc__sdefaultsNones__init__s __getitem__s __setitem__skeyssitemssvalues(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys Collectionds       s CollectionNScBsYtZdZd„Zed„Zd„Zd„Zd„Zd„Z d„Z d„Z RS( s7Helper class for maintaining ordered named collections.cCs|iS(N(sksname(sselfsk((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysƒscCsHti|ƒti|ƒ|_t|_g|_|p|i |_ dS(N( sUserDicts__init__sselfsweakrefsrefsparentsNonestargetNamespaceslistskeysdefaults_func(sselfsparentskey((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__„s    cCs‚|iƒi|_t|ƒtijo|i|Sn0|i|ƒo|\}}|i ||Sn|i |iƒi|SdS(N( sselfsparentstargetNamespacestypeskeystypessIntTypeslists_CollectionNS__isSequencesnsurisnamesdata(sselfskeysnamesnsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys __getitem__‹s cCswti|ƒ|_|ii|ƒt|d|iƒiƒ}|i i |ƒ oh|i |¢s(skeyssselfsdatastnssappendsmapsvalues(sselfskeysstns((sselfstnss7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyskeysŸs 0cst‡d†ˆiƒSdS(Ncsˆi|ƒ|fS(N(sselfs_funcsi(si(sself(s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys¦s(smapsselfslist(sself((sselfs7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysitems¥scCs |iSdS(N(sselfslist(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysvalues¨s( s__name__s __module__s__doc__sdefaultsNones__init__s __getitem__s __setitem__s_CollectionNS__isSequenceskeyssitemssvalues(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys CollectionNSs       (sPullDOMs START_ELEMENTicCslt|dƒ o g|_n|ii|pd|fƒ|ii|iiƒƒ|pd|i||i tii i i-jo|i.|i'ƒ}n |i tii i i/jo1|i0|i|iƒ}t1|_|i|_n¿|i tii i i2jo†tiii } |i3i4|i5|i6|i7ƒ}||_|oBg|i8_9g|i:_9x{|i:i9D]m}tii i<|i|i6|i7ƒ}||_|i:i9i>|ƒt?|dƒo|i@| ||ƒqqWx©|i8i9D]—}tii iB|i|i6|i7|iCƒ}|iE|_E|iF|_F|iG|_G||_|i8i9i>|ƒt?|dƒo|i@| ||ƒqÿqÿWq¾ntiiHdtI|ƒƒ‚t?|dƒo|i@| ||ƒn|SdS(s{ Clone a node and give it the new owner document. Called by Node.cloneNode and Document.importNode sxmlnss_call_user_data_handlersCannot clone node %sN(Jsnodes ownerDocuments isSameNodesnewOwnerDocumentsxmlsdomsUserDataHandlers NODE_CLONEDs operations NODE_IMPORTEDsnodeTypesminidomsNodes ELEMENT_NODEscreateElementNSs namespaceURIsnodeNamesclones attributessvaluessattrssetAttributeNSsvalues_nssplitsprefixstagsgetAttributeNodeNSsas specifiedsdeeps childNodesschilds _clone_nodescs appendChildsDOCUMENT_FRAGMENT_NODEscreateDocumentFragments TEXT_NODEscreateTextNodesdatasCDATA_SECTION_NODEscreateCDATASectionsPROCESSING_INSTRUCTION_NODEscreateProcessingInstructionstargets COMMENT_NODEs createCommentsATTRIBUTE_NODEscreateAttributeNSsTruesDOCUMENT_TYPE_NODEsimplementationscreateDocumentTypesnamespublicIdssystemIdsentitiess_seqs notationssnsNotationsnotationsappendshasattrs_call_user_data_handlersesEntitys notationNamesentitysactualEncodingsencodingsversionsNotSupportedErrsrepr(snodesdeepsnewOwnerDocumentscsesattrsnotationsclonesnsprefixstagsaschilds operationsentity((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _clone_nodes’          !    $       #(Bsidentssysstypesshttplibssmtplibsurllibssocketsweakrefsos.pathsisfilesstringsjoinsstripssplitsUserDicts cStringIOsStringIOs TimeoutSockets TimeoutErrorsurlparsesHTTPConnectionsHTTPSConnections exceptionss ExceptionsZSIs _get_idstrsxml.dom.minidomsxmlsxml.domsNodesloggingsc14ns Canonicalizes NamespacessSCHEMAsSOAPsXMLNSsZSI_SCHEMA_URIs xml.dom.exts SplitQNamesbasejoins version_infostokensNamespaceErrorsRecursionErrors ParseErrors DOMExceptionsBases HTTPResponses TimeoutHTTPs TimeoutHTTPSsNonesurlopensDOMsMessageInterfaces ElementProxys Collections CollectionNSsxml.dom.pulldomsPullDOMs START_ELEMENTsstartPrefixMappingsstartElementNSs _clone_nodesdomsminidom(3sPullDOMsZSI_SCHEMA_URIs DOMExceptionsDOMs TimeoutSockets START_ELEMENTs Collectionsstripsisfilesxmlsurlparses _get_idstrsMessageInterfacesbasejoins TimeoutHTTPstokensurllibsBasessplits HTTPResponsessmtplibsSCHEMAsstartPrefixMappingsNodes ExceptionsXMLNSs TimeoutErrorsurlopensUserDicts ParseErrorssyss CanonicalizesstartElementNSs ElementProxysHTTPConnections CollectionNSsloggingsNamespaceErrorsRecursionErrorstypesshttplibsidentsjoinssocketsStringIOs _clone_nodesweakrefs SplitQNamesHTTPSConnections TimeoutHTTPSsSOAP((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys?sh?           -   =ÿ¹ =ÿ1   9  WPK†¨58mñqHŠŠZSI/wstools/logging.pyc;ò •@Ec@s–dZdZdkZdZdZdfd„ƒYZdefd„ƒYZead „Zd „Z d „Z d „Z d d„Z d„Z d„ZdS(sLoggings4$Id: logging.py 1204 2006-05-03 00:13:47Z boverhof $NiisILoggercBs_tZdZdZd„Zd„Zd„Zd„Zd„Ze eƒZd„Z d„Z RS( s[Logger interface, by default this class will be used and logging calls are no-ops. icCsdSdS(N((sselfsmsg((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys__init__scGsdSdS(N((sselfsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyswarningscGsdSdS(N((sselfsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysdebugscGsdSdS(N((sselfsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyserrorscCs ||_dS(N(slevelscls(sclsslevel((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetLevelscCs |itjS(N(sselfslevelsDEBUG(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysscCs |itjS(N(sselfslevelsWARN(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys s( s__name__s __module__s__doc__slevels__init__swarningsdebugserrorssetLevels classmethodsdebugOnswarnOn(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysILoggers        s BasicLoggercBsStZdZeid„Zd„ZdZd„ZdZ d„Z dZ d „Z RS( NscCs||f\|_|_dS(N(smsgsoutsself(sselfsmsgsout((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys__init__&scGsz|iƒtjodSnti|ijo)|it_|dI|iIdIJn|dtiI|||IJdS(Ns---- s ----s %s (sselfswarnOnsFalses BasicLoggerslastsmsgsWARNsargs(sselfsmsgsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyswarning)s s[WARN]cGsz|iƒtjodSnti|ijo)|it_|dI|iIdIJn|dtiI|||IJdS(Ns---- s ----s %s (sselfsdebugOnsFalses BasicLoggerslastsmsgsDEBUGsargs(sselfsmsgsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysdebug1s s[DEBUG]cGs_ti|ijo)|it_|dI|iIdIJn|dtiI|||IJdS(Ns---- s ----s %s (s BasicLoggerslastsselfsmsgsERRORsargs(sselfsmsgsargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyserror9s  s[ERROR]cGs%x|D]}|ii|ƒqWdS(s4Write convenience function; writes strings. N(sargssssselfsoutswrite(sselfsargsss((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyswriteAs( s__name__s __module__slastssyssstdouts__init__swarningsWARNsdebugsDEBUGserrorsERRORswrite(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys BasicLogger#s   cCsttƒtidƒdS(sUse Basic Logger. iN(ssetLoggerClasss BasicLoggerssetLevel(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetBasicLoggerHs cCsttƒtitƒdS(sUse Basic Logger. N(ssetLoggerClasss BasicLoggerssetLevelsWARN(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetBasicLoggerWARNNs cCsttƒtitƒdS(sUse Basic Logger. N(ssetLoggerClasss BasicLoggerssetLevelsDEBUG(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetBasicLoggerDEBUGTs cCs$t|tƒp td‚|adS(sSet Logging Class. s"loggingClass must subclass ILoggerN(s issubclasss loggingClasssILoggersAssertionErrors _LoggerClass(s loggingClass((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetLoggerClassZsicCs |t_dS(sSet Global Logging Level. N(slevelsILogger(slevel((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pyssetLevelascCs tiSdS(N(sILoggerslevel(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pysgetLevelfscCst|ƒSdS(s&Return instance of Logging class. N(s _LoggerClasssmsg(smsg((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys getLoggeris(s__doc__sidentssyssWARNsDEBUGsILoggers BasicLoggers _LoggerClassssetBasicLoggerssetBasicLoggerWARNssetBasicLoggerDEBUGssetLoggerClassssetLevelsgetLevels getLogger( sWARNsidentssetLoggerClassssetBasicLoggerDEBUGsgetLevelssyss getLoggers BasicLoggersILoggersDEBUGssetBasicLoggerssetBasicLoggerWARNssetLevel((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/logging.pys?s #      PK†¨58SWòÍÍZSI/wstools/Utility.pyc;ò •@Ec@s7dZdkZdkZdkZdkZdkZdkZdkZdkl Z dk l Z l Z l Z dklZdklZdklZlZdklZdklZlZd klZyd klZWnd „ZnXdkZd klZdkZd kl Z dk!l"Z"l#Z#l$Z$l%Z%ydk&l'Z'Wnd„Z'nXei(Z(ei)dd!dddddfdd!jodZ*d„Z(ndefd„ƒYZ+defd„ƒYZ,defd„ƒYZ-defd„ƒYZ.dfd „ƒYZ/d!fd"„ƒYZ0d#efd$„ƒYZ1d%efd&„ƒYZ2d'e3d(„Z4d)fd*„ƒYZ5e5ƒZ5d+fd,„ƒYZ6d-e/e6fd.„ƒYZ7d/efd0„ƒYZ8d1efd2„ƒYZ9d3k:l;Z;l<Z<no(d5„Z=e=e;_=d6„Z>e>e;_>nnod7„Z?e?ei@iA_?ndS(8s4$Id: Utility.py 1116 2006-01-24 20:51:57Z boverhof $N(sisfile(sjoinsstripssplit(sUserDict(sStringIO(s TimeoutSockets TimeoutError(surlparse(sHTTPConnectionsHTTPSConnection(s Exception(s _get_idstrcCs7t|ƒ}|djodt|ƒSnd|SdS(sªPython 2.3.x generates a FutureWarning for negative IDs, so we use a different prefix character to ensure uniqueness, and call abs() to avoid the warning.isx%xso%xN(sidspyobjsxsabs(spyobjsx((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _get_idstrs   (sNode(s Canonicalize(sSCHEMAsSOAPsXMLNSsZSI_SCHEMA_URI(s SplitQNamecCs~|idƒ}t|ƒdjo|idtƒn;t|ƒdjo#|ddjo|iƒqpndSt|ƒSdS(sFSplitQName(qname) -> (string, string) Split Qualified Name into a tuple of len 2, consisting of the prefix and the local name. (prefix, localName) Special Cases: xmlns -- (localName, 'xmlns') None -- (None, localName) s:iiisxmlnsN(sqnamessplitslslensinsertsNonesreversestuple(sqnamesl((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys SplitQName1s iiisfinals./cCsB|itƒtjoti||dƒSnti||ƒSdS(Ni(surls startswithstokensTruesurllibsbasejoinsbase(sbasesurl((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysbasejoinPssNamespaceErrorcBstZdZRS(s#Used to indicate a Namespace Error.(s__name__s __module__s__doc__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysNamespaceErrorUs sRecursionErrorcBstZdZRS(s+Used to indicate a HTTP redirect recursion.(s__name__s __module__s__doc__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysRecursionErrorYs s ParseErrorcBstZdZRS(s%Used to indicate a XML parsing error.(s__name__s __module__s__doc__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys ParseError]s s DOMExceptioncBstZdZRS(s*Used to indicate a problem processing DOM.(s__name__s __module__s__doc__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys DOMExceptionas sBasecBstZdZed„ZRS(s%Base class for instance level LoggingcCs,tid||it|ƒfƒ|_dS(Ns %s-%s(%s)(sloggings getLoggersmodulesselfs __class__s _get_idstrslogger(sselfsmodule((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__gs(s__name__s __module__s__doc__s__init__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysBasees s HTTPResponsecBstZdZd„ZRS(s5Captures the information in an HTTP response message.cCsH|i|_|i|_|i|_|iƒpt|_|i ƒdS(N( sresponsesstatussselfsreasonsmsgsheaderssreadsNonesbodysclose(sselfsresponse((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__ns    (s__name__s __module__s__doc__s__init__(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys HTTPResponseks s TimeoutHTTPcBs&tZdZedd„Zd„ZRS(s=A custom http connection object that supports socket timeout.icCs ti|||ƒ||_dS(N(sHTTPConnections__init__sselfshostsportstimeout(sselfshostsportstimeout((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__wscCs2t|iƒ|_|ii|i|ifƒdS(N(s TimeoutSocketsselfstimeoutssocksconnectshostsport(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysconnect{s(s__name__s __module__s__doc__sNones__init__sconnect(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys TimeoutHTTPus s TimeoutHTTPScBs&tZdZedd„Zd„ZRS(sºA custom https object that supports socket timeout. Note that this is not really complete. The builtin SSL support in the Python socket module requires a real socket (type) to be passed in to be hooked to SSL. That means our fake socket won't work and our timeout hacks are bypassed for send and recv calls. Since our hack _is_ in place at connect() time, it should at least provide some timeout protection.icKs)ti|t|ƒ||||_dS(N(sHTTPSConnections__init__sselfsstrshostsportskwargsstimeout(sselfshostsportstimeoutskwargs((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__‡scCstt|iƒ}|i|i|ifƒt|id|iƒ}t i ||i |i ƒ}t i||ƒ|_dS(Ns_sock(s TimeoutSocketsselfstimeoutssocksconnectshostsportsgetattrsrealsockssocketssslskey_files cert_fileshttplibs FakeSocket(sselfssockssslsrealsock((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysconnect‹s (s__name__s __module__s__doc__sNones__init__sconnect(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys TimeoutHTTPS€s icCsœt|ƒ\}} } }}} |ddfj oti |ƒSn|od| |f} n|od| |f} n| od| | f} n|djogt t dƒot | t |ƒ}qdk}|iiƒ}|i|ƒ|ii| d|ƒ}nt| t |ƒ}|id | ƒ|id d ƒ|iƒt } xBno:|iƒ} | id joPnti|_ t |_!qTW| i}|djo |djo›| i"i#dƒ}|t j ol| i%ƒ|t j o |i'|ƒot(dƒ‚n|t jo h}nd ||e:e:e:d$d%„Z?e:d&„Z@e:d'„ZAe:e<d(„ZBd)„ZCe:d*„ZDd+„ZEd,„ZFd-„ZGd.„ZHd/d0„ZId1„ZJd/eKfƒd2„ZLe:d3„ZMd4„ZNd5„ZORS(6sThe DOM singleton defines a number of XML related constants and provides a number of utility methods for DOM related tasks. It also provides some basic abstractions so that the rest of the package need not care about actual DOM implementation in use.s)http://schemas.xmlsoap.org/soap/envelope/s)http://schemas.xmlsoap.org/soap/encoding/s'http://www.w3.org/2001/06/soap-envelopes'http://www.w3.org/2001/06/soap-encodings1.1s1.2s*http://schemas.xmlsoap.org/soap/actor/nexts2http://www.w3.org/2001/06/soap-envelope/actor/nextcCs;|ii|ƒ}|tj o|Sntd|ƒ‚dS(s3Return the SOAP version related to an envelope uri.s!Unsupported SOAP envelope uri: %sN(sselfs_soap_uri_mappingsgetsurisvaluesNones ValueError(sselfsurisvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysSOAPUriToVersionís  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(spReturn the appropriate SOAP envelope uri for a given human-friendly SOAP version string (e.g. '1.1').sNS_SOAP_ENV_%ss.s_sUnsupported SOAP version: %sN( sjoinssplitsversionsattrnamesgetattrsselfsNonesvalues ValueError(sselfsversionsvaluesattrname((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys GetSOAPEnvUriös  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(spReturn the appropriate SOAP encoding uri for a given human-friendly SOAP version string (e.g. '1.1').sNS_SOAP_ENC_%ss.s_sUnsupported SOAP version: %sN( sjoinssplitsversionsattrnamesgetattrsselfsNonesvalues ValueError(sselfsversionsvaluesattrname((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys GetSOAPEncUris  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(soReturn the right special next-actor uri for a given human-friendly SOAP version string (e.g. '1.1').sSOAP_ACTOR_NEXT_%ss.s_sUnsupported SOAP version: %sN( sjoinssplitsversionsattrnamesgetattrsselfsNonesvalues ValueError(sselfsversionsvaluesattrname((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetSOAPActorNextUri s  s http://www.w3.org/1999/XMLSchemas)http://www.w3.org/1999/XMLSchema-instances#http://www.w3.org/2000/10/XMLSchemas,http://www.w3.org/2000/10/XMLSchema-instances http://www.w3.org/2001/XMLSchemas)http://www.w3.org/2001/XMLSchema-instancecCs|ii|ƒSdS(sjReturn the appropriate matching XML Schema instance uri for the given XML Schema namespace uri.N(sselfs_xsd_uri_mappingsgetsuri(sselfsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysInstanceUriForSchemaUri3scCs|ii|ƒSdS(stReturn the appropriate matching XML Schema namespace uri for the given XML Schema instance namespace uri.N(sselfs_xsd_uri_mappingsgetsuri(sselfsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysSchemaUriForInstanceUri8ss http://schemas.xmlsoap.org/wsdl/s%http://schemas.xmlsoap.org/wsdl/soap/s%http://schemas.xmlsoap.org/wsdl/http/s%http://schemas.xmlsoap.org/wsdl/mime/s$http://schemas.xmlsoap.org/soap/httpcCs;|ii|ƒ}|tj o|Sntd|ƒ‚dS(s8Return the WSDL version related to a WSDL namespace uri.s!Unsupported SOAP envelope uri: %sN(sselfs_wsdl_uri_mappingsgetsurisvaluesNones ValueError(sselfsurisvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysWSDLUriToVersionYs  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(Ns NS_WSDL_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys GetWSDLUribs  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(NsNS_SOAP_BINDING_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetWSDLSoapBindingUriks  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(NsNS_HTTP_BINDING_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetWSDLHttpBindingUrits  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(NsNS_MIME_BINDING_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetWSDLMimeBindingUri}s  cCsWdtt|dƒdƒ}t||tƒ}|tj o|Sntd|ƒ‚dS(NsNS_SOAP_HTTP_%ss.s_sUnsupported WSDL version: %s( sjoinssplitsversionsattrsgetattrsselfsNonesvalues ValueError(sselfsversionsattrsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysGetWSDLHttpTransportUri†s  shttp://www.w3.org/2000/xmlns/cCsO|i|ijodSn|i|jo |tjp|i|i |ƒSdS(sfReturn true if the given node is an element with the given name and optional namespace uri.iN( snodesnodeTypes ELEMENT_NODEs localNamesnamesnsurisNonesselfs nsUriMatchs namespaceURI(sselfsnodesnamesnsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys isElement•scCs¡|i}|i}xj|iD]_}|i|joI|i|jp |t jo|t jp||i |ƒo|Sq{qqW|tj o|Snt|‚dS(stReturn the first child of node with a matching name and namespace uri, or the default if one is provided.N(sselfs nsUriMatchsnsmatchsnodes ELEMENT_NODEs childNodesschildsnodeTypes localNamesnamesNonesnsuris namespaceURIsdefaultsjoinsKeyError(sselfsnodesnamesnsurisdefaultsnsmatchs ELEMENT_NODEschild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getElements   = cCsz|i}|i}xC|iD]8}|i|jo"||dƒ|jo|SqTqqW|t j o|Snt t ‚dS(s8Return the first child of node matching an id reference.sidN( sselfsgetAttrsattrgetsnodes ELEMENT_NODEs childNodesschildsnodeTypesidsdefaultsjoinsKeyErrorsname(sselfsnodesidsdefaultsattrgets ELEMENT_NODEschild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetElementById¬s    ic CsÍ|tj o|i}h}n|iidtƒ}|tj o|||i element mapping of those elements within a document that define an id attribute. The depth of the search may be controlled by using the (1-based) depth argument.sidiN(sdocumentsNonesdocumentElementselementsmappings_attrssgetsattrsvaluesdepthslevels ELEMENT_NODEs childNodesschildsnodeTypesselfsgetMappingById( sselfsdocumentsdepthselementsmappingslevelsattrs ELEMENT_NODEschild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetMappingById¸s       %cCs–|i}g}|i}xs|iD]h}|i|joR|i |jp |t jo|t jp||i |ƒo|i|ƒqŠq"q"W|SdS(szReturn a sequence of the child elements of the given node that match the given name and optional namespace uri.N(sselfs nsUriMatchsnsmatchsresultsnodes ELEMENT_NODEs childNodesschildsnodeTypes localNamesnamesNonesnsuris namespaceURIsappend(sselfsnodesnamesnsurisnsmatchs ELEMENT_NODEsresultschild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getElementsËs   =cCsA|tjo |i|ƒotSntSn|i||ƒSdS(sÉReturn true if element has attribute with the given name and optional nsuri. If nsuri is not specified, returns true if an attribute exists with the given name with any namespace.N(snsurisNonesnodes hasAttributesnamesTruesFalseshasAttributeNS(sselfsnodesnamesnsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyshasAttrØs  cCsÄ|tjog|ii|tƒ}|tjoAx>|iiƒD])}|d|jo|i|}Pq?q?Wqn|ii||ftƒ}|tj o |i Sn|t j o|SndSdS(súReturn the value of the attribute named 'name' with the optional nsuri, or the default if one is specified. If nsuri is not specified, an attribute that matches the given name will be returned regardless of namespace.isN( snsurisNonesnodes_attrssgetsnamesresults_attrsNSskeyssitemsvaluesdefaultsjoin(sselfsnodesnamesnsurisdefaultsitemsresult((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetAttrâs      cCs;h}x*|iiƒD]\}}|i||d'„Z?d(„Z@d)„ZAd*„ZBd+„ZCd,„ZDd-„ZEd.„ZFd/„ZGd0„ZHRS(1s sSOAP-ENVsSOAP-ENCsZSIsxsdsxsisxmlsxmlnscCs½d|_ti||ƒti|ƒt|_t|_ t |ƒt i t ifjo|i|ƒn-t|tƒo|iƒ|_ n ||_ |iiƒ|_|ii|iƒdS(s1Initialize. sw -- SoapWriter iN(sselfs_indxsMessageInterfaces__init__sswsBasesDOMs_domsNonesnodestypesmessagestypess StringTypes UnicodeTypesloadFromStrings isinstances ElementProxys_getNodes standard_nsscopys processorNsssupdates reserved_ns(sselfsswsmessage((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__és     cCs|iƒSdS(N(sselfstoString(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__str__ûscsxdkl}| o"|iiˆidˆiƒ}n|iiˆid|ƒ}|i|ƒ}t ‡d†|ƒSdS(s0expression -- XPath compiled expression (sXPaths processorNsscstˆi|ƒS(N(s ElementProxysselfsswsnode(snode(sself(s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssN( sFt.XmlsXPaths processorNsssContextsselfsnodescontexts expressionsevaluatesnodessmap(sselfs expressions processorNsssXPathscontextsnodes((sselfs7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysevaluateþs "cCs||p|i}|p|i}t}|o|io|ii|i||ƒ}n| ot d|i|f‚ndS(si namespaceURI -- namespace of element localName -- local name of element s%unexpected node type %s, expecting %sN( s namespaceURIsselfs localNamesnamesFalseschecksnodes_doms isElementsNamespaceError(sselfs namespaceURIs localNamescheck((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys checkNode scCsÇ|o0t|tƒo|iƒ|_q¹||_nƒ|ioY|ii|i|i|idt ƒ}| ot d|i|if‚n||_n |i |id|idt ƒ|i ƒdS(Nsdefaultscant find element (%s,%s)s localNamesdoctype( snodes isinstances ElementProxys_getNodesselfs_doms getElementsnames namespaceURIsNonesNamespaceErrorscreateDocuments checkNode(sselfsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssetNodes  ' cCs |iSdS(N(sselfsnode(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys_getNode.scCs|ii|idtƒSdS(Nsname(sselfs_doms getElementssnodesNone(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _getElements1scCs|iip|iSdS(N(sselfsnodes ownerDocument(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys_getOwnerDocument4scCsix^noV|id7_d|i}y|ii||iƒƒWqtj o }PqXq W|SdS(s¤I guess we need to resolve all potential prefixes because when the current node is attached it copies the namespaces into the parent node. isns%dN(sselfs_indxsprefixs_domsfindNamespaceURIs_getNodes DOMExceptionsex(sselfsprefixsex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys_getUniquePrefix7s  cCsy?|o)|i|ijo||ii|ƒjotSnWntj o }nX|t i jo |i Sn|it ijomxj|iiƒD]4}|it ijo ||ijo |iSq•q•W|io|i|i|ƒSqòntd|‚dS(s{ Keyword arguments: node -- DOM Element Node nsuri -- namespace of attribute value s namespaceURI "%s" is not definedN(snodesnodeTypes ELEMENT_NODEsnsurisselfs_doms findDefaultNSsNones DOMExceptionsexsXMLNSsXMLs _xml_prefixsNodes attributessvaluessattrs namespaceURIsBASEsvalues localNames parentNodes _getPrefixsNamespaceError(sselfsnodesnsurisattrsex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _getPrefixEs 3  # cCs.|tjo td‚n|ii|ƒdS(sI Keyword arguments: node -- DOM Element Node s node is NoneN(snodesNones TypeErrorsselfs appendChild(sselfsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _appendChild]s  cCs|ii||ƒdS(s~ Keyword arguments: child -- DOM Element Node to insert refChild -- DOM Element Node N(sselfsnodes insertBeforesnewChildsrefChild(sselfsnewChildsrefChild((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys _insertBeforefscCs|ii|||ƒdS(s Keyword arguments: namespaceURI -- namespace of attribute qualifiedName -- qualified name of new attribute value value -- value of attribute N(sselfsnodessetAttributeNSs namespaceURIs qualifiedNamesvalue(sselfs namespaceURIs qualifiedNamesvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys_setAttributeNSnscCstSdS(s6check to see if this is a soap:fault message. N(sFalse(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysisFaultzscCs[y|id|id|ƒ}Wn1tj o%}|iƒ}|i||ƒnX|SdS(Nsnodesnsuri( sselfs _getPrefixsnodes namespaceURIsprefixsNamespaceErrorsexs_getUniquePrefixssetNamespaceAttribute(sselfs namespaceURIsprefixsex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getPrefixs  cCs|iƒSdS(N(sselfs_getOwnerDocument(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getDocument‡scCs ||_dS(N(sdocumentsselfsnode(sselfsdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys setDocumentŠscCsP|iit|ƒƒ}|ii|dtƒ}|i |ƒ}|i |ƒdS(Nsname( sselfs_doms loadDocumentsStringIOs xmlStringsdocs getElementsNonesnodes importNodesclones _appendChild(sselfs xmlStringsnodesdocsclone((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysimportFromStringscCsCt|tƒo|iƒ}n|ii|iƒ|ddƒSdS(Nsdeepi(s isinstancesnodes ElementProxys_getNodesselfs_doms importNodes_getOwnerDocument(sselfsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys importNode“scCs|iit|ƒƒ|_dS(N(sselfs_doms loadDocumentsStringIOsdatasnode(sselfsdata((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysloadFromString˜scCst|iƒSdS(N(s Canonicalizesselfsnode(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys canonicalize›scCs|iƒSdS(N(sselfs canonicalize(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pystoStringžscCs|i}||i|jod||f}nV||jo tjno#|ii tttƒ|_ dSnt d|i|‚|ii d|d|d|ƒ}|id|_ xI|iiƒD]8\}}|id|id d|i|fd |ƒqÇWdS( sSIf specified must be a SOAP envelope, else may contruct an empty document. s%s:%sNs'only support creation of document in %ssnsurisqnamesdoctypeis namespaceURIs qualifiedNamesvalue(sselfs_soap_env_prefixsprefixs namespaceURIs reserved_nss localNames qualifiedNamesNones_domscreateDocumentsnodesKeyErrorsdoctypesdocuments childNodessitemssnsuris_setAttributeNSs _xmlns_nsuris _xmlns_prefix(sselfs namespaceURIs localNamesdoctypes qualifiedNamesprefixsnsurisdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateDocument¡s ! cCs&|ii|iƒd|d|ƒSdS(Nsnamesnsuri(sselfs_domshasAttrs_getNodes localNames namespaceURI(sselfs namespaceURIs localName((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys hasAttributeºscCsp|iid||ƒ|}|od|i|ƒ|f}n|i|iƒ}|i |id||ƒdS(sŸset xsi:type Keyword arguments: namespaceURI -- namespace of attribute value localName -- name of new attribute value ssetAttributeType: (%s,%s)s%s:%ss%s:typeN( sselfsloggersdebugs namespaceURIs localNamesvalues getPrefixs _xsi_nsuris xsi_prefixs_setAttributeNS(sselfs namespaceURIs localNames xsi_prefixsvalue((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssetAttributeType½scCs%|iƒ}|i|||ƒ}dS(N(sselfs_getOwnerDocumentsdocumentscreateAttributeNSs namespacesnamesvaluesattrNode(sselfs namespacesnamesvaluesattrNodesdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateAttributeNSÌs cCsŠt}|oEy|i|ƒ}WqRtj o}d}|i||ƒqRXn|}|od||f}n|i |||ƒdS(sû Keyword arguments: namespaceURI -- namespace of attribute to create, None is for attributes in no namespace. localName -- local name of new attribute value -- value of new attribute sns2s%s:%sN( sNonesprefixs namespaceURIsselfs getPrefixsKeyErrorsexssetNamespaceAttributes localNames qualifiedNames_setAttributeNSsvalue(sselfs namespaceURIs localNamesvalues qualifiedNamesprefixsex((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssetAttributeNSÐscCs|itid||ƒdS(ss Keyword arguments: prefix -- xmlns prefix namespaceURI -- value of prefix sxmlns:%sN(sselfs_setAttributeNSsXMLNSsBASEsprefixs namespaceURI(sselfsprefixs namespaceURI((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyssetNamespaceAttributeäscCs2|iƒ}|i||ƒ}t|i|ƒSdS(s Keyword arguments: namespace -- namespace of element to create qname -- qualified name of new element N( sselfs_getOwnerDocumentsdocumentscreateElementNSs namespacesqnamesnodes ElementProxyssw(sselfs namespacesqnamesnodesdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateElementNSïs cCs;|i||dtƒ}|iƒ}|i|iƒƒdS(sƒCreate a new element (namespaceURI,name), append it to current node, then set it to be the current node. Keyword arguments: namespaceURI -- namespace of element to create localName -- local name of new element prefix -- if namespaceURI is not defined, declare prefix. defaults to 'ns1' if left unspecified. sprefixN(sselfscreateAppendElements namespaceURIs localNamesNonesnodes_getNodes_setNode(sselfs namespaceURIs localNamesprefixsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateAppendSetElementùs cCs½t}|}|oUy|i|ƒ}Wn t}|p |i ƒ}nX|od||f}qhn|i ||ƒ}|o|i t id||ƒn|id|iƒƒ|SdS(s‚Create a new element (namespaceURI,name), append it to current node, and return the newly created node. Keyword arguments: namespaceURI -- namespace of element to create localName -- local name of new element prefix -- if namespaceURI is not defined, declare prefix. defaults to 'ns1' if left unspecified. s%s:%ssxmlns:%ssnodeN(sFalsesdeclares localNames qualifiedNames namespaceURIsselfs getPrefixsprefixsTrues_getUniquePrefixscreateElementNSsnodes_setAttributeNSsXMLNSsBASEs _appendChilds_getNode(sselfs namespaceURIs localNamesprefixsnodes qualifiedNamesdeclare((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateAppendElements cCsl|}|i|ƒ}|od||f}n|i||ƒ}|id|i ƒd|i ƒƒ|SdS(Ns%s:%ssnewChildsrefChild( s localNames qualifiedNamesselfs getPrefixs namespaceURIsprefixscreateElementNSsnodes _insertBefores_getNodesrefChild(sselfs namespaceURIs localNamesrefChildsnodes qualifiedNamesprefix((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateInsertBefores"cCsD|ii|i||dtƒ}|ot|i|ƒSntSdS(s„ Keyword arguments: namespaceURI -- namespace of element localName -- local name of element sdefaultN( sselfs_doms getElementsnodes localNames namespaceURIsNones ElementProxyssw(sselfs namespaceURIs localNamesnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getElement(s !cCs;|i||ƒo |ii||ƒ}|iSntSdS(sˆ Keyword arguments: namespaceURI -- namespace of attribute localName -- local name of attribute N( sselfs hasAttributes namespaceURIs localNamesnodesgetAttributeNodeNSsattrsvaluesNone(sselfs namespaceURIs localNamesattr((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetAttributeValue3s  cCs|ii|idtƒSdS(Ns preserve_ws(sselfs_domsgetElementTextsnodesTrue(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysgetValue>scCs-|i|ƒ}|id|iƒƒ|SdS(Nsnode(sselfscreateTextNodespyobjsnodes _appendChilds_getNode(sselfspyobjsnode((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateAppendTextNodeDscCs/|iƒ}|i|ƒ}t|i|ƒSdS(N(sselfs_getOwnerDocumentsdocumentscreateTextNodespyobjsnodes ElementProxyssw(sselfspyobjsnodesdocument((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyscreateTextNodeIs cCs`t|ƒ}|iƒ}t|ƒdjo|ii|ƒt fSn|ii |d|ƒSdS(Nii( s SplitQNames qualifiedNamespartssselfs_getNodeselementslens_doms findTargetNSsvaluesfindNamespaceURI(sselfs qualifiedNameselementsparts((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysfindNamespaceURIQs   cCs#|iƒ}|ii||ƒSdS(N(sselfs_getNodeselements_domsfindNamespaceURIsprefix(sselfsprefixselement((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys resolvePrefixXs cCs |iSdS(N(sselfs_soap_env_nsuri(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys getSOAPEnvURI\scCs |i SdS(N(sselfsnode(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysisEmpty_s(Is__name__s __module__s__doc__s_soap_env_prefixs_soap_enc_prefixs _zsi_prefixs _xsd_prefixs _xsi_prefixs _xml_prefixs _xmlns_prefixsSOAPsENVs_soap_env_nsurisENCs_soap_enc_nsurisZSI_SCHEMA_URIs _zsi_nsurisSCHEMAsXSD3s _xsd_nsurisXSI3s _xsi_nsurisXMLNSsXMLs _xml_nsurisBASEs _xmlns_nsuris standard_nss reserved_nssNonesnames namespaceURIs__init__s__str__sevaluates checkNodessetNodes_getNodes _getElementss_getOwnerDocuments_getUniquePrefixs _getPrefixs _appendChilds _insertBefores_setAttributeNSsisFaults getPrefixs getDocuments setDocumentsimportFromStrings importNodesloadFromStrings canonicalizestoStringscreateDocuments hasAttributessetAttributeTypescreateAttributeNSssetAttributeNSssetNamespaceAttributescreateElementNSscreateAppendSetElementscreateAppendElementscreateInsertBefores getElementsgetAttributeValuesgetValuescreateAppendTextNodescreateTextNodesfindNamespaceURIs resolvePrefixs getSOAPEnvURIsisEmpty(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys ElementProxyÈsx       3                               s CollectioncBsPtZdZd„Zed„Zd„Zd„Zd„Zd„Z d„Z RS(s7Helper class for maintaining ordered named collections.cCs|iS(N(sksname(sselfsk((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysfscCs?ti|ƒti|ƒ|_g|_|p|i|_ dS(N( sUserDicts__init__sselfsweakrefsrefsparentslistskeysdefaults_func(sselfsparentskey((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__gs  cCs7t|ƒtdƒjo|i|Sn|i|SdS(Ni(stypeskeysselfslistsdata(sselfskey((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys __getitem__mscCs3ti|ƒ|_|ii|ƒ||i|xs(smapsselfslist(sself((sselfs7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyskeyswscst‡d†ˆiƒSdS(Ncsˆi|ƒ|fS(N(sselfs_funcsi(si(sself(s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys{s(smapsselfslist(sself((sselfs7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysitemszscCs |iSdS(N(sselfslist(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysvalues}s( s__name__s __module__s__doc__sdefaultsNones__init__s __getitem__s __setitem__skeyssitemssvalues(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys Collectionds       s CollectionNScBsYtZdZd„Zed„Zd„Zd„Zd„Zd„Z d„Z d„Z RS( s7Helper class for maintaining ordered named collections.cCs|iS(N(sksname(sselfsk((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysƒscCsHti|ƒti|ƒ|_t|_g|_|p|i |_ dS(N( sUserDicts__init__sselfsweakrefsrefsparentsNonestargetNamespaceslistskeysdefaults_func(sselfsparentskey((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys__init__„s    cCs‚|iƒi|_t|ƒtijo|i|Sn0|i|ƒo|\}}|i ||Sn|i |iƒi|SdS(N( sselfsparentstargetNamespacestypeskeystypessIntTypeslists_CollectionNS__isSequencesnsurisnamesdata(sselfskeysnamesnsuri((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys __getitem__‹s cCswti|ƒ|_|ii|ƒt|d|iƒiƒ}|i i |ƒ oh|i |¢s(skeyssselfsdatastnssappendsmapsvalues(sselfskeysstns((sselfstnss7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pyskeysŸs 0cst‡d†ˆiƒSdS(Ncsˆi|ƒ|fS(N(sselfs_funcsi(si(sself(s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys¦s(smapsselfslist(sself((sselfs7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysitems¥scCs |iSdS(N(sselfslist(sself((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pysvalues¨s( s__name__s __module__s__doc__sdefaultsNones__init__s __getitem__s __setitem__s_CollectionNS__isSequenceskeyssitemssvalues(((s7build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Utility.pys CollectionNSs       (sPullDOMs START_ELEMENTicCslt|dƒ o g|_n|ii|pd|fƒ|ii|iiƒƒ|pd|i|s s WSRF_V1_2cBsZtZdZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZRS( s*OASIS WSRF Specifications Version 1.2 sLIFETIMEcBs>tZdZdZdZdZeZeefZeefZRS(NsQhttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsdsQhttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.xsdsRhttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdlsRhttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.wsdl( s__name__s __module__s XSD_DRAFT1s XSD_DRAFT4s WSDL_DRAFT1s WSDL_DRAFT4sLATESTs WSDL_LISTsXSD_LIST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysLIFETIMETs s PROPERTIEScBs>tZdZdZdZdZeZeefZeefZRS(NsShttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsdsShttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsdsThttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdlsThttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.wsdl( s__name__s __module__s XSD_DRAFT1s XSD_DRAFT5s WSDL_DRAFT1s WSDL_DRAFT5sLATESTs WSDL_LISTsXSD_LIST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys PROPERTIES^s sBASENOTIFICATIONcBs,tZdZdZeZefZefZRS(NsOhttp://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsdsPhttp://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl(s__name__s __module__s XSD_DRAFT1s WSDL_DRAFT1sLATESTs WSDL_LISTsXSD_LIST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysBASENOTIFICATIONhs  s BASEFAULTScBs tZdZdZeefZRS(NsKhttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsdsKhttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-BaseFaults-1.2-draft-03.xsd(s__name__s __module__s XSD_DRAFT1s XSD_DRAFT3sXSD_LIST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys BASEFAULTSps(s__name__s __module__s__doc__sLIFETIMEs PROPERTIESsBASENOTIFICATIONs BASEFAULTS(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys WSRF_V1_2Qs   sOASIScBs]tZdZdZdZdfd„ƒYZeiiZei iZ ei iZ ei iZ RS(s"URLs for Oasis specifications sQhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsdsRhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsds X509TOKENcBs,tZdZdZdZdZdZdZRS(Ns^http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64BinarysQhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0sThttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#PKCS7sShttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509s\http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1sihttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3SubjectKeyIdentifier(s__name__s __module__s Base64Binarys STRTransformsPKCS7sX509s X509PKIPathv1sX509v3SubjectKeyIdentifier(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys X509TOKENs ( s__name__s __module__s__doc__sWSSEsUTILITYs X509TOKENs WSRF_V1_2sLIFETIMEs XSD_DRAFT1s PROPERTIESsBASENOTIFICATIONs BASEFAULTS(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysOASIS{s    sWSTRUSTcBstZdZdZRS(Ns+http://schemas.xmlsoap.org/ws/2004/04/trusts1http://schemas.xmlsoap.org/ws/2004/04/trust/Issue(s__name__s __module__sBASEsISSUE(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSTRUSTssWSSEcBstZdZeiZRS(Ns,http://schemas.xmlsoap.org/ws/2002/04/secext(s__name__s __module__sBASEsWSTRUSTsTRUST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSSE“ssWSUcBstZdZdZRS(Ns-http://schemas.xmlsoap.org/ws/2002/04/utilitys-http://schemas.xmlsoap.org/ws/2002/07/utility(s__name__s __module__sBASEsUTILITY(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSU˜ssWSRcBstZdZdZRS(NsBhttp://www.ibm.com/xmlns/stdwip/web-services/WS-ResourcePropertiess@http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime(s__name__s __module__s PROPERTIESsLIFETIME(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSRss WSA200408cBs"tZdZdeZdeZRS(Ns0http://schemas.xmlsoap.org/ws/2004/08/addressings%s/role/anonymouss%s/fault(s__name__s __module__sADDRESSs ANONYMOUSsFAULT(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys WSA200408¢s s WSA200403cBs"tZdZdeZdeZRS(Ns0http://schemas.xmlsoap.org/ws/2004/03/addressings%s/role/anonymouss%s/fault(s__name__s __module__sADDRESSs ANONYMOUSsFAULT(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys WSA200403§s s WSA200303cBstZdZdeZeZRS(Ns0http://schemas.xmlsoap.org/ws/2003/03/addressings%s/role/anonymous(s__name__s __module__sADDRESSs ANONYMOUSsNonesFAULT(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys WSA200303¬s sWSPcBstZdZRS(Ns,http://schemas.xmlsoap.org/ws/2002/12/policy(s__name__s __module__sPOLICY(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSPµssBEAcBstZdZdZRS(Ns(http://schemas.xmlsoap.org/ws/2004/04/scs5http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct(s__name__s __module__sSECCONVsSCTOKEN(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysBEA¸ssGLOBUScBs tZdZdZdZdZRS(Ns4http://wsrf.globus.org/core/2004/07/security/secconvs-http://www.globus.org/namespaces/2004/06/cores0http://www.globus.org/2002/04/xmlenc#gssapi-signs=http://www.globus.org/ws/2004/09/security/sc#GSSAPI_GSI_TOKEN(s__name__s __module__sSECCONVsCOREsSIGsTOKEN(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysGLOBUS¼ss"http://www.zolera.com/schemas/ZSI/N(s__doc__sidentsxml.nssSOAPsSCHEMAsWSDLsXMLNSsDSIGs ENCRYPTIONsC14Ns WSRF_V1_2sWSRFsWSRFLISTsOASISsWSTRUSTsWSSEsWSUsWSRs WSA200408s WSA200403s WSA200303sWSAsWSA_LISTsWSPsBEAsGLOBUSsZSI_SCHEMA_URI(sWSAsBEAsWSPsWSRsWSUsWSSEs WSA200403sGLOBUSsWSRFsOASISsSCHEMAs WSRF_V1_2sXMLNSs WSA200303sWSRFLISTsZSI_SCHEMA_URIsWSDLsidentsWSTRUSTs ENCRYPTIONsWSA_LISTs WSA200408sDSIGsSOAP((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys? s8+  & PKN¤Y5x×R|Ü Ü ZSI/wstools/XMLname.py"""Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2: Adjuncts", W3C Working Draft 17, December 2001, Also see . Author: Gregory R. Warnes Date:: 2002-04-25 Version 0.9.0 """ ident = "$Id: XMLname.py 954 2005-02-16 14:45:37Z warnes $" from re import * def _NCNameChar(x): return x.isalpha() or x.isdigit() or x=="." or x=='-' or x=="_" def _NCNameStartChar(x): return x.isalpha() or x=="_" def _toUnicodeHex(x): hexval = hex(ord(x[0]))[2:] hexlen = len(hexval) # Make hexval have either 4 or 8 digits by prepending 0's if (hexlen==1): hexval = "000" + hexval elif (hexlen==2): hexval = "00" + hexval elif (hexlen==3): hexval = "0" + hexval elif (hexlen==4): hexval = "" + hexval elif (hexlen==5): hexval = "000" + hexval elif (hexlen==6): hexval = "00" + hexval elif (hexlen==7): hexval = "0" + hexval elif (hexlen==8): hexval = "" + hexval else: raise Exception, "Illegal Value returned from hex(ord(x))" return "_x"+ hexval + "_" def _fromUnicodeHex(x): return eval( r'u"\u'+x[2:-1]+'"' ) def toXMLname(string): """Convert string to a XML name.""" if string.find(':') != -1 : (prefix, localname) = string.split(':',1) else: prefix = None localname = string T = unicode(localname) N = len(localname) X = []; for i in range(N) : if i< N-1 and T[i]==u'_' and T[i+1]==u'x': X.append(u'_x005F_') elif i==0 and N >= 3 and \ ( T[0]==u'x' or T[0]==u'X' ) and \ ( T[1]==u'm' or T[1]==u'M' ) and \ ( T[2]==u'l' or T[2]==u'L' ): X.append(u'_xFFFF_' + T[0]) elif (not _NCNameChar(T[i])) or (i==0 and not _NCNameStartChar(T[i])): X.append(_toUnicodeHex(T[i])) else: X.append(T[i]) if prefix: return "%s:%s" % (prefix, u''.join(X)) return u''.join(X) def fromXMLname(string): """Convert XML name to unicode string.""" retval = sub(r'_xFFFF_','', string ) def fun( matchobj ): return _fromUnicodeHex( matchobj.group(0) ) retval = sub(r'_x[0-9A-Za-z]+_', fun, retval ) return retval PK‡¨58Ô½ö‰®®ZSI/wstools/TimeoutSocket.pyc;ò •@Ec@sodZdZdkZdkZdkZdkZeeddƒZdfd„ƒYZde fd„ƒYZ dS( sBased on code from timeout_socket.py, with some tweaks for compatibility. These tweaks should really be rolled back into timeout_socket, but it's not totally clear who is maintaining it at this point. In the meantime, we'll use a different module name for our tweaked version to avoid any confusion. The original timeout_socket is by: Scott Cotton Lloyd Zusman Phil Mayes Piers Lauder Radovan Garabik s7$Id: TimeoutSocket.py 237 2003-05-20 21:10:14Z warnes $Ns WSAEINVALi&'s TimeoutSocketcBsªtZdZded„Zd„Zd„Zdd„Zdd„ZdZ d Z d d d „Z d „Z d d„Z d d„Zdd„Zd„Zd„Zd„ZRS(s/A socket imposter that supports timeout limits.icCspt|ƒ|_d|_|tjotititiƒ}n||_|ii dƒd|_ d|_ dS(Nsi( sfloatstimeoutsselfsinbufssocksNonessocketsAF_INETs SOCK_STREAMs setblockings_rbufs_wbuf(sselfstimeoutssock((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys__init__s    cCst|i|ƒSdS(N(sgetattrsselfssocksname(sselfsname((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys __getattr__$sc Gs’|i}|i}y8|idƒt|i|ƒ|i|djƒdSWn5tij o&}| o‚n|idƒt |i ƒdjo d}n |\}}|t it it ifjo‚ntig|gg|ƒ\}}}|o„yt|i|ƒdSWq}tij oV}t |i ƒdjo d}n |\}}|t itfjodSn‚q}Xq‚nXtdƒ‚dS(Niissocket connect() timeout.(sselfstimeoutssocks setblockingsapplysconnectsaddrssocketserrorswhyslensargsscodeserrnos EINPROGRESSsEALREADYs EWOULDBLOCKsselectsrswsesEISCONNs WSAEINVALs TimeoutError( sselfsaddrscodesessockswsrstimeoutswhy((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysconnect(s:      $  ic Cs®t|ƒ}d}x•notig|igg|iƒ\}}}|oL|||d!} |ii | |ƒ}||}||jo|Sqqntdƒ‚qWdS(Niii ssocket send() timeout.(slensdatastotalsnextsselectsselfssockstimeoutsrswsesbuffssendsflagsssents TimeoutError( sselfsdatasflagssesnextsrssentswstotalsbuff((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pyssendLs *  cCsMti|iggg|iƒdo|ii||ƒSntdƒ‚dS(Nissocket recv() timeout.(sselectsselfssockstimeoutsrecvsamtsflagss TimeoutError(sselfsamtsflags((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysrecvZs&iisriÿÿÿÿcCs!|id|_||_|SdS(Ni(sselfshandlessmode(sselfsmodesbuffsize((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysmakefilebs cCsK|id|_|idjo|iiƒdjo|iiƒndS(Nii(sselfshandlesssocksfilenosclose(sself((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysclosegs&cCs¶t|tdƒƒ o d}n|djot|iƒ}||jo%|i| }|i||_|Sn||}|ig}d|_x|djo|i t ||i ƒƒ}| oPnt|ƒ}||jo#|i || ƒ|||_Pn|i |ƒ||}q‘Wdi|ƒSnt d|i ƒ}|ig}d|_xLnoD|i |ƒ}| oPn|i |ƒt|dddƒ}q`Wdi|ƒSdS(Niiÿÿÿÿisiii(s isinstancesnstypeslensselfs_rbufsksdatasLsrecvsmaxsbuffsizesnewsappendsjoinsmin(sselfsnsdatasLsnewsk((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysreadlsF               cCs=d}|iidƒ}xœ|djo%d|jot|iƒjn of|i|iƒ}| oPn|idƒ}|djo|t|iƒ}n|i||_qW|djot|iƒ}n |d}d|jot|iƒjno |}n|i| |i|f\}|_|SdS(Nss ii( sdatasselfs_rbufsfindsislimitslensrecvsbuffsizesnew(sselfslimitsisnewsdata((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysreadlines$5   ' #cCsrd}g}x[noS|iƒ}| oPn|i|ƒ|t|ƒ7}|o ||joPqqW|SdS(Nii(stotalslistsselfsreadlineslinesappendslenssizehint(sselfssizehintslistslinestotal((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys readlinesœs   cCs|idi|ƒƒdS(Ns(sselfssendsjoinslist(sselfslist((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys writelines¨scCs|i|ƒdS(N(sselfssendsdata(sselfsdata((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pyswrite«scCsdS(N((sself((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pysflush®s(s__name__s __module__s__doc__sNones__init__s __getattr__sconnectssendsrecvsbuffsizeshandlessmakefilesclosesreadsreadlines readliness writelinesswritesflush(((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys TimeoutSockets   $    !   s TimeoutErrorcBstZRS(N(s__name__s __module__(((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys TimeoutError²s( s__doc__sidentsstringssocketsselectserrnosgetattrs WSAEINVALs TimeoutSockets Exceptions TimeoutError(sidentsstringserrnos TimeoutSockets TimeoutErrors WSAEINVALsselectssocket((s=build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/TimeoutSocket.pys?s $›PK¨58ií Í3Í3ZSI/wstools/Namespaces.pyo;ò •@Ec@sÒdZdZy8dklZlZlZlZlZlZde_ Wnydfd„ƒYZdfd„ƒYZdfd „ƒYZd fd „ƒYZd fd „ƒYZdfd„ƒYZnXdfd„ƒYZ e Z e fZ dfd„ƒYZ dfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZd fd!„ƒYZeZeeefZd"fd#„ƒYZd$fd%„ƒYZd&fd'„ƒYZd(Zd)S(*s+Namespace module, so you don't need PyXML s7$Id: Namespaces.py 1160 2006-03-17 19:28:11Z boverhof $(sSOAPsSCHEMAsWSDLsXMLNSsDSIGs ENCRYPTIONs/http://www.w3.org/TR/2001/REC-xml-c14n-20010315sSOAPcBstZdZdZdZRS(Ns)http://schemas.xmlsoap.org/soap/envelope/s)http://schemas.xmlsoap.org/soap/encoding/s*http://schemas.xmlsoap.org/soap/actor/next(s__name__s __module__sENVsENCs ACTOR_NEXT(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysSOAPssSCHEMAcBsPtZdZdZdZeeegZdZdZdZeeegZ eZ RS(Ns http://www.w3.org/1999/XMLSchemas#http://www.w3.org/2000/10/XMLSchemas http://www.w3.org/2001/XMLSchemas)http://www.w3.org/1999/XMLSchema-instances,http://www.w3.org/2000/10/XMLSchema-instances)http://www.w3.org/2001/XMLSchema-instance( s__name__s __module__sXSD1sXSD2sXSD3sXSD_LISTsXSI1sXSI2sXSI3sXSI_LISTsBASE(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysSCHEMAssWSDLcBs&tZdZdZdZdZdZRS(Ns http://schemas.xmlsoap.org/wsdl/s%http://schemas.xmlsoap.org/wsdl/http/s%http://schemas.xmlsoap.org/wsdl/mime/s%http://schemas.xmlsoap.org/wsdl/soap/s'http://schemas.xmlsoap.org/wsdl/soap12/(s__name__s __module__sBASEs BIND_HTTPs BIND_MIMEs BIND_SOAPs BIND_SOAP12(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSDL"s sXMLNScBstZdZdZdZRS(Nshttp://www.w3.org/2000/xmlns/s$http://www.w3.org/XML/1998/namespaceshttp://www.w3.org/TR/REC-html40(s__name__s __module__sBASEsXMLsHTML(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysXMLNS)ssDSIGcBs\tZdZdZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZRS(Ns"http://www.w3.org/2000/09/xmldsig#s/http://www.w3.org/TR/2001/REC-xml-c14n-20010315s;http://www.w3.org/TR/2000/CR-xml-c14n-20010315#WithCommentss'http://www.w3.org/2001/10/xml-exc-c14n#s%http://www.w3.org/2000/09/xmldsig#md2s%http://www.w3.org/2000/09/xmldsig#md5s&http://www.w3.org/2000/09/xmldsig#sha1s(http://www.w3.org/2000/09/xmldsig#base64s5http://www.w3.org/2000/09/xmldsig#enveloped-signatures+http://www.w3.org/2000/09/xmldsig#hmac-sha1s*http://www.w3.org/2000/09/xmldsig#dsa-sha1s*http://www.w3.org/2000/09/xmldsig#rsa-sha1s,http://www.w3.org/TR/1999/REC-xpath-19991116s+http://www.w3.org/TR/1999/REC-xslt-19991116(s__name__s __module__sBASEsC14Ns C14N_COMMs C14N_EXCLs DIGEST_MD2s DIGEST_MD5s DIGEST_SHA1s ENC_BASE64s ENVELOPEDs HMAC_SHA1s SIG_DSA_SHA1s SIG_RSA_SHA1sXPATHsXSLT(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysDSIG.ss ENCRYPTIONcBshtZdZdZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZRS(Ns!http://www.w3.org/2001/04/xmlenc#s(http://www.w3.org/2001/04/xmlenc#des-cbcs+http://www.w3.org/2001/04/xmlenc#aes128-cbcs+http://www.w3.org/2001/04/xmlenc#aes192-cbcs+http://www.w3.org/2001/04/xmlenc#aes256-cbcs*http://www.w3.org/2001/04/xmlenc#ripemd160s'http://www.w3.org/2001/04/xmlenc#sha256s'http://www.w3.org/2001/04/xmlenc#sha512s#http://www.w3.org/2001/04/xmlenc#dhs(http://www.w3.org/2001/04/xmlenc#rsa-1_5s/http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1ps(http://www.w3.org/2001/04/xmlenc#arcfours(http://www.w3.org/2001/04/xmlenc#kw-3dess*http://www.w3.org/2001/04/xmlenc#kw-aes128s*http://www.w3.org/2001/04/xmlenc#kw-aes192s*http://www.w3.org/2001/04/xmlenc#kw-aes256(s__name__s __module__sBASEs BLOCK_3DESs BLOCK_AES128s BLOCK_AES192s BLOCK_AES256sDIGEST_RIPEMD160s DIGEST_SHA256s DIGEST_SHA512sKA_DHs KT_RSA_1_5s KT_RSA_OAEPsSTREAM_ARCFOURs WRAP_3DESs WRAP_AES128s WRAP_AES192s WRAP_AES256(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys ENCRYPTION>s s WSRF_V1_2cBsZtZdZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZRS( s*OASIS WSRF Specifications Version 1.2 sLIFETIMEcBs>tZdZdZdZdZeZeefZeefZRS(NsQhttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsdsQhttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.xsdsRhttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdlsRhttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.wsdl( s__name__s __module__s XSD_DRAFT1s XSD_DRAFT4s WSDL_DRAFT1s WSDL_DRAFT4sLATESTs WSDL_LISTsXSD_LIST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysLIFETIMETs s PROPERTIEScBs>tZdZdZdZdZeZeefZeefZRS(NsShttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsdsShttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsdsThttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdlsThttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.wsdl( s__name__s __module__s XSD_DRAFT1s XSD_DRAFT5s WSDL_DRAFT1s WSDL_DRAFT5sLATESTs WSDL_LISTsXSD_LIST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys PROPERTIES^s sBASENOTIFICATIONcBs,tZdZdZeZefZefZRS(NsOhttp://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsdsPhttp://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl(s__name__s __module__s XSD_DRAFT1s WSDL_DRAFT1sLATESTs WSDL_LISTsXSD_LIST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysBASENOTIFICATIONhs  s BASEFAULTScBs tZdZdZeefZRS(NsKhttp://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsdsKhttp://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-BaseFaults-1.2-draft-03.xsd(s__name__s __module__s XSD_DRAFT1s XSD_DRAFT3sXSD_LIST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys BASEFAULTSps(s__name__s __module__s__doc__sLIFETIMEs PROPERTIESsBASENOTIFICATIONs BASEFAULTS(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys WSRF_V1_2Qs   sOASIScBs]tZdZdZdZdfd„ƒYZeiiZei iZ ei iZ ei iZ RS(s"URLs for Oasis specifications sQhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsdsRhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsds X509TOKENcBs,tZdZdZdZdZdZdZRS(Ns^http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64BinarysQhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0sThttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#PKCS7sShttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509s\http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1sihttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3SubjectKeyIdentifier(s__name__s __module__s Base64Binarys STRTransformsPKCS7sX509s X509PKIPathv1sX509v3SubjectKeyIdentifier(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys X509TOKENs ( s__name__s __module__s__doc__sWSSEsUTILITYs X509TOKENs WSRF_V1_2sLIFETIMEs XSD_DRAFT1s PROPERTIESsBASENOTIFICATIONs BASEFAULTS(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysOASIS{s    sWSTRUSTcBstZdZdZRS(Ns+http://schemas.xmlsoap.org/ws/2004/04/trusts1http://schemas.xmlsoap.org/ws/2004/04/trust/Issue(s__name__s __module__sBASEsISSUE(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSTRUSTssWSSEcBstZdZeiZRS(Ns,http://schemas.xmlsoap.org/ws/2002/04/secext(s__name__s __module__sBASEsWSTRUSTsTRUST(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSSE“ssWSUcBstZdZdZRS(Ns-http://schemas.xmlsoap.org/ws/2002/04/utilitys-http://schemas.xmlsoap.org/ws/2002/07/utility(s__name__s __module__sBASEsUTILITY(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSU˜ssWSRcBstZdZdZRS(NsBhttp://www.ibm.com/xmlns/stdwip/web-services/WS-ResourcePropertiess@http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime(s__name__s __module__s PROPERTIESsLIFETIME(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSRss WSA200408cBs"tZdZdeZdeZRS(Ns0http://schemas.xmlsoap.org/ws/2004/08/addressings%s/role/anonymouss%s/fault(s__name__s __module__sADDRESSs ANONYMOUSsFAULT(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys WSA200408¢s s WSA200403cBs"tZdZdeZdeZRS(Ns0http://schemas.xmlsoap.org/ws/2004/03/addressings%s/role/anonymouss%s/fault(s__name__s __module__sADDRESSs ANONYMOUSsFAULT(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys WSA200403§s s WSA200303cBstZdZdeZeZRS(Ns0http://schemas.xmlsoap.org/ws/2003/03/addressings%s/role/anonymous(s__name__s __module__sADDRESSs ANONYMOUSsNonesFAULT(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys WSA200303¬s sWSPcBstZdZRS(Ns,http://schemas.xmlsoap.org/ws/2002/12/policy(s__name__s __module__sPOLICY(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysWSPµssBEAcBstZdZdZRS(Ns(http://schemas.xmlsoap.org/ws/2004/04/scs5http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct(s__name__s __module__sSECCONVsSCTOKEN(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysBEA¸ssGLOBUScBs tZdZdZdZdZRS(Ns4http://wsrf.globus.org/core/2004/07/security/secconvs-http://www.globus.org/namespaces/2004/06/cores0http://www.globus.org/2002/04/xmlenc#gssapi-signs=http://www.globus.org/ws/2004/09/security/sc#GSSAPI_GSI_TOKEN(s__name__s __module__sSECCONVsCOREsSIGsTOKEN(((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pysGLOBUS¼ss"http://www.zolera.com/schemas/ZSI/N(s__doc__sidentsxml.nssSOAPsSCHEMAsWSDLsXMLNSsDSIGs ENCRYPTIONsC14Ns WSRF_V1_2sWSRFsWSRFLISTsOASISsWSTRUSTsWSSEsWSUsWSRs WSA200408s WSA200403s WSA200303sWSAsWSA_LISTsWSPsBEAsGLOBUSsZSI_SCHEMA_URI(sWSAsBEAsWSPsWSRsWSUsWSSEs WSA200403sGLOBUSsWSRFsOASISsSCHEMAs WSRF_V1_2sXMLNSs WSA200303sWSRFLISTsZSI_SCHEMA_URIsWSDLsidentsWSTRUSTs ENCRYPTIONsWSA_LISTs WSA200408sDSIGsSOAP((s:build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/Namespaces.pys? s8+  & PK…¨58ï³ímššZSI/wstools/__init__.pyc;ò •@Ec@s+dZdZdkZdkZdkZdS(s:WSDL parsing services package for Web Services for Python.s3$Id: __init__.py 840 2004-12-07 15:54:53Z blunck2 $N(s__doc__sidents WSDLToolssXMLnameslogging(sXMLnamesidentsloggings WSDLTools((s8build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/__init__.pys?s  PKN¤Y5úÍxààZSI/wstools/TimeoutSocket.py"""Based on code from timeout_socket.py, with some tweaks for compatibility. These tweaks should really be rolled back into timeout_socket, but it's not totally clear who is maintaining it at this point. In the meantime, we'll use a different module name for our tweaked version to avoid any confusion. The original timeout_socket is by: Scott Cotton Lloyd Zusman Phil Mayes Piers Lauder Radovan Garabik """ ident = "$Id: TimeoutSocket.py 237 2003-05-20 21:10:14Z warnes $" import string, socket, select, errno WSAEINVAL = getattr(errno, 'WSAEINVAL', 10022) class TimeoutSocket: """A socket imposter that supports timeout limits.""" def __init__(self, timeout=20, sock=None): self.timeout = float(timeout) self.inbuf = '' if sock is None: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock = sock self.sock.setblocking(0) self._rbuf = '' self._wbuf = '' def __getattr__(self, name): # Delegate to real socket attributes. return getattr(self.sock, name) def connect(self, *addr): timeout = self.timeout sock = self.sock try: # Non-blocking mode sock.setblocking(0) apply(sock.connect, addr) sock.setblocking(timeout != 0) return 1 except socket.error,why: if not timeout: raise sock.setblocking(1) if len(why.args) == 1: code = 0 else: code, why = why if code not in ( errno.EINPROGRESS, errno.EALREADY, errno.EWOULDBLOCK ): raise r,w,e = select.select([],[sock],[],timeout) if w: try: apply(sock.connect, addr) return 1 except socket.error,why: if len(why.args) == 1: code = 0 else: code, why = why if code in (errno.EISCONN, WSAEINVAL): return 1 raise raise TimeoutError('socket connect() timeout.') def send(self, data, flags=0): total = len(data) next = 0 while 1: r, w, e = select.select([],[self.sock], [], self.timeout) if w: buff = data[next:next + 8192] sent = self.sock.send(buff, flags) next = next + sent if next == total: return total continue raise TimeoutError('socket send() timeout.') def recv(self, amt, flags=0): if select.select([self.sock], [], [], self.timeout)[0]: return self.sock.recv(amt, flags) raise TimeoutError('socket recv() timeout.') buffsize = 4096 handles = 1 def makefile(self, mode="r", buffsize=-1): self.handles = self.handles + 1 self.mode = mode return self def close(self): self.handles = self.handles - 1 if self.handles == 0 and self.sock.fileno() >= 0: self.sock.close() def read(self, n=-1): if not isinstance(n, type(1)): n = -1 if n >= 0: k = len(self._rbuf) if n <= k: data = self._rbuf[:n] self._rbuf = self._rbuf[n:] return data n = n - k L = [self._rbuf] self._rbuf = "" while n > 0: new = self.recv(max(n, self.buffsize)) if not new: break k = len(new) if k > n: L.append(new[:n]) self._rbuf = new[n:] break L.append(new) n = n - k return "".join(L) k = max(4096, self.buffsize) L = [self._rbuf] self._rbuf = "" while 1: new = self.recv(k) if not new: break L.append(new) k = min(k*2, 1024**2) return "".join(L) def readline(self, limit=-1): data = "" i = self._rbuf.find('\n') while i < 0 and not (0 < limit <= len(self._rbuf)): new = self.recv(self.buffsize) if not new: break i = new.find('\n') if i >= 0: i = i + len(self._rbuf) self._rbuf = self._rbuf + new if i < 0: i = len(self._rbuf) else: i = i+1 if 0 <= limit < len(self._rbuf): i = limit data, self._rbuf = self._rbuf[:i], self._rbuf[i:] return data def readlines(self, sizehint = 0): total = 0 list = [] while 1: line = self.readline() if not line: break list.append(line) total += len(line) if sizehint and total >= sizehint: break return list def writelines(self, list): self.send(''.join(list)) def write(self, data): self.send(data) def flush(self): pass class TimeoutError(Exception): pass PKލ58ù<Œ44ZSI/wstools/XMLSchema.pyo;ò •@Ec@sîdZdkZdkZdkZdkZdklZlZdkl Z l Z l Z l Z l Z dklZydklZWn&ej odfd„ƒYZnXdZd Zd Zd Zd Zd „Zdfd„ƒYZdefd„ƒYZdfd„ƒYZdefd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZ dfd„ƒYZ!d fd!„ƒYZ"d"fd#„ƒYZ#d$fd%„ƒYZ$d&fd'„ƒYZ%d(e%fd)„ƒYZ&d*e%fd+„ƒYZ'd,e%fd-„ƒYZ(d.fd/„ƒYZ)d0fd1„ƒYZ*d2fd3„ƒYZ+d4fd5„ƒYZ,d6fd7„ƒYZ-d8fd9„ƒYZ.d:fd;„ƒYZ/d<fd=„ƒYZ0d>ee0fd?„ƒYZ1d@e1fdA„ƒYZ2dBe1fdC„ƒYZ3dDe1fdE„ƒYZ4dFfdG„ƒYZ5dHe1fdI„ƒYZ6dJe1e efdK„ƒYZ7dLe7e e/efdM„ƒYZ8dNe1e ee"fdO„ƒYZ9dPe1e e$fdQ„ƒYZ:dRe1e!efdS„ƒYZ;dTe1e!e$fdU„ƒYZ<dVe1fdW„ƒYZ=dXe=fdY„ƒYZ>dZe=fd[„ƒYZ?d\e=fd]„ƒYZ@d^e1e#efd_„ƒYZAd`eAe/fda„ƒYZBdbe1e#e$fdc„ƒYZCddeBe"fde„ƒYZDdfe1e(fdg„ƒYZEdhe1e&fdi„ƒYZFdje1e'fdk„ƒYZGdle1e%efdm„ƒYZHdne1e%e$fdo„ƒYZIdpe1ee.fdq„ƒYZJdreJe/fds„ƒYZKdte1ee+fdu„ƒYZLdveLe+e/fdw„ƒYZMdxfdy„ƒYZNeiOdz dzdzfjo ePZQndkRZReRiRZQd{eQfd|„ƒYZSdS(}s6$Id: XMLSchema.py 1207 2006-05-04 18:34:01Z boverhof $N(sSCHEMAsXMLNS(sDOMs DOMExceptions Collections SplitQNamesbasejoin(sStringIO(sRLocksRLockcBstZd„Zd„ZRS(NcCsdS(N((((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysacquirescCsdS(N((((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysreleases(s__name__s __module__sacquiresrelease(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysRLocks stypess attr_groupss attr_declselementss model_groupscCs3|}x"t|tƒ o|iƒ}q W|SdS(sBconvience function for finding the parent XMLSchema instance. N(s componentsparents isinstances XMLSchemas_parent(s componentsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys GetSchema*s s SchemaReadercBsztZdZhZeed„Zd„Zd„Zd„Zd„Z d„Z ed„Z d„Z ed „Z d „ZRS( sEA SchemaReader creates XMLSchema objects from urls and xml data. cCs@||_||_|i o t|_nh|_h|_dS(sedomReader -- class must implement DOMAdapterInterface base_url -- base url string N(sbase_urlsselfs_SchemaReader__base_urls domReaders_SchemaReader__readerClasss DOMAdapters _includess_imports(sselfs domReadersbase_url((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__8s     cCsOxH|iiƒD]7\}}|ii|ƒo|i|i|ƒqqWdS(s^Add dictionary of imports to schema instance. schema -- XMLSchema instance N( sschemasimportssitemssnssvalsselfs_importsshas_keysaddImportSchema(sselfsschemasnssval((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys __setImportsCs  cCsOxH|iiƒD]7\}}|ii|ƒo|i|i |ƒqqWdS(s_Add dictionary of includes to schema instance. schema -- XMLSchema instance N( sschemasincludessitemssschemaLocationsvalsselfs _includesshas_keysaddIncludeSchemas_imports(sselfsschemasschemaLocationsval((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys __setIncludesKs  cCs||i|load a Document from a file object file -- sadapter method not implementedN(sNotImplementedError(sselfsfile((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys loadDocumentÍscCs td‚dS(sIload a Document from an url url -- URL to dereference sadapter method not implementedN(sNotImplementedError(sselfsurl((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys loadFromURLÓs( s__name__s __module__sNoneshasattrsgetContentListssetAttributeDictionarysgetAttributeDictionarys getNamespaces getTagNames getParentNodes loadDocuments loadFromURL(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysDOMAdapterInterface¥s        s DOMAdaptercBswtZdZed„Zd„Zed„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „ZRS( s Adapter for ZSI.Utility.DOM cCs6t|dƒo|i|_n ||_t|_dS(sXReset all instance variables. element -- DOM document, node, or None sdocumentElementN(shasattrsnodesdocumentElementsselfs_DOMAdapter__nodesNones_DOMAdapter__attributes(sselfsnode((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Ýs  cCs |iSdS(N(sselfs_DOMAdapter__node(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetNodeçscCsT|i o|iƒn|o |ii|hƒi|ƒSn|ii|ƒSdS(saattr -- attribute ns -- optional namespace, None means unprefixed attribute. N(sselfs_DOMAdapter__attributesssetAttributeDictionarysnssgetshas_keysattr(sselfsattrsns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pyshasattrês   cGsg}|ii}xXti|itƒD]A}|i|jot |i ƒd|jo|i |ƒq(q(Wt |i|ƒSdS(Ni(snodessselfs_DOMAdapter__nodes ELEMENT_NODEsDOMs getElementssNoneschildsnodeTypes SplitQNamestagNamescontentssappendsmaps __class__(sselfscontentss ELEMENT_NODEschildsnodes((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetContentListôs *cCs=h|_x-|iiiƒD]}|i|i|i s %s* %s = %s s ( sXMLBases_XMLBase__rlocksacquires_XMLBase__indentsstrsselfs __class__stmps__dict__sitemssksvsrelease(sselfstmpsvsk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__str__2s  " ( s__name__s __module__s__doc__sNonestags_XMLBase__indentsRLocks_XMLBase__rlocks__str__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysXMLBase+s  sDefinitionMarkercBstZdZRS(smarker for definitions (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysDefinitionMarkerAs sDeclarationMarkercBstZdZRS(smarker for declarations (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysDeclarationMarkerFs sAttributeMarkercBstZdZRS(smarker for attributes (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeMarkerKs sAttributeGroupMarkercBstZdZRS(s marker for attribute groups (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeGroupMarkerPs sWildCardMarkercBstZdZRS(smarker for wildcards (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysWildCardMarkerUs s ElementMarkercBstZdZRS(smarker for wildcards (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ElementMarkerZs sReferenceMarkercBstZdZRS(smarker for references (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysReferenceMarker_s sModelGroupMarkercBstZdZRS(smarker for model groups (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysModelGroupMarkerds s AllMarkercBstZdZRS(smarker for all model group (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys AllMarkeris s ChoiceMarkercBstZdZRS(s"marker for choice model group (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ChoiceMarkerns sSequenceMarkercBstZdZRS(s$marker for sequence model group (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysSequenceMarkerss sExtensionMarkercBstZdZRS(smarker for extensions (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysExtensionMarkerxs sRestrictionMarkerc Bs8tZdZddddddddd d d d g ZRS( smarker for restrictions s enumerationslengths maxExclusives maxInclusives maxLengths minExclusives minInclusives minLengthspatternsfractionDigitss totalDigitss whiteSpace(s__name__s __module__s__doc__sfacets(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysRestrictionMarker}s s SimpleMarkercBstZdZRS(s'marker for simple type information (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys SimpleMarker„s s ListMarkercBstZdZRS(s marker for simple type list (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ListMarker‰s s UnionMarkercBstZdZRS(s!marker for simple type Union (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys UnionMarkerŽs s ComplexMarkercBstZdZRS(s(marker for complex type information (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ComplexMarker”s s LocalMarkercBstZdZRS(s(marker for complex type information (s__name__s __module__s__doc__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys LocalMarker™s sMarkerInterfacecBsªtZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zd„ZRS(NcCst|tƒSdS(N(s isinstancesselfsDefinitionMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isDefinition scCst|tƒSdS(N(s isinstancesselfsDeclarationMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isDeclaration£scCst|tƒSdS(N(s isinstancesselfsAttributeMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isAttribute¦scCst|tƒSdS(N(s isinstancesselfsAttributeGroupMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisAttributeGroup©scCst|tƒSdS(N(s isinstancesselfs ElementMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isElement¬scCst|tƒSdS(N(s isinstancesselfsReferenceMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isReference¯scCst|tƒSdS(N(s isinstancesselfsWildCardMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isWildCard²scCst|tƒSdS(N(s isinstancesselfsModelGroupMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isModelGroupµscCst|tƒSdS(N(s isinstancesselfs AllMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisAll¸scCst|tƒSdS(N(s isinstancesselfs ChoiceMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisChoice»scCst|tƒSdS(N(s isinstancesselfsSequenceMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isSequence¾scCst|tƒSdS(N(s isinstancesselfsExtensionMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isExtensionÁscCst|tƒSdS(N(s isinstancesselfsRestrictionMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isRestrictionÄscCst|tƒSdS(N(s isinstancesselfs SimpleMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisSimpleÇscCst|tƒSdS(N(s isinstancesselfs ComplexMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isComplexÊscCst|tƒSdS(N(s isinstancesselfs LocalMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisLocalÍscCst|tƒSdS(N(s isinstancesselfs ListMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisListÐscCst|tƒSdS(N(s isinstancesselfs UnionMarker(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisUnionÓs(s__name__s __module__s isDefinitions isDeclarations isAttributesisAttributeGroups isElements isReferences isWildCards isModelGroupsisAllsisChoices isSequences isExtensions isRestrictionsisSimples isComplexsisLocalsisListsisUnion(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysMarkerInterfaceŸs$                 sXMLSchemaComponentcBsÚtZdZgZhZhZdZdZdZe d„Z d„Z d„Z d„Z d„Zd „Zd „Zd „Zd „Zd „Ze d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s class variables: required -- list of required attributes attributes -- dict of default attribute values, including None. Value can be a function for runtime dependencies. contents -- dict of namespace keyed content lists. 'xsd' content of xsd namespace. xmlns_key -- key for declared xmlns namespace. xmlns -- xmlns is special prefix for namespace dictionary xml -- special xml prefix for xml namespace. ssxmlnssxmlcCsÂt|_||_|ioti|ƒ|_n|itj odt |ii ƒt ti ƒjoAt |iiƒt tiƒjot |ii ƒt ti ƒj ot d|i‚ndS(s~parent -- parent instance instance variables: attributes -- dictionary of node's attributes s#Bad type for a class variable in %sN( sNonesselfs attributessparents_parentsweakrefsrefs __class__sXMLSchemaComponentstypesrequiredscontentss RuntimeError(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ís   xcCs1|gddf\}}}}x»t|tƒ ot|tƒ o˜|i|ƒ}|t joR|i|ƒ}|t jo|i d|i ƒqË|i d|i |fƒn|i d|i |fƒ|i ƒ}q!Wy|iƒ}Wn d}nX|i d|i |fƒ|iƒdi|ƒSdS( s6Returns a node trace up to the item. snamesrefs<%s>s <%s ref="%s">s<%s name="%s">ss<%s targetNamespace="%s">N(sselfsitemspathsnamesrefs isinstances XMLSchemasWSDLToolsAdapters getAttributesattrsNonesappendstags_parentsgetTargetNamespacestnssreversesjoin(sselfsnamestnssitemspathsrefsattr((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getItemTraceýs&"    cCsT|}d}|ii|ƒ}x+| o"|iƒ}|ii|ƒ}q!W|SdS(sreturn targetNamespace stargetNamespaceN(sselfsparentstargetNamespaces attributessgetstnss_parent(sselfstargetNamespacestnssparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTargetNamespaces cCs|it|ƒSdS(sˆattribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance N(sselfsgetQNameAttributes ATTRIBUTESs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeDeclarationscCs|it|ƒSdS(sˆattribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance N(sselfsgetQNameAttributesATTRIBUTE_GROUPSs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeGroup#scCs|it|ƒSdS(sˆattribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance N(sselfsgetQNameAttributesTYPESs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinition)scCs|it|ƒSdS(sattribute -- attribute with a QName value (eg. element). collection -- check elements collection in parent Schema instance. N(sselfsgetQNameAttributesELEMENTSs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclaration/scCs|it|ƒSdS(sŽattribute -- attribute with a QName value (eg. ref). collection -- check model_group collection in parent Schema instance. N(sselfsgetQNameAttributes MODEL_GROUPSs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getModelGroup5scCsIt}|i|ƒ}|o%|i||iƒ|i ƒƒ}n|SdS(s returns object instance representing QName --> (namespace,name), or if does not exist return None. attribute -- an information item attribute, with a QName value. collection -- collection in parent Schema instance to search. N( sNonesobjsselfsgetAttributeQNames attributestdcs getSchemaItems collectionsgetTargetNamespacesgetName(sselfs collections attributesobjstdc((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetQNameAttribute;s %cCs^t|ƒ}|i|joMyt||ƒ|}Wn+t j o}t d|||f‚nX|Sn|i i |ƒ ot Sn|i |}t|tƒ o.|iƒ}|t j o||i |tZdZhde<de parent: schema attributes: id -- ID name -- NCName, Required public -- token, Required system -- anyURI contents: annotation? snamespublicsidssystemsxsds annotationsnotationcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__%scCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom)s ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysNotations  * s AnnotationcBsvtZdZhde parent: all,any,anyAttribute,attribute,attributeGroup,choice,complexContent, complexType,element,extension,field,group,import,include,key,keyref, list,notation,redefine,restriction,schema,selector,simpleContent, simpleType,union,unique attributes: id -- ID contents: (documentation | appinfo)* sidsxsds documentationsappinfos annotationcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNonescontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__FscCs—|i|ƒ|i|ƒ}g}x_|D]W}t|iƒƒd}|djoq)q)|djoq)q)t d|iƒ‚q)Wt |ƒ|_dS(Nis documentationsappinfosUnknown component (%s)( sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomJs   s DocumentationcBsStZdZhde<de parent: annotation attributes: source, anyURI xml:lang, language contents: mixed, any ssourcesxml:langsxsdsmixedsanys documentationcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNonescontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__jscCs—|i|ƒ|i|ƒ}g}x_|D]W}t|iƒƒd}|djoq)q)|djoq)q)t d|iƒ‚q)Wt |ƒ|_dS(NismixedsanysUnknown component (%s)( sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomns   ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Documentation\s  sAppinfocBsStZdZhde<de parent: annotation attributes: source, anyURI contents: mixed, any ssourcesanyURIsxsdsmixedsanysappinfocCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNonescontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__scCs—|i|ƒ|i|ƒ}g}x_|D]W}t|iƒƒd}|djoq)q)|djoq)q)t d|iƒ‚q)Wt |ƒ|_dS(NismixedsanysUnknown component (%s)( sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom‘s   ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAppinfo€s  ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDomsXMLSchemaComponents DocumentationsAppinfo(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Annotation6s   $s XMLSchemaFakecBstZd„ZRS(NcCs"ti|dƒ|_||_dS(NstargetNamespace(sDOMsgetAttrselementsselfstargetNamespace(sselfselement((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__¥s(s__name__s __module__s__init__(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys XMLSchemaFake£ss XMLSchemacBsftZdZhde<de<de<de<dd<dd<de<d e element information items. It represents the abstract notion of a schema rather than a single schema document (or other representation). parent: ROOT attributes: id -- ID version -- token xml:lang -- language targetNamespace -- anyURI attributeFormDefault -- 'qualified' | 'unqualified', 'unqualified' elementFormDefault -- 'qualified' | 'unqualified', 'unqualified' blockDefault -- '#all' | list of ('substitution | 'extension' | 'restriction') finalDefault -- '#all' | list of ('extension' | 'restriction' | 'list' | 'union') contents: ((include | import | redefine | annotation)*, (attribute, attributeGroup, complexType, element, group, notation, simpleType)*, annotation*)* attributes -- schema attributes imports -- import statements includes -- include statements redefines -- types -- global simpleType, complexType definitions elements -- global element declarations attr_decl -- global attribute declarations attr_groups -- attribute Groups model_groups -- model Groups notations -- global notations sidsversionsxml:langstargetNamespacesattributeFormDefaults unqualifiedselementFormDefaults blockDefaults finalDefaultsxsdsincludesimportsredefines annotations attributesattributeGroups complexTypeselementsgroupsnotations simpleTypessschemacCst|_t|_ti||ƒd„}d„}d„}t |d|ƒ|_ t |d|ƒ|_ t |d|ƒ|_ t |d|ƒ|_t |d|ƒ|_t |d|ƒ|_t |d|ƒ|_t |d|ƒ|_h|_h|_t|_dS(s,parent -- instance variables: targetNamespace -- schema's declared targetNamespace, or empty string. _imported_schemas -- namespace keyed dict of schema dependencies, if a schema is provided instance will not resolve import statement. _included_schemas -- schemaLocation keyed dict of component schemas, if schema is provided instance will not resolve include statement. _base_url -- needed for relative URLs support, only works with URLs relative to initial document. includes -- collection of include statements imports -- collection of import statements elements -- collection of global element declarations types -- collection of global type definitions attr_decl -- collection of global attribute declarations attr_groups -- collection of global attribute group definitions model_groups -- collection of model group definitions notations -- collection of notations cCs |idS(Nsname(sks attributes(sk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysõscCs |idS(Ns namespace(sks attributes(sk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysöscCs |idS(NsschemaLocation(sks attributes(sk((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys÷sskeyN(sNonesselfs_XMLSchema__nodestargetNamespacesXMLSchemaComponents__init__sparentsfsnsssls Collectionsincludessimportsselementsstypess attr_decls attr_groupss model_groupss notationss_imported_schemass_included_schemass _base_url(sselfsparentsfsslsns((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Þs$       cCs |iSdS(s; Interacting with the underlying DOM tree. N(sselfs_XMLSchema__node(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetNodescCsRt|tƒ o td‚n|i|ijo||i|iˆƒ}|i|ƒ|ˆi?|i0dƒ parent: schema attributes: id -- ID namespace -- anyURI schemaLocation -- anyURI contents: annotation? sids namespacesschemaLocationsxsds annotationsimportcCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations_schema(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ÿs cCs¼|i|ƒ|i|ƒ}|id|iƒjo td‚nxr|D]j}t |i ƒƒd}|djo|i o#t |ƒ|_ |i i|ƒqJtd|i ƒ‚qJWdS(Ns namespaces$namespace of schema and import matchis annotationsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentss attributessgetTargetNamespaces SchemaErrorsis SplitQNames getTagNames components annotations AnnotationsfromDom(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDoms  cCs|i oý|id}|iƒiƒi|ƒ}| o |iƒio%|iƒiƒiƒi|ƒ}n| oŒ|iidƒ}| ot d|‚n|iƒi ƒ}t d|ƒ}|iƒiƒ|_|iƒiƒ|_|i|ƒ|_qn|ip|SdS(síif schema is not defined, first look for a Schema class instance in parent Schema. Else if not defined resolve schemaLocation and create a new Schema class instance, and keep a hard reference. s namespacesschemaLocationsnamespace(%s) is unknownsbase_urlN(sselfs_schemas attributessnss_parentsgetImportSchemassgetsschemasurls SchemaErrors getBaseUrlsbase_urls SchemaReadersreaders_importssgetIncludeSchemass _includess loadFromURL(sselfsurlsbase_urlsreadersnssschema((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getSchemas   %cCs•|iƒiƒ}td|ƒ}|iƒiƒ|_|iƒiƒ|_ ||_ |i i dƒ o td‚n|i|i idƒ|ƒdS(s sbase_urlsschemaLocationsno schemaLocationN(sselfs_parents getBaseUrlsbase_urls SchemaReadersreadersgetImportSchemass_importssgetIncludeSchemass _includessschemas_schemas attributesshas_keys SchemaErrors loadFromURLsget(sselfsschemasbase_urlsreader((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys loadSchema)s  ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDoms getSchemas loadSchema(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysImportîs !   sIncludecBsbtZdZdgZhde<de parent: schema attributes: id -- ID schemaLocation -- anyURI, required contents: annotation? sschemaLocationsidsxsds annotationsincludecCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations_schema(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Gs cCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomLs cCs¶|i o |iƒ}|iƒi|idƒ|_|i of|id}td|i ƒƒ}|i ƒ|_ |iƒ|_ t|ƒ|_|i||iƒq«n|iSdS(sÓif schema is not defined, first look for a Schema class instance in parent Schema. Else if not defined resolve schemaLocation and create a new Schema class instance. sschemaLocationsbase_urlN(sselfs_schemas_parentsschemasgetIncludeSchemassgets attributessurls SchemaReaders getBaseUrlsreadersgetImportSchemass_importss _includess XMLSchemas loadFromURL(sselfsurlsreadersschema((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getSchemaXs    ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sfromDoms getSchema(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysInclude7s    (s__name__s __module__s__doc__sNones attributesscontentssempty_namespacestags__init__sgetNodesaddImportSchemasaddIncludeSchemassetImportSchemassgetImportSchemassgetSchemaNamespacesToImportssetIncludeSchemassgetIncludeSchemass getBaseUrls setBaseUrlsgetElementFormDefaultsisElementFormDefaultQualifiedsgetAttributeFormDefaultsgetBlockDefaultsgetFinalDefaultsloadsXMLSchemaComponentsImportsInclude(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys XMLSchema©s0 %N3 '               ˆIsAttributeDeclarationcBswtZdZdgZhde<de<de<de<de parent: schema attributes: id -- ID name -- NCName, required type -- QName default -- string fixed -- string contents: annotation?, simpleType? snamesidstypesdefaultsfixedsxsds annotations simpleTypes attributecCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ˆs cCsÅ|i|ƒ|i|ƒ}x¢|D]š}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#|djo#t |ƒ|_ |i i |ƒq#td|iƒ‚q#WdS(s" No list or union support is annotations simpleTypesUnknown component (%s)N(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDomsAnonymousSimpleTypescontents SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDoms  ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeDeclarationps  3 sLocalAttributeDeclarationcBs†tZdZdgZhde<de<de<dd„<dd<de<d e parent: complexType, restriction, extension, attributeGroup attributes: id -- ID name -- NCName, required type -- QName form -- ('qualified' | 'unqualified'), schema.attributeFormDefault use -- ('optional' | 'prohibited' | 'required'), optional default -- string fixed -- string contents: annotation?, simpleType? snamesidstypesformcCst|ƒiƒS(N(s GetSchemasselfsgetAttributeFormDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysµssusesoptionalsdefaultsfixedsxsds annotations simpleTypecCs&ti||ƒt|_t|_dS(N(sAttributeDeclarations__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__»s cCsÅ|i|ƒ|i|ƒ}x¢|D]š}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#|djo#t |ƒ|_ |i i |ƒq#td|iƒ‚q#WdS(Nis annotations simpleTypesUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDomsAnonymousSimpleTypescontents SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomÀs  ( s__name__s __module__s__doc__srequiredsNones attributesscontentss__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysLocalAttributeDeclarationŸs  H sAttributeWildCardcBsYtZdZhde<dd<dd parents: complexType, restriction, extension, attributeGroup attributes: id -- ID namespace -- '##any' | '##other' | (anyURI* | '##targetNamespace' | '##local'), ##any processContents -- 'lax' | 'skip' | 'strict', strict contents: annotation? sids namespaces##anysprocessContentssstrictsxsds annotations anyAttributecCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__åscCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomés ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeWildCardÐs ! sAttributeReferencecBs€tZdZdgZhde<de<dd<de<de parents: complexType, restriction, extension, attributeGroup attributes: id -- ID ref -- QName, required use -- ('optional' | 'prohibited' | 'required'), optional default -- string fixed -- string contents: annotation? srefsidsusesoptionalsdefaultsfixedsxsds annotations attributecCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__scCsti||ƒSdS(N(sXMLSchemaComponentsgetAttributeDeclarationsselfs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeDeclarationscCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDoms ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetAttributeDeclarationsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeReferenceös  3  sAttributeGroupDefinitioncBsktZdZdgZhde<de parents: schema, redefine attributes: id -- ID name -- NCName, required contents: annotation?, (attribute | attributeGroup)*, anyAttribute? snamesidsxsds annotations attributesattributeGroups anyAttributecCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__4s cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContent9scCsä|i|ƒ|i|ƒ}g}x¬tt|ƒƒD]˜}t ||i ƒƒd}|djo| o't |ƒ|_ |i i||ƒq5|djox||idƒo|it|ƒƒn5||idƒo|it|ƒƒn td‚|di||ƒq5|djo,|it|ƒƒ|di||ƒq5|d joZt|ƒ|djotd |iƒ‚n|it|ƒƒ|di||ƒq5td ||i ƒ‚q5Wt|ƒ|_dS( Nis annotations attributesnamesrefsUnknown attribute typeiÿÿÿÿsattributeGroups anyAttributes"anyAttribute is out of order in %ssUnknown component (%s)(sselfs setAttributessnodes getContentsscontentsscontentsrangeslensindxs SplitQNames getTagNames components Annotations annotationsfromDomshasattrsappendsLocalAttributeDeclarationsAttributeReferences SchemaErrorsAttributeGroupReferences getItemTracesAttributeWildCardstuples attr_content(sselfsnodes componentsindxscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom<s4     ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetAttributeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeGroupDefinition"s    sAttributeGroupReferencecBsetZdZdgZhde<de parents: complexType, restriction, extension, attributeGroup attributes: id -- ID ref -- QName, required contents: annotation? srefsidsxsds annotationsattributeGroupcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__mscCsti||ƒSdS(sˆattribute -- attribute with a QName value (eg. type). collection -- check types collection in parent Schema instance N(sXMLSchemaComponentsgetAttributeGroupsselfs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeGroupqscCs•|i|ƒ|i|ƒ}xr|D]j}t|iƒƒd}|djo|i o#t |ƒ|_ |i i |ƒq#t d|iƒ‚q#WdS(Nis annotationsUnknown component (%s)( sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomws ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetAttributeGroupsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAttributeGroupReference[s    sIdentityConstrantscBsbtZdZd„Zd„Zdefd„ƒYZdefd„ƒYZdefd„ƒYZRS( súAllow one to uniquely identify nodes in a document and ensure the integrity of references between them. attributes -- dictionary of attributes selector -- XPath to selected nodes fields -- list of XPath to key field cCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNonesselectorsfieldss annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__s  cCsI|i|ƒ|i|ƒ}g}x |D]}t|iƒƒd}||i idjoÃ|djo|i o#t |ƒ|_ |i i |ƒq2|djo)|i|ƒ|_|ii |ƒq)q2|djo.|i|i|ƒƒ|di |ƒq)q2td|iƒ‚ntd|iƒ‚t|ƒ|_q)WdS(Nisxsds annotationsselectorsfieldiÿÿÿÿsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssfieldssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomsSelectorsselectorsappendsFields SchemaErrorstuple(sselfsnodesisfieldss componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom–s*   s ConstraintcBstZd„Zd„ZRS(NcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__±scCsÃ|i|ƒ|i|ƒ}x |D]˜}t|iƒƒd}||i idjoR|djo|i o#t |ƒ|_ |i i |ƒq»t d|iƒ‚q#t d|iƒ‚q#WdS(Nisxsds annotationsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomµs (s__name__s __module__s__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Constraint°s sSelectorcBsGtZdZdgZhde<de parent: unique, key, keyref attributes: id -- ID xpath -- XPath subset, required contents: annotation? sxpathsidsxsds annotationsselector(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysSelectorÄs  sFieldcBsGtZdZdgZhde<de parent: unique, key, keyref attributes: id -- ID xpath -- XPath subset, required contents: annotation? sxpathsidsxsds annotationsfield(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysFieldÔs  ( s__name__s __module__s__doc__s__init__sfromDomsXMLSchemaComponents ConstraintsSelectorsField(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysIdentityConstrantsˆs   sUniquecBsMtZdZdgZhde<de Enforce fields are unique w/i a specified scope. parent: element attributes: id -- ID name -- NCName, required contents: annotation?, selector, field+ snamesidsxsds annotationsselectorsfieldsunique(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysUniqueås  sKeycBsMtZdZdgZhde<de Enforce fields are unique w/i a specified scope, and all field values are present w/i document. Fields cannot be nillable. parent: element attributes: id -- ID name -- NCName, required contents: annotation?, selector, field+ snamesidsxsds annotationsselectorsfieldskey(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysKey÷s  sKeyRefcBsYtZdZddgZhde<de<de Ensure a match between two sets of values in an instance. parent: element attributes: id -- ID name -- NCName, required refer -- QName, required contents: annotation?, selector, field+ snamesrefersidsxsds annotationsselectorsfieldskeyref(s__name__s __module__s__doc__srequiredsNones attributesscontentsstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysKeyRef s  !sElementDeclarationc BstZdZdgZhde<de<de<de<de<dd<dd<d e<d d „<d d „ parents: schema attributes: id -- ID name -- NCName, required type -- QName default -- string fixed -- string nillable -- boolean, false abstract -- boolean, false substitutionGroup -- QName block -- ('#all' | ('substition' | 'extension' | 'restriction')*), schema.blockDefault final -- ('#all' | ('extension' | 'restriction')*), schema.finalDefault contents: annotation?, (simpleType,complexType)?, (key | keyref | unique)* snamesidstypesdefaultsfixedsnillableisabstractssubstitutionGroupsblockcCs|iƒiƒS(N(sselfs_parentsgetBlockDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys?ssfinalcCs|iƒiƒS(N(sselfs_parentsgetFinalDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys@ssxsds annotations simpleTypes complexTypeskeyskeyrefsuniqueselementcCs/ti||ƒt|_t|_f|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontents constraints(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Es  cCstSdS(s.Global elements are always qualified. N(sTrue(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isQualifiedKscCsôti||ƒ}|djp |tj o|Sn|itj otSn|}x’noŠ|iti }xA|i ƒD]3\}}|tijoqynt|dfƒSqyWt|tƒpt|dƒ oPn|iƒ}q\Wtd‚dS(s—return attribute. If attribute is type and it's None, and no simple or complex content, return the default type "xsd:anyType" stypeisanyTypes_parents"failed to locate the XSD namespaceN(sXMLSchemaComponents getAttributesselfs attributesvaluesNonescontentsparents attributessxmlnssnsdictsitemssksvsSCHEMAsXSD_LISTsTypeDescriptionComponents isinstancesWSDLToolsAdaptershasattrs_parents SchemaError(sselfs attributesparentsvaluesvsksnsdict((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getAttributePs& !cCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclarationkscCsG|oti||ƒSnti|dƒ}|o|Sn|iSdS(sIf attribute is None, "type" is assumed, return the corresponding representation of the global type definition (TypeDefinition), or the local definition if don't find "type". To maintain backwards compat, if attribute is provided call base class method. stypeN(s attributesXMLSchemaComponentsgetTypeDefinitionsselfsgtscontent(sselfs attributesgt((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinitionnscCs |iSdS(N(sselfs _constraints(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetConstraints{scCst|ƒ|_dS(N(stuples constraintssselfs _constraints(sselfs constraints((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pyssetConstraints}ss(tuple of key, keyref, unique constraintscCsç|i|ƒ|i|ƒ}g}xµ|D]­}t|iƒƒd}||i idjog|djo|i o#t |ƒ|_ |i i |ƒqÖ|djo|i o#t|ƒ|_|ii |ƒqÖ|djo|i o#t|ƒ|_|ii |ƒqÖ|djo(|it|ƒƒ|di |ƒqÖ|djo(|it|ƒƒ|di |ƒqÖ|d jo(|it|ƒƒ|di |ƒqÖtd |iƒ‚q)td |iƒ‚q)W||_dS( Nisxsds annotations simpleTypes complexTypeskeyiÿÿÿÿskeyrefsuniquesUnknown component (%s)(sselfs setAttributessnodes getContentsscontentss constraintssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomscontentsAnonymousSimpleTypesLocalComplexTypesappendsKeysKeyRefsUniques SchemaError(sselfsnodesis componentscontentss constraints((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDoms8    (s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__s isQualifieds getAttributesgetElementDeclarationsgetTypeDefinitionsgetConstraintsssetConstraintsspropertys constraintssfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysElementDeclarations  f !      sLocalElementDeclarationc Bs°tZdZdgZhde<de<dd„<de<dd<dd<d e<d e<d d <d d <dd„ parents: all, choice, sequence attributes: id -- ID name -- NCName, required form -- ('qualified' | 'unqualified'), schema.elementFormDefault type -- QName minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 default -- string fixed -- string nillable -- boolean, false block -- ('#all' | ('extension' | 'restriction')*), schema.blockDefault contents: annotation?, (simpleType,complexType)?, (key | keyref | unique)* snamesidsformcCst|ƒiƒS(N(s GetSchemasselfsgetElementFormDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys¸sstypes minOccurss1s maxOccurssdefaultsfixedsnillableisabstractsblockcCst|ƒiƒS(N(s GetSchemasselfsgetBlockDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysÀssxsds annotations simpleTypes complexTypeskeyskeyrefsuniquecCsV|idƒ}|djotSn|djotSntd||iƒf‚dS(s¯ Local elements can be qualified or unqualifed according to the attribute form, or the elementFormDefault. By default local elements are unqualified. sforms qualifieds unqualifiedsBad form (%s) for element: %sN(sselfs getAttributesformsTruesFalses SchemaErrors getItemTrace(sselfsform((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isQualifiedÄs  (s__name__s __module__s__doc__srequiredsNones attributesscontentss isQualified(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysLocalElementDeclaration¢s  o !sElementReferencecBswtZdZdgZhde<de<dd<dd parents: all, choice, sequence attributes: id -- ID ref -- QName, required minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation? srefsids minOccurss1s maxOccurssxsds annotationselementcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__èscCs/|oti||ƒSnti|dƒSdS(sïIf attribute is None, "ref" is assumed, return the corresponding representation of the global element declaration (ElementDeclaration), To maintain backwards compat, if attribute is provided call base class method. srefN(s attributesXMLSchemaComponentsgetElementDeclarationsself(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclarationìscCs³t|_|i|ƒx–|i|ƒD]…}t|iƒƒd}||i i djoR|djo|i o#t |ƒ|_|ii |ƒq«td|iƒ‚q&q&WdS(Nisxsds annotationsUnknown component (%s)(sNonesselfs annotations setAttributessnodes getContentssis SplitQNames getTagNames components __class__scontentss AnnotationsfromDoms SchemaError(sselfsnodesis component((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomõs  ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetElementDeclarationsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysElementReferenceÒs  *  sElementWildCardcBsŒtZdZgZhde<dd<dd<dd<dd parents: choice, sequence attributes: id -- ID minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 namespace -- '##any' | '##other' | (anyURI* | '##targetNamespace' | '##local'), ##any processContents -- 'lax' | 'skip' | 'strict', strict contents: annotation? sids minOccurss1s maxOccurss namespaces##anysprocessContentssstrictsxsds annotationsanycCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__scCst|ƒiƒSdS(s– Global elements are always qualified, but if processContents are not strict could have dynamically generated local elements. N(s GetSchemasselfsisElementFormDefaultQualified(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys isQualifiedscCsti||ƒSdS(sreturn attribute. N(sXMLSchemaComponents getAttributesselfs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getAttribute$scCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinition)scCs³t|_|i|ƒx–|i|ƒD]…}t|iƒƒd}||i i djoR|djo|i o#t |ƒ|_|ii |ƒq«td|iƒ‚q&q&WdS(Nisxsds annotationsUnknown component (%s)(sNonesselfs annotations setAttributessnodes getContentssis SplitQNames getTagNames components __class__scontentss AnnotationsfromDoms SchemaError(sselfsnodesis component((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom,s  ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__s isQualifieds getAttributesgetTypeDefinitionsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysElementWildCards 3    sSequencec BshtZdZhde<dd<dd parents: complexType, extension, restriction, group, choice, sequence attributes: id -- ID minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation?, (element | group | choice | sequence | any)* sids minOccurss1s maxOccurssxsds annotationselementsgroupschoicessequencesanycCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Ps cCsÇ|i|ƒ|i|ƒ}g}x|D]‡}t|iƒƒd}||i idjoA|djo|i o&t |ƒ|_ |i i |ƒq)nï|djo>|idƒo|it|ƒƒqˆ|it|ƒƒn¤|djo|it|ƒƒn€|djo|it|ƒƒn\|djo|it|ƒƒn8|d jo|it|ƒƒntd |iƒ‚|d i |ƒq)td |iƒ‚q)Wt|ƒ|_dS( Nisxsds annotationselementsrefsgroupschoicessequencesanysUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomshasattrsappendsElementReferencesLocalElementDeclarationsModelGroupReferencesChoicesSequencesElementWildCards SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomUs6      ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysSequence<s !! sAllcBs\tZdZhde<dd<dd parents: complexType, extension, restriction, group attributes: id -- ID minOccurs -- '0' | '1', 1 maxOccurs -- '1', 1 contents: annotation?, element* sids minOccurss1s maxOccurssxsds annotationselementsallcCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__‰s cCs7|i|ƒ|i|ƒ}g}xÿ|D]÷}t|iƒƒd}||i idjo±|djo|i o&t |ƒ|_ |i i |ƒq)n_|djo>|idƒo|it|ƒƒqø|it|ƒƒntd|iƒ‚|di |ƒq)td|iƒ‚q)Wt|ƒ|_dS(Nisxsds annotationselementsrefsUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomshasattrsappendsElementReferencesLocalElementDeclarations SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomŽs&  ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAllvs ! sChoicec BshtZdZhde<dd<dd parents: complexType, extension, restriction, group, choice, sequence attributes: id -- ID minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation?, (element | group | choice | sequence | any)* sids minOccurss1s maxOccurssxsds annotationselementsgroupschoicessequencesanycCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__»s cCsÇ|i|ƒ|i|ƒ}g}x|D]‡}t|iƒƒd}||i idjoA|djo|i o&t |ƒ|_ |i i |ƒq)nï|djo>|idƒo|it|ƒƒqˆ|it|ƒƒn¤|djo|it|ƒƒn€|djo|it|ƒƒn\|djo|it|ƒƒn8|d jo|it|ƒƒntd |iƒ‚|d i |ƒq)td |iƒ‚q)Wt|ƒ|_dS( Nisxsds annotationselementsrefsgroupschoicessequencesanysUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentsscontentsis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomshasattrsappendsElementReferencesLocalElementDeclarationsModelGroupReferencesChoicesSequencesElementWildCards SchemaErrorstuple(sselfsnodesis componentscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomÀs6      ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysChoice§s !! sModelGroupDefinitioncBsbtZdZdgZhde<de parents: redefine, schema attributes: id -- ID name -- NCName, required contents: annotation?, (all | choice | sequence)? snamesidsxsds annotationsallschoicessequencesgroupcCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ôs cCsW|i|ƒ|i|ƒ}x4|D],}t|iƒƒd}||i idjoæ|djo|i o&t |ƒ|_ |i i |ƒq#n•|djo|i ot|ƒ|_ nj|djo|i ot|ƒ|_ n?|djo|i ot|ƒ|_ ntd|iƒ‚|i i |ƒq#td|iƒ‚q#WdS(Nisxsds annotationsallschoicessequencesUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDomscontentsAllsChoicesSequences SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomùs& ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysModelGroupDefinitionás   sModelGroupReferencecBsttZdZdgZhde<de<dd<dd parents: choice, complexType, extension, restriction, sequence attributes: id -- ID ref -- NCName, required minOccurs -- Whole Number, 1 maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation? srefsids minOccurss1s maxOccurssxsds annotationsgroupcCsti||ƒt|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotation(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__( scCs|idƒSdS(Nsref(sselfs getModelGroup(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetModelGroupReference, scCsÃ|i|ƒ|i|ƒ}x |D]˜}t|iƒƒd}||i idjoR|djo|i o#t |ƒ|_ |i i |ƒq»t d|iƒ‚q#t d|iƒ‚q#WdS(Nisxsds annotationsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDoms SchemaError(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom/ s ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetModelGroupReferencesfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysModelGroupReference s  *  s ComplexTypecBs tZdZdgZhde<de<dd<dd<dd„<dd „ parents: redefine, schema attributes: id -- ID name -- NCName, required mixed -- boolean, false abstract -- boolean, false block -- ('#all' | ('extension' | 'restriction')*), schema.blockDefault final -- ('#all' | ('extension' | 'restriction')*), schema.finalDefault contents: annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute?)) snamesidsmixedisabstractsblockcCs|iƒiƒS(N(sselfs_parentsgetBlockDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysW ssfinalcCs|iƒiƒS(N(sselfs_parentsgetFinalDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysX ssxsds annotations simpleContentscomplexContentsgroupsallschoicessequences attributesattributeGroups anyAttributesanys complexTypecCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontents attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__^ s  cCsž|idƒ}|djp |tjotSnt|tƒtjo:|ddfjotSn|ddfjotSqntd||iƒf‚dS(Nsmixedisfalses0strues1s)invalid value for attribute mixed(%s): %s( sselfs getAttributesmsFalses isinstances basestringsTrues SchemaErrors getItemTrace(sselfsm((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisMixedd s cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContentq scCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclarationt scCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinitionw scCsý|i|ƒ|i|ƒ}d}t|ƒ}| odSnt||i ƒƒd}|djoKt |ƒ|_ |i i ||ƒ|d7}t||i ƒƒd}nt|_|djo-|ii|ƒ|_|ii ||ƒn|djo-|ii|ƒ|_|ii ||ƒnÍ|djot|ƒ|_na|djot|ƒ|_nA|djot|ƒ|_n!|d jot|ƒ|_n|io"|ii ||ƒ|d7}ng|_x||jot||i ƒƒd}|d joH||id ƒo|iit|ƒƒqÒ|iit|ƒƒnr|d jo|iit|ƒƒnK|d jo|iit|ƒƒn$td||i ƒ|iƒf‚|idi ||ƒ|d7}qåWdS(Niis annotations simpleContentscomplexContentsallschoicessequencesgroups attributesrefsattributeGroups anyAttributesUnknown component (%s): %siÿÿÿÿ( sselfs setAttributessnodes getContentsscontentssindxslensnums SplitQNames getTagNames components Annotations annotationsfromDomsNonescontents __class__s SimpleContentsComplexContentsAllsChoicesSequencesModelGroupReferences attr_contentshasattrsappendsAttributeReferencesLocalAttributeDeclarationsAttributeGroupReferencesAttributeWildCards SchemaErrors getItemTrace(sselfsnodes componentsindxsnumscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomz sZ                 #s _DerivedTypecBstZd„Zd„ZRS(NcCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations derivationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__² s  cCsD|i|ƒ|i|ƒ}x|D] }t|iƒƒd}||i idjo·|djo|i o&t |ƒ|_ |i i |ƒq#q |djo|i o|i i|ƒ|_ q |djo|i o|i i|ƒ|_ q td|iƒ‚ntd|iƒ‚|i i |ƒq#W|i |_dS(Nisxsds annotations restrictions extensionsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentssis SplitQNames getTagNames components __class__s annotations AnnotationsfromDoms derivations Restrictions Extensions SchemaErrorscontent(sselfsnodesis componentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom¹ s$ (s__name__s __module__s__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys _DerivedType± s sComplexContentcBs•tZdZhde<dd parents: complexType attributes: id -- ID mixed -- boolean, false contents: annotation?, (restriction | extension) sidsmixedisxsds annotations restrictions extensionscomplexContentcCsž|idƒ}|djp |tjotSnt|tƒtjo:|ddfjotSn|ddfjotSqntd||iƒf‚dS(Nsmixedisfalses0strues1s)invalid value for attribute mixed(%s): %s( sselfs getAttributesmsFalses isinstances basestringsTrues SchemaErrors getItemTrace(sselfsm((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysisMixedà s s_DerivationBasec BsqtZdZdgZhde<de, parents: complexContent attributes: id -- ID base -- QName, required contents: annotation?, (group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute? sbasesidsxsds annotationsgroupsallschoicessequences attributesattributeGroups anyAttributecCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontents attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__þ s  cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContent scCs÷|i|ƒ|i|ƒ}d}t|ƒ}| odSnt||i ƒƒd}|djoKt |ƒ|_ |i i ||ƒ|d7}t||i ƒƒd}n|djo1t|ƒ|_|ii ||ƒ|d7}nÄ|djo1t|ƒ|_|ii ||ƒ|d7}n†|djo1t|ƒ|_|ii ||ƒ|d7}nH|djo1t|ƒ|_|ii ||ƒ|d7}n t|_g|_x6||jo(t||i ƒƒd}|djoH||id ƒo|iit|ƒƒqÌ|iit|ƒƒn”|d joH||id ƒo|iit|ƒƒqÌ|iit|ƒƒn?|d jo|iit|ƒƒntd ||i ƒ‚|id i ||ƒ|d7}q½WdS(Niis annotationsallschoicessequencesgroups attributesrefsattributeGroups anyAttributesUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentssindxslensnums SplitQNames getTagNames components Annotations annotationsfromDomsAllscontentsChoicesSequencesModelGroupReferencesNones attr_contentshasattrsappendsAttributeReferencesLocalAttributeDeclarationsAttributeGroupReferencesAttributeGroupDefinitionsAttributeWildCards SchemaError(sselfsnodes componentsindxsnumscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom s\              ( s__name__s __module__s__doc__srequiredsNones attributesscontentss__init__sgetAttributeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys_DerivationBaseì s  '  s ExtensioncBstZdZdZRS(s\ parents: complexContent attributes: id -- ID base -- QName, required contents: annotation?, (group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute? s extension(s__name__s __module__s__doc__stag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Extension> s s RestrictioncBstZdZdZRS(s^ parents: complexContent attributes: id -- ID base -- QName, required contents: annotation?, (group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute? s restriction(s__name__s __module__s__doc__stag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys RestrictionM s (s__name__s __module__s__doc__sNones attributesscontentsstagsisMixedsXMLSchemaComponents_DerivationBasesExtensionMarkers ExtensionsRestrictionMarkers Restriction(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysComplexContentÏ s  Rs SimpleContentcBsmtZdZhde parents: complexType attributes: id -- ID contents: annotation?, (restriction | extension) sidsxsds annotations restrictions extensions simpleContents ExtensioncBsktZdZdgZhde<de parents: simpleContent attributes: id -- ID base -- QName, required contents: annotation?, (attribute | attributeGroup)*, anyAttribute? sbasesidsxsds annotations attributesattributeGroups anyAttributes extensioncCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotations attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ s cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContent„ scCsÀ|i|ƒ|i|ƒ}d}t|ƒ}|ovt||i ƒƒd}|djoKt |ƒ|_ |i i ||ƒ|d7}t||i ƒƒd}q«ng}xù||joët||i ƒƒd}|djoB||idƒo|it|ƒƒq‰|it|ƒƒn`|djo|it|ƒƒn<|djo|it|ƒƒntd||i ƒ‚|d i ||ƒ|d7}q´Wt|ƒ|_dS( Niis annotations attributesrefsattributeGroups anyAttributesUnknown component (%s)iÿÿÿÿ(sselfs setAttributessnodes getContentsscontentssindxslensnums SplitQNames getTagNames components Annotations annotationsfromDomscontentshasattrsappendsAttributeReferencesLocalAttributeDeclarationsAttributeGroupReferencesAttributeWildCards SchemaErrorstuples attr_content(sselfsnodes componentsindxscontentsnumscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom‡ s6    "    ( s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetAttributeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Extensionl s    s RestrictioncBsutZdZdgZhde<de parents: simpleContent attributes: id -- ID base -- QName, required contents: annotation?, simpleType?, (enumeration | length | maxExclusive | maxInclusive | maxLength | minExclusive | minInclusive | minLength | pattern | fractionDigits | totalDigits | whiteSpace)*, (attribute | attributeGroup)*, anyAttribute? sbasesidsxsds annotations simpleTypes attributesattributeGroups anyAttributes restrictioncCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontents attr_content(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__Á s  cCs |iSdS(N(sselfs attr_content(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeContentÇ scCsýg|_|i|ƒ|i|ƒ}d}t|ƒ}t ||i ƒƒd}|djoKt |ƒ|_ |i i||ƒ|d7}t ||i ƒƒd}ng}x8||jo*t ||i ƒƒd}|djoB||idƒo|it|ƒƒqÆ|it|ƒƒnŸ|djo|it|ƒƒn{|djo|it|ƒƒnW|djo2|iit|ƒƒ|id i||ƒntd ||i ƒ‚|d i||ƒ|d7}q²Wt|ƒ|_dS( Niis annotations attributesrefsattributeGroups anyAttributes simpleTypeiÿÿÿÿsUnknown component (%s)(sselfscontents setAttributessnodes getContentsscontentssindxslensnums SplitQNames getTagNames components Annotations annotationsfromDomshasattrsappendsAttributeReferencesLocalAttributeDeclarationsAttributeGroupReferencesAttributeWildCardsAnonymousSimpleTypes SchemaErrorstuples attr_content(sselfsnodes componentsindxscontentsnumscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomÊ s<          ( s__name__s __module__s__doc__srequiredsNones attributessRestrictionMarkersfacetsscontentsstags__init__sgetAttributeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Restrictionª s  %  ( s__name__s __module__s__doc__sNones attributesscontentsstagsXMLSchemaComponentsExtensionMarkers ExtensionsRestrictionMarkers Restriction(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys SimpleContent] s >(s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sisMixedsgetAttributeContentsgetElementDeclarationsgetTypeDefinitionsfromDomsXMLSchemaComponents _DerivedTypes ComplexMarkersComplexContents SimpleMarkers SimpleContent(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ComplexType@ s  B0     7ŽsLocalComplexTypecBs2tZdZgZhde<dd parents: element attributes: id -- ID mixed -- boolean, false contents: annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, (attribute | attributeGroup)*, anyAttribute?)) sidsmixedis complexType(s__name__s __module__s__doc__srequiredsNones attributesstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysLocalComplexTypeï s s SimpleTypecBsËtZdZdgZhde<de<dd„ parents: redefine, schema attributes: id -- ID name -- NCName, required final -- ('#all' | ('extension' | 'restriction' | 'list' | 'union')*), schema.finalDefault contents: annotation?, (restriction | list | union) snamesidsfinalcCs|iƒiƒS(N(sselfs_parentsgetFinalDefault(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys ssxsds annotations restrictionslistsunions simpleTypecCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ s cCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetElementDeclaration scCstd|i‚dS(Nsinvalid operation for <%s>(sWarningsselfstag(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinition scCs|i|ƒ|i|ƒ}x\|D]P}t|iƒƒd}|djo&t |ƒ|_ |i i |ƒq#nPq#WdS|djo|i i |ƒ|_nZ|djo|i i|ƒ|_n4|djo|i i|ƒ|_ntd|‚|ii |ƒdS(Nis annotations restrictionslistsunionsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentsschilds SplitQNames getTagNames components Annotations annotationsfromDoms __class__s RestrictionscontentsListsUnions SchemaError(sselfsnodes componentschildscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom# s&      s RestrictioncBsxtZdZhde<de parents: simpleType attributes: id -- ID base -- QName, required or simpleType child contents: annotation?, simpleType?, (enumeration | length | maxExclusive | maxInclusive | maxLength | minExclusive | minInclusive | minLength | pattern | fractionDigits | totalDigits | whiteSpace)* sidsbasesxsds annotations simpleTypes restrictioncCs/ti||ƒt|_t|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontentsfacets(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__M s  cCsti|dƒSdS(Nsbase(sXMLSchemaComponents getAttributesself(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetAttributeBaseS scCsti||ƒSdS(N(sXMLSchemaComponentsgetTypeDefinitionsselfs attribute(sselfs attribute((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinitionV scCs1x&|iD]}|iƒo|Sq q WtSdS(N(sselfscontentselsisSimplesNone(sselfsel((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetSimpleTypeContentY s   cCs=g|_|i|ƒ|i|ƒ}g}xütt|ƒƒD]è}t ||i ƒƒd}|djo| o*t |ƒ|_|ii||ƒq>q>|djo| p |djo,|it|ƒƒ|di||ƒq>|tijo|ii||ƒq>tdti ƒ‚q>Wt|ƒ|_dS(Nis annotations simpleTypeiÿÿÿÿsUnknown component (%s)(sselfsfacetss setAttributessnodes getContentsscontentsscontentsrangeslensindxs SplitQNames getTagNames components Annotations annotationsfromDomsappendsAnonymousSimpleTypesRestrictionMarkers SchemaErrorsistuple(sselfsnodes componentsindxscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom^ s$  "(s__name__s __module__s__doc__sNones attributessRestrictionMarkersfacetsscontentsstags__init__sgetAttributeBasesgetTypeDefinitionsgetSimpleTypeContentsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys Restriction9 s     sUnioncBsStZdZhde<de parents: simpleType attributes: id -- ID memberTypes -- list of QNames, required or simpleType child. contents: annotation?, simpleType* sids memberTypessxsds annotations simpleTypesunioncCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__… s cCsô|i|ƒ|i|ƒ}g}x¼tt|ƒƒD]¨}t ||i ƒƒd}|djo| o't |ƒ|_ |i i||ƒq5|djo,|it|ƒƒ|di||ƒq5tdti ƒ‚q5Wt|ƒ|_dS(Nis annotations simpleTypeiÿÿÿÿsUnknown component (%s)(sselfs setAttributessnodes getContentsscontentsscontentsrangeslensindxs SplitQNames getTagNames components Annotations annotationsfromDomsappendsAnonymousSimpleTypes SchemaErrorsistuple(sselfsnodes componentsindxscontentscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDomŠ s  ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__sfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysUniont s  sListcBshtZdZhde<de parents: simpleType attributes: id -- ID itemType -- QName, required or simpleType child. contents: annotation?, simpleType? sidsitemTypesxsds annotations simpleTypeslistcCs&ti||ƒt|_t|_dS(N(sXMLSchemaComponents__init__sselfsparentsNones annotationscontent(sselfsparent((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__¬ s cCs|iidƒSdS(NsitemType(sselfs attributessget(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys getItemType± scCs$ti||ƒ}|p|iSdS(sà return the type refered to by itemType attribute or the simpleType content. If returns None, then the type refered to by itemType is primitive. N(sXMLSchemaComponentsgetTypeDefinitionsselfs attributestpscontent(sselfs attributestp((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTypeDefinition´ scCsít|_t|_|i|ƒ|i|ƒ}x¸tt |ƒƒD]¤}t ||i ƒƒd}|djo| o't|ƒ|_|ii||ƒqA|djo(t|ƒ|_|ii||ƒPqAtdti ƒ‚qAWdS(Nis annotations simpleTypesUnknown component (%s)(sNonesselfs annotationscontents setAttributessnodes getContentsscontentssrangeslensindxs SplitQNames getTagNames components AnnotationsfromDomsAnonymousSimpleTypes SchemaErrorsi(sselfsnodes componentsindxscontents((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysfromDom½ s    ( s__name__s __module__s__doc__sNones attributesscontentsstags__init__s getItemTypesgetTypeDefinitionsfromDom(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysList› s    (s__name__s __module__s__doc__srequiredsNones attributesscontentsstags__init__sgetElementDeclarationsgetTypeDefinitionsfromDomsXMLSchemaComponentsRestrictionMarkers Restrictions UnionMarkersUnions ListMarkersList(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys SimpleType s  $    ;'sAnonymousSimpleTypecBs)tZdZgZhde parents: attribute, element, list, restriction, union attributes: id -- ID contents: annotation?, (restriction | list | union) sids simpleType(s__name__s __module__s__doc__srequiredsNones attributesstag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysAnonymousSimpleTypeÏ s sRedefinecBstZdZdZRS(sD parents: attributes: contents: sredefine(s__name__s __module__s__doc__stag(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysRedefineà s isTypeDescriptionComponentcBs)tZdZd„Zd„Zd„ZRS(sMTuple of length 2, consisting of a namespace and unprefixed name. cCsxt|ƒdjotd|‚n=|didƒdjo"|dt|dƒdf}nti||ƒdSdS(sSargs -- (namespace, name) Remove the name's prefix, irrelevant. is)expecting tuple (namespace, name), got %sis:iN(slensargss TypeErrorsfinds SplitQNamestuples__init__sself(sselfsargs((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys__init__ø s"cCs |dSdS(Ni(sself(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetTargetNamespace scCs |dSdS(Ni(sself(sself((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysgetName s(s__name__s __module__s__doc__s__init__sgetTargetNamespacesgetName(((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pysTypeDescriptionComponentô s  (Tsidentstypessweakrefssysswarningss NamespacessSCHEMAsXMLNSsUtilitysDOMs DOMExceptions Collections SplitQNamesbasejoinsStringIOs threadingsRLocks ImportErrorsTYPESsATTRIBUTE_GROUPSs ATTRIBUTESsELEMENTSs MODEL_GROUPSs GetSchemas SchemaReaders Exceptions SchemaErrorsDOMAdapterInterfaces DOMAdaptersXMLBasesDefinitionMarkersDeclarationMarkersAttributeMarkersAttributeGroupMarkersWildCardMarkers ElementMarkersReferenceMarkersModelGroupMarkers AllMarkers ChoiceMarkersSequenceMarkersExtensionMarkersRestrictionMarkers SimpleMarkers ListMarkers UnionMarkers ComplexMarkers LocalMarkersMarkerInterfacesXMLSchemaComponentsWSDLToolsAdaptersNotations Annotations XMLSchemaFakes XMLSchemasAttributeDeclarationsLocalAttributeDeclarationsAttributeWildCardsAttributeReferencesAttributeGroupDefinitionsAttributeGroupReferencesIdentityConstrantssUniquesKeysKeyRefsElementDeclarationsLocalElementDeclarationsElementReferencesElementWildCardsSequencesAllsChoicesModelGroupDefinitionsModelGroupReferences ComplexTypesLocalComplexTypes SimpleTypesAnonymousSimpleTypesRedefines version_infostuples tupleClasss UserTuplesTypeDescriptionComponent(MsModelGroupReferences tupleClasss DOMExceptionsDOMAdapterInterfaces MODEL_GROUPSsDOMs ListMarkersbasejoinsAttributeWildCardsAttributeMarkersELEMENTSsMarkerInterfacesExtensionMarkers DOMAdaptersWSDLToolsAdapters AnnotationsModelGroupDefinitionsXMLSchemaComponents AllMarkersLocalAttributeDeclarationsNotations ElementMarkers SimpleMarkersChoices CollectionsAttributeReferences GetSchemasKeysATTRIBUTE_GROUPSsElementReferences XMLSchemaFakesXMLBases UnionMarkersRestrictionMarkersTYPESsSCHEMAsModelGroupMarkersXMLNSsUniquesElementDeclarationswarningssAttributeDeclarationsSequenceMarkersRedefinesRLockssyssDefinitionMarkersAttributeGroupDefinitionsTypeDescriptionComponentsLocalElementDeclarations XMLSchemas SimpleTypesDeclarationMarkersReferenceMarkerstypessAttributeGroupReferences SchemaReadersAllsidentsAnonymousSimpleTypesKeyRefsStringIOs LocalMarkersElementWildCardsSequences ComplexMarkersweakrefs SplitQNamesIdentityConstrantss ComplexTypes UserTuples ATTRIBUTESs SchemaErrors ChoiceMarkersLocalComplexTypesWildCardMarkersAttributeGroupMarker((s9build/bdist.darwin-8.0.1-x86/egg/ZSI/wstools/XMLSchema.pys?sš$%   l5Q;ÿ+"mÿÈ/1&,9-]ƒ00::1:0/ÿ°Í   PK”¨58“×2EGG-INFO/zip-safe PKn¨58.xì™&0&0EGG-INFO/SOURCES.txtCHANGES Copyright MANIFEST.in Makefile README RELEASE newver.py setup.cfg setup.py ZSI/LBNLCopyright ZSI/ServiceContainer.py ZSI/ServiceProxy.py ZSI/TC.py ZSI/TCapache.py ZSI/TCcompound.py ZSI/TCnumbers.py ZSI/TCtimes.py ZSI/__init__.py ZSI/address.py ZSI/auth.py ZSI/client.py ZSI/digest_auth.py ZSI/dispatch.py ZSI/fault.py ZSI/parse.py ZSI/resolvers.py ZSI/schema.py ZSI/typeinterpreter.py ZSI/version.py ZSI/writer.py ZSI.egg-info/PKG-INFO ZSI.egg-info/SOURCES.txt ZSI.egg-info/dependency_links.txt ZSI.egg-info/entry_points.txt ZSI.egg-info/requires.txt ZSI.egg-info/top_level.txt ZSI/generate/__init__.py ZSI/generate/commands.py ZSI/generate/containers.py ZSI/generate/pyclass.py ZSI/generate/utility.py ZSI/generate/wsdl2dispatch.py ZSI/generate/wsdl2python.py ZSI/twisted/WSresource.py ZSI/twisted/WSsecurity.py ZSI/twisted/__init__.py ZSI/twisted/client.py ZSI/wstools/Namespaces.py ZSI/wstools/TimeoutSocket.py ZSI/wstools/UserTuple.py ZSI/wstools/Utility.py ZSI/wstools/WSDLTools.py ZSI/wstools/XMLSchema.py ZSI/wstools/XMLname.py ZSI/wstools/ZPL ZSI/wstools/__init__.py ZSI/wstools/c14n.py ZSI/wstools/license.txt ZSI/wstools/logging.py ZSI/wstools/test/README ZSI/wstools/test/__init__.py ZSI/wstools/test/config.txt ZSI/wstools/test/schema.tar.gz ZSI/wstools/test/test_t1.py ZSI/wstools/test/test_wsdl.py ZSI/wstools/test/test_wstools.py ZSI/wstools/test/test_wstools_net.py ZSI/wstools/test/xmethods.tar.gz ZSI/zsi/newver.py ZSI/zsi/setup.py ZSI/zsi/ZSI/ServiceContainer.py ZSI/zsi/ZSI/ServiceProxy.py ZSI/zsi/ZSI/TC.py ZSI/zsi/ZSI/TCapache.py ZSI/zsi/ZSI/TCcompound.py ZSI/zsi/ZSI/TCnumbers.py ZSI/zsi/ZSI/TCtimes.py ZSI/zsi/ZSI/__init__.py ZSI/zsi/ZSI/address.py ZSI/zsi/ZSI/auth.py ZSI/zsi/ZSI/client.py ZSI/zsi/ZSI/digest_auth.py ZSI/zsi/ZSI/dispatch.py ZSI/zsi/ZSI/fault.py ZSI/zsi/ZSI/parse.py ZSI/zsi/ZSI/resolvers.py ZSI/zsi/ZSI/schema.py ZSI/zsi/ZSI/typeinterpreter.py ZSI/zsi/ZSI/version.py ZSI/zsi/ZSI/writer.py ZSI/zsi/ZSI/generate/__init__.py ZSI/zsi/ZSI/generate/commands.py ZSI/zsi/ZSI/generate/containers.py ZSI/zsi/ZSI/generate/pyclass.py ZSI/zsi/ZSI/generate/utility.py ZSI/zsi/ZSI/generate/wsdl2dispatch.py ZSI/zsi/ZSI/generate/wsdl2python.py ZSI/zsi/ZSI/twisted/WSresource.py ZSI/zsi/ZSI/twisted/WSsecurity.py ZSI/zsi/ZSI/twisted/__init__.py ZSI/zsi/ZSI/twisted/client.py ZSI/zsi/ZSI/wstools/Namespaces.py ZSI/zsi/ZSI/wstools/TimeoutSocket.py ZSI/zsi/ZSI/wstools/UserTuple.py ZSI/zsi/ZSI/wstools/Utility.py ZSI/zsi/ZSI/wstools/WSDLTools.py ZSI/zsi/ZSI/wstools/XMLSchema.py ZSI/zsi/ZSI/wstools/XMLname.py ZSI/zsi/ZSI/wstools/__init__.py ZSI/zsi/ZSI/wstools/c14n.py ZSI/zsi/ZSI/wstools/logging.py ZSI/zsi/ZSI/wstools/test/__init__.py ZSI/zsi/ZSI/wstools/test/test_t1.py ZSI/zsi/ZSI/wstools/test/test_wsdl.py ZSI/zsi/ZSI/wstools/test/test_wstools.py ZSI/zsi/ZSI/wstools/test/test_wstools_net.py ZSI/zsi/doc/examples/client/receive_response/complex/manual/ComplexTypes.py ZSI/zsi/doc/examples/client/receive_response/complex/manual/client.py ZSI/zsi/doc/examples/client/receive_response/complex/server/server.py ZSI/zsi/doc/examples/client/receive_response/complex/wsdl2py/client.py ZSI/zsi/doc/examples/client/receive_response/simple/ServiceProxy/client.py ZSI/zsi/doc/examples/client/receive_response/simple/server/server.py ZSI/zsi/doc/examples/client/receive_response/simple/wsdl2py/client.py ZSI/zsi/doc/examples/client/send_request/complex/manual/ComplexTypes.py ZSI/zsi/doc/examples/client/send_request/complex/manual/client.py ZSI/zsi/doc/examples/client/send_request/complex/server/ComplexTypes.py ZSI/zsi/doc/examples/client/send_request/complex/server/server.py ZSI/zsi/doc/examples/client/send_request/complex/wsdl2py/client.py ZSI/zsi/doc/examples/client/send_request/simple/Binding/client.py ZSI/zsi/doc/examples/client/send_request/simple/ServiceProxy/client.py ZSI/zsi/doc/examples/client/send_request/simple/server/server.py ZSI/zsi/doc/examples/client/send_request/simple/wsdl2py/client.py ZSI/zsi/doc/examples/server/receive_request/complex/client/ComplexTypes.py ZSI/zsi/doc/examples/server/receive_request/complex/client/client.py ZSI/zsi/doc/examples/server/receive_request/complex/manual/ComplexTypes.py ZSI/zsi/doc/examples/server/receive_request/complex/manual/server.py ZSI/zsi/doc/examples/server/receive_request/complex/wsdl2py/server.py ZSI/zsi/doc/examples/server/receive_request/simple/CGI/cgi.py ZSI/zsi/doc/examples/server/receive_request/simple/client/client.py ZSI/zsi/doc/examples/server/receive_request/simple/mod_python/MyHandler.py ZSI/zsi/doc/examples/server/receive_request/simple/mod_python/mod_python.py ZSI/zsi/doc/examples/server/receive_request/simple/standalone/standalone.py ZSI/zsi/doc/examples/server/send_response/complex/client/client.py ZSI/zsi/doc/examples/server/send_response/complex/manual/ComplexTypes.py ZSI/zsi/doc/examples/server/send_response/complex/manual/server.py ZSI/zsi/doc/examples/server/send_response/complex/wsdl2py/server.py ZSI/zsi/doc/examples/server/send_response/simple/no_typecode/client.py ZSI/zsi/doc/examples/server/send_response/simple/no_typecode/server.py ZSI/zsi/doc/examples/server/send_response/simple/wsdl2py/client.py ZSI/zsi/doc/examples/server/send_response/simple/wsdl2py/server.py ZSI/zsi/interop/client.py ZSI/zsi/interop/cpackets.py ZSI/zsi/interop/sclasses.py ZSI/zsi/interop/server.py ZSI/zsi/samples/poly.py ZSI/zsi/samples/Echo/EchoClient.py ZSI/zsi/samples/Echo/EchoServer.py ZSI/zsi/test/cgicli.py ZSI/zsi/test/test_TCtimes.py ZSI/zsi/test/test_t1.py ZSI/zsi/test/test_t2.py ZSI/zsi/test/test_t3.py ZSI/zsi/test/test_t4.py ZSI/zsi/test/test_t5.py ZSI/zsi/test/test_t6.py ZSI/zsi/test/test_t7.py ZSI/zsi/test/test_t8.py ZSI/zsi/test/test_t9.py ZSI/zsi/test/test_zsi.py ZSI/zsi/test/test_zsi_net.py ZSI/zsi/test/tests_bad.py ZSI/zsi/test/tests_good.py ZSI/zsi/test/wsdl2py/ServiceTest.py ZSI/zsi/test/wsdl2py/runTests.py ZSI/zsi/test/wsdl2py/test_AWSECommerceService.py ZSI/zsi/test/wsdl2py/test_AmazonS3.py ZSI/zsi/test/wsdl2py/test_Attributes.py ZSI/zsi/test/wsdl2py/test_Choice.py ZSI/zsi/test/wsdl2py/test_DerivedTypes.py ZSI/zsi/test/wsdl2py/test_Echo.py ZSI/zsi/test/wsdl2py/test_InfoBil.py ZSI/zsi/test/wsdl2py/test_MapPoint.py ZSI/zsi/test/wsdl2py/test_OpcDaGateway.py ZSI/zsi/test/wsdl2py/test_Sabre.py ZSI/zsi/test/wsdl2py/test_TerraService.py ZSI/zsi/test/wsdl2py/test_ThreatService.py ZSI/zsi/test/wsdl2py/test_WhiteMesa.py ZSI/zsi/test/wsdl2py/test_XMethodsQuery.py ZSI/zsi/test/wsdl2py/test_ZipCodeResolver.py ZSI/zsi/test/wsdl2py/servers/EchoServer.py ZSI/zsi/test/wsdl2py/servers/WhiteMesa.py doc/Makefile doc/app-dispatch-dict.tex doc/app-dispatch.tex doc/app-lowlevel.tex doc/app-pickler.tex doc/bibliography.tex doc/blank.png doc/c01-intro.tex doc/c02-samples.tex doc/c02a-coverage.tex doc/c03-except.tex doc/c04-utils.tex doc/c05-parse.tex doc/c06-tc.tex doc/c07-writer.tex doc/c08-fault.tex doc/c09-resolve.tex doc/c10-dispatch.tex doc/client-hello-struct.tex doc/contents.png doc/dispatch-rpc-hello-array.tex doc/dispatch-rpc-hello-struct.tex doc/guide.css doc/guide.html doc/guide.pdf doc/guide.ps doc/guide.tex doc/guide01-intro.tex doc/guide02-wsdl2py.tex doc/index.png doc/modules.png doc/next.png doc/previous.png doc/pyfav.png doc/up.png doc/version.tex doc/zsi.css doc/zsi.html doc/zsi.l2h~ doc/zsi.pdf doc/zsi.ps doc/zsi.tex doc/zsi.xsd doc/examples/client/receive_response/complex/binding.wsdl doc/examples/client/receive_response/complex/interface.wsdl doc/examples/client/receive_response/complex/types.xsd doc/examples/client/receive_response/complex/manual/ComplexTypes.py doc/examples/client/receive_response/complex/manual/client.py doc/examples/client/receive_response/complex/server/server.py doc/examples/client/receive_response/complex/wsdl2py/client.py doc/examples/client/receive_response/simple/binding.wsdl doc/examples/client/receive_response/simple/interface.wsdl doc/examples/client/receive_response/simple/ServiceProxy/client.py doc/examples/client/receive_response/simple/server/server.py doc/examples/client/receive_response/simple/wsdl2py/README doc/examples/client/receive_response/simple/wsdl2py/client.py doc/examples/client/send_request/complex/binding.wsdl doc/examples/client/send_request/complex/interface.wsdl doc/examples/client/send_request/complex/types.xsd doc/examples/client/send_request/complex/manual/ComplexTypes.py doc/examples/client/send_request/complex/manual/client.py doc/examples/client/send_request/complex/server/ComplexTypes.py doc/examples/client/send_request/complex/server/server.py doc/examples/client/send_request/complex/wsdl2py/client.py doc/examples/client/send_request/simple/README doc/examples/client/send_request/simple/binding.wsdl doc/examples/client/send_request/simple/interface.wsdl doc/examples/client/send_request/simple/Binding/client.py doc/examples/client/send_request/simple/ServiceProxy/client.py doc/examples/client/send_request/simple/server/server.py doc/examples/client/send_request/simple/wsdl2py/README doc/examples/client/send_request/simple/wsdl2py/client.py doc/examples/server/receive_request/complex/binding.wsdl doc/examples/server/receive_request/complex/interface.wsdl doc/examples/server/receive_request/complex/types.xsd doc/examples/server/receive_request/complex/client/ComplexTypes.py doc/examples/server/receive_request/complex/client/client.py doc/examples/server/receive_request/complex/manual/ComplexTypes.py doc/examples/server/receive_request/complex/manual/server.py doc/examples/server/receive_request/complex/wsdl2py/server.py doc/examples/server/receive_request/simple/binding.wsdl doc/examples/server/receive_request/simple/interface.wsdl doc/examples/server/receive_request/simple/CGI/README doc/examples/server/receive_request/simple/CGI/cgi.py doc/examples/server/receive_request/simple/client/client.py doc/examples/server/receive_request/simple/mod_python/MyHandler.py doc/examples/server/receive_request/simple/mod_python/README doc/examples/server/receive_request/simple/mod_python/mod_python.py doc/examples/server/receive_request/simple/standalone/README doc/examples/server/receive_request/simple/standalone/standalone.py doc/examples/server/send_response/complex/binding.wsdl doc/examples/server/send_response/complex/interface.wsdl doc/examples/server/send_response/complex/types.xsd doc/examples/server/send_response/complex/client/client.py doc/examples/server/send_response/complex/manual/ComplexTypes.py doc/examples/server/send_response/complex/manual/server.py doc/examples/server/send_response/complex/wsdl2py/server.py doc/examples/server/send_response/simple/binding.wsdl doc/examples/server/send_response/simple/interface.wsdl doc/examples/server/send_response/simple/no_typecode/client.py doc/examples/server/send_response/simple/no_typecode/server.py doc/examples/server/send_response/simple/wsdl2py/README doc/examples/server/send_response/simple/wsdl2py/client.py doc/examples/server/send_response/simple/wsdl2py/server.py interop/InteropTest.wsdl interop/InteropTestB.wsdl interop/README interop/client.py interop/cpackets.py interop/echoHeaderBindings.wsdl interop/sclasses.py interop/server.py interop/start samples/README samples/poly.py samples/Echo/Echo.wsdl samples/Echo/EchoClient.py samples/Echo/EchoServer.py samples/Echo/README samples/Echo/buildms.bat samples/Echo/echo.cs scripts/wsdl2dispatch scripts/wsdl2py test/README test/cgicli.py test/test_TCtimes.py test/test_t1.py test/test_t2.py test/test_t3.py test/test_t4.py test/test_t5.py test/test_t6.py test/test_t7.py test/test_t8.py test/test_t9.py test/test_zsi.py test/test_zsi_net.py test/tests_bad.py test/tests_good.py test/wsdl2py/README test/wsdl2py/ServiceTest.py test/wsdl2py/config.txt test/wsdl2py/runTests.py test/wsdl2py/test_AWSECommerceService.py test/wsdl2py/test_AmazonS3.py test/wsdl2py/test_Attributes.py test/wsdl2py/test_Attributes.xsd test/wsdl2py/test_Choice.py test/wsdl2py/test_Choice.xsd test/wsdl2py/test_DerivedTypes.py test/wsdl2py/test_DerivedTypes.xsd test/wsdl2py/test_Echo.py test/wsdl2py/test_InfoBil.py test/wsdl2py/test_MapPoint.py test/wsdl2py/test_OpcDaGateway.py test/wsdl2py/test_Sabre.py test/wsdl2py/test_TerraService.py test/wsdl2py/test_ThreatService.py test/wsdl2py/test_WhiteMesa.py test/wsdl2py/test_XMethodsQuery.py test/wsdl2py/test_ZipCodeResolver.py test/wsdl2py/servers/EchoServer.py test/wsdl2py/servers/WhiteMesa.py PKg¨58ëNwéooEGG-INFO/entry_points.txt[console_scripts] wsdl2dispatch = ZSI.generate.commands:wsdl2dispatch wsdl2py = ZSI.generate.commands:wsdl2py PKg¨58·ãm]]EGG-INFO/dependency_links.txthttp://sourceforge.net/project/showfiles.php?group_id=6473&package_id=6541&release_id=286213 PKg¨58 Bá,++EGG-INFO/PKG-INFOMetadata-Version: 1.0 Name: ZSI Version: 2.0-rc3 Summary: Zolera SOAP Infrastructure Home-page: http://pywebsvcs.sf.net/ Author: Rich Salz, et al Author-email: pywebsvcs-talk@lists.sf.net License: Python Description: For additional information, please see http://pywebsvcs.sf.net/ Platform: UNKNOWN PKg¨58Óå1ËEGG-INFO/requires.txtPyXML >= 0.8.3PKg¨58a½`*EGG-INFO/top_level.txtZSI PK€¨58Ô›A°..¤ZSI/address.pycPK‹¨58+ì[[¤0.ZSI/resolvers.pyoPK/¤Y5^¹&H³2³2¤ºMZSI/ServiceProxy.pyPK‚¨58,U³O// ¤ž€ZSI/TC.pycPKŒ¨58SÆu´Ó7Ó7 ¤Ë¯ZSI/fault.pyoPK‚¨58+ì[[¤ÉçZSI/resolvers.pycPK/¤Y5£fh‘€€¤SZSI/typeinterpreter.pyPKƒ¨58®^R³ÏgÏg¤ZSI/client.pycPK/¤Y5}Póæ.æ.¤‚ZSI/address.pyPKŒ¨58[­Á»%%¤±ZSI/digest_auth.pyoPK/¤Y5, bž<ž<¤jÃZSI/__init__.pyPKЍ58Ô›A°..¤5ZSI/address.pyoPK/¤Y5¥ÏC¤%% ¤e.ZSI/writer.pyPKŒ¨58_ u¥3¥3¤µGZSI/dispatch.pyoPK/¤Y5¢;£¤œœ ¤ˆ{ZSI/TC.pyPK‹¨58ÿfûŠ?Š?¤K|ZSI/schema.pyoPK/¤Y5öølÓ'' ¤¼ZSI/auth.pyPKŒ¨589ž /°°¤QÃZSI/version.pyoPK€¨58L!  ¤.ÄZSI/typeinterpreter.pycPK¨58å$öD@D@ ¤ƒØZSI/parse.pyoPKЍ58fÌÂTnTnT¤òZSI/__init__.pyoPK‚¨58ÿfûŠ?Š?¤ŽmZSI/schema.pycPK/¤Y5XÝ—‘““¤D­ZSI/resolvers.pyPK/¤Y5i!êhh¤ÀZSI/TCcompound.pyPK/¤Y5WÿŒÁ.Á. ¤O(ZSI/schema.pyPK‚¨58ÿPÙácác¤;WZSI/TCcompound.pycPK‹¨58$DnG3 3 ¤L»ZSI/TCapache.pyoPKƒ¨589ž /°°¤­ÈZSI/version.pycPKŒ¨58àrêfêf¤ŠÉZSI/ServiceContainer.pyoPKƒ¨58[­Á»%%¤ª0ZSI/digest_auth.pycPK‰¨58ƒdò7ò7¤CZSI/ServiceProxy.pyoPK/¤Y5ZËÜnK)K)¤${ZSI/TCtimes.pyPK/¤Y5TJX-8±1;1;¤ý+ZSI/TCtimes.pycPK‡¨58å$öD@D@ ¤[gZSI/parse.pycPK‹¨58>-8±1;1;¤Ê§ZSI/TCtimes.pyoPK/¤Y5µ¢ Ê(Ê(¤(ãZSI/dispatch.pyPK¨58–J N"N"¤ ZSI/writer.pycPK/¤Y5AütG]] ¤™. ZSI/fault.pyPKƒ¨58_ u¥3¥3¤ N ZSI/dispatch.pycPK/¤Y5ï:òT+D+D¤ó ZSI/ServiceContainer.pyPK/¤Y5ïä+‰µ µ ¤SÆ ZSI/digest_auth.pyPK/¤Y5c¦’QQ¤8Ñ ZSI/TCnumbers.pyPKЍ58L!  ¤·æ ZSI/typeinterpreter.pyoPKƒ¨58SÆu´Ó7Ó7 ¤ û ZSI/fault.pycPK€¨588™êO8O8¤ 3 ZSI/ServiceProxy.pycPK¨58fÌÂTnTnT¤‹k ZSI/__init__.pycPK„¨58Ÿ9ÑÚ*Ú*¤'À ZSI/TCnumbers.pycPK¨58Ÿ9ÑÚ*Ú*¤0ë ZSI/TCnumbers.pyoPKƒ¨58+4è5¥g¥g¤9 ZSI/ServiceContainer.pycPK‚¨58ˆ_Ì û û ¤~ ZSI/auth.pycPKЍ58!øG­x.x. ¤9Š ZSI/TC.pyoPK‚¨58$DnG3 3 ¤Ù¸ ZSI/TCapache.pycPK‹¨58ÿPÙácác¤:Æ ZSI/TCcompound.pyoPKŒ¨58®^R³ÏgÏg¤K* ZSI/client.pyoPK/¤Y5ù£·`:`: ¤F’ ZSI/parse.pyPKލ58J¬J½7½7¤ÐÌ ZSI/generate/commands.pyoPK…¨58Y\•’Š`Š`¤ÄZSI/generate/wsdl2python.pycPK-¤Y5#B] YY¤ˆeZSI/generate/__init__.pyPK„¨58!  ¤jZSI/generate/utility.pycPKލ588O[ìÌmÌm¤cŠZSI/generate/wsdl2dispatch.pyoPK-¤Y5Ó›ýÔË)Ë)¤køZSI/generate/pyclass.pyPK…¨58¯dÆbÚ8Ú8¤k"ZSI/generate/commands.pycPK¨58¶y\ \ ¤|[ZSI/generate/__init__.pyoPK¨58!  ¤eZSI/generate/utility.pyoPK-¤Y5¼hº½DŸDŸ¤[…ZSI/generate/containers.pyPK-¤Y5Øa@@¤×$ZSI/generate/utility.pyPK-¤Y5S™EŸLŸL¤L;ZSI/generate/wsdl2python.pyPK¨58¹]‘wÞ¬Þ¬¤$ˆZSI/generate/containers.pyoPK¨58ÒN-½æ%æ%¤;5ZSI/generate/pyclass.pyoPK-¤Y5ù<¬X¬X¤W[ZSI/generate/wsdl2dispatch.pyPK…¨58F+Wξq¾q¤>´ZSI/generate/wsdl2dispatch.pycPK„¨58¶y\ \ ¤8&ZSI/generate/__init__.pycPKލ58˜ißW^W^¤Ë/ZSI/generate/wsdl2python.pyoPK„¨583C=g·g·¤\ŽZSI/generate/containers.pycPK„¨58AïRaž'ž'¤üEZSI/generate/pyclass.pycPK-¤Y5]¤ý(£3£3¤ÐmZSI/generate/commands.pyPKN¤Y5ŽcÁþþ§þ§¤©¡ZSI/wstools/XMLSchema.pyPK¨58‘ [oAoA¤ÝIZSI/wstools/c14n.pyoPK¨58Ô½ö‰®®¤~‹ZSI/wstools/TimeoutSocket.pyoPKN¤Y5¨$WhÈȤg©ZSI/wstools/__init__.pyPK†¨58‘ [oAoA¤dªZSI/wstools/c14n.pycPKN¤Y5wƒö½  ¤ìZSI/wstools/logging.pyPKN¤Y5”â¤gK@K@¤T÷ZSI/wstools/c14n.pyPKN¤Y5ÛiÒ8Æ8ƤÐ7ZSI/wstools/Utility.pyPK‡¨58î4xx¤<þZSI/wstools/XMLname.pycPK¨58ú&¤é ZSI/wstools/UserTuple.pyoPKލ58ï³ímšš¤$'ZSI/wstools/__init__.pyoPK…¨58ù<Œ44¤ô(ZSI/wstools/XMLSchema.pycPKN¤Y5 þþ¤I]ZSI/wstools/UserTuple.pyPK†¨58%ûcCC¤}mZSI/wstools/WSDLTools.pycPKN¤Y5縋äìäì¤È°ZSI/wstools/WSDLTools.pyPK¨58˜dUߤâZSI/wstools/logging.pyoPK¨58%ûcCC¤2¶ZSI/wstools/WSDLTools.pyoPK¨58î4xx¤}ùZSI/wstools/XMLname.pyoPK†¨58ú&¤* ZSI/wstools/UserTuple.pycPKN¤Y5 f§"¥"¥"¤e" ZSI/wstools/Namespaces.pyPK¨58õŽ9££¤AE ZSI/wstools/Utility.pyoPK†¨58mñqHŠŠ¤J!ZSI/wstools/logging.pycPK†¨58SWòÍͤØb!ZSI/wstools/Utility.pycPK‡¨58ií Í3Í3¤Úg"ZSI/wstools/Namespaces.pycPKN¤Y5x×R|Ü Ü ¤ß›"ZSI/wstools/XMLname.pyPK‡¨58Ô½ö‰®®¤ï¥"ZSI/wstools/TimeoutSocket.pycPK¨58ií Í3Í3¤ØÃ"ZSI/wstools/Namespaces.pyoPK…¨58ï³ímšš¤Ý÷"ZSI/wstools/__init__.pycPKN¤Y5úÍxàभù"ZSI/wstools/TimeoutSocket.pyPKލ58ù<Œ44¤Ç#ZSI/wstools/XMLSchema.pyoPK”¨58“×2¤C%EGG-INFO/zip-safePKn¨58.xì™&0&0¤LC%EGG-INFO/SOURCES.txtPKg¨58ëNwéoo¤¤s%EGG-INFO/entry_points.txtPKg¨58·ãm]]¤Jt%EGG-INFO/dependency_links.txtPKg¨58 Bá,++¤ât%EGG-INFO/PKG-INFOPKg¨58Óå1ˤ