N
u9c       s+    d  Z    d Z  d Z  d Z  e e Z  d Z  e d d Z  d Z  d Z   x, e	 d	  d
   r Z
   e e e
  Z qr W! e e d   e e e d  d Z " e e d   e e e d  d Z # e e d   e e e d  d Z $ [
 ' e Z ( e Z ) e Z * e Z - d   Z 9 d   Z E d   Z R d   Z _ d   Z j d   Z x e d
 d  Z  e d
 d  Z  d d  Z  d d  Z  d
 e d  Z   d
 e d  Z!  d
 e d  Z" d
 e d  Z# .d
 e d  Z$ Ih  h  d  <Z% Le Z& Md!   Z' ld# d"  Z( d# d$  Z) d%   Z* d&   Z+ d'   Z, d(   Z- d* d)  Z. d d+  Z/ 
d,   Z0 e d-  Z1 !e Z2 "d.   Z3 6d
 d/  Z4 Fy Gk5 l6 He e Z Wn Ie7 j
 o
 Jn Xd0 S(1   s8  Common string manipulations.

Public module variables:

whitespace -- a string containing all characters considered whitespace
lowercase -- a string containing all characters considered lowercase letters
uppercase -- a string containing all characters considered uppercase letters
letters -- a string containing all characters considered letters
digits -- a string containing all characters considered decimal digits
hexdigits -- a string containing all characters considered hexadecimal digits
octdigits -- a string containing all characters considered octal digits

s    	
s   abcdefghijklmnopqrstuvwxyzs   ABCDEFGHIJKLMNOPQRSTUVWXYZs
   0123456789s   abcdefs   ABCDEFs   01234567s    i   i    s   As   Zi   s   as   zc    sJ   - 2 3 d } 4 x* |  d 4 r } 5 | t t |  } q W6 | Sd S(   sM   lower(s) -> string

	Return a copy of the string s converted to lowercase.

	s    i    N(   s   ress   ss   cs   _lowers   ord(   s   ss   ress   cs*   /usr/lib/python1.5/site-packages/string.pys   lower- s   	 	c    sJ   9 > ? d } @ x* |  d @ r } A | t t |  } q WB | Sd S(   sM   upper(s) -> string

	Return a copy of the string s converted to uppercase.

	s    i    N(   s   ress   ss   cs   _uppers   ord(   s   ss   ress   cs*   /usr/lib/python1.5/site-packages/string.pys   upper9 s   	 	c    sJ   E K L d } M x* |  d M r } N | t t |  } q WO | Sd S(   s{   swapcase(s) -> string

	Return a copy of the string s with upper case characters
	converted to lowercase and vice versa.

	s    i    N(   s   ress   ss   cs	   _swapcases   ord(   s   ss   ress   cs*   /usr/lib/python1.5/site-packages/string.pys   swapcaseE s   	 	c    s   R X Y d t  |   f \ } } Z x3 Z | | j  o |  | t j o Z | d } q' W[ x7 [ | | j  o |  | d t j o [ | d } q` W\ |  | | !Sd S(   sd   strip(s) -> string

	Return a copy of the string s with leading and trailing
	whitespace removed.

	i    i   N(   s   lens   ss   is   js
   whitespace(   s   ss   is   js*   /usr/lib/python1.5/site-packages/string.pys   stripR s    !  % c    sl   _ d e d t  |   f \ } } f x3 f | | j  o |  | t j o f | d } q' Wg |  | | !Sd S(   sW   lstrip(s) -> string

	Return a copy of the string s with leading whitespace removed.

	i    i   N(   s   lens   ss   is   js
   whitespace(   s   ss   is   js*   /usr/lib/python1.5/site-packages/string.pys   lstrip_ s    ! c    sp   j p q d t  |   f \ } } r x7 r | | j  o |  | d t j o r | d } q' Ws |  | | !Sd S(   sY   rstrip(s) -> string

	Return a copy of the string s with trailing whitespace
	removed.

	i    i   N(   s   lens   ss   is   js
   whitespace(   s   ss   is   js*   /usr/lib/python1.5/site-packages/string.pys   rstripj s    % c    s  x   | t j	 o  t |  | |  Sn  g  }  d t |   f \ } }  | d j o  | } n  d }  x | | j  o  x3  | | j  o |  | t
 j o  | d } q W | | j o  Pn  | | j o  | i |  |   Pn  | }  x3  | | j  o |  | t
 j o  | d } qW | d }  | i |  | | !  | } q} W | Sd S(   sD  split(str [,sep [,maxsplit]]) -> list of strings

	Return a list of the words in the string s, using sep as the
	delimiter string.  If maxsplit is nonzero, splits into at most
	maxsplit words If sep is not specified, any whitespace string
	is a separator.  Maxsplit defaults to 0.

	(split and splitfields are synonymous)

	i    i   N(   s   seps   Nones   splitfieldss   ss   maxsplits   ress   lens   is   ns   counts
   whitespaces   appends   j(   s   ss   seps   maxsplits   ress   is   ns   counts   js*   /usr/lib/python1.5/site-packages/string.pys   splitx s4   
 	 	  !  	 ! c 	   s\     | t j o  t |  t |  Sn  g  }  t |  }  | d j o  |  g Sn  t |   }  | d j o  | } n  d } }  d }  x  | | | j o}  |  | | | !| j oQ  | d }  | i |  | | !  | | } }  | | j o  Pn n  | d } q W | i |  |   | Sd S(   sJ  splitfields(str [,sep [,maxsplit]]) -> list of strings

	Return a list of the words in the string s, using sep as the
	delimiter string.  If maxsplit is nonzero, splits into at most
	maxsplit words If sep is not specified, any whitespace string
	is a separator.  Maxsplit defaults to 0.

	(split and splitfields are synonymous)

	i    i   N(   s   seps   Nones   splits   ss   maxsplits   ress   lens   nseps   nss   is   js   counts   append(	   s   ss   seps   maxsplits   ress   nseps   nss   is   js   counts*   /usr/lib/python1.5/site-packages/string.pys   splitfields s.   
 	 	  c    s      t  |  |  Sd S(   s   join(list [,sep]) -> string

	Return a string composed of the words in list, with
	intervening occurences of sep.  Sep defaults to a single
	space.

	(joinfields and join are synonymous)

	N(   s
   joinfieldss   wordss   sep(   s   wordss   seps*   /usr/lib/python1.5/site-packages/string.pys   join s   	s    c    sN      d }  x$ |  d  r }  | | | } q W | t |  Sd S(   s   joinfields(list [,sep]) -> string

	Return a string composed of the words in list, with
	intervening occurences of sep.  The default separator is a
	single space.

	(joinfields and join are synonymous)

	s    i    N(   s   ress   wordss   ws   seps   len(   s   wordss   seps   ress   ws*   /usr/lib/python1.5/site-packages/string.pys
   joinfields s   		 	c    sl      | t j o  t |   } n  t |  | | |  }  | d j  o  t d  n  | Sd S(   s   index(s, sub [,start [,end]]) -> int

	Return the lowest index in s where substring sub is found,
	such that sub is contained within s[start,end].  Optional
	arguments start and end are interpreted as in slice notation.

	Raise ValueError if not found.

	i    s#   substring not found in string.indexN(	   s   lasts   Nones   lens   ss   finds   subs   is   ress
   ValueError(   s   ss   subs   is   lasts   ress*   /usr/lib/python1.5/site-packages/string.pys   index s   	 c    sl      | t j o  t |   } n  t |  | | |  }  | d j  o  t d  n  | Sd S(   s  rindex(s, sub [,start [,end]]) -> int

	Return the highest index in s where substring sub is found,
	such that sub is contained within s[start,end].  Optional
	arguments start and end are interpreted as in slice notation.

	Raise ValueError if not found.

	i    s#   substring not found in string.indexN(	   s   lasts   Nones   lens   ss   rfinds   subs   is   ress
   ValueError(   s   ss   subs   is   lasts   ress*   /usr/lib/python1.5/site-packages/string.pys   rindex s   	 c    sW     t  |   }  | t j o | } nH | d j  o t d | |  } n | | j o | } n | d j  o t d | |  } n t  |  } | d | } 	| d j o 	| | Sn 
