Package horizons :: Package ext :: Module polib :: Class _MOFileParser
[hide private]
[frames] | no frames]

Class _MOFileParser

source code

object --+
         |
        _MOFileParser

A class to parse binary mo files.

Instance Methods [hide private]
 
__init__(self, mofile, *args, **kwargs)
Constructor.
source code
 
parse(self)
Build the instance with the file handle provided in the constructor.
source code
 
_build_entry(self, msgid, msgstr=None, msgid_plural=None, msgstr_plural=None) source code
 
_readbinary(self, fmt, numbytes)
Private method that unpack n bytes of data using format <fmt>.
source code
    Inherited from object
 
__delattr__(...)
x.__delattr__('name') <==> del x.name
 
__format__(...)
default object formatter
 
__getattribute__(...)
x.__getattribute__('name') <==> x.name
 
__hash__(x)
hash(x)
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__reduce__(...)
helper for pickle
 
__reduce_ex__(...)
helper for pickle
 
__repr__(x)
repr(x)
 
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
int
__sizeof__()
size of object in memory, in bytes
 
__str__(x)
str(x)
 
__subclasshook__(...)
Abstract classes can override this to customize issubclass().
Properties [hide private]
    Inherited from object
  __class__
the object's class
Method Details [hide private]

__init__(self, mofile, *args, **kwargs)
(Constructor)

source code 

Constructor.

Keyword arguments:

``mofile``
    string, path to the mo file or its content

``encoding``
    string, the encoding to use, defaults to ``default_encoding``
    global variable (optional).

``check_for_duplicates``
    whether to check for duplicate entries when adding entries to the
    file (optional, default: ``False``).

Overrides: object.__init__

_readbinary(self, fmt, numbytes)

source code 

Private method that unpack n bytes of data using format <fmt>. It returns a tuple or a mixed value if the tuple length is 1.