
RaΈ2c      sA     d  Z   d   h  Z  d   Z $ d   Z 3 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.)
c   sQ     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   oss   /usr/lib/python1.4/fnmatch.pys   fnmatchc   s   $ ) d  + t  i |  oV , t |  } - k } . | i d  } / | i |  t  | <0 | i |  } n 1 t  | i	 |   t |   j Sd S(   s   Test wheter FILENAME matches PATTERN, including case.
	
	This is a version of fnmatch() which doesn't case-normalize
	its arguments.
	i    N(   s   _caches   has_keys   pats	   translates   ress   regexs
   set_syntaxs   save_syntaxs   compiles   matchs   names   len(   s   names   pats   ress   regexs   save_syntaxs   /usr/lib/python1.4/fnmatch.pys   fnmatchcasec   s  3 7 d  9 d t  |   f \ } } : d } ; xA; | | j  o0< |  | } = | d } > | d j o ? | d } nς@ | d j o A | d } nΡB | d j oC | } D | | j  o |  | d	 j o E | d } n F | | j  o |  | d
 j o G | d } n H x3 H | | j  o |  | d
 j o I | d } q#WJ | | j o K | d } nΔ M |  | | !} N | d } O | d d	 j o P d | d d
 } nm Q | d t  |  j o R d } nF T x. T | d d j o U | d | d } qξWV d | d
 } W | | } n3 X | d j o Y | d | } n [ | | } q4 W\ | Sd S(   sa   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   \N(   s   lens   pats   is   ns   ress   cs   js   stuff(   s   pats   is   ns   ress   cs   js   stuffs   /usr/lib/python1.4/fnmatch.pys	   translateN(   s   __doc__s   _caches   fnmatchs   fnmatchcases	   translate(    s   /usr/lib/python1.4/fnmatch.pys   ?