API for reading POTemplates attributes
Bug #525371 reported by
Adi Roiban
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Adi Roiban |
Bug Description
To help creating various translations statistics (ie for Ubuntu translations) it would be nice to have an LP API that could export the following information about a POTemplate:
* template name in Launchpad
* priority
* length
* date last updated
* domain name
* iscurrent (active or not)
* source package
* is in lang pack
* in how many languages it is translates (nice to have)
The API should return a list of all templates for a series, but also the info for a single template
The requirements are tracked on this wiki page:
https:/
Related branches
lp:~adiroiban/launchpad/bug-525371
- Данило Шеган (community): Needs Fixing
- Jeroen T. Vermeulen: Pending requested
-
Diff: 1034 lines (+338/-153)18 files modifiedlib/canonical/launchpad/interfaces/_schema_circular_imports.py (+18/-4)
lib/canonical/launchpad/security.py (+11/-2)
lib/lp/registry/configure.zcml (+0/-6)
lib/lp/registry/interfaces/distroseries.py (+5/-3)
lib/lp/registry/interfaces/productseries.py (+3/-1)
lib/lp/registry/interfaces/sourcepackage.py (+8/-6)
lib/lp/registry/model/distroseries.py (+5/-8)
lib/lp/registry/model/productseries.py (+2/-4)
lib/lp/registry/model/sourcepackage.py (+2/-4)
lib/lp/registry/stories/webservice/xx-distroseries.txt (+2/-1)
lib/lp/registry/stories/webservice/xx-project-registry.txt (+10/-5)
lib/lp/translations/browser/potemplate.py (+11/-12)
lib/lp/translations/interfaces/pofile.py (+12/-5)
lib/lp/translations/interfaces/potemplate.py (+107/-82)
lib/lp/translations/interfaces/webservice.py (+15/-0)
lib/lp/translations/model/distroseries_translations_copy.py (+1/-1)
lib/lp/translations/model/potemplate.py (+5/-9)
lib/lp/translations/stories/webservice/xx-potemplate.txt (+121/-0)
Changed in rosetta: | |
assignee: | nobody → Adi Roiban (adiroiban) |
description: | updated |
description: | updated |
summary: |
- API for reading POTemplates statistics + API for reading POTemplates details |
description: | updated |
Changed in rosetta: | |
status: | Triaged → In Progress |
summary: |
- API for reading POTemplates details + API for reading POTemplates attributes |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in rosetta: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Adi, just a suggestion on how you should structure this work (you don't have to take it, but it will make it easier for everybody if you at least do similar division of work).
First, I'd do API for single PO file statistics: you'd have to worry about exporting a shared interface IRosettaStats through API, so all the other objects which are based on it will get the same API as well.
Next step would be to figure out a good API for a single potemplate and work on that. Other than the simple properties, the most interesting bit here is how do you get statistics for a bunch of attached PO files. If you don't do anything but just export a single method to list out all the PO files, you'll be doing one API call for each of the languages for a PO template and that's going to be very slow. Eg. to get full status export for Ubuntu out of LP you'd need to do some ~400k API calls.
So, a much better solution to that is to provide a method which gives you all related PO file statistics: "getPOFilesWith Statistics( )" which returns tuples of form (POFile, translated_count, changed_count, unreviewed_count, untranslated_count) directly. FWIW, I'd keep this a separate step as well, so this would be bug/branch 3 already :)
And only then, as the final step, I'd do an export of IPOTemplateS(ubs)et APIs for all the different objects that have them. As another part of this step, you'd probably want to do the similar to above and provide a getPOFilesWithS tatistics( language) method on them.
If you don't divide the work in this manner, you are going to end up with a gigantic branch that'll be hard to get right and get landed, and everybody will easily get lost about what exactly should be the next step.