> Hi Ursula,
>
> Nice branch! I've got a few comments but they're all stylistic nitpicks, so
> I'm happy to approve this with the changes I've requested.
All changes applied, incremental diff below. Thanks!
- for language, pofile in query.order_by(['Language.englishname']):
+ ordered_results = query.order_by(['Language.englishname'])
+
+ for language, pofile in ordered_results: psl = ProductSeriesLanguage(self, language, pofile=pofile) psl.setCounts(pofile.potemplate.messageCount(), pofile.currentCount(), pofile.updatesCount(), pofile.rosettaCount(),
- pofile.unreviewedCount(),
+ pofile.unreviewedCount(), pofile.date_changed) results.append(psl)
else:
@@ -537,12 +539,13 @@
# This seems to be irrelevant to what we're trying to achieve
# here, but making a note either way.
> Hi Ursula,
>
> Nice branch! I've got a few comments but they're all stylistic nitpicks, so
> I'm happy to approve this with the changes I've requested.
All changes applied, incremental diff below. Thanks!
=== modified file 'lib/lp/ registry/ model/productse ries.py' registry/ model/productse ries.py 2009-11-03 04:55:45 +0000 registry/ model/productse ries.py 2009-11-04 17:15:56 +0000
POTemplate. iscurrent= =True,
Language. id!=english. id)
--- lib/lp/
+++ lib/lp/
@@ -493,13 +493,15 @@
- for language, pofile in query.order_ by(['Language. englishname' ]): by(['Language. englishname' ])
psl = ProductSeriesLa nguage( self, language, pofile=pofile)
psl. setCounts( pofile. potemplate. messageCount( ),
pofile. currentCount( ),
pofile. updatesCount( ),
pofile. rosettaCount( ), unreviewedCount (), unreviewedCount (),
pofile. date_changed)
results. append( psl)
+ ordered_results = query.order_
+
+ for language, pofile in ordered_results:
- pofile.
+ pofile.
else:
@@ -537,12 +539,13 @@
# This seems to be irrelevant to what we're trying to achieve
# here, but making a note either way.
- for (language, imported, changed, new, unreviewed, by(['Language. englishname' ])): by(['Language. englishname' ])
psl = ProductSeriesLa nguage( self, language) total, imported, changed, new, unreviewed,
results. append( psl)
- last_changed) in (
- query.order_
+ ordered_results = query.order_
+
+ for (language, imported, changed, new, unreviewed,
+ last_changed) in ordered_results:
- psl.setCounts(
- last_changed)
+ psl.setCounts(
+ total, imported, changed, new, unreviewed, last_changed)
return results
=== modified file 'lib/lp/ translations/ tests/test_ productseriesla nguage. py' translations/ tests/test_ productseriesla nguage. py 2009-11-03 13:53:07 +0000 translations/ tests/test_ productseriesla nguage. py 2009-11-04 17:15:56 +0000
--- lib/lp/
+++ lib/lp/
@@ -113,7 +113,7 @@
return potemplate
def setPOFileStatis tics(self, pofile, imported, changed, new, unreviewed,
naked_ pofile = removeSecurityP roxy(pofile)
psl.updatesCoun t(),
psl.unreviewedC ount(),
psl.last_ changed_ date),
- date_changed):
+ date_changed):
# Instead of creating all relevant translation messages, we
# just fake cached statistics instead.
@@ -141,7 +141,7 @@
- stats)
+ stats)
def test_DummyProdu ctSeriesLanguag e(self) : mplateWithPOTMs gSets(10) set.getDummy( self.productser ies, self.language) tatistics( psl, (10, 0, 0, 0, 0, 0, tatistics(
# With no templates all counts are zero.
@@ -153,8 +153,8 @@
# count of messages go up to 10.
potemplate = self.createPOTe
psl = self.psl_
- self.assertPSLS
- None))
+ self.assertPSLS
+ psl, (10, 0, 0, 0, 0, 0, None))
def test_OneTemplat e(self) :
# With only one template, statistics match those of the POFile.