class documentation

class PoFileParser(object):

View In Hierarchy

Support class to read messages from a gettext PO (portable object) file and add them to a Catalog

See read_po for simple cases.

Method __init__ Undocumented
Method ​_add​_message Add a message to the catalog based on the current parser state and clear the state ready to process the next message.
Method ​_finish​_current​_message Undocumented
Method ​_invalid​_pofile Undocumented
Method ​_process​_comment Undocumented
Method ​_process​_keyword​_line Undocumented
Method ​_process​_message​_line Undocumented
Method ​_process​_string​_continuation​_line Undocumented
Method ​_reset​_message​_state Undocumented
Method parse Reads from the file-like object fileobj and adds any po file units found in it to the Catalog supplied to the constructor.
Class Variable ​_keywords Undocumented
Instance Variable abort​_invalid Undocumented
Instance Variable auto​_comments Undocumented
Instance Variable catalog Undocumented
Instance Variable context Undocumented
Instance Variable counter Undocumented
Instance Variable flags Undocumented
Instance Variable ignore​_obsolete Undocumented
Instance Variable in​_msgctxt Undocumented
Instance Variable in​_msgid Undocumented
Instance Variable in​_msgstr Undocumented
Instance Variable locations Undocumented
Instance Variable messages Undocumented
Instance Variable obsolete Undocumented
Instance Variable offset Undocumented
Instance Variable translations Undocumented
Instance Variable user​_comments Undocumented
def __init__(self, catalog, ignore_obsolete=False, abort_invalid=False):

Undocumented

def _add_message(self):
Add a message to the catalog based on the current parser state and clear the state ready to process the next message.
def _finish_current_message(self):

Undocumented

def _invalid_pofile(self, line, lineno, msg):

Undocumented

def _process_comment(self, line):

Undocumented

def _process_keyword_line(self, lineno, line, obsolete=False):

Undocumented

def _process_message_line(self, lineno, line, obsolete=False):

Undocumented

def _process_string_continuation_line(self, line, lineno):

Undocumented

def _reset_message_state(self):

Undocumented

def parse(self, fileobj):
Reads from the file-like object fileobj and adds any po file units found in it to the Catalog supplied to the constructor.
_keywords: list[str] =

Undocumented

abort_invalid =

Undocumented

auto_comments: list =

Undocumented

catalog =

Undocumented

context =

Undocumented

counter: int =

Undocumented

flags: list =

Undocumented

ignore_obsolete =

Undocumented

in_msgctxt: bool =

Undocumented

in_msgid: bool =

Undocumented

in_msgstr: bool =

Undocumented

locations: list =

Undocumented

messages: list =

Undocumented

obsolete =

Undocumented

offset =

Undocumented

translations: list =

Undocumented

user_comments: list =

Undocumented