Lines Matching refs:data

17 # 1999-01-19 fl  Fixed array data element (from Skip Montanaro)
110 Binary binary data wrapper
112 Marshaller Generate an XML-RPC params chunk from a Python data structure
127 loads Convert an XML-RPC packet to unmarshalled data plus a method
370 def decode(self, data):
371 self.value = str(data).strip()
378 def _datetime(data):
381 value.decode(data)
384 def _datetime_type(data):
385 return datetime.strptime(data, "%Y%m%dT%H:%M:%S")
388 # Wrapper for binary data. This can be used to transport any kind
389 # of binary data over XML-RPC, using BASE64 encoding.
391 # @param data An 8-bit string containing arbitrary data.
394 """Wrapper for binary data."""
396 def __init__(self, data=None):
397 if data is None:
398 data = b""
400 if not isinstance(data, (bytes, bytearray)):
402 data.__class__.__name__)
403 data = bytes(data) # Make a copy of the bytes!
404 self.data = data
412 return str(self.data, "latin-1") # XXX encoding?!
416 other = other.data
417 return self.data == other
419 def decode(self, data):
420 self.data = base64.decodebytes(data)
424 encoded = base64.encodebytes(self.data)
428 def _binary(data):
431 value.decode(data)
446 parser.CharacterDataHandler = target.data
450 def feed(self, data):
451 self._parser.Parse(data, False)
460 parser.Parse(b"", True) # end of data
473 """Generate an XML-RPC params chunk from a Python data structure.
476 the "dumps" method to convert your data (represented as a tuple)
487 self.data = None
587 write("<value><array><data>\n")
590 write("</data></array></value>\n")
641 messages (start, data, end). Call close() to get the resulting
642 data structure.
645 XML-RPC data without complaining (but not bogus XML).
692 def data(self, text):
711 def end_dispatch(self, tag, data):
712 # dispatch data
722 return f(self, data)
729 def end_nil (self, data):
734 def end_boolean(self, data):
735 if data == "0":
737 elif data == "1":
744 def end_int(self, data):
745 self.append(int(data))
754 def end_double(self, data):
755 self.append(float(data))
760 def end_bigdecimal(self, data):
761 self.append(Decimal(data))
765 def end_string(self, data):
767 data = data.decode(self._encoding)
768 self.append(data)
773 def end_array(self, data):
780 def end_struct(self, data):
791 def end_base64(self, data):
793 value.decode(data.encode("ascii"))
795 value = value.data
800 def end_dateTime(self, data):
802 value.decode(data)
804 value = _datetime_type(data)
808 def end_value(self, data):
812 self.end_string(data)
815 def end_params(self, data):
819 def end_fault(self, data):
823 def end_methodName(self, data):
825 data = data.decode(self._encoding)
826 self._methodname = data
942 # @return A string containing marshalled data.
946 """data [,options] -> marshalled data
951 In addition to the data object, the following options can be given
962 All byte strings in the data structure are assumed to use the
981 data = m.dumps(params)
991 data = (
995 data,
1000 data = (
1003 data,
1007 return data # return as is
1008 return "".join(data)
1014 # @param data An XML-RPC packet, given as an 8-bit string.
1015 # @return A tuple containing the unpacked data, and the method name
1019 def loads(data, use_datetime=False, use_builtin_types=False):
1020 """data -> unmarshalled data, method name
1022 Convert an XML-RPC packet to unmarshalled data plus a method
1029 p.feed(data)
1038 # @param data the unencoded data
1039 # @return the encoded data
1041 def gzip_encode(data):
1042 """data -> gzip encoded data
1044 Encode data using the gzip content encoding as described in RFC 1952
1050 gzf.write(data)
1058 # @param data The encoded data
1061 # @return the unencoded data
1062 # @raises ValueError if data is not correctly coded.
1065 def gzip_decode(data, max_decode=20971520):
1066 """gzip encoded data -> unencoded data
1068 Decode data using the gzip content encoding as described in RFC 1952
1072 with gzip.GzipFile(mode="rb", fileobj=BytesIO(data)) as gzf:
1079 raise ValueError("invalid data")
1089 # @return a file-like object that the decoded data can be read() from
1193 #Discard any response data and raise exception
1330 # read response data from httpresponse, and parse it
1343 data = stream.read(1024)
1344 if not data:
1347 print("body:", repr(data))
1348 p.feed(data)