;ņ
ķü?c           @   sO   d  Z  d k Z d d d d g Z h  Z d   Z d   Z d   Z d	   Z d S(
   s£  Filename matching with shell patterns.

fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.

The functions operate by translating the pattern into a regular
expression.  They cache the compiled regular expressions for speed.

The function translate(PATTERN) returns a regular expression
corresponding to PATTERN.  (It does not compile it.)
Ns   filters   fnmatchs   fnmatchcases	   translatec         C   s>   d k  } | i i |   }  | i i |  } t |  |  Sd S(   s½  Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).
    N(   s   oss   paths   normcases   names   pats   fnmatchcase(   s   names   pats   os(    (    s$   /mit/python/lib/python2.3/fnmatch.pys   fnmatch   s
     	c         C   sī   d k  } d k } g  } | i i |  } | t j o# t |  } t	 i
 |  t | <n t | i } | i | j o3 xk |  D]$ } | |  o | i |  q q Wn< x8 |  D]0 } | | i i |   o | i |  q² q² W| Sd S(   s2   Return the subset of the list NAMES that match PATN(   s   oss	   posixpaths   results   paths   normcases   pats   _caches	   translates   ress   res   compiles   matchs   namess   names   append(   s   namess   pats	   posixpaths   ress   names   results   oss   match(    (    s$   /mit/python/lib/python2.3/fnmatch.pys   filter(   s$       c         C   sL   | t j o# t |  } t i |  t | <n t | i |   t j	 Sd S(   s   Test whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.
    N(	   s   pats   _caches	   translates   ress   res   compiles   matchs   names   None(   s   names   pats   res(    (    s$   /mit/python/lib/python2.3/fnmatch.pys   fnmatchcase<   s
     c         C   sĖ  d t  |   f \ } } d } x| | j  o|  | } | d } | d j o | d } q! | d j o | d } q! | d j o"| } | | j  o |  | d	 j o | d } n | | j  o |  | d
 j o | d } n x- | | j  o |  | d
 j o | d } qę W| | j o | d } qŗ|  | | !i d d  } | d } | d d	 j o d | d } n  | d d j o d | } n d | | f } q! | t	 i
 |  } q! W| d Sd S(   sf   Translate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.
    i    s    i   s   *s   .*s   ?s   .s   [s   !s   ]s   \[s   \s   \\s   ^s   %s[%s]s   $N(   s   lens   pats   is   ns   ress   cs   js   replaces   stuffs   res   escape(   s   pats   cs   is   ress   js   ns   stuff(    (    s$   /mit/python/lib/python2.3/fnmatch.pys	   translateH   s>      

 
(   s   __doc__s   res   __all__s   _caches   fnmatchs   filters   fnmatchcases	   translate(   s   __all__s   fnmatchcases   filters   res   fnmatchs   _caches	   translate(    (    s$   /mit/python/lib/python2.3/fnmatch.pys   ?   s   				