File: //home/arjun/projects/env/lib/python3.10/site-packages/pathlib_mate/mate_tool_box.pyc
�
�´ac @ sz d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d e f d � � YZ
d S( i����Ni ( t all_true( t repr_data_size( t
ToolBoxZipt ToolBoxc B s� e Z d � Z e d � � Z e d � � Z e d � � Z e d � Z e d � Z
d d � Z d d � Z d d � Z
e d
� Z e d � Z d � Z d d
� Z d � d � Z d � Z RS( c C se | � } xO | j d t � D]; } | j t | � j d � � | j | j j d � � q W| j � S( Nt recursives utf-8( t select_filet Truet updatet strt encodet md5t hexdigest( t selft hash_metht mt p( ( s pathlib_mate/mate_tool_box.pyt get_dir_fingerprint s
c C s | j t j � S( N( R t hashlibR
( R ( ( s pathlib_mate/mate_tool_box.pyt dir_md5 s c C s | j t j � S( N( R R t sha256( R ( ( s pathlib_mate/mate_tool_box.pyt
dir_sha256 s c C s | j t j � S( N( R R t sha512( R ( ( s pathlib_mate/mate_tool_box.pyt
dir_sha512 s c C s� | j � r� | j � r% | j d k S| j � r~ | rY t t | j d t � � � d k St t | j d t � � � d k Sq� d | } t | � � n t d | � � d S( s�
- If it's a file, check if it is a empty file. (0 bytes content)
- If it's a directory, check if there's no file and dir in it.
But if ``strict = False``, then only check if there's no file in it.
:param strict: only useful when it is a directory. if True, only
return True if this dir has no dir and file. if False, return True
if it doesn't have any file.
i R s5 '%s' is not either file or directory! (maybe simlink)s '%s' not exists!N(
t existst is_filet sizet is_dirt lent listt selectR R t EnvironmentError( R t strictt msg( ( s pathlib_mate/mate_tool_box.pyt is_empty! s
"%
c s | j � | j j � � | r0 � f d � } n � f d � } t � } | j � r� | j | � x� | j | j d t � � D] } | j | � q} Wnm | j } | j � r� xU | j | j d t � � D]% } | | j � r� | j | � q� q� Wn t d | � � | S( s�
A command line auto complete similar behavior. Find all item with same
prefix of this one.
:param case_sensitive: toggle if it is case sensitive.
:return: list of :class:`pathlib_mate.pathlib2.Path`.
c s
| j � � S( N( t
startswith( t basename( t
self_basename( s pathlib_mate/mate_tool_box.pyt matchD s c s | j � j � � S( N( t lowerR"