class documentation

class PoFileParser: (source)

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 parse Reads from the file-like object `fileobj` and adds any po file units found in it to the `Catalog` supplied to the constructor.
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
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
Class Variable _keywords Undocumented
def __init__(self, catalog: Catalog, ignore_obsolete: bool = False, abort_invalid: bool = False): (source)

Undocumented

def parse(self, fileobj: IO[AnyStr]): (source)

Reads from the file-like object `fileobj` and adds any po file units found in it to the `Catalog` supplied to the constructor.

abort_invalid = (source)

Undocumented

auto_comments: list = (source)

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

ignore_obsolete = (source)

Undocumented

in_msgctxt: bool = (source)

Undocumented

in_msgid: bool = (source)

Undocumented

in_msgstr: bool = (source)

Undocumented

locations: list = (source)

Undocumented

messages: list = (source)

Undocumented

obsolete = (source)

Undocumented

Undocumented

translations: list = (source)

Undocumented

user_comments: list = (source)

Undocumented

def _add_message(self): (source)

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): (source)

Undocumented

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

Undocumented

def _process_comment(self, line): (source)

Undocumented

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

Undocumented

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

Undocumented

def _process_string_continuation_line(self, line, lineno): (source)

Undocumented

def _reset_message_state(self): (source)

Undocumented

_keywords: list[str] = (source)

Undocumented