Module Expr Str Import alias Import alias ImportFrom alias alias ImportFrom alias alias Assign NameStore Num Assign NameStore Num FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Dict Assign NameStore Call NameLoad NameLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad Call NameLoad Str SubscriptLoad NameLoad Slice Num Index Num If CompareEq NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad Str SubscriptLoad NameLoad Slice Num Num Assign NameStore Str orelse If CompareEq NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad Str SubscriptLoad NameLoad Slice Num Num Assign NameStore Str orelse Raise Call NameLoad Num Str NameLoad For NameStore Call NameLoad Num NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad Num Assign NameStore BinOpAdd NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad Num Assign NameStore BinOpAdd NameLoad NameLoad If BoolOpAnd CompareLt NameLoad NameLoad CompareLt NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad orelse Raise Call NameLoad Num Str NameLoad If CompareEq NameLoad Num body Assign NameStore NameStore NameLoad For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Continue If CompareIn Str NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Assign NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr orelse If NameLoad body AugAssignAdd SubscriptStore NameLoad Index NameLoad BinOpAdd Str NameLoad If CompareIn Str NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str orelse Assign NameStore NameLoad If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str If AttributeLoad NameLoad attr body Assign NameStore ListComp Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore NameLoad orelse If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad NameLoad keyword NameLoad AugAssignAdd NameStore Num AugAssignAdd NameStore Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad If UnaryOpNot NameLoad body Assign SubscriptStore NameLoad Slice Num ListComp NameLoad comprehension NameStore SubscriptLoad NameLoad Slice Num UnaryOpNot AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore NameStore Str Assign NameStore ListLoad For NameStore NameLoad body If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr ListComp Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Call NameLoad Call NameLoad NameLoad Num orelse Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Str attr ListComp Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr ListLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad AugAssignAdd NameStore BinOpAdd NameLoad Str AugAssignAdd NameStore BinOpAdd NameLoad Str Assign NameStore BinOpAdd BinOpMult Num Num BinOpMult Num Call NameLoad NameLoad Assign NameStore BinOpAdd NameLoad Call NameLoad NameLoad Assign NameStore ListLoad Assign NameStore ListLoad For TupleStore NameStore NameStore NameStore NameStore NameLoad body AugAssignAdd NameStore ListLoad NameLoad BinOpAdd NameLoad NameLoad AugAssignAdd NameStore ListLoad NameLoad BinOpAdd NameLoad NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd Call AttributeLoad NameLoad attr Str NameLoad Num Call NameLoad NameLoad BinOpMult Num Num BinOpAdd BinOpMult Num Num BinOpMult Call NameLoad NameLoad Num Num Num Call NameLoad Call AttributeLoad NameLoad attr Str NameLoad NameLoad NameLoad decorator_list
N/A N/A 
    babel.messages.mofile
    ~~~~~~~~~~~~~~~~~~~~~

    Writing of files in the ``gettext`` MO (machine object) format.

    :copyright: (c) 2013 by the Babel Team.
    :license: BSD, see LICENSE for more details.
 N/A array N/A struct babel.messages.catalog Catalog Message babel._compat range_type array_tobytes N/A LE_MAGIC 2500072158 N/A BE_MAGIC 3725722773 read_mo N/A N/A fileobj N/A N/A N/A Read a binary MO file from the given file-like object and return a
    corresponding `Catalog` object.

    :param fileobj: the file-like object to read the MO file from

    :note: The implementation of this function is heavily based on the
           ``GNUTranslations._parse`` method of the ``gettext`` module in the
           standard library.
     N/A catalog N/A Catalog N/A headers N/A N/A filename N/A getattr fileobj name N/A buf N/A N/A fileobj read N/A buflen N/A len buf N/A unpack N/A struct unpack N/A magic N/A N/A unpack <I N/A buf N/A 4 N/A 0 N/A N/A magic LE_MAGIC N/A N/A N/A version msgcount origidx transidx N/A unpack <4I N/A buf N/A 4 20 N/A ii <II N/A N/A N/A magic BE_MAGIC N/A N/A N/A version msgcount origidx transidx N/A unpack >4I N/A buf N/A 4 20 N/A ii >II N/A N/A N/A IOError 0 Bad magic number filename N/A i N/A range_type 0 msgcount N/A N/A N/A mlen moff N/A unpack ii N/A buf N/A origidx N/A origidx 8 N/A mend N/A moff mlen N/A N/A tlen toff N/A unpack ii N/A buf N/A transidx N/A transidx 8 N/A tend N/A toff tlen N/A N/A N/A mend buflen N/A tend buflen N/A N/A msg N/A buf N/A moff mend N/A tmsg N/A buf N/A toff tend N/A N/A N/A IOError 0 File is corrupt filename N/A N/A mlen 0 N/A N/A lastkey key None N/A item N/A N/A tmsg splitlines N/A N/A item N/A N/A item strip N/A N/A item N/A N/A N/A N/A : item N/A N/A N/A key value N/A N/A item split : 1 N/A lastkey key N/A N/A N/A N/A key strip lower N/A N/A headers N/A key N/A N/A value strip N/A N/A lastkey N/A N/A N/A headers N/A lastkey N/A item N/A N/A msg N/A N/A N/A ctxt msg N/A N/A msg split N/A N/A ctxt None N/A N/A msg N/A N/A msg N/A N/A msg split N/A tmsg N/A N/A tmsg split N/A N/A catalog charset N/A N/A msg N/A N/A N/A x decode N/A catalog charset N/A x msg N/A tmsg N/A N/A N/A x decode N/A catalog charset N/A x tmsg N/A N/A N/A catalog charset N/A N/A msg N/A N/A msg decode N/A catalog charset N/A tmsg N/A N/A tmsg decode N/A catalog charset N/A N/A catalog N/A msg N/A Message msg tmsg context ctxt N/A origidx 8 N/A transidx 8 N/A N/A catalog mime_headers N/A N/A headers items N/A catalog N/A write_mo N/A N/A fileobj catalog use_fuzzy N/A False N/A N/A Write a catalog to the specified file-like object using the GNU MO file
    format.

    >>> from babel.messages import Catalog
    >>> from gettext import GNUTranslations
    >>> from StringIO import StringIO

    >>> catalog = Catalog(locale='en_US')
    >>> catalog.add('foo', 'Voh')
    <Message ...>
    >>> catalog.add((u'bar', u'baz'), (u'Bahr', u'Batz'))
    <Message ...>
    >>> catalog.add('fuz', 'Futz', flags=['fuzzy'])
    <Message ...>
    >>> catalog.add('Fizz', '')
    <Message ...>
    >>> catalog.add(('Fuzz', 'Fuzzes'), ('', ''))
    <Message ...>
    >>> buf = StringIO()

    >>> write_mo(buf, catalog)
    >>> buf.seek(0)
    >>> translations = GNUTranslations(fp=buf)
    >>> translations.ugettext('foo')
    u'Voh'
    >>> translations.ungettext('bar', 'baz', 1)
    u'Bahr'
    >>> translations.ungettext('bar', 'baz', 2)
    u'Batz'
    >>> translations.ugettext('fuz')
    u'fuz'
    >>> translations.ugettext('Fizz')
    u'Fizz'
    >>> translations.ugettext('Fuzz')
    u'Fuzz'
    >>> translations.ugettext('Fuzzes')
    u'Fuzzes'

    :param fileobj: the file-like object to write to
    :param catalog: the `Catalog` instance
    :param use_fuzzy: whether translations marked as "fuzzy" should be included
                      in the output
     N/A messages N/A list catalog N/A N/A use_fuzzy N/A N/A N/A messages N/A 1 N/A m N/A m N/A messages N/A 1 N/A N/A m fuzzy N/A N/A N/A messages sort N/A ids strs N/A offsets N/A N/A message messages N/A N/A N/A message pluralizable N/A N/A msgid N/A N/A join N/A N/A N/A msgid encode N/A catalog charset N/A msgid N/A message id N/A msgstrs N/A N/A N/A idx string N/A enumerate N/A message string N/A N/A N/A string N/A N/A N/A N/A msgstrs append N/A N/A message id N/A N/A min N/A int idx 1 N/A N/A N/A N/A msgstrs append string N/A msgstr N/A N/A join N/A N/A N/A msgstr encode N/A catalog charset N/A msgstr msgstrs N/A N/A msgid N/A N/A N/A message id encode N/A catalog charset N/A N/A N/A message string N/A N/A msgstr N/A N/A N/A message id encode N/A catalog charset N/A N/A msgstr N/A N/A N/A message string encode N/A catalog charset N/A N/A message context N/A N/A msgid N/A N/A join N/A N/A N/A N/A message context encode N/A catalog charset msgid N/A N/A N/A offsets append N/A N/A len ids N/A len msgid N/A len strs N/A len msgstr N/A ids N/A msgid N/A strs N/A msgstr N/A keystart N/A N/A 7 4 N/A 16 N/A len messages N/A valuestart N/A keystart N/A len ids N/A koffsets N/A N/A voffsets N/A N/A N/A o1 l1 o2 l2 offsets N/A N/A koffsets N/A l1 N/A o1 keystart N/A voffsets N/A l2 N/A o2 valuestart N/A offsets N/A koffsets voffsets N/A N/A N/A fileobj write N/A N/A N/A N/A N/A struct pack Iiiiiii LE_MAGIC 0 N/A len messages N/A 7 4 N/A N/A 7 4 N/A N/A len messages 8 0 0 N/A array_tobytes N/A N/A array array i offsets ids strs N/A