ok
Direktori : /opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/toml/ |
Current File : //opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/toml/encoder.pyo |
� Bu�_c @ s d d l Z d d l Z d d l Z d d l m Z d d l m Z e j d k r\ e Z n d d � Z d d � Z d � Z d � Z d � Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d S( i����N( t Decimal( t InlineTableDicti c C s; | j s t d � � n t | d | �} | j | � | S( s Writes out dict as toml to a file Args: o: Object to dump into toml f: File descriptor where the toml should be stored encoder: The ``TomlEncoder`` to use for constructing the output string Returns: String containing the toml corresponding to dictionary Raises: TypeError: When anything other than file descriptor is passed s0 You can only dump an object to a file descriptort encoder( t writet TypeErrort dumps( t ot fR t d( ( sI /opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/toml/encoder.pyt dump s c C s� d } | d k r$ t | j � } n | j | d � \ } } | | 7} t | � g } x$| r{g | D] } t | � ^ qe } x) | D]! } | | k r� t d � � q� q� W| | 7} | j � } x� | D]� } | j | | | � \ } } | s� | rG| rG| r| d d k r| d 7} n | d | d 7} | rG| | 7} qGn x$ | D] } | | | | d | <qNWq� W| } qX W| S( s Stringifies input dict as toml Args: o: Object to dump into toml encoder: The ``TomlEncoder`` to use for constructing the output string Returns: String containing the toml corresponding to dict Examples: ```python >>> import toml >>> output = { ... 'a': "I'm a string", ... 'b': ["I'm", "a", "list"], ... 'c': 2400 ... } >>> toml.dumps(output) 'a = "I'm a string" b = [ "I'm", "a", "list",] c = 2400 ' ``` t s Circular reference detectedi����s s t [s ] t .N( t Nonet TomlEncodert __class__t dump_sectionst idt ValueErrort get_empty_table( R R t retvalt addtoretvalt sectionst outer_objst sectiont section_idst outer_objt newsectionst addtosectionst s( ( sI /opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/toml/encoder.pyR "