File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/output/__pycache__/table_out.cpython-310.pyc
Back
o ;j�1 � @ sV d Z ddlZddlmZ ddlZddlZddlZdZdd� Z G dd� d�Z d d � ZdS )a� Display output in a table format ================================= .. versionadded:: 2017.7.0 The ``table`` outputter displays a sequence of rows as table. Example output: .. code-block:: text edge01.bjm01: ---------- comment: ---------- out: ---------- ______________________________________________________________________________ | Active | Interface | Last Move | Mac | Moves | Static | Vlan | ______________________________________________________________________________ | True | ae1.900 | 0.0 | 40:A6:77:5A:50:01 | 0 | False | 111 | ______________________________________________________________________________ | True | ae1.111 | 0.0 | 64:16:8D:32:26:58 | 0 | False | 111 | ______________________________________________________________________________ | True | ae1.111 | 0.0 | 8C:60:4F:73:2D:57 | 0 | False | 111 | ______________________________________________________________________________ | True | ae1.111 | 0.0 | 8C:60:4F:73:2D:7C | 0 | False | 111 | ______________________________________________________________________________ | True | ae1.222 | 0.0 | 8C:60:4F:73:2D:57 | 0 | False | 222 | ______________________________________________________________________________ | True | ae1.222 | 0.0 | F4:0F:1B:76:9D:97 | 0 | False | 222 | ______________________________________________________________________________ result: ---------- CLI Example: .. code-block:: bash salt '*' foo.bar --out=table � N)�reduce�tablec C s t S �N)�__virtualname__� r r �I/opt/saltstack/salt/lib/python3.10/site-packages/salt/output/table_out.py�__virtual__7 s r c @ sj e Zd ZdZejejejd�Z ddd�Z ddd�Z dd� Zdd� Zdd� Z ddd�Zd S )�TableDisplayz+ Manage the table display content. )�center�right�leftT�-� | r �| � |�2 Nc C s� | j �tjj�t�d�t�d��� t�dd�| _|| _ || _ || _|| _|| _ || _|| _|| _| r7t| �s=| j| _d S | | _d S )N�colorZcolor_theme�strip_colorsT)�__dict__�update�salt�utilsr Z get_colors�__opts__�getr � has_header� row_delimiter�delim�justify� separate_rows�prefix�suffix�width�callable�wrap_onspace�wrapfunc) �selfr r r r r r r r! r$ r r r �__init__F s"