IRosettaStats current interface doesn't suit database/pofile.py very well
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
Low
|
Unassigned |
Bug Description
The current IRosettaStats interface doesn't suit database/pofile.py very well. If you look at the POFile class, you'll see stuff like:
def messageCount(self):
"""See IRosettaStats."""
return self.potemplate
def currentCount(self, language=None):
"""See IRosettaStats."""
return self.currentcount
def updatesCount(self, language=None):
"""See IRosettaStats."""
return self.updatescount
def rosettaCount(self, language=None):
"""See IRosettaStats."""
return self.rosettacount
Apart from the inconsistency (and note also that messageCount is /not/ exported in the IRosettaStats interface, so I don't know what it's for) the unused language argument is pretty bogus.
SteveA suggests instead having a getStatsFor(lang) API that returns an IRosettaStats object. Carlos apparently concurs.
Changed in rosetta: | |
status: | New → Accepted |
tags: | added: tech-debt |
Changed in rosetta: | |
importance: | Medium → Low |
What we should do is to have: tistics providing statistical counts tistics object
1. ITranslationSta
2. IHasTranslations which has a standard interface to get individual language ITranslationSta
The problem is that we are (ab)using IRosettaStats to handle both (i.e. POTemplates and POFiles). In practice POTemplate seems to be the only class using it in the wrong way.