File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/serializers/__pycache__/tomlmod.cpython-310.pyc
Back
o ;j� � @ sv d Z ddlZddlmZmZ zddlZdZW n ey! dZY nw dZg d�Z e� e�Zdd � Z d d� Zdd � ZdS )z� salt.serializers.tomlmod ~~~~~~~~~~~~~~~~~~~~~~~~ Implements TOML serializer. It's just a wrapper around the python toml module. � N)�DeserializationError�SerializationErrorTF�toml)�deserialize� serialize�HAS_TOMLc C s t du rdS tS )NF)FzThe 'toml' library is missing)r �__virtualname__� r r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/serializers/tomlmod.py�__virtual__ s r c K sd z!t | ttf�stj| fi |��W S t | t�r| �d�} t�| �W S ty1 } zt|��d}~ww )z� Deserialize from TOML into Python data structure. :param stream_or_string: toml stream or string to deserialize. :param options: options given to the python toml module. zutf-8N) � isinstance�bytes�strr �load�decode�loads� Exceptionr )Zstream_or_string�options�errorr r r r $ s ��r c K sX zd|v rt j| |d fi |��W S t j| fi |��W S ty+ } zt|��d}~ww )z� Serialize Python data to TOML. :param obj: the data structure to serialize. :param options: options given to the python toml module. Zfile_outN)r �dump�dumpsr r )�objr r r r r r 8 s ��r )�__doc__�loggingZsalt.serializersr r r r �ImportErrorr �__all__� getLogger�__name__�logr r r r r r r �<module> s �
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings