Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/clint/textui/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/clint/textui/__pycache__/cols.cpython-37.pyc

B

���U�@sddZddlmZddlmZmZddlmZddlZdZ	d	d
�Z
dd�Zd
d�Zdd�Z
dZdZdS)z^
clint.textui.columns
~~~~~~~~~~~~~~~~~~~~

Core TextUI functionality for column formatting.

�)�absolute_import�)�	max_width�	min_width�)�tsplitN)�
�
z
c	Csvddl}ddl}ddl}ddl}|j��s.dS|�ddddd�}|j��}|�||j	|�}|�
d|�dd�\}}|S)Nr�HHHHr)�termios�fcntl�struct�sys�stdout�isatty�pack�fileno�ioctl�
TIOCGWINSZ�unpack)	rrr
r�s�	fd_stdout�size�height�width�r�B/opt/alt/python37/lib/python3.7/site-packages/clint/textui/cols.py�_find_unix_console_widths 

rcCs�ddlm}m}d\}}}|j�|�}|d�}|j�||�}|r�ddl}|�d|j�\}	}
}}}
}}}}}}||d}||d}|SdS)Nr)�windll�create_string_buffer)i����i����i���hhhhHhhhhhhr)	�ctypesrr�kernel32�GetStdHandle�GetConsoleScreenBufferInfor
r�raw)rr�STDIN�STDOUT�STDERR�h�csbi�resr
�bufx�bufy�curx�cury�wattr�left�top�right�bottom�maxx�maxy�sizex�sizeyrrr�_find_windows_console_width%s
$r:cCs<tj�d�rt�}nt�}|�dd�}|r0|}n|s8d}|S)z"Determine console_width.�winrN�P)r�platform�
startswithr:r�get)�kwargs�
console_width�_widthrrrrA8srAcOs�t|�}t|�}d}d}xJt|�D]>\}\}}|dk	r\||d7}t||��d�||d<q"|}q"W|r�||t|�||d<t||d||d��d�||d<ttdd�|D�td��}	xrt|�D]f\}\}
}x*t|	t|
��D]}||d�d�q�Wx,t|
�D] \}}t	||�||d|<�qWq�Wdd�|D�}
g}xDt|	�D]8}d}x"|
D]}|||7}|d	7}�q`W|�|��qRWd�
|�S)
NrrrcSsg|]}|d�qS)rr)�.0�crrr�
<listcomp>aszcolumns.<locals>.<listcomp>)�key�cSsg|]}|d�qS)rr)rCrDrrrrEks� )�listrA�	enumerater�split�len�max�range�appendr�join)�colsr@�columns�cwidth�_big_col�_total_cols�i�stringrr�strings�_�j�stack�_out�_row�colrrrrRKs6( 
	rRz1this is text that goes into a small column
 cool?z&this is other text
othertext
othertext)�__doc__�
__future__r�
formattersrr�utilsrr�NEWLINESrr:rArR�a�brrrr�<module>	s?