class documentation

class MessageIdStore: (source)

View In Hierarchy

The MessageIdStore store MessageId and make sure that there is a 1-1 relation between msgid and symbol.

Method __init__ Undocumented
Method __len__ Undocumented
Method __repr__ Undocumented
Method add_legacy_msgid_and_symbol Add valid legacy message id.
Method add_msgid_and_symbol Add valid message id.
Method check_msgid_and_symbol Undocumented
Method get_active_msgids Return msgids but the input can be a symbol.
Method get_msgid Undocumented
Method get_symbol Undocumented
Method register_message_definition Undocumented
Static Method _raise_duplicate_msgid Raise an error when a msgid is duplicated.
Static Method _raise_duplicate_symbol Raise an error when a symbol is duplicated.
Instance Variable __active_msgids Undocumented
Instance Variable __msgid_to_symbol Undocumented
Instance Variable __old_names Undocumented
Instance Variable __symbol_to_msgid Undocumented
def __init__(self): (source)

Undocumented

def __len__(self) -> int: (source)

Undocumented

def __repr__(self) -> str: (source)

Undocumented

def add_legacy_msgid_and_symbol(self, msgid: str, symbol: str, new_msgid: str): (source)

Add valid legacy message id. There is a little duplication with add_msgid_and_symbol to avoid a function call, this is called a lot at initialization.

def add_msgid_and_symbol(self, msgid: str, symbol: str): (source)

Add valid message id. There is a little duplication with add_legacy_msgid_and_symbol to avoid a function call, this is called a lot at initialization.

def check_msgid_and_symbol(self, msgid: str, symbol: str): (source)

Undocumented

def get_active_msgids(self, msgid_or_symbol: str) -> list[str]: (source)

Return msgids but the input can be a symbol. self.__active_msgids is used to implement a primitive cache for this function.

def get_msgid(self, symbol: str) -> str: (source)

Undocumented

def get_symbol(self, msgid: str) -> str: (source)

Undocumented

def register_message_definition(self, msgid: str, symbol: str, old_names: list[tuple[str, str]]): (source)

Undocumented

@staticmethod
def _raise_duplicate_msgid(symbol: str, msgid: str, other_msgid: str) -> NoReturn: (source)

Raise an error when a msgid is duplicated.

@staticmethod
def _raise_duplicate_symbol(msgid: str, symbol: str, other_symbol: str) -> NoReturn: (source)

Raise an error when a symbol is duplicated.

__active_msgids: dict[str, list[str]] = (source)

Undocumented

__msgid_to_symbol: dict[str, str] = (source)

Undocumented

__old_names: dict[str, list[str]] = (source)

Undocumented

__symbol_to_msgid: dict[str, str] = (source)

Undocumented