l.t.u.x.XpiManifest : class documentation

Part of lp.translations.utilities.xpi_manifest View In Hierarchy

Representation of an XPI manifest file.

Does two things: parsers an XPI file; and looks up chrome paths and locales for given filesystem paths inside the XPI file.

Method __init__ Initialize: parse content as a manifest file.
Method getChromePathAndLocale Return chrome path and locale applying to a filesystem path.
Method containsLocales Is file_path a prefix of any path containing locale files?
Method findMatchingXpiPath Reverse-map a chrome path in a given locale to a file path.
Class Method _normalizePath Normalize path. Here so it can be tested without exporting it.
Method _getMatchingEntry Return longest matching entry matching file_path.
def __init__(self, content):
Initialize: parse content as a manifest file.
@classmethod
def _normalizePath(cls, path):
Normalize path. Here so it can be tested without exporting it.
def _getMatchingEntry(self, file_path):
Return longest matching entry matching file_path.
def getChromePathAndLocale(self, file_path):
Return chrome path and locale applying to a filesystem path.
def containsLocales(self, file_path):
Is file_path a prefix of any path containing locale files?
Parametersfile_pathpath of a directory or jar file inside this XPI.
ReturnsBoolean: does file_path contain locale files?
def findMatchingXpiPath(self, chrome_path, locale):
Reverse-map a chrome path in a given locale to a file path.

For example, if given "browser/gui/print.dtd" for locale en-US, may return "jar:locales/en-US.jar!/chrome/gui/print.dtd", assuming that the file path jar:locales/en-US.jar!/chrome/ is associated with the chrome path browser.

If there are multiple matches, this returns the one with the longest file path.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.