ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/tomlkit/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/tomlkit/__pycache__/api.cpython-311.pyc

�

�܋f���8�ddlmZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZ ddlm!Z!ddlm"Z"ddlm#Z#ddlm$Z$ddlm%Z%ddl&m'Z'ddl(m)Z)dbd#�Z*dcddd*�Z+ded-�Z,d$d.�dfd1�Z-dbd2�Z.dgd3�Z/dhd7�Z0did:�Z1djd<�Z2d$d$d=d>�dkdC�Z3dldE�Z4dmdG�Z5dndI�ZdodpdK�Z6dodqdO�Z7drdQ�Z8dsdS�Z9dtdW�Z:dudY�Z;dvd\�Z<dwd^�Z=dxd_�Z>dyda�Z?dS)z�)�annotationsN)�Mapping)�IO)�Iterable)�
parse_rfc3339)�	Container)�UnexpectedCharError��AoT)�Array)�Bool)�Comment)�Date)�DateTime)�	DottedKey)�Float)�InlineTable)�Integer)�Item)�Key)�	SingleKey)�String)�
StringType)�Table)�Time)�Trivia��
Whitespace��item)�Parser��TOMLDocument�string�str | bytes�returnr#c� �t|��S)zF
    Parses a string into a TOMLDocument.

    Alias for parse().
    )�parse�r$s �\/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/tomlkit/api.py�loadsr+$s����=�=��F�datar�	sort_keys�bool�strc�&�t|t��s3t|t��rtt	|��|���}	|���S#t$r(}dt|���d�}t|��|�d}~wwxYw)z-
    Dumps a TOMLDocument into a string.
    )�
_sort_keysz%Expecting Mapping or TOML Container, z givenN)	�
isinstancerrr �dict�	as_string�AttributeError�type�	TypeError)r-r.�ex�msgs    r*�dumpsr;-s����d�I�&�&�6�:�d�G�+D�+D�6��D��J�J�9�5�5�5��%��~�~������%�%�%�H�d�4�j�j�H�H�H����n�n�"�$�����%���s�
A�
B�(#B�B�fp�IO[str] | IO[bytes]c�D�t|�����S)z5
    Load toml document from a file-like object.
    )r(�read)r<s r*�loadr@=s����������r,�r.�IO[str]�Nonec�N�|�t||�����dS)z�
    Dump a TOMLDocument into a writable file stream.

    :param data: a dict-like object to dump
    :param sort_keys: if true, sort the keys in alphabetic order
    rAN)�writer;)r-r<r.s   r*�dumprFDs)���H�H�U�4�9�
-�
-�
-�.�.�.�.�.r,c�D�t|�����S)z7
    Parses a string or bytes into a TOMLDocument.
    )r!r(r)s r*r(r(Ns���&�>�>���!�!�!r,c��t��S)z.
    Returns a new TOMLDocument instance.
    r"�r,r*�documentrJUs���>�>�r,�raw�	str | intrc�:�tt|����S)z/Create an integer item from a number or string.)r �int�rKs r*�integerrP]s����C���>�>�r,�str | floatrc�:�tt|����S)z-Create an float item from a number or string.)r �floatrOs r*�float_rTbs����c�
�
���r,r
c�(�t|dk��S)z+Turn `true` or `false` into a boolean item.�truerrOs r*�booleanrWgs����v�
���r,T)�literal�	multiline�escaperXrYrZrc�X�tj||��}tj|||��S)aBCreate a string item.

    By default, this function will create *single line basic* strings, but
    boolean flags (e.g. ``literal=True`` and/or ``multiline=True``)
    can be used for personalization.

    For more information, please check the spec: `<https://toml.io/en/v1.0.0#string>`__.

    Common escaping rules will be applied for basic strings.
    This can be controlled by explicitly setting ``escape=False``.
    Please note that, if you disable escaping, you will have to make sure that
    the given strings don't contain any forbidden character or sequence.
    )�_StringType�selectr�from_raw)rKrXrYrZ�type_s     r*r$r$ls*��(
��w�	�2�2�E��?�3��v�.�.�.r,rc��t|��}t|tj��st	d���t|��S)zCreate a TOML date.z!date() only accepts date strings.)rr3�	_datetime�date�
ValueErrorr �rK�values  r*rbrb��>���#���E��e�Y�^�,�,�>��<�=�=�=���;�;�r,rc��t|��}t|tj��st	d���t|��S)zCreate a TOML time.z!time() only accepts time strings.)rr3ra�timercr rds  r*rhrh�rfr,rc��t|��}t|tj��st	d���t|��S)zCreate a TOML datetime.z)datetime() only accepts datetime strings.)rr3ra�datetimercr rds  r*rjrj�s@���#���E��e�Y�/�0�0�F��D�E�E�E���;�;�r,rc�(�|�d}t|��S)z�Create an array item for its string representation.

    :Example:

    >>> array("[1, 2, 3]")  # Create from a string
    [1, 2, 3]
    >>> a = array()
    >>> a.extend([1, 2, 3])  # Create from a list
    >>> a
    [1, 2, 3]
    Nz[])rerOs r*�arrayrl�s���{�����:�:�r,�is_super_table�bool | Nonerc�V�tt��t��d|��S)aFCreate an empty table.

    :param is_super_table: if true, the table is a super table

    :Example:

    >>> doc = document()
    >>> foo = table(True)
    >>> bar = table()
    >>> bar.update({'x': 1})
    >>> foo.append('bar', bar)
    >>> doc.append('foo', foo)
    >>> print(doc.as_string())
    [foo.bar]
    x = 1
    F)rrr)rms r*�tablerp�s ��"����f�h�h��~�>�>�>r,rc�V�tt��t��d���S)z�Create an inline table.

    :Example:

    >>> table = inline_table()
    >>> table.update({'x': 1, 'y': 2})
    >>> print(table.as_string())
    {x = 1, y = 2}
    T)�new)rrrrIr,r*�inline_tablers�s!���y�{�{�F�H�H�$�7�7�7�7r,rc� �tg��S)z�Create an array of table.

    :Example:

    >>> doc = document()
    >>> aot = aot()
    >>> aot.append(item({'x': 1}))
    >>> doc.append('foo', aot)
    >>> print(doc.as_string())
    [[foo]]
    x = 1
    r
rIr,r*�aotru�s���r�7�7�Nr,�k�str | Iterable[str]rc�|�t|t��rt|��Std�|D����S)aCreate a key from a string. When a list of string is given,
    it will create a dotted key.

    :Example:

    >>> doc = document()
    >>> doc.append(key('foo'), 1)
    >>> doc.append(key(['bar', 'baz']), 2)
    >>> print(doc.as_string())
    foo = 1
    bar.baz = 2
    c�,�g|]}t|����SrI)�key)�.0�_ks  r*�
