Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/xmlrpc.txt
blob: 7a6875194ad304480f3dc5c2ee12c606af46503b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
Help on module xmlrpclib:

NAME
    xmlrpclib - An XML-RPC client interface for Python.

FILE
    /usr/lib/python2.5/xmlrpclib.py

MODULE DOCS
    http://www.python.org/doc/current/lib/module-xmlrpclib.html

DESCRIPTION
    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
      Boolean        boolean wrapper to generate a "boolean" XML-RPC value
      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
    
      SlowParser     Slow but safe standard parser (based on xmllib)
      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:
    
      True
      False
    
    Exported functions:
    
      boolean        Convert any Python value to an XML-RPC boolean
      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).

CLASSES
    exceptions.Exception(exceptions.BaseException)
        Error
            Fault
            ProtocolError
            ResponseError
    Binary
    DateTime
    ExpatParser
    Marshaller
    MultiCall
    MultiCallIterator
    ServerProxy
    SlowParser
    Transport
        SafeTransport
    Unmarshaller
    
    class Binary
     |  Wrapper for binary data.
     |  
     |  Methods defined here:
     |  
     |  __cmp__(self, other)
     |  
     |  __init__(self, data=None)
     |  
     |  __str__(self)
     |  
     |  decode(self, data)
     |  
     |  encode(self, out)
    
    class DateTime
     |  DateTime wrapper for an ISO 8601 string or time tuple or
     |  localtime integer value to generate 'dateTime.iso8601' XML-RPC
     |  value.
     |  
     |  Methods defined here:
     |  
     |  __cmp__(self, other)
     |  
     |  __init__(self, value=0)
     |  
     |  __repr__(self)
     |  
     |  __str__(self)
     |  
     |  decode(self, data)
     |  
     |  encode(self, out)
    
    class Error(exceptions.Exception)
     |  Base class for client errors.
     |  
     |  Method resolution order:
     |      Error
     |      exceptions.Exception
     |      exceptions.BaseException
     |      __builtin__.object
     |  
     |  Methods defined here:
     |  
     |  __str__(self)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from exceptions.Exception:
     |  
     |  __init__(...)
     |      x.__init__(...) initializes x; see x.__class__.__doc__ for signature
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from exceptions.Exception:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x6eb8560>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from exceptions.BaseException:
     |  
     |  __delattr__(...)
     |      x.__delattr__('name') <==> del x.name
     |  
     |  __getattribute__(...)
     |      x.__getattribute__('name') <==> x.name
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __getslice__(...)
     |      x.__getslice__(i, j) <==> x[i:j]
     |      
     |      Use of negative indices is not supported.
     |  
     |  __reduce__(...)
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  __setattr__(...)
     |      x.__setattr__('name', value) <==> x.name = value
     |  
     |  __setstate__(...)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from exceptions.BaseException:
     |  
     |  __dict__
     |  
     |  args
     |  
     |  message
     |      exception message
    
    class ExpatParser
     |  Methods defined here:
     |  
     |  __init__(self, target)
     |      # fast expat parser for Python 2.0 and later.  this is about
     |      # 50% slower than sgmlop, on roundtrip testing
     |  
     |  close(self)
     |  
     |  feed(self, data)
    
    class Fault(Error)
     |  Indicates an XML-RPC fault package.
     |  
     |  Method resolution order:
     |      Fault
     |      Error
     |      exceptions.Exception
     |      exceptions.BaseException
     |      __builtin__.object
     |  
     |  Methods defined here:
     |  
     |  __init__(self, faultCode, faultString, **extra)
     |  
     |  __repr__(self)
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from Error:
     |  
     |  __str__(self)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Error:
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from exceptions.Exception:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x6eb8560>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from exceptions.BaseException:
     |  
     |  __delattr__(...)
     |      x.__delattr__('name') <==> del x.name
     |  
     |  __getattribute__(...)
     |      x.__getattribute__('name') <==> x.name
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __getslice__(...)
     |      x.__getslice__(i, j) <==> x[i:j]
     |      
     |      Use of negative indices is not supported.
     |  
     |  __reduce__(...)
     |  
     |  __setattr__(...)
     |      x.__setattr__('name', value) <==> x.name = value
     |  
     |  __setstate__(...)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from exceptions.BaseException:
     |  
     |  __dict__
     |  
     |  args
     |  
     |  message
     |      exception message
    
    class Marshaller
     |  Generate 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.
     |  
     |  Methods defined here:
     |  
     |  __init__(self, encoding=None, allow_none=0)
     |  
     |  dump_array(self, value, write)
     |  
     |  dump_bool(self, value, write)
     |  
     |  dump_date(self, value, write)
     |  
     |  dump_datetime(self, value, write)
     |  
     |  dump_double(self, value, write)
     |  
     |  dump_instance(self, value, write)
     |  
     |  dump_int(self, value, write)
     |  
     |  dump_long(self, value, write)
     |  
     |  dump_nil(self, value, write)
     |  
     |  dump_string(self, value, write, escape=<function escape at 0xb7de0304>)
     |  
     |  dump_struct(self, value, write, escape=<function escape at 0xb7de0304>)
     |  
     |  dump_time(self, value, write)
     |  
     |  dump_unicode(self, value, write, escape=<function escape at 0xb7de0304>)
     |  
     |  dumps(self, values)
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  dispatch = {<type 'datetime.date'>: <function dump_date at 0xb7d68d4c>...
    
    class MultiCall
     |  server -> a 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()
     |  
     |  Methods defined here:
     |  
     |  __call__(self)
     |  
     |  __getattr__(self, name)
     |  
     |  __init__(self, server)
     |  
     |  __repr__(self)
     |  
     |  __str__ = __repr__(self)
    
    class MultiCallIterator
     |  Iterates over the results of a multicall. Exceptions are
     |  thrown in response to xmlrpc faults.
     |  
     |  Methods defined here:
     |  
     |  __getitem__(self, i)
     |  
     |  __init__(self, results)
    
    class ProtocolError(Error)
     |  Indicates an HTTP protocol error.
     |  
     |  Method resolution order:
     |      ProtocolError
     |      Error
     |      exceptions.Exception
     |      exceptions.BaseException
     |      __builtin__.object
     |  
     |  Methods defined here:
     |  
     |  __init__(self, url, errcode, errmsg, headers)
     |  
     |  __repr__(self)
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from Error:
     |  
     |  __str__(self)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Error:
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from exceptions.Exception:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x6eb8560>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from exceptions.BaseException:
     |  
     |  __delattr__(...)
     |      x.__delattr__('name') <==> del x.name
     |  
     |  __getattribute__(...)
     |      x.__getattribute__('name') <==> x.name
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __getslice__(...)
     |      x.__getslice__(i, j) <==> x[i:j]
     |      
     |      Use of negative indices is not supported.
     |  
     |  __reduce__(...)
     |  
     |  __setattr__(...)
     |      x.__setattr__('name', value) <==> x.name = value
     |  
     |  __setstate__(...)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from exceptions.BaseException:
     |  
     |  __dict__
     |  
     |  args
     |  
     |  message
     |      exception message
    
    class ResponseError(Error)
     |  Indicates a broken response package.
     |  
     |  Method resolution order:
     |      ResponseError
     |      Error
     |      exceptions.Exception
     |      exceptions.BaseException
     |      __builtin__.object
     |  
     |  Methods inherited from Error:
     |  
     |  __str__(self)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Error:
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from exceptions.Exception:
     |  
     |  __init__(...)
     |      x.__init__(...) initializes x; see x.__class__.__doc__ for signature
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from exceptions.Exception:
     |  
     |  __new__ = <built-in method __new__ of type object at 0x6eb8560>
     |      T.__new__(S, ...) -> a new object with type S, a subtype of T
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from exceptions.BaseException:
     |  
     |  __delattr__(...)
     |      x.__delattr__('name') <==> del x.name
     |  
     |  __getattribute__(...)
     |      x.__getattribute__('name') <==> x.name
     |  
     |  __getitem__(...)
     |      x.__getitem__(y) <==> x[y]
     |  
     |  __getslice__(...)
     |      x.__getslice__(i, j) <==> x[i:j]
     |      
     |      Use of negative indices is not supported.
     |  
     |  __reduce__(...)
     |  
     |  __repr__(...)
     |      x.__repr__() <==> repr(x)
     |  
     |  __setattr__(...)
     |      x.__setattr__('name', value) <==> x.name = value
     |  
     |  __setstate__(...)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from exceptions.BaseException:
     |  
     |  __dict__
     |  
     |  args
     |  
     |  message
     |      exception message
    
    class SafeTransport(Transport)
     |  Handles an HTTPS transaction to an XML-RPC server.
     |  
     |  Methods defined here:
     |  
     |  make_connection(self, host)
     |  
     |  ----------------------------------------------------------------------
     |  Methods inherited from Transport:
     |  
     |  __init__(self, use_datetime=0)
     |  
     |  get_host_info(self, host)
     |  
     |  getparser(self)
     |  
     |  parse_response(self, file)
     |  
     |  request(self, host, handler, request_body, verbose=0)
     |  
     |  send_content(self, connection, request_body)
     |  
     |  send_host(self, connection, host)
     |  
     |  send_request(self, connection, handler, request_body)
     |  
     |  send_user_agent(self, connection)
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from Transport:
     |  
     |  user_agent = 'xmlrpclib.py/1.0.1 (by www.pythonware.com)'
    
    Server = class ServerProxy
     |  uri [,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.
     |  
     |  Methods defined here:
     |  
     |  __getattr__(self, name)
     |  
     |  __init__(self, uri, transport=None, encoding=None, verbose=0, allow_none=0, use_datetime=0)
     |  
     |  __repr__(self)
     |  
     |  __str__ = __repr__(self)
    
    class ServerProxy
     |  uri [,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.
     |  
     |  Methods defined here:
     |  
     |  __getattr__(self, name)
     |  
     |  __init__(self, uri, transport=None, encoding=None, verbose=0, allow_none=0, use_datetime=0)
     |  
     |  __repr__(self)
     |  
     |  __str__ = __repr__(self)
    
    class SlowParser
     |  Default XML parser (based on xmllib.XMLParser).
     |  
     |  Methods defined here:
     |  
     |  __init__(self, target)
     |      # this is about 10 times slower than sgmlop, on roundtrip
     |      # testing.
    
    class Transport
     |  Handles an HTTP transaction to an XML-RPC server.
     |  
     |  Methods defined here:
     |  
     |  __init__(self, use_datetime=0)
     |  
     |  get_host_info(self, host)
     |  
     |  getparser(self)
     |  
     |  make_connection(self, host)
     |  
     |  parse_response(self, file)
     |  
     |  request(self, host, handler, request_body, verbose=0)
     |  
     |  send_content(self, connection, request_body)
     |  
     |  send_host(self, connection, host)
     |  
     |  send_request(self, connection, handler, request_body)
     |  
     |  send_user_agent(self, connection)
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  user_agent = 'xmlrpclib.py/1.0.1 (by www.pythonware.com)'
    
    class Unmarshaller
     |  Unmarshal 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).
     |  
     |  Methods defined here:
     |  
     |  __init__(self, use_datetime=0)
     |  
     |  close(self)
     |  
     |  data(self, text)
     |  
     |  end(self, tag, join=<function join at 0xb7db6294>)
     |  
     |  end_array(self, data)
     |  
     |  end_base64(self, data)
     |  
     |  end_boolean(self, data)
     |  
     |  end_dateTime(self, data)
     |  
     |  end_dispatch(self, tag, data)
     |  
     |  end_double(self, data)
     |  
     |  end_fault(self, data)
     |  
     |  end_int(self, data)
     |  
     |  end_methodName(self, data)
     |  
     |  end_nil(self, data)
     |  
     |  end_params(self, data)
     |  
     |  end_string(self, data)
     |  
     |  end_struct(self, data)
     |  
     |  end_value(self, data)
     |  
     |  getmethodname(self)
     |  
     |  start(self, tag, attrs)
     |  
     |  xml(self, encoding, standalone)
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  dispatch = {'array': <function end_array at 0xb7d6a10c>, 'base64': <fu...

FUNCTIONS
    dumps(params, methodname=None, methodresponse=None, encoding=None, allow_none=0)
        data [,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 8-bit strings in the data structure are assumed to use the
        packet encoding.  Unicode strings are automatically converted,
        where necessary.
    
    escape(s, replace=<function replace at 0xb7db6614>)
    
    getparser(use_datetime=0)
        getparser() -> parser, unmarshaller
        
        Create an instance of the fastest available parser, and attach it
        to an unmarshalling object.  Return both objects.
    
    loads(data, use_datetime=0)
        data -> 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.

DATA
    APPLICATION_ERROR = -32500
    False = False
    FastMarshaller = None
    FastParser = None
    FastUnmarshaller = None
    INTERNAL_ERROR = -32603
    INVALID_ENCODING_CHAR = -32702
    INVALID_METHOD_PARAMS = -32602
    INVALID_XMLRPC = -32600
    MAXINT = 2147483647L
    METHOD_NOT_FOUND = -32601
    MININT = -2147483648L
    NOT_WELLFORMED_ERROR = -32700
    PARSE_ERROR = -32700
    SERVER_ERROR = -32600
    SYSTEM_ERROR = -32400
    SgmlopParser = None
    StringTypes = (<type 'str'>, <type 'unicode'>)
    TRANSPORT_ERROR = -32300
    True = True
    UNSUPPORTED_ENCODING = -32701
    WRAPPERS = (<class xmlrpclib.DateTime at 0xb7ddaadc>, <class xmlrpclib...
    __version__ = '1.0.1'

VERSION
    1.0.1