d } x[ | | j  oJ | |  | | | !j o | d } | | } n | d } q W| Sd S(   s   count(s, sub[, start[,end]]) -> int

	Return the number of occurrences of substring sub in string
	s[start:end].  Optional arguments start and end are
	interpreted as in slice notation.

	i    i   N(   s   lens   ss   Slens   lasts   Nones   maxs   is   subs   ns   ms   r(   s   ss   subs   is   lasts   Slens   ns   ms   rs*   /usr/lib/python1.5/site-packages/string.pys   count s,     	 c    s  t  |   } | t j o  | } nH !| d j  o "t d | |  } n #| | j o $| } n %| d j  o %t d | |  } n &t  |  } '| d | } (xH (| | j  o7 )| |  | | | !j o )| Sn *| d } q W+d Sd S(   s   find(s, sub [,start [,end]]) -> in

	Return the lowest index in s where substring sub is found,
	such that sub is contained within s[start,end].  Optional
	arguments start and end are interpreted as in slice notation.

	Return -1 on failure.

	i    i   N(
   s   lens   ss   Slens   lasts   Nones   maxs   is   subs   ns   m(   s   ss   subs   is   lasts   Slens   ns   ms*   /usr/lib/python1.5/site-packages/string.pys   finds$   	   c    s(  .78t  |   } 9| t j o :| } nH ;| d j  o <t d | |  } n =| | j o >| } n ?| d j  o ?t d | |  } n @t  |  } A| d | } Bd } CxJ C| | j  o9 D| |  | | | !j o D| } n E| d } q WF| Sd S(   s   rfind(s, sub [,start [,end]]) -> int

	Return the highest index in s where substring sub is found,
	such that sub is contained within s[start,end].  Optional
	arguments start and end are interpreted as in slice notation.

	Return -1 on failure.

	i    i   N(   s   lens   ss   Slens   lasts   Nones   maxs   is   subs   ns   ms   r(   s   ss   subs   is   lasts   Slens   ns   ms   rs*   /usr/lib/python1.5/site-packages/string.pys   rfind.s&   	 
  s   __builtins__c    s  MRSTt  t j o? Vy Wk } Wn Xt j
 o Yd a  n X[| a  n \d } ]t |   } ^| o | d d j o _| d } `| d } n a| o bt d  n cxJ c| d d j o! t	 |  d j o | d t
 j o c| d } q Wdt  o t  i d |  o et d  n fy gt t | | t   SWn" ht j
 o it d  n Xd S(	   sS   atof(s) -> float

	Return the floating point number represented by the string s.

	i    s    s   +-i   s!   non-float argument to string.atofs   0s$   [0-9]*(\.[0-9]*)?([eE][-+]?[0-9]+)?$N(   s   _res   Nones   res   ImportErrors   signs   strips   strs   ss
   ValueErrors   lens   digitss   matchs   floats   evals	   _safe_envs   SyntaxError(   s   strs   res   signs   ss*   /usr/lib/python1.5/site-packages/string.pys   atofMs0   	 8 c    s"  lvw| d j o yt d  n zd } {t |   } || o | d d j o }| d } ~| d } n | o t d  n x9 | d d j o t |  d j o | d } q Wx3 | d r& } | t j o t d  n q Wt	 | | t
  Sd	 S(
   s^  atoi(s [,base]) -> int

	Return the integer represented by the string s in the given
	base, which defaults to 10.  The string s must consist of one
	or more digits, possibly preceded by a sign.  If base is 0, it
	is chosen from the leading characters of s, 0 for octal, 0x or
	0X for hexadecimal.  If base is 16, a preceding 0x or 0X is
	accepted.

	i
   s+   this string.atoi doesn't support base != 10s    i    s   +-i   s#   non-integer argument to string.atois   0N(   s   bases
   ValueErrors   signs   strips   strs   ss   lens   cs   digitss   evals	   _safe_env(   s   strs   bases   signs   ss   cs*   /usr/lib/python1.5/site-packages/string.pys   atoils$   
	 '  	i
   c    s&  | d j o t d  n d } t |   } | o | d d j o | d } | d } n | o t d  n x9 | d d j o t |  d j o | d } q Wx3 | d r& } | t j o t d  n q Wt	 | | d	 t
  Sd
 S(   s  atol(s [,base]) -> long

	Return the long integer represented by the string s in the
	given base, which defaults to 10.  The string s must consist
	of one or more digits, possibly preceded by a sign.  If base
	is 0, it is chosen from the leading characters of s, 0 for
	octal, 0x or 0X for hexadecimal.  If base is 16, a preceding
	0x or 0X is accepted.  A trailing L or l is not accepted,
	unless base is 0.

	i
   s+   this string.atol doesn't support base != 10s    i    s   +-i   s#   non-integer argument to string.atols   0s   LN(   s   bases
   ValueErrors   signs   strips   strs   ss   lens   cs   digitss   evals	   _safe_env(   s   strs   bases   signs   ss   cs*   /usr/lib/python1.5/site-packages/string.pys   atols$   	 '  	c    sG   | t |   } | d j o |  Sn |  d | Sd S(   s   ljust(s, width) -> string

	Return a left-justified version of s, in a field of the
	specified width, padded with spaces as needed.  The string is
	never truncated.

	i    s    N(   s   widths   lens   ss   n(   s   ss   widths   ns*   /usr/lib/python1.5/site-packages/string.pys   ljusts
    c    sG   | t |   } | d j o |  Sn d | |  Sd S(   s   rjust(s, width) -> string

	Return a right-justified version of s, in a field of the
	specified width, padded with spaces as needed.  The string is
	never truncated.

	i    s    N(   s   widths   lens   ss   n(   s   ss   widths   ns*   /usr/lib/python1.5/site-packages/string.pys   rjusts
    c    s   | t |   } | d j o |  Sn | d } | d o | d o | d } n d | |  d | | Sd S(   s   center(s, width) -> string

	Return a center version of s, in a field of the specified
	width. padded with spaces as needed.  The string is never
	truncated.

	i    i   i   s    N(   s   widths   lens   ss   ns   half(   s   ss   widths   ns   halfs*   /usr/lib/python1.5/site-packages/string.pys   centers    c    s   t  |   t  d  j o |  } n |  } t |  } | | j o | Sn d } | d d d f j o! | d | d f \ } } n | d | | | Sd S(   s   zfill(x, width) -> string

	Pad a numeric string x with zeros on the left, to fill a field
	of the specified width.  The string x is never truncated.

	s    i    s   -s   +i   s   0N(   s   types   xs   ss   lens   ns   widths   sign(   s   xs   widths   ss   ns   signs*   /usr/lib/python1.5/site-packages/string.pys   zfills    
 	!c    s   d } } xy |  d rl } | d j o d | t |  | } n | | } | d j o | | } d } n q W| | Sd S(   s   expandtabs(s [,tabsize]) -> string

	Return a copy of the string s with all tab characters replaced
	by the appropriate number of spaces, depending on the current
	column, and the tabsize (default 8).

	s    i    s   	s    s   
N(   s   ress   lines   ss   cs   tabsizes   len(   s   ss   tabsizes   ress   lines   cs*   /usr/lib/python1.5/site-packages/string.pys
   expandtabss    	i   c    s    t  |  t  d  j p t |  d j o t d  n d } x> |  d r1 } | | j o | | t |  } n qZ W| Sd S(   s  translate(s,table [,deletechars]) -> string

	Return a copy of the string s, where all characters occurring
	in the optional argument deletechars are removed, and the
	remaining characters have been mapped through the given
	translation table, which must be a string of length 256.

	s    i   s-   translation table must be 256 characters longi    N(	   s   types   tables   lens	   TypeErrors   ress   ss   cs	   deletionss   ord(   s   ss   tables	   deletionss   ress   cs*   /usr/lib/python1.5/site-packages/string.pys	   translates   /	 	c    s)   
t  |  d   t |  d  Sd S(   sf   capitalize(s) -> string

	Return a copy of the string s with only its first character
	capitalized.

	i   N(   s   uppers   ss   lower(   s   ss*   /usr/lib/python1.5/site-packages/string.pys
   capitalize
s   c    s3   t  t t t |  |   | p d  Sd S(   s   capwords(s, [sep]) -> string

	Split the argument into words using split, capitalize each
	word using capitalize, and join the capitalized words using
	join. Note that this replaces runs of whitespace characters by
	a single space.

	s    N(   s   joins   maps
   capitalizes   splits   ss   sep(   s   ss   seps*   /usr/lib/python1.5/site-packages/string.pys   capwordss   c    s   ")*t  |   t  |  j o +t d  n ,-t o .t t t  a n /t } 0t t	 |   }  1x4 t
 t  |    d 1r } 2| | | |  | <q W3t | d  Sd S(   s   maketrans(frm, to) -> string

	Return a translation table (a string of 256 bytes long)
	suitable for use in string.translate.  The strings frm and to
	must be of the same length.

	s)   maketrans arguments must have same lengthi    s    N(   s   lens   fromstrs   tostrs
   ValueErrors   _idmapLs   maps   Nones   _idmaps   Ls   ords   ranges   is
   joinfields(   s   fromstrs   tostrs   Ls   is*   /usr/lib/python1.5/site-packages/string.pys	   maketrans"s   
 	c    s&   6=>t  t |  | |  |  Sd S(   s   replace (str, old, new[, maxsplit]) -> string

	Return a copy of string str with all occurrences of substring
	old replaced by new. If the optional argument maxsplit is
	given, only the first maxsplit occurrences are replaced.

	N(   s
   joinfieldss   splitfieldss   strs   olds   maxsplits   new(   s   strs   olds   news   maxsplits*   /usr/lib/python1.5/site-packages/string.pys   replace6s   N(8   s   __doc__s
   whitespaces	   lowercases	   uppercases   letterss   digitss	   hexdigitss	   octdigitss   _idmaps   ranges   is   chrs   ords   _lowers   _uppers	   _swapcases
   ValueErrors   index_errors
   atoi_errors
   atof_errors
   atol_errors   lowers   uppers   swapcases   strips   lstrips   rstrips   Nones   splits   splitfieldss   joins
   joinfieldss   indexs   rindexs   counts   finds   rfinds	   _safe_envs   _res   atofs   atois   atols   ljusts   rjusts   centers   zfills
   expandtabss	   translates
   capitalizes   capwordss   _idmapLs	   maketranss   replaces   strops   *s   ImportError(    s*   /usr/lib/python1.5/site-packages/string.pys   ? sn   						 	 )))				  		
