-
D<c       s/    d  Z  ' ( d k Z d k Z * d Z + e d a - h  Z . d   Z D d   Z l g  Z m x~ d d d d	 f Dm ]g Z	 n e i
 i e	  oK o e i e i
 e	 d
  Z p e e e  Z q e d   e  Z r Pn qw Ws d e j o t e i d  n w e e  d Z x xH x e d j o7 y e e e e  j o z e e =n { e d Z q"W| [ ~ d Z  d   Z  d   Z  d   Z  d f  d     YZ  e a  h  Z  t d  Z  d   Z  d   Z e Z d   Z 
d   Z e  d j o 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.
Ns
   /usr/locals   /share/localec    sN  . / t  o
0 x d d d d g D0 ] } 4 y 5 t | d  } 6 | i   } 7 x 7 | o 8 t i |  } 9 | o | d d j oZ : t i |  } ; t
 |  d j o t  i | d  o < | d	 t  | d <n n = | i   } qZ WWn > ? n Xq$ Wn @ x% @ t  i |   o A t  |  }  qWB |  Sd  S(
   Ns   /usr/share/locale/locale.aliass$   /usr/local/share/locale/locale.aliass    /usr/lib/X11/locale/locale.aliass$   /usr/openwin/lib/locale/locale.aliass   ri    s   #i   i   (   s   _aliasess   files   opens   fps   readlines   lines   strings   strips   splits   ps   lens   has_keys   lang(   s   langs   fps   files   ps   line(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   _unalias_lang. s(    	 
+ c    s  D E t  |   }  F d d >} G d d >} H d d >}	 J d } K t i |  d  } L | d j o+ M |  | } N |  |  }  O | |	 B} n
 Q d } R t i |  d  } S | d j o+ T |  | } U |  |  }  V | | B} n
 X d } Y t i |  d  } Z | d j o+ [ |  | } \ |  |  }  ] | | B} n
 _ d } ` |  } b g  } c x t | d  Dc ] } d | | @o} e | }
 f | | @o f |
 | }
 n g | | @o g |
 | }
 n h | |	 @o h |
 | }
 n i | i d |
  n qsWj | Sd  S(   Ni   i    i   s   @s    s   .s   _(   s   _unalias_langs   locales   COMPONENT_CODESETs   COMPONENT_TERRITORYs   COMPONENT_MODIFIERs   masks   strings   finds   poss   modifiers   codesets	   territorys   languages   rets   ranges   is   vals   insert(   s   locales   modifiers   languages   COMPONENT_TERRITORYs   is   masks   poss   rets   COMPONENT_CODESETs   COMPONENT_MODIFIERs   vals   codesets	   territory(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   _expand_langD sJ   						 		   s   LANGUAGEs   LC_ALLs   LC_MESSAGESs   LANGs   :c    s   q |  | S(   N(   s   as   b(   s   as   b(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   <lambda>q s    s   Ci   i    s   gettext.errorc    sN     t  |  d  t  |  d  d >t  |  d  d >t  |  d  d >Sd  S(   Ni    i   i   i   i   i   i   (   s   ords   str(   s   str(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   _lsbStrToInt 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   str(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   _msbStrToInt s   c    sN     t  |  d @ t  |  d ?d @ t  |  d ?d @ t  |  d ?d @ Sd  S(   Ni   i   i   i   (   s   chrs   int(   s   int(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   _intToLsbStr s   s   Catalogc      sM     e  e d  Z  d   Z  e Z  e Z  d   Z  d   Z RS(   Nc    s    | |  _   | |  _  h  |  _  | o  d  Sn  x t D ] |  _  |  i d j o  d  Sn  d | |  i | f }  y/  t | d  }  | i   }  ~  PWn  t
 j
 o
  n XqG 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 ] }  | | | | d ! }  | | | d | d ! }  | d }  | | | | !}
  | | | | d ! }  | | | d | d ! }  | d }  | | | | !}  | |  i |
 <qWd  S(   Ns   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
   origOffsets   transLengths   buffers   transTabOffsets   catalogs   transStrs   nstringss   origStrs   origTabOffsets   fs   is   strToInts   transOffsets
   origLength(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   __init__ 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   string(    (    s+   /usr/lib/python2.2/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   trans(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   __setitem__ s   c    su     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 ]r \ } }  |	 i t |  t |  f   | | d }  | i t |  t |  f   | | d } q W d }  | d	 t |	  }  | d	 t |  }
  |
 t |  }  | i t |    | i t |    xG |	 D ]< \ } }  | i t |    | i t | |
   qW xG | D ]< \ } }  | 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	   tIndexOfss   tDatas   fs	   oIndexOfss   offsets   lengths   tDataOfss   oIndexs   oDataOfss   transs   oDatas   tIndexs   orig(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   save s@    ""	
 
 (   s   Nones	   localedirs   __init__s   gettexts   __getitem__s   __call__s   __setitem__s   save(    (    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   Catalog 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	   localedir(    (    s+   /usr/lib/python2.2/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   domain(    (    s+   /usr/lib/python2.2/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   string(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   gettext s    c    sa   |  t j o t |  Sn t i |   o t |   n t |  i |  Sd  S(   N(   s   domains   Nones   gettexts   strings   _catss   has_keys   bindtextdomain(   s   domains   string(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   dgettexts
   c     s   
d  k  }  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  } | o! d | t	 i
 f GH| GHn	 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   infos   domain(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   test
s   
s   __main__(!   s   __doc__s   oss   strings   prefixs	   localedirs   _aliasess   _unalias_langs   _expand_langs   langs   envs   environs   has_keys   splits   maps   reduces   appends   lens   is   errors   _lsbStrToInts   _msbStrToInts   _intToLsbStrs   Catalogs   Nones   _cats   _catss   bindtextdomains
   textdomains   gettexts   _s   dgettexts   tests   __name__(   s   strings   _intToLsbStrs   _lsbStrToInts   prefixs   _unalias_langs   _aliasess   _catss   bindtextdomains   _s   langs   _msbStrToInts   _expand_langs   is   Catalogs   gettexts
   textdomains   envs   errors   tests   oss   dgettext(    (    s+   /usr/lib/python2.2/site-packages/gettext.pys   ?' sL   		(	 	 	^			