a Rf @sfdZddlZddlZddlZddlmZddlmZddlZddl Z ddl m Z ddl Z ddlmZz ddlZWneydZYn0ddZd ejdd Zd Zd Zd ZdZdZdZdZd ZdZdZdZdZ dZ!dZ"Gddde#Z$Gddde$Z%Gddde$Z&Gddde$Z'e(Z)Z*edddZ+d d!Z,e,d"rJd#d$Z-ne,d%r^d&d$Z-nd'd$Z-[+[,d(d)Z.Gd*d+d+Z/d,d-Z0d.d/Z1Gd0d1d1Z2d2d3Z3e/e2fZ4Gd4d5d5Z5Gd6d7d7Z6Gd8d9d9Z7Gd:d;d;Z8Gdd?d?Z:dZ;Zd[dCdDZ?d\dEdFZ@dGdHZAd]dJdKZBGdLdMdMerTejCneDZEGdNdOdOZFGdPdQdQZGGdRdSdSeGZHGdTdUdUZIeIZJeKdVkrbeIdWZLzeMeLjNOWn0e$yZPzeMdXePWYdZP[Pn dZP[P00e:eLZQeQReQSd dYeQTdd zeQD]ZUeMeUqWn0e$y`ZPzeMdXePWYdZP[Pn dZP[P00dS)^a An XML-RPC client interface for Python. The marshalling and response parser code can also be used to implement XML-RPC servers. Exported exceptions: Error Base class for client errors ProtocolError Indicates an HTTP protocol error ResponseError Indicates a broken response package Fault Indicates an XML-RPC fault package Exported classes: ServerProxy Represents a logical connection to an XML-RPC server MultiCall Executor of boxcared xmlrpc requests DateTime dateTime wrapper for an ISO 8601 string or time tuple or localtime integer value to generate a "dateTime.iso8601" XML-RPC value Binary binary data wrapper Marshaller Generate an XML-RPC params chunk from a Python data structure Unmarshaller Unmarshal an XML-RPC response from incoming XML event message Transport Handles an HTTP transaction to an XML-RPC server SafeTransport Handles an HTTPS transaction to an XML-RPC server Exported constants: (none) Exported functions: getparser Create instance of the fastest available parser & attach to an unmarshalling object dumps Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). loads Convert an XML-RPC packet to unmarshalled data plus a method name (None if not present). N)datetime)Decimal)expat)BytesIOcCs$|dd}|dd}|ddS)N&z&z>)replace)sr 2/opt/alt/python39/lib64/python3.9/xmlrpc/client.pyescapes  r z%d.%diiiDii ipiԁiCiBiiic@seZdZdZejZdS)ErrorzBase class for client errors.N)__name__ __module__ __qualname____doc__object__str__r r r r rsrc@s eZdZdZddZddZdS) ProtocolErrorz!Indicates an HTTP protocol error.cCs&t|||_||_||_||_dSN)r__init__urlerrcodeerrmsgheaders)selfrrrrr r r rs  zProtocolError.__init__cCsd|jj|j|j|jfS)Nz<%s for %s: %s %s>) __class__rrrrrr r r __repr__szProtocolError.__repr__Nrrrrrr r r r r rsrc@seZdZdZdS) ResponseErrorz$Indicates a broken response package.N)rrrrr r r r r"sr"c@s eZdZdZddZddZdS)Faultz#Indicates an XML-RPC fault package.cKst|||_||_dSr)rr faultCode faultString)rr$r%Zextrar r r rs zFault.__init__cCsd|jj|j|jfS)Nz <%s %s: %r>)rrr$r%rr r r r szFault.__repr__Nr!r r r r r#sr#cCs*zt|dkWSty$YdS0dS)NZ0001F)_day0strftime ValueError)Zfmtr r r _try s r*z%YcCs |dSN%Y%m%dT%H:%M:%Sr(valuer r r _iso8601_formatsr0z%4YcCs |dS)Nz%4Y%m%dT%H:%M:%Sr-r.r r r r0scCs|ddS)Nr,)r(zfillr.r r r r0scCsLt|trt|St|ttjfs<|dkr2t}t|}d|ddS)Nrz%04d%02d%02dT%02d:%02d:%02d) isinstancerr0tupletime struct_time localtimer.r r r _strftimes  r9c@sreZdZdZdddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZdS)DateTimezDateTime wrapper for an ISO 8601 string or time tuple or localtime integer value to generate 'dateTime.iso8601' XML-RPC value. rcCs t|tr||_n t||_dSr)r4strr/r9)rr/r r r r.s zDateTime.__init__cCstt|tr|j}|j}nTt|tr2|j}t|}n:t|trH|j}|}n$t|drd|}|}n|}t}||fS)N timetuple) r4r:r/rr0r;hasattrr<NotImplementedrotherr or r r make_comparable4s      zDateTime.make_comparablecCs"||\}}|turtS||kSrrBr>r?r r r __lt__FszDateTime.__lt__cCs"||\}}|turtS||kSrrCr?r r r __le__LszDateTime.__le__cCs"||\}}|turtS||kSrrCr?r r r __gt__RszDateTime.__gt__cCs"||\}}|turtS||kSrrCr?r r r __ge__XszDateTime.__ge__cCs"||\}}|turtS||kSrrCr?r r r __eq__^szDateTime.__eq__cCst|jdSr+)r6strptimer/rr r r r<dszDateTime.timetuplecCs|jSrr.rr r r rlszDateTime.__str__cCsd|jj|jt|fS)Nz<%s %r at %#x>)rrr/idrr r r r oszDateTime.__repr__cCst||_dSr)r;stripr/rdatar r r decoderszDateTime.decodecCs$|d||j|ddSNzz )writer/)routr r r encodeus  zDateTime.encodeN)r)rrrrrrBrDrErFrGrHr<rr rNrRr r r r r:(s r:cCst}|||Sr)r:rNrMr/r r r _datetimezs rTcCs t|dSr+)rrI)rMr r r _datetime_typesrUc@s:eZdZdZd ddZddZddZd d Zd d ZdS)BinaryzWrapper for binary data.NcCs>|durd}n&t|ttfs,td|jjt|}||_dS)Nz#expected bytes or bytearray, not %s)r4bytes bytearray TypeErrorrrrMrLr r r rszBinary.__init__cCs t|jdS)Nzlatin-1)r;rMrr r r rszBinary.__str__cCst|tr|j}|j|kSr)r4rVrM)rr@r r r rHs z Binary.__eq__cCst||_dSr)base64 decodebytesrMrLr r r rNsz Binary.decodecCs4|dt|j}||d|ddSNz asciiz )rPr[ encodebytesrMrN)rrQencodedr r r rRs  z Binary.encode)N) rrrrrrrHrNrRr r r r rVs  rVcCst}|||Sr)rVrNrSr r r _binarys rac@s$eZdZddZddZddZdS) ExpatParsercCsDtdd|_}||_|j|_|j|_|j|_ d}| |ddSr) rZ ParserCreate_parser_targetstartZStartElementHandlerendZEndElementHandlerrMZCharacterDataHandlerxml)rtargetparserencodingr r r rszExpatParser.__init__cCs|j|ddS)NF)rcParserLr r r feedszExpatParser.feedcCs6z |j}WntyYn0|`|`|dddS)NrWT)rcAttributeErrorrdrk)rrir r r closes   zExpatParser.closeN)rrrrrlrnr r r r rbs rbc@seZdZdZdddZiZddZdd Zd d Zeee d<d d Z e ee <ddZ e ee <e ZddZeee<efddZeee<ddZeee<eee<ddZeee<eee<efddZeee<ddZeee<ddZeee<eee <eed<dS) MarshalleravGenerate an XML-RPC params chunk from a Python data structure. Create a Marshaller instance for each set of parameters, and use the "dumps" method to convert your data (represented as a tuple) to an XML-RPC params chunk. To write a fault response, pass a Fault instance instead. You may prefer to use the "dumps" module function for this purpose. NFcCsi|_d|_||_||_dSr)memorMrj allow_none)rrjrqr r r rszMarshaller.__init__cCsg}|j}|j}t|tr@|d||j|jd||dn4|d|D]}|d||||dqL|dd|}|S) Nz )r$r%z z z z z )append_Marshaller__dumpr4r#r$r%join)rvaluesrQrPdumpvresultr r r dumpss&     zMarshaller.dumpscCsz|jt|}Wndtyvt|ds:tdt|t|jD]"}||jvrDtdt|qD|jd}Yn0||||dS)N__dict__zcannot marshal %s objects_arbitrary_instance)dispatchtypeKeyErrorr=rZ__mro__keys)rr/rPftype_r r r Z__dumps  zMarshaller.__dumpcCs|jstd|ddS)Nz0cannot marshal None unless allow_none is enabledz)rqrZrr/rPr r r dump_nilszMarshaller.dump_nilcCs$|d||rdpd|ddS)Nz10z r rr r r dump_bool szMarshaller.dump_boolcCs<|tks|tkrtd|d|tt||ddS)Nzint exceeds XML-RPC limitsz z )MAXINTMININT OverflowErrorr;intrr r r dump_long&s zMarshaller.dump_longcCs |d|t||ddS)Nzz )reprrr r r dump_double1s zMarshaller.dump_doublecCs |d||||ddS)Nzz r )rr/rPr r r r dump_unicode7s zMarshaller.dump_unicodecCs,|dt|}||d|ddSr])r[r_rN)rr/rPr`r r r dump_bytes=s zMarshaller.dump_bytescCsZt|}||jvrtdd|j|<|j}|d|D]}|||q6|d|j|=dS)Nz"cannot marshal recursive sequencesz z )rJrprZrt)rr/rPirwrxr r r dump_arrayEs   zMarshaller.dump_arraycCst|}||jvrtdd|j|<|j}|d|D]D\}}|dt|ts\td|d||||||dq:|d|j|=dS)Nz%cannot marshal recursive dictionariesz z zdictionary key must be stringz%s z z )rJrprZrtitemsr4r;)rr/rPr rrwkrxr r r dump_structSs     zMarshaller.dump_structcCs |d|t||ddSrO)r9rr r r dump_datetimees zMarshaller.dump_datetimecCs2|jtvr ||_|||`n||j|dSr)rWRAPPERSrPrRrr{rr r r dump_instanceks   zMarshaller.dump_instancer|)NF)!rrrrrr}rzrtrr~rboolrrZdump_intrfloatr rr;rrXrYrr5listrdictrrrr:rVr r r r ros<      roc@sneZdZdZdEddZddZddZd d Zd d Zd dZ ddZ ddZ iZ ddZ e e d<ddZee d<ddZee d<ee d<ee d<ee d<ee d<ee d <d!d"Zee d#<ee d$<d%d&Zee d'<d(d)Zee d*<ee d+<d,d-Zee d.<d/d0Zee d1<d2d3Zee d4<d5d6Zee d7<d8d9Zee d:<d;d<Zee d=<d>d?Zee d@<dAdBZee dC<dDS)F UnmarshalleraUnmarshal an XML-RPC response, based on incoming XML event messages (start, data, end). Call close() to get the resulting data structure. Note that this reader is fairly tolerant, and gladly accepts bogus XML-RPC data without complaining (but not bogus XML). FcCsHd|_g|_g|_g|_d|_d|_d|_|jj|_|p:||_||_ dS)NFutf-8) _type_stack_marks_data_value _methodname _encodingrs _use_datetime _use_bytes)r use_datetimeuse_builtin_typesr r r rs  zUnmarshaller.__init__cCs>|jdus|jrt|jdkr4tfi|jdt|jS)Nfaultr)rrr"r#rr5rr r r rns  zUnmarshaller.closecCs|jSr)rrr r r getmethodnameszUnmarshaller.getmethodnamecCs ||_dSr)r)rrjZ standaloner r r rgszUnmarshaller.xmlcCshd|vr|dd}|dks&|dkr8|jt|jg|_|jrZ||jvrZtd||dk|_dS)N:arraystructzunknown tag %rr/) splitrrslenrrrr}r")rtagattrsr r r res zUnmarshaller.startcCs|j|dSr)rrs)rtextr r r rMszUnmarshaller.datac Csrz|j|}WnPty^d|vr*YdSz|j|dd}WntyXYYdS0Yn0||d|jS)Nrrrr)r}rrrur)rrrr r r rfs  zUnmarshaller.endc Csjz|j|}WnPty^d|vr*YdSz|j|dd}WntyXYYdS0Yn0|||S)Nrr)r}rr)rrrMrr r r end_dispatchs  zUnmarshaller.end_dispatchcCs|dd|_dSNr)rsrrLr r r end_nils zUnmarshaller.end_nilZnilcCs:|dkr|dn|dkr(|dntdd|_dS)NrFrTzbad boolean valuer)rsrZrrLr r r end_booleans   zUnmarshaller.end_booleanbooleancCs|t|d|_dSr)rsrrrLr r r end_intszUnmarshaller.end_intZi1Zi2Zi4Zi8rZ bigintegercCs|t|d|_dSr)rsrrrLr r r end_doubleszUnmarshaller.end_doubleZdoublercCs|t|d|_dSr)rsrrrLr r r end_bigdecimalszUnmarshaller.end_bigdecimalZ bigdecimalcCs&|jr||j}||d|_dSr)rrNrsrrLr r r end_strings  zUnmarshaller.end_stringstringnamecCs.|j}|j|dg|j|d<d|_dSr)rpoprr)rrMmarkr r r end_arrays zUnmarshaller.end_arrayrcCs`|j}i}|j|d}tdt|dD]}||d|||<q,|g|j|d<d|_dS)Nrrr&)rrrrangerr)rrMrrrrr r r end_struct s zUnmarshaller.end_structrcCs6t}||d|jr"|j}||d|_dS)Nr^r)rVrNrRrrMrsrrrMr/r r r end_base64s  zUnmarshaller.end_base64r[cCs,t}|||jrt|}||dSr)r:rNrrUrsrr r r end_dateTime s  zUnmarshaller.end_dateTimezdateTime.iso8601cCs|jr||dSr)rrrLr r r end_value(szUnmarshaller.end_valuer/cCs d|_dS)NparamsrrLr r r end_params/szUnmarshaller.end_paramsrcCs d|_dS)NrrrLr r r end_fault3szUnmarshaller.end_faultrcCs"|jr||j}||_d|_dS)N methodName)rrNrrrLr r r end_methodName7s zUnmarshaller.end_methodNamerN)FF)rrrrrrnrrgrerMrfrr}rrrrrrrrrrrrrrr r r r rsZ   rc@s$eZdZddZddZddZdS)_MultiCallMethodcCs||_||_dSr)_MultiCallMethod__call_list_MultiCallMethod__name)rZ call_listrr r r rDsz_MultiCallMethod.__init__cCst|jd|j|fSNz%s.%s)rrrrrr r r __getattr__Gsz_MultiCallMethod.__getattr__cGs|j|j|fdSr)rrsrrargsr r r __call__Isz_MultiCallMethod.__call__Nrrrrrrr r r r rAsrc@s eZdZdZddZddZdS)MultiCallIteratorzaIterates over the results of a multicall. Exceptions are raised in response to xmlrpc faults.cCs ||_dSr)results)rrr r r rPszMultiCallIterator.__init__cCsR|j|}t|tikr.t|d|dn t|tgkrF|dStddS)Nr$r%rz#unexpected type in multicall result)rr~r#r))rritemr r r __getitem__Ss  zMultiCallIterator.__getitem__N)rrrrrrr r r r rLsrc@s0eZdZdZddZddZddZdd Zd S) MultiCalla~server -> an object used to boxcar method calls server should be a ServerProxy object. Methods can be added to the MultiCall using normal method call syntax e.g.: multicall = MultiCall(server_proxy) multicall.add(2,3) multicall.get_address("Guido") To execute the multicall, call the MultiCall object e.g.: add_result, address = multicall() cCs||_g|_dSr)_MultiCall__server_MultiCall__call_list)rserverr r r rmszMultiCall.__init__cCsd|jjt|fS)Nz <%s at %#x>)rrrJrr r r r qszMultiCall.__repr__cCs t|j|Sr)rrrr r r rtszMultiCall.__getattr__cCs6g}|jD]\}}|||dq t|jj|S)N)rr)rrsrrsystemZ multicall)rZmarshalled_listrrr r r rwszMultiCall.__call__N)rrrrrr rrr r r r r\s rFcCsrtrHtrH|rt}tj}n|r&t}t}nt}t}tdd||t}t|}n"t||d}trbt|}nt |}||fS)zgetparser() -> parser, unmarshaller Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects. TFrr) FastParserFastUnmarshallerrUr[r\rarTr#rrb)rrZ mkdatetimeZmkbytesrhrir r r getparsers    rcCst|trd}n|rt|tr|s&d}tr4t|}n t||}||}|dkr^dt|}nd}|rx|d|d|df}n|r|d|d f}n|Sd |S) adata [,options] -> marshalled data Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodname: the method name for a methodCall packet methodresponse: true to create a methodResponse packet. If this option is used with a tuple, the tuple must be a singleton (i.e. it can contain only one element). encoding: the packet encoding (default is UTF-8) All byte strings in the data structure are assumed to use the packet encoding. Unicode strings are automatically converted, where necessary. r&rz$ z z z z z z rr)r4r#r5FastMarshallerrorzr;ru)r methodnameZmethodresponserjrqmrMZ xmlheaderr r r rzs6    rzcCs2t||d\}}|||||fS)zdata -> unmarshalled data, method name Convert an XML-RPC packet to unmarshalled data plus a method name (None if not present). If the XML-RPC packet represents a fault condition, this function raises a Fault exception. r)rrlrnr)rMrrpur r r loadss  rcCsPtstt}tjd|dd}||Wdn1s>0Y|S)zhdata -> gzip encoded data Encode data using the gzip content encoding as described in RFC 1952 wbr&)modefileobjZ compresslevelN)gzipNotImplementedErrorrGzipFilerPgetvalue)rMrgzfr r r gzip_encodes (r@c Cststtjdt|dP}z$|dkr0|}n||d}WntyZtdYn0Wdn1sp0Y|dkrt||krtd|S)zrgzip encoded data -> unencoded data Decode data using the gzip content encoding as described in RFC 1952 rbrrrr&z invalid dataNz#max gzipped payload length exceeded)rrrrreadOSErrorr)r)rMZ max_decoderZdecodedr r r gzip_decode)s  ,rc@s eZdZdZddZddZdS)GzipDecodedResponsezha file-like object to decode a response encoded with the gzip method, as described in RFC 1952. cCs.tstt||_tjj|d|jddS)Nrr)rrrriorr)rresponser r r rGszGzipDecodedResponse.__init__cCs,ztj|W|jn |j0dSr)rrrnrrr r r rnOszGzipDecodedResponse.closeN)rrrrrrnr r r r rCsrc@s$eZdZddZddZddZdS)_MethodcCs||_||_dSr _Method__send _Method__name)rsendrr r r r\sz_Method.__init__cCst|jd|j|fSr)rrrrr r r r_sz_Method.__getattr__cGs||j|Srrrr r r rasz_Method.__call__Nrr r r r rYsrc@seZdZdZdeZdZdZddddd Zdd d Z d d d Z ddZ ddZ ddZ ddZddZddZddZddZdS)! Transportz1Handles an HTTP transaction to an XML-RPC server.zPython-xmlrpc/%sTNFr )rcCs&||_||_d|_t||_g|_dSN)NN)r_use_builtin_types _connectionr_headers_extra_headers)rrrrr r r rxs  zTransport.__init__c CsdD]v}z|||||WStjjy:|r6Yqtyx}z(|sb|jtjtjtjfvrdWYd}~qd}~00qdS)N)rr&) single_requesthttpclientZRemoteDisconnectedrerrnoZ ECONNRESETZ ECONNABORTEDZEPIPE)rhosthandler request_bodyverboserer r r requestszTransport.requestcCsz8|||||}|}|jdkr6||_||WSWn.tyLYntyf|Yn0|ddr|| t |||j|j t | dS)Nzcontent-lengthrr) send_requestZ getresponseZstatusrparse_responser# Exceptionrn getheaderrrreasonrZ getheaders)rrrrrZ http_connZrespr r r r s$     zTransport.single_requestcCst|j|jdS)Nr)rrrrr r r rszTransport.getparsercCsri}t|tr|\}}tj|\}}|rdtj|}t|d}d | }dd|fg}ng}|||fS)NrrrZ AuthorizationzBasic ) r4r5urllibparseZ _splituserZunquote_to_bytesr[r_rNrur)rrx509ZauthZ extra_headersr r r get_host_infos   zTransport.get_host_infocCsL|jr||jdkr|jdS||\}|_}|tj|f|_|jdS)Nrr&)rrr r r ZHTTPConnectionrrZchostrr r r make_connections  zTransport.make_connectioncCs |j\}}|rd|_|dSr)rrn)rr connectionr r r rns zTransport.closecCs||}|j|j}|r$|d|jrJtrJ|jd|dd|dn |d||d|d|jf| ||| |||S)Nr&ZPOSTT)Zskip_accept_encoding)zAccept-Encodingr)z Content-Typeztext/xmlz User-Agent) rrr Zset_debuglevelaccept_gzip_encodingrZ putrequestrs user_agent send_headers send_content)rrrrdebugr rr r r rs         zTransport.send_requestcCs|D]\}}|||qdSr) putheader)rr rkeyvalr r r r#s zTransport.send_headerscCsR|jdur0|jt|kr0tr0|ddt|}|dtt|||dS)NContent-EncodingrzContent-Length)encode_thresholdrrr&rr;Z endheaders)rr rr r r r$ s   zTransport.send_contentcCst|dr*|dddkr$t|}q.|}n|}|\}}|d}|sJqj|jr^tdt|||q:||urz| | | S)Nrr)rrrizbody:) r=rrrrrprintrrlrn)rrstreamrrrMr r r r1s      zTransport.parse_response)FF)F)F)rrrr __version__r"r!r*rrr rrrrnrr#r$rr r r r rjs"  ! rcs2eZdZdZd dddfdd Zdd ZZS) SafeTransportz2Handles an HTTPS transaction to an XML-RPC server.Fr Nrcontextcstj|||d||_dS)Nrrr)superrr0)rrrrr0rr r rRs zSafeTransport.__init__cCst|jr||jdkr|jdSttjds2td||\}|_}|tjj|dfd|ji|p`if|_|jdS)Nrr&HTTPSConnectionz1your version of http.client doesn't support HTTPSr0) rr=r r rrr r4r0rr r r r[s    zSafeTransport.make_connection)FF)rrrrrr __classcell__r r r3r r.Os  r.c@sZeZdZdZddddddZdd Zd d Zd d ZddZddZ ddZ ddZ dS) ServerProxyauri [,options] -> a logical connection to an XML-RPC server uri is the connection point on the server, given as scheme://host/target. The standard implementation always supports the "http" scheme. If SSL socket support is available (Python 2.0), it also supports "https". If the target part and the slash preceding it are both omitted, "/RPC2" is assumed. The following options can be given as keyword arguments: transport: a transport factory encoding: the request encoding (default is UTF-8) All 8-bit strings passed to the server proxy are assumed to use the given encoding. NFr r/c Cstj|} | jdvrtd| j|_tjddg| dd|_|jsPd|_|dur| jdkrpt } d| i} nt } i} | f|||d| }||_ |pd |_ ||_ ||_dS) N)r httpszunsupported XML-RPC protocolrrrz/RPC2r7r0r1r)rrZurlsplitZschemerZnetloc_ServerProxy__hostZ urlunsplit_ServerProxy__handlerr.r_ServerProxy__transport_ServerProxy__encoding_ServerProxy__verbose_ServerProxy__allow_none) rZuri transportrjrrqrrrr0rrZ extra_kwargsr r r rs.     zServerProxy.__init__cCs|jdSr)r:rnrr r r Z__closeszServerProxy.__closecCsPt|||j|jd|jd}|jj|j|j||jd}t |dkrL|d}|S)N)rjrqxmlcharrefreplace)rr&r) rzr;r=rRr:rr8r9r<r)rrrrrr r r Z __requests  zServerProxy.__requestcCsd|jj|j|jfS)Nz <%s for %s%s>)rrr8r9rr r r r szServerProxy.__repr__cCs t|j|Sr)r_ServerProxy__requestrr r r rszServerProxy.__getattr__cCs.|dkr|jS|dkr|jStd|fdS)z|A workaround to get special attributes on the ServerProxy without interfering with the magic __getattr__ rnr>zAttribute %r not foundN)_ServerProxy__closer:rm)rattrr r r rs zServerProxy.__call__cCs|Srr rr r r __enter__szServerProxy.__enter__cGs |dSr)rArr r r __exit__szServerProxy.__exit__)NNFFFF) rrrrrrAr@r rrrCrDr r r r r6zs  r6__main__zhttp://localhost:8000ZERROR )FF)NNNF)FF)r)Vrr[sysr6rdecimalrZ http.clientr Z urllib.parserZ xml.parsersrr rrr ImportErrorr version_infor-rrZ PARSE_ERRORZ SERVER_ERRORZAPPLICATION_ERRORZ SYSTEM_ERRORZTRANSPORT_ERRORZNOT_WELLFORMED_ERRORZUNSUPPORTED_ENCODINGZINVALID_ENCODING_CHARZINVALID_XMLRPCZMETHOD_NOT_FOUNDZINVALID_METHOD_PARAMSZINTERNAL_ERRORrrrr"r#rrZBooleanr'r*r0r9r:rTrUrVrarrbrorrrrrrrrrzrrrrrrrrr.r6ZServerrrr+Z currentTimeZgetCurrentTimerxZmultiZgetDatapowaddrr r r r Ys*              R #!(C %  ' K  f+i