Ñò
WÉëPc           @   sO   d  Z  d d k Z d d k Z d Z e i d ƒ Z d „  Z d e d „ Z	 d S(   s6   Shared utility functions for scanning directory trees.iÿÿÿÿNs   nnaze@google.com (Nathan Naze)s   ^.+\.js$c         C   s   t  |  d t ƒS(   s¤   Scans a directory tree for JavaScript files.

  Args:
    root: str, Path to a root directory.

  Returns:
    An iterable of paths to JS files, relative to cwd.
  t   path_filter(   t   ScanTreet   _JS_FILE_REGEX(   t   root(    (    s?   /home/yoya/public_html/js/mid.js/closure-primitives/treescan.pyt   ScanTreeForJsFiles   s    	c   
      c   sã   d „  } xÓ t  i |  d | ƒD]¼ \ } } } x6 | D]. } | o! | i d ƒ o | i | ƒ q5 q5 Wxq | D]i } | o | i d ƒ o qn n t  i i | | ƒ }	 | o | i |	 ƒ o qn n t  i i |	 ƒ Vqn Wq Wd S(   sz  Scans a directory tree for files.

  Args:
    root: str, Path to a root directory.
    path_filter: A regular expression filter.  If set, only paths matching
      the path_filter are returned.
    ignore_hidden: If True, do not follow or return hidden directories or files
      (those starting with a '.' character).

  Yields:
    A string path to files, relative to cwd.
  c         S   s
   |  ‚ d  S(   N(    (   t   os_error(    (    s?   /home/yoya/public_html/js/mid.js/closure-primitives/treescan.pyt   OnError9   s    t   onerrort   .N(   t   ost   walkt
   startswitht   removet   patht   joint   matcht   normpath(
   R   R    t   ignore_hiddenR   t   dirpatht   dirnamest	   filenamest   dirnamet   filenamet   fullpath(    (    s?   /home/yoya/public_html/js/mid.js/closure-primitives/treescan.pyR   +   s    	   (
   t   __doc__R	   t   ret
   __author__t   compileR   R   t   Nonet   TrueR   (    (    (    s?   /home/yoya/public_html/js/mid.js/closure-primitives/treescan.pyt   <module>   s   	