<listcomp>zkey.<locals>.<listcomp>�s��*�*�*�"�c�"�g�g�*�*�*r,)r3r0rr)rvs r*rzrz�s?���!�S������|�|���*�*��*�*�*�+�+�+r,�_Itemc��t|��}|���}|���s!|�t|j����|S)z�Parse a simple value from a string.

    :Example:

    >>> value("1")
    1
    >>> value("true")
    True
    >>> value("[1, 2, 3]")
    [1, 2, 3]
    )�char)r!�_parse_value�end�parse_errorr	�_current)rK�parser�vs   r*rere�sR���C�[�[�F������A��:�:�<�<�L�� � �!4�6�?� �K�K�K��Hr,�src�tuple[Key, _Item]c�D�t|�����S)zkParse a key-value pair from a string.

    :Example:

    >>> key_value("foo = 1")
    (Key('foo'), 1)
    )r!�_parse_key_value�r�s r*�	key_valuer�s���#�;�;�'�'�)�)�)r,rc�$�t|d���S)z"Create a whitespace from a string.T)�fixedrr�s r*�wsr�s���c��&�&�&�&r,c� �td��S)zCreate a newline item.�
)r�rIr,r*�nlr�s
��
�d�8�8�Or,rc�D�ttdd|z�����S)zCreate a comment item.z  z# )�
comment_ws�comment)rrr)s r*r�r�s!���6�T�4�&�=�A�A�A�B�B�Br,)r$r%r&r#)F)r-rr.r/r&r0)r<r=r&r#)r-rr<rBr.r/r&rC)r&r#)rKrLr&r)rKrQr&r)rKr0r&r
)
rKr0rXr/rYr/rZr/r&r)rKr0r&r)rKr0r&r)rKr0r&r)N)rKr0r&r)rmrnr&r)r&r)r&r)rvrwr&r)rKr0r&r~)r�r0r&r�)r�r0r&r)r&r)r$r0r&r)@�
__future__rrjra�collections.abcr�typingrr�tomlkit._utilsr�tomlkit.containerr�tomlkit.exceptionsr	�
tomlkit.itemsrrr
rrrrrrrrr~rrrrr\rrrrr �tomlkit.parserr!�tomlkit.toml_documentr#r+r;r@rFr(rJrPrTrWr$rbrhrlrprsrurzrer�r�r�r�rIr,r*�<module>r�s+��"�"�"�"�"�"�����#�#�#�#�#�#�������������(�(�(�(�(�(�'�'�'�'�'�'�2�2�2�2�2�2�������������������!�!�!�!�!�!�������"�"�"�"�"�"�#�#�#�#�#�#�������%�%�%�%�%�%�!�!�!�!�!�!�'�'�'�'�'�'�������#�#�#�#�#�#� � � � � � �3�3�3�3�3�3������������� � � � � � �$�$�$�$�$�$�������!�!�!�!�!�!�.�.�.�.�.�.�����
%�
%�
%�
%�
%� ����;@�/�/�/�/�/�/�"�"�"�"���������
����
�������/�/�/�/�/�/�0�����������������$?�?�?�?�?�(
8�
8�
8�
8�
�
�
�
� ,�,�,�,�$
�
�
�
�&*�*�*�*�'�'�'�'�
����
C�C�C�C�C�Cr,

Zerion Mini Shell 1.0