Merge lp:~jtv/launchpad/bug-662552-get-tm-or-dummy into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Jeroen T. Vermeulen on 2010-10-27 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 11811 |
| Proposed branch: | lp:~jtv/launchpad/bug-662552-get-tm-or-dummy |
| Merge into: | lp:launchpad |
| Diff against target: |
674 lines (+102/-182) 10 files modified
lib/lp/translations/browser/pofile.py (+3/-22) lib/lp/translations/browser/tests/translationmessage-views.txt (+27/-15) lib/lp/translations/browser/translationmessage.py (+17/-44) lib/lp/translations/doc/canonical_url_examples.txt (+4/-4) lib/lp/translations/doc/potmsgset.txt (+7/-29) lib/lp/translations/doc/translationmessage.txt (+13/-12) lib/lp/translations/interfaces/potmsgset.py (+8/-8) lib/lp/translations/model/potmsgset.py (+7/-11) lib/lp/translations/model/translationmessage.py (+0/-7) lib/lp/translations/tests/test_potmsgset.py (+16/-30) |
| To merge this branch: | bzr merge lp:~jtv/launchpad/bug-662552-get-tm-or-dummy |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Edwin Grubbs (community) | code | 2010-10-27 | Approve on 2010-10-27 |
|
Review via email:
|
|||
Commit Message
Streamline IPOTMsgSet.
Description of the Change
= Bug 662552: Streamline getCurrentDummy
We're getting timeouts on the POFile:+translate page, so I'm fixing up a bunch of relatively non-invasive things that it wastes time on.
In this case, it's IPOTMsgSet.
message = potmsgset.
if message is None:
message = potmsgset.
else:
(The message.setPOFile() part is a hack to get around the fact that some code still relies on TranslationMess
In this branch I replace the entire usage pattern with a single new method:
message = potmsgset.
pofile)
I also eliminated a few assertions that guarded the integrity of this pattern along the way, doing several redundant database lookups to ensure that there is no real current translation message before creating a dummy. That pattern is now explicit, and enshrined in a single place in the code.
About half of the branch is actually lint cleanup. There's a bit of lint left, but that's all related to blank lines around free-standing comment blocks. I'm not yet convinced that "make lint" has a creditable complaint.
Jeroen

Hi Jeroen,
This branch looks good. I just have one comment on an preexisting typo.
-Edwin
>=== modified file 'lib/lp/ translations/ browser/ tests/translati onmessage- views.txt' translations/ browser/ tests/translati onmessage- views.txt 2010-10-18 22:24:59 +0000 translations/ browser/ tests/translati onmessage- views.txt 2010-10-27 20:18:48 +0000 ssage View ======= ======= ==== worlddata. interfaces. language import ILanguageSet .publisher import TranslationsLayer
>--- lib/lp/
>+++ lib/lp/
>@@ -1,4 +1,5 @@
>-= TranslationMessage View =
>+TranslationMe
>+=====
>
> On this section, we are going to test the view class for an
> ITranslationMessage object.
>@@ -11,13 +12,14 @@
> >>> from lp.services.
> >>> from lp.translations
>
>-All the tests will be submitted as comming from Kurem, an editor for the POFile
>-that we are going to edit.
>+All the tests will be submitted as comming from Kurem, an editor for the
s/comming/coming/
>+POFile that we are going to edit.
>
> >>> login('<email address hidden>')
>
>
>-== No plural forms ==
>+No plural forms
>+---------------
>
> We are going to see what happens if we get an entry for a language
> without the plural form information.