U
    d?                     @   s   d Z G dd dZdS )zQTablib - Jira table export support.

   Generates a Jira table from the dataset.
c                   @   sB   e Zd ZdZedd Zedd Zedd Zedd	d
ZdS )
JIRAFormatZjirac                 C   s6   |j r| |j nd}| |}|r2| d| S |S )a  Formats the dataset according to the Jira table syntax:

        ||heading 1||heading 2||heading 3||
        |col A1|col A2|col A3|
        |col B1|col B2|col B3|

        :param dataset: dataset to serialize
        :type dataset: tablib.core.Dataset
         
)headers_get_header	_get_body)clsdatasetheaderbody r   8/tmp/pip-unpacked-wheel-_3ph8cfy/tablib/formats/_jira.py
export_set
   s    
zJIRAFormat.export_setc                    s   d  fdd|D S )Nr   c                    s   g | ]}  |qS r   _serialize_row).0rowr   r   r   
<listcomp>   s     z(JIRAFormat._get_body.<locals>.<listcomp>)join)r   r   r   r   r   r      s    zJIRAFormat._get_bodyc                 C   s   | j |ddS )Nz||)	delimiterr   )r   r   r   r   r   r      s    zJIRAFormat._get_header|c                 C   s   d ||dd |D |S )Nz{}{}{}c                 S   s   g | ]}|rt |nd qS ) )str)r   itemr   r   r   r   &   s     z-JIRAFormat._serialize_row.<locals>.<listcomp>)formatr   )r   r   r   r   r   r   r   "   s
    zJIRAFormat._serialize_rowN)r   )	__name__
__module____qualname__titleclassmethodr   r   r   r   r   r   r   r   r      s   


r   N)__doc__r   r   r   r   r   <module>   s   