Part of lp.translations.utilities.xpi_manifest View In Hierarchy
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. |
file_path
a prefix of any path containing locale files?Parameters | file_path | path of a directory or jar file inside this XPI. |
Returns | Boolean: does file_path contain locale files? |
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.