File: //opt/hc_python/lib/python3.12/site-packages/__pycache__/dicttoxml.cpython-312.pyc
g:
Z d Z ddlmZ dZeZddlmZ ddlmZ ddlZddl
Z
ddlmZ e
j d Z e e dd
Zd Zg Zd dZd
Zd Zd Zd Zd Zd Zd Z d Z!d!dZ"d Z#d Z$d"dZ%d"dZ&d"dZ'dddd de!d dddf
dZ(y# e
$ r ddlmZ Y }w xY w# eZY dxY w# eZY jxY w)#a
Converts a Python dictionary or other native data type into a valid XML string.
Supports item (`int`, `float`, `long`, `decimal.Decimal`, `bool`, `str`, `unicode`, `datetime`, `none` and other number-like objects) and collection (`list`, `set`, `tuple` and `dict`, as well as iterable and dict-like objects) data types, with arbitrary nesting for the collections. Items with a `datetime` type are converted to ISO format strings. Items with a `None` type become empty XML elements.
This module works with both Python 2 and 3.
)unicode_literalsz1.7.16)randint)IterableN)parseString dicttoxmlFc 2 | rqdd l }t d|z t j |t j t
j
dt |j j z y t j t j y )Nr z*Debug mode is on. Events are logged at: %s)filenamelevelz
Logging session starts: %s)r
)
datetimeprintloggingbasicConfigINFOLOGinfostrtodayWARNING)debugr r s 8/opt/hc_python/lib/python3.12/site-packages/dicttoxml.py set_debugr , si
:hGHXW\\B/!!'')*,
'//2 c r t j d| d t | d S # t | cY S xY w)zConverts strings with non-ASCII characters to unicode for LOG.
Python 3 doesn't have a `unicode()` function, so `unicode()` is an alias
for `str()`, but `str()` doesn't take a second argument, hence this kludge.
zInside unicode_me(). val = ""utf-8)r r unicodevals r
unicode_mer 8 s6
HH#
89sG$$s|s '
6c b t j d| d|d|d | dt || S )zReturns a random integerzInside make_id(). element = "z
", start="z", end="r _)r r r )elementstartends r make_idr% F s) HHRWY\
]^wuc233r c t j d| d t | }d}|r.|t vrd}t j | nt | }|r.t d S )z'Returns a unique id for a given elementz#Inside get_unique_id(). element = "r TF)r r r% idsappend)r"