XEP-0009 will likely be updated to use <base64 /> instead of <Base64 />
Both are supported when reading, but <base64 /> will be used for output.
This commit is contained in:
parent
e33949c397
commit
3e384d3cfe
1 changed files with 4 additions and 1 deletions
|
@ -63,7 +63,7 @@ def _py2xml(*args):
|
||||||
double.text = str(x)
|
double.text = str(x)
|
||||||
val.append(double)
|
val.append(double)
|
||||||
elif type(x) is rpcbase64:
|
elif type(x) is rpcbase64:
|
||||||
b64 = ET.Element("Base64")
|
b64 = ET.Element("base64")
|
||||||
b64.text = x.encoded()
|
b64.text = x.encoded()
|
||||||
val.append(b64)
|
val.append(b64)
|
||||||
elif type(x) is rpctime:
|
elif type(x) is rpctime:
|
||||||
|
@ -110,7 +110,10 @@ def _xml2py(value):
|
||||||
return value.find('{%s}string' % namespace).text
|
return value.find('{%s}string' % namespace).text
|
||||||
if value.find('{%s}double' % namespace) is not None:
|
if value.find('{%s}double' % namespace) is not None:
|
||||||
return float(value.find('{%s}double' % namespace).text)
|
return float(value.find('{%s}double' % namespace).text)
|
||||||
|
if value.find('{%s}base64') is not None:
|
||||||
|
return rpcbase64(value.find('base64' % namespace).text)
|
||||||
if value.find('{%s}Base64') is not None:
|
if value.find('{%s}Base64') is not None:
|
||||||
|
# Older versions of XEP-0009 used Base64
|
||||||
return rpcbase64(value.find('Base64' % namespace).text)
|
return rpcbase64(value.find('Base64' % namespace).text)
|
||||||
if value.find('{%s}dateTime.iso8601') is not None:
|
if value.find('{%s}dateTime.iso8601') is not None:
|
||||||
return rpctime(value.find('{%s}dateTime.iso8601'))
|
return rpctime(value.find('{%s}dateTime.iso8601'))
|
||||||
|
|
Loading…
Reference in a new issue