ó
á™xTc           @   s¡   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z d  d l m	 Z	 d  d l
 Z
 d  d l Z d „  Z d d	 „ Z e d
 k r� e e
 j d ƒ n  d S(   iÿÿÿÿ(   t   division(   t   detect_binary_file(   t   walk_source_tree(   t   option_parser(   t   show_stringNc            s`   ‡  ‡ f d †  } | r( | r( | ƒ  n4 t  j d ˆ  ƒ } | d  k sR | | k r\ | ƒ  n  d  S(   Nc              s   ˆ r t  ˆ  ƒ GHn ˆ  GHd  S(   N(   R   (    (   t   patht   quote(    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/list_files.pyt   show	   s     t	   file_name(   R   t   from_initial_blockt   None(   R   t   textt   binaryR   R   t   status(    (   R   R   sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/list_files.pyt   show_status   s    
s   libtbx.list_filesc   
      C   s­  t  |  ƒ d k r d g }  n  t d d | d d ƒ j d d d	 d
 d t d d ƒj d d d	 d
 d t d d ƒj d d d	 d
 d t d d ƒj d |  ƒ } | j } | j } | j } | j } | j	 } | pÓ | så t
 } t
 } n  t  | ƒ d k rd g } n  x£ | D]› } t j j | ƒ s8t j d I| IJq
t j j | ƒ rlt d | d | d | d | ƒ q
x6 t d | ƒ D]% }	 t d |	 d | d | d | ƒ q|Wq
Wd  S(   Ni    t   .t   usages   %s [options] path ...t   descriptionsO   Recursively lists all files, excluding CVS and .svn directories and .pyc files.s   -ts   --textt   actiont
   store_truet   defaultt   helps   list text files onlys   -bs   --binarys   list binary files onlys   -qs   --quotes   quote file namest   argss   No such file or directory:R   R   R   R   t   top(   t   lenR   t   optiont   Falset   processR   t   optionsR   R   R   t   Truet   osR   t   existst   syst   stderrt   isfileR   R   (
   R   t   command_namet   command_linet   pathst   coR   R   R   R   t	   file_path(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/list_files.pyt   run   sF     
													 "t   __main__i   (   t
   __future__R    t   libtbx.utilsR   t   libtbx.pathR   t   libtbx.option_parserR   t   libtbx.str_utilsR   R    R   R   R(   t   __name__t   argv(    (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/list_files.pyt   <module>   s   	%