Part of lp.translations.utilities.tests.test_mozilla_zip View In Hierarchy
Does nothing but keep track of the structure of nested zip files it traverses, and the various parameters for each translatable file.
Produces a nice list of tuples (representing parameters for a translatable file) and lists (representing nested jar files). Each zip file's traversal, including nested ones, is concluded with a string containing a full stop (".").
Method | _begin | Overridable hook: optional pre-traversal actions. |
Method | _processTranslatableFile | Overridable hook: process a file entry. |
Method | _processNestedJar | Overridable hook: handle a nested jar file. |
Method | _finish | Overridable hook: post-traversal actions. |
Inherited from MozillaZipTraversal:
Method | __init__ | Open zip (or XPI, or jar) file and scan its contents. |
Method | _processEntry | Read one zip archive entry, figure out what to do with it. |
Called only for files that may be localizable. If there is a manifest, that means the file must be in a location (or subtree) named by a "locale" entry.
Parameters | entry | Full name of file inside this zip archive, including path relative to the archive's root. |
locale_code | Code for locale this file belongs to, e.g. "en-US". | |
xpi_path | Full path of this file inside the XPI archive, e.g. "jar:locale/en-US.jar!/data/messages.dtd". | |
chrome_path | File's chrome path. This is a kind of "normalized" path used in XPI to describe a virtual directory hierarchy. The zip archive's actual layout (which the XPI paths describe) may be different. | |
filename_suffix | File name suffix or "extension" of the translatable file. This may be e.g. ".dtd" or ".xhtml," or the empty string if the filename does not contain a dot. |
Parameters | zip_instance | An instance of the same class as self, which has just parsed the nested jar file. |