B
    q\                 @   s\   d Z ddlmZ ddlmZmZmZmZ G dd deZG dd deZ	G dd	 d	eZ
d
S )z1
:Author: Simon Gibbons (simongibbons@gmail.com)
   )DefaultSplitter)
FixedWidthFixedWidthDataFixedWidthHeaderFixedWidthTwoLineDataSplitterc                   s,   e Zd ZdZdZeZdZ fddZ  Z	S )SimpleRSTHeader    r   =c                s$   t  |\}}}d |d< |||fS )N)superget_fixedwidth_params)selflineZvalsZstartsZends)	__class__ 3lib/python3.7/site-packages/astropy/io/ascii/rst.pyr      s    z%SimpleRSTHeader.get_fixedwidth_params)
__name__
__module____qualname__Zposition_line
start_liner   splitter_classZposition_charr   __classcell__r   r   )r   r   r      s
   r   c               @   s   e Zd ZdZdZeZdS )SimpleRSTData   r
   N)r   r   r   r   Zend_liner   r   r   r   r   r   r      s   r   c                   s<   e Zd ZdZdZdZeZeZ	 fddZ
 fddZ  ZS )RSTa
  
    Read or write a `reStructuredText simple format table
    <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#simple-tables>`_.

    Example::

        ==== ===== ======
        Col1  Col2  Col3
        ==== ===== ======
          1    2.3  Hello
          2    4.5  Worlds
        ==== ===== ======

    Currently there is no support for reading tables which utilize continuation lines,
    or for ones which define column spans through the use of an additional
    line of dashes in the header.
    ZrstzreStructuredText simple tablec                s   t  jd dd d S )NF)Zdelimiter_padZbookend)r   __init__)r   )r   r   r   r   8   s    zRST.__init__c                s(   t  |}|d g| |d g }|S )Nr   )r   write)r   lines)r   r   r   r   ;   s    z	RST.write)r   r   r   __doc__Z_format_nameZ_descriptionr   Z
data_classr   Zheader_classr   r   r   r   r   )r   r   r   !   s   r   N)r   Zcorer   Z
fixedwidthr   r   r   r   r   r   r   r   r   r   r   <module>   s
   