Your IP : 216.73.216.196


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

B

���UB�@s�dZddlmZddlmZddlZddlZddlmZddlmZye	Wne
k
rdeZ	YnXdd�Zd	d
�Z
dd�Zd
d�Zdd�ZdS)zF
clint.utils
~~~~~~~~~~~~

Various Python helpers used within clint.

�)�absolute_import)�with_statementN)�makedirs)�globcCsxg}tj�|�}tj�|�}tj�|�rfxJt�|�D],\}}}x |D]}|�tj�||��qDWq4Wn|�t	|��|S)z,Expands directories and globs in given path.)
�os�path�
expanduser�
expandvars�isdir�walk�append�join�extendr)r�paths�dir�dirs�files�file�r�</opt/alt/python37/lib/python3.7/site-packages/clint/utils.py�expand_paths
rcCst|t�rdSt|d�S)z8Tests if an object is a collection. Strings don't count.F�__getitem__)�
isinstance�
basestring�hasattr)�objrrr�
is_collection+s
rc
CsDyt|�Wn2tk
r>}z|jtjkr,n�Wdd}~XYnXdS)zEmulates `mkdir -p` behavior.N)r�OSError�errno�EEXIST)r�excrrr�mkdir_p4sr!cCsNt|�}t|�dkr|gS|d}x |dd�D]}|�||�}q0W|�|�S)z4Behaves str.split but supports tuples of delimiters.�rN)�tuple�len�replace�split)�string�
delimiters�final_delimiter�irrr�tsplit>sr+cs ��fdd�tdt����D�S)z"Splits string into n sized chunks.csg|]}�||���qSrr)�.0r*)�sizer'rr�
<listcomp>Kszschunk.<locals>.<listcomp>r)�ranger$)r'r-r)r-r'r�schunkIsr0)�__doc__�
__future__rrr�os.pathrrrr�	NameError�strrrr!r+r0rrrr�<module>	s