<s> """<STR_LIT>""" <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> class FtException ( Exception ) : <EOL> def __init__ ( self , errorCode , messages , args ) : <EOL> self . params = args <EOL> self . errorCode = errorCode <EOL> self . message = messages [ errorCode ] % args <EOL> Exception . __init__ ( self , self . message , args ) <EOL> def __str__ ( self ) : <EOL> return self . message <EOL> def _ ( msg ) : <EOL> return msg <EOL> try : <EOL> import gettext <EOL> except ( ImportError , IOError ) : <EOL> def get_translator ( pkg ) : <EOL> return _ <EOL> else : <EOL> import os <EOL> _cache = { } <EOL> _top = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> def get_translator ( pkg ) : <EOL> if not _cache . has_key ( pkg ) : <EOL> locale_dir = os . path . join ( _top , pkg . replace ( "<STR_LIT:.>" , os . sep ) ) <EOL> try : <EOL> f = gettext . translation ( '<STR_LIT>' , locale_dir ) . gettext <EOL> except IOError : <EOL> f = _ <EOL> _cache [ pkg ] = f <EOL> return _cache [ pkg ] </s>
