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, fpath, enc='utf-8')
_MOFileParser constructor.
source code
 
parse_magicnumber(self)
Parse the magic number and raise an exception if not valid.
source code
 
parse(self)
Build the instance with the file handle provided in the constructor.
source code
 
_readbinary(self, fmt, numbytes)
Private method that unpack n bytes of data using format <fmt>.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BIG_ENDIAN = 3725722773
  LITTLE_ENDIAN = 2500072158
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, fpath, enc='utf-8')
(Constructor)

source code 

_MOFileParser constructor.

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.