Dashboard
PHP:
8.2.30
OS:
Linux
User:
dh_nv8b2m
/
/
usr
/
lib
/
python3
/
dist-packages
/
docutils
/
parsers
/
rst
/
directives
/
__pycache__
📤 Upload
📝 New File
📁 New Folder
Close
Editing: tables.cpython-310.pyc
o �?�]Y � @ s� d Z dZddlZddlZddlZddlmZmZm Z m Z ddlmZ ddl mZ ddlmZ ddlmZ d d � ZG dd� de�ZG d d� de�ZG dd� de�ZG dd� de�ZdS )z Directives for table elements. �reStructuredText� N)�io�nodes�statemachine�utils)� SafeString)�SystemMessagePropagation)� Directive)� directivesc C s t �| d�S )N)�left�center�right)r �choice)�argument� r �H/usr/lib/python3/dist-packages/docutils/parsers/rst/directives/tables.py�align s r c @ sx e Zd ZdZdZdZejeje ej e�dej�d�Z dZdd� Zdd � Zd d� Zdd � Zedd� �Zdd� Zdd� ZdS )�Tablez# Generic table base class. � T)�auto�grid)�class�namer �width�widthsc C sf | j r+| j d }| j�|| j�\}}tj|dg|�R � }| j�| j�\|_|_ ||fS d }g }||fS )Nr � ) � arguments�state�inline_text�linenor �title� state_machine�get_source_and_line�source�line)�self� title_text� text_nodes�messagesr r r r � make_title+ s ���zTable.make_titlec C sX | j �| jd �}g }d}d| jv r(| �| jd �d�| �� |�\}}|�|� ||fS )Nr r �header� )r! � get_sourcer �options�parse_csv_data_into_rows�split� HeaderDialect�extend)r% r# � table_head�max_header_cols�rowsr r r �process_header_option8 s � zTable.process_header_optionc C sB t |�|k r#| jjjd|t |�| jf t�| j| j�| jd�}t |��t |�| kr/dkrMn n| jjjdt |�| jf t�| j| j�| jd�}t |��|D ]O}t |�|k rt| jjjd|t |�| jf t�| j| j�| jd�}t |��t |�| kr�dkr�n qO| jjjdt |�| jf t�| j| j�| jd�}t |��qOd S )NzP%s header row(s) specified but only %s row(s) of data supplied ("%s" directive).�r$ r zeInsufficient data supplied (%s row(s)); no data remaining for table body, required by "%s" directive.zU%s stub column(s) specified but only %s columns(s) of data supplied ("%s" directive).ziInsufficient data supplied (%s columns(s)); no data remaining for table body, required by "%s" directive.) �lenr! �reporter�errorr r � literal_block� block_textr r )r% r4 �header_rows�stub_columnsr9 �rowr r r �check_table_dimensionsC s^ ��������������zTable.check_table_dimensionsc C s"