Merge lp:~jtv/launchpad/exportstorage-cleanup into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Robert Collins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11178 |
Proposed branch: | lp:~jtv/launchpad/exportstorage-cleanup |
Merge into: | lp:launchpad |
Diff against target: |
289 lines (+53/-39) 4 files modified
lib/lp/translations/utilities/gettext_mo_exporter.py (+6/-5) lib/lp/translations/utilities/gettext_po_exporter.py (+7/-3) lib/lp/translations/utilities/tests/test_export_file_storage.py (+18/-12) lib/lp/translations/utilities/translation_export.py (+22/-19) |
To merge this branch: | bzr merge lp:~jtv/launchpad/exportstorage-cleanup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | code | Approve | |
Robert Collins (community) | Approve | ||
Review via email: mp+30418@code.launchpad.net |
Commit message
Set translations export storage MIME type when adding file, not on __init__.
Description of the change
= Export Storage Strategy cleanup =
This is preparation for an overhaul of the translations export machinery.
Sometimes the export needs to store a single file. Sometimes it needs to store several, which have to be bundled up into a tarball first. A neat little "strategy" pattern hides this inside an object that just accepts files.
Currently the storage strategy is made to contain files of a single MIME type. This fits the use cases—we actually don't care about MIME types inside a tarball!—but not the use pattern once we start dumping multiple files into one storage object.
In this branch I provide the MIME type not while creating the storage object, but when adding a file. To test,
{{{
./bin/test -vvc -m lp.translations
}}}
No lint.
Jeroen
Looks good - thanks.