™N
z£9c       s!    d  Z  ' ( k Z k Z * d Z + e d Z - d „  Z 7 g  Z 8 x€ d d d d f d 8 rg Z 9 e i i	 e ƒ oK : e i
 e i e d	 ƒ Z ; e e e ƒ Z < e d
 „  e ƒ Z = Pn q^ W> d e j o ? e i d ƒ n B d Z C x‰ C e e e ƒ j  or D e d Z E xN E e e e ƒ j  o7 F e e e e j o G e e =n I e d Z q(WJ e d Z qÿ WK [ [ M e i i	 d ƒ o N e i d Z n
 P e Z R [ [ T d Z V d „  Z [ d „  Z ` d „  Z f d d „ Z w d f  d „  ƒ  YZ × e Z Ø h  Z Ú e o| Û d f  d „  ƒ  YZ k Z e e d ƒ o e i Z n
 e Z e e d „ Z e e _ [ [ [ [ n e d „ Z #d „  Z  )d „  Z! -e! Z" /d „  Z# 6d „  Z$ Ge% d j o He$ ƒ  n d S(   sÀ  This module allows python programs to use GNU gettext message catalogs.

Author: James Henstridge <james@daa.com.au>
(This is loosely based on gettext.pl in the GNU gettext distribution)

The best way to use it is like so:
    import gettext
    gettext.bindtextdomain(PACKAGE, LOCALEDIR)
    gettext.textdomain(PACKAGE)
    _ = gettext.gettext
    print _('Hello World')

where PACKAGE is the domain for this package, and LOCALEDIR is usually
'$prefix/share/locale' where $prefix is the install prefix.

If you have more than one catalog to use, you can directly create catalog
objects.  These objects are created as so:
    import gettext
    cat = gettext.Catalog(PACKAGE, localedir=LOCALEDIR)
    _ = cat.gettext
    print _('Hello World')

The catalog object can also be accessed as a dictionary (ie cat['hello']).

There are also some experimental features.  You can add to the catalog, just
as you would with a normal dictionary.  When you are finished, you can call
its save method, which will create a new .mo file containing all the
translations:
    import gettext
    cat = Catalog()
    cat['Hello'] = 'konichiwa'
    cat.save('./tmp.mo')

Once you have written an internationalized program, you can create a .po file
for it with "xgettext --keyword=_ fillename ...".  Then do the translation and
compile it into a .mo file, ready for use with this module.  Note that you
will have to use C style strings (ie. use double quotes) for proper string
extraction.
s
   /usr/locals   /share/localec    s|   - . |  g } 0 d |  j o$ 1 | i t i |  d ƒ d ƒ n 3 t |  ƒ d j o 4 | i |  d  ƒ n 5 | Sd  S(   Ns   .i    i   (   s   strs   langss   appends   strings   splits   len(   s   strs   langss+   /usr/lib/python1.5/site-packages/gettext.pys   _expandLang- s   $s   LANGUAGEs   LC_ALLs   LC_MESSAGESs   LANGi    s   :c    s   < |  | S(   N(   s   as   b(   s   as   bs+   /usr/lib/python1.5/site-packages/gettext.pys   <lambda>< s    s   Ci   s   PY_XGETTEXTs   gettext.errorc    sN   V W t  |  d ƒ t  |  d ƒ d >t  |  d ƒ d >t  |  d ƒ d >Sd  S(   Ni    i   i   i   i   i   i   (   s   ords   str(   s   strs+   /usr/lib/python1.5/site-packages/gettext.pys   _lsbStrToIntV s   c    sN   [ \ t  |  d ƒ d >t  |  d ƒ d >t  |  d ƒ d >t  |  d ƒ Sd  S(   Ni    i   i   i   i   i   i   (   s   ords   str(   s   strs+   /usr/lib/python1.5/site-packages/gettext.pys   _msbStrToInt[ s   c    sN   ` a t  |  d @ƒ t  |  d ?d @ƒ t  |  d ?d @ƒ t  |  d ?d @ƒ Sd  S(   Niÿ   i   i   i   (   s   chrs   int(   s   ints+   /usr/lib/python1.5/site-packages/gettext.pys   _intToLsbStr` s   c    s«   f h i k  } k y l t ‚ Wn% m t j
 o n | i i } n Xo | i } p x. p |  d j o q | i } r |  d }  qY Ws | i d | i i	 | i
 f Sd S(   s|   Returns the position in the code where the function was called.
	The function uses some knowledge about python stack frames.i    i   s   __name__N(   s   syss   RuntimeErrors   exc_tracebacks   tb_frames   frames   f_backs   levelss	   f_globalss   f_codes   co_names   f_lineno(   s   levelss   syss   frames+   /usr/lib/python1.5/site-packages/gettext.pys   _getposf s   	 s   Catalogc      sM   w x e  e d „ Z © d „  Z ° e Z ± e Z ´ d „  Z · d „  Z RS(   Nc    s†  x y | |  _  z | |  _ { h  |  _ | | o | d  Sn } x¢ t d } rŽ |  _ ~ |  i d j o  d  Sn € d | |  i | f } ‚ y/ ƒ t | d ƒ } „ | i ƒ  } … ~ † PWn ‡ t
 j
 o
 ˆ n XqI WŠ d  SŒ t }  | | d  ƒ d j o>  t }  | | d  ƒ d j o ’ t d | f ‚ n n ” | | d d !ƒ |  _ • | | d d	 !ƒ } – | | d	 d
 !ƒ } — | | d
 d !ƒ }	 ˜ xÛ t | ƒ d ˜ rÈ }
 ™ | | | | d !ƒ } › | | | d | d !ƒ }  | d } ž | | | | !}   | | |	 |	 d !ƒ } ¢ | | |	 d |	 d !ƒ } ¤ |	 d }	 ¥ | | | | !} § | |  i | <q³Wd  S(   Ni    s   Cs   %s//%s/LC_MESSAGES/%s.mos   rbi   iÞ•s   Bad magic number in %si   i   i   i   (   s   domains   selfs	   localedirs   cats   langs   catalogs   opens   fs   reads   buffers   IOErrors   _lsbStrToInts   strToInts   _msbStrToInts   errors   revisions   nstringss   origTabOffsets   transTabOffsets   ranges   is
   origLengths
   origOffsets   origStrs   transLengths   transOffsets   transStr(   s   selfs   domains	   localedirs   catalogs   fs   buffers   strToInts   nstringss   origTabOffsets   transTabOffsets   is
   origLengths
   origOffsets   origStrs   transLengths   transOffsets   transStrs+   /usr/lib/python1.5/site-packages/gettext.pys   __init__x sL     		 	c    s9   © ª « |  i i | ƒ o ¬ |  i | Sn ® | Sd S(   s%   Get the translation of a given stringN(   s   selfs   cats   has_keys   string(   s   selfs   strings+   /usr/lib/python1.5/site-packages/gettext.pys   gettext© s   c    s   ´ µ ¶ | |  i | <d S(   s%   Set the translation of a given stringN(   s   transs   selfs   cats   string(   s   selfs   strings   transs+   /usr/lib/python1.5/site-packages/gettext.pys   __setitem__´ s   c    s{  · ¸ ¹ y º t  | d ƒ } Wn* » t j
 o ¼ t d | d ‚ n X½ | i t d ƒ ƒ ¾ | i t d ƒ ƒ ¿ | i t t |  i	 ƒ ƒ ƒ Á g  } d } Â g  } d } Ã xˆ |  i	 i ƒ  d Ã rr \ } } Ä | i t | ƒ t | ƒ f ƒ Å | | d } Æ | i t | ƒ t | ƒ f ƒ Ç | | d } qÊ WÈ d }	 É |	 d	 t | ƒ }
 Ê |
 d	 t | ƒ } Ë | t | ƒ } Ì | i t |	 ƒ ƒ Í | i t |
 ƒ ƒ Î xI | d Î r< \ } } Ï | i t | ƒ ƒ Ð | i t | | ƒ ƒ qÅWÑ xI | d Ñ r< \ } } Ò | i t | ƒ ƒ Ó | i t | | ƒ ƒ qWÔ | i | ƒ Õ | i | ƒ d
 S(   s'   Create a .mo file from a Catalog objects   wbs   can't open s    for writingiÞ•i    s    s    i   i   N(   s   opens   files   fs   IOErrors   errors   writes   _intToLsbStrs   lens   selfs   cats   oIndexs   oDatas   tIndexs   tDatas   itemss   origs   transs   appends	   oIndexOfss	   tIndexOfss   oDataOfss   tDataOfss   lengths   offset(   s   selfs   files   fs   oIndexs   oDatas   tIndexs   tDatas   origs   transs	   oIndexOfss	   tIndexOfss   oDataOfss   tDataOfss   lengths   offsets+   /usr/lib/python1.5/site-packages/gettext.pys   save· s@    ""	  (   s   Nones	   localedirs   __init__s   gettexts   __getitem__s   __call__s   __setitem__s   save(    s+   /usr/lib/python1.5/site-packages/gettext.pys   Catalogw s   1		c      sS   Û Ü d „  Z  à d „  Z ê e Z ë e Z ì d „  Z î d „  Z ð d „  Z RS(   Nc    s+   Ü Ý | |  _  Þ | |  _ ß h  |  _ d  S(   N(   s   domains   selfs	   localedirs   _strings(   s   selfs   domains	   localedirs+   /usr/lib/python1.5/site-packages/gettext.pys   __init__Ü s   c    s|   à ã t  d ƒ } ä |  i i | ƒ o6 å | |  i | j o æ |  i | i | ƒ n n è | g |  i | <é | Sd  S(   Ni   (   s   _getposs   poss   selfs   _stringss   has_keys   strings   append(   s   selfs   strings   poss+   /usr/lib/python1.5/site-packages/gettext.pys   gettextà s   c    s
   ì í d  S(   N(    (   s   selfs   items   datas+   /usr/lib/python1.5/site-packages/gettext.pys   __setitem__ì s   c    s
   î ï d  S(   N(    (   s   selfs   files+   /usr/lib/python1.5/site-packages/gettext.pys   saveî s   c    s¸  ð ñ k  } ò | i d |  i f ƒ ó xˆ|  i i ƒ  d ó rr} ô t d „  õ |  i | ƒ } ö | i
 ƒ  ÷ d } ø x | d ø rt } ù | t | ƒ d j o ú | i d ƒ û d } n ü | i d ƒ ý | i | ƒ þ | d	 t | ƒ } q… Wÿ | i d
 ƒ  d
 | j oi | i d ƒ | i | d
 ƒ } t d „  | d	  ƒ d | d	 f g } | i | ƒ n 	| i d | f ƒ 
| i d ƒ q; Wd  S(   Ns   # POT file for domain %s
i    c    s   ô d |  S(   Ns	   %s(%s):%d(   s   x(   s   xs+   /usr/lib/python1.5/site-packages/gettext.pys   <lambda>ô s    iP   iJ   s   
#:i   s    i   s   
s	   msgid ""
c    s   d |  f S(   Ns   "%s\n"
(   s   x(   s   xs+   /usr/lib/python1.5/site-packages/gettext.pys   <lambda>s    s   "%s"
s   msgid "%s"
s
   msgstr ""
(   s   strings   fps   writes   selfs   domains   _stringss   keyss   strs   maps   poss   sorts   lengths   ps   lens   splits   liness
   writelines(   s   selfs   fps   strings   strs   poss   lengths   ps   liness+   /usr/lib/python1.5/site-packages/gettext.pys   outputð s2   	 		 	$(   s   __init__s   gettexts   __getitem__s   __call__s   __setitem__s   saves   output(    s+   /usr/lib/python1.5/site-packages/gettext.pys   CatalogÛ s   
		s   exitfuncc    s–   k  } xh t i ƒ  d rU } t | i i |  | d ƒ d ƒ } t | } | i
 | ƒ | i ƒ  q W| o | ƒ  n d  S(   Ni    s   .pots   w(   s   oss   _catss   keyss   files   opens   paths   joins   dirs   fps   cats   outputs   closes
   _exitchain(   s   dirs
   _exitchains   oss   files   fps   cats+   /usr/lib/python1.5/site-packages/gettext.pys   exitfuncs   	 	%
 c    sT   t  i |  ƒ o  t |  | ƒ t  |  <n !t o !t  |  a n d  S(   N(   s   _catss   has_keys   domains   Catalogs	   localedirs   _cat(   s   domains	   localedirs+   /usr/lib/python1.5/site-packages/gettext.pys   bindtextdomains
    c    sB   #$%t  i |  ƒ o &t |  ƒ t  |  <n 't  |  a d  S(   N(   s   _catss   has_keys   domains   Catalogs   _cat(   s   domains+   /usr/lib/python1.5/site-packages/gettext.pys
   textdomain#s   c    s7   )*t  t j o *t d ‚ n +t  i |  ƒ Sd  S(   Ns   No catalog loaded(   s   _cats   Nones   errors   gettexts   string(   s   strings+   /usr/lib/python1.5/site-packages/gettext.pys   gettext)s    c    sh   /0|  t j o 1t | ƒ Sn 2t i |  ƒ o 3t d |  d ‚ n 4t |  i | ƒ Sd  S(   Ns   Domain 's   ' not loaded(   s   domains   Nones   gettexts   strings   _catss   has_keys   error(   s   domains   strings+   /usr/lib/python1.5/site-packages/gettext.pys   dgettext/s
   c     sï   67k  }  89t |  i ƒ d d f j o* :d |  i d f GH;|  i d ƒ n <|  i d } =t |  i ƒ d j o >t | |  i d ƒ n ?t | ƒ @t d ƒ } A| o! Bd | t	 i
 f GHC| GHn	 Ed GHd  S(	   Ni   i   s   Usage: %s DOMAIN [LOCALEDIR]i    i   s    s   Info for domain %s, lang %s.s   No info given in mo file.(   s   syss   lens   argvs   exits   domains   bindtextdomains
   textdomains   gettexts   infos   _cats   lang(   s   syss   domains   infos+   /usr/lib/python1.5/site-packages/gettext.pys   test6s   	
s   __main__N(&   s   __doc__s   oss   strings   prefixs	   localedirs   _expandLangs   langs   envs   environs   has_keys   splits   maps   reduces   appends   is   lens   js   xgettexts   Nones   errors   _lsbStrToInts   _msbStrToInts   _intToLsbStrs   _getposs   Catalogs   _cats   _catss   syss   hasattrs   exitfuncs
   _exitchains   bindtextdomains
   textdomains   gettexts   _s   dgettexts   tests   __name__(    s+   /usr/lib/python1.5/site-packages/gettext.pys   ?' sl   	
	 		  				`		
1				