l.t.u.xpi_manifest : module documentation

Part of lp.translations.utilities

No module docstring
Function normalize_path Normalize filesystem path within XPI file.
Function is_valid_path Check that path is a valid, normalized path inside an XPI file.
Function is_valid_dir_path Check that path is a normalized directory path in an XPI file.
Function make_jarpath Construct base path for files inside a jar file.
Class ManifestEntry A "locale" line in a manifest file.
Function manifest_entry_sort_key We keep manifest entries sorted by path length.
Class XpiManifest Representation of an XPI manifest file.
def normalize_path(path):
Normalize filesystem path within XPI file.
def is_valid_path(path):
Check that path is a valid, normalized path inside an XPI file.
def is_valid_dir_path(path):
Check that path is a normalized directory path in an XPI file.
def make_jarpath(path, jarname):
Construct base path for files inside a jar file.

To name some translation file that's inside a jar file inside an XPI file, concatenate the result of this method (for the jar file) and the translation file's path within the jar file.

For example, let's say the XPI file contains foo/bar.jar. Inside foo/bar.jar is a translation file locale/gui.dtd. Then make_jarfile('foo', 'bar.jar') will return "jar:foo/bar.jar!/", to which you can append "locale/gui.dtd" to get the full path "jar:foo/bar.jar!/locale/gui.dtd" which identifies the translation file within the XPI file.

def manifest_entry_sort_key(entry):
We keep manifest entries sorted by path length.
API Documentation for Launchpad, generated by pydoctor at 2018-11-20 00:00:05.