File: //opt/alt/python37/lib/python3.7/site-packages/pip/_vendor/toml/__pycache__/encoder.cpython-37.pyc
B
�u|���sK� @ s� d dl Z d dlZd dlZd dlmZ d dlmZ ejdkr>eZ ddd�Z
ddd�Zd d
� Zdd� Z
d
d� ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZdS )� N)�Decimal)�InlineTableDict)� c C s( |j std��t| |d�}|� |� |S )a 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
z0You can only dump an object to a file descriptor)�encoder)�write� TypeError�dumps)�o�fr �d� r ��/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el9.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_vendor/toml/encoder.py�dump s
r c C s d}|dkrt | j�}|�| d�\}}||7 }t| �g}x�|�r
dd� |D �}x|D ]}||krTtd��qTW ||7 }|�� }x�|D ]~} |�|| | �\}}
|s�|s�|
s�|r�|dd� dkr�|d7 }|d | d
7 }|r�||7 }x |
D ]}|
| || d | <