damned-lies r756 - trunk
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r756 - trunk
- Date: Sat, 23 Feb 2008 21:39:29 +0000 (GMT)
Author: claudep
Date: Sat Feb 23 21:39:29 2008
New Revision: 756
URL: http://svn.gnome.org/viewvc/damned-lies?rev=756&view=rev
Log:
2008-02-23 Claude Paroz <claude 2xlibre net>
* releases.py: Check in get_aggregate_stats that all domains retrieved
from database are valid domains.
Fixes (hopefully!) #416009.
Modified:
trunk/ChangeLog
trunk/releases.py
Modified: trunk/releases.py
==============================================================================
--- trunk/releases.py (original)
+++ trunk/releases.py Sat Feb 23 21:39:29 2008
@@ -392,9 +392,11 @@
return modules
def get_aggregate_stats(release, releasesfile = defaults.releases_xml):
+ """ release is the id of a release (e.g. 'gnome-2-20') """
# Initialise modules
modules = []
+ allmodules = data.getModules()
releases = data.getReleases()
if releases.has_key(release):
myrelease = releases[release]
@@ -424,39 +426,41 @@
Statistics.q.Branch == branch,
Statistics.q.Language == None))
for stat in list(res):
- un = stat.Untranslated
- type = stat.Type
- if type=='ui': totalpot += un
- elif type=='doc': dtotalpot += un
+ if allmodules[stat.Module]['branch'][stat.Branch]['domain'].has_key(stat.Domain):
+ un = stat.Untranslated
+ type = stat.Type
+ if type=='ui': totalpot += un
+ elif type=='doc': dtotalpot += un
for (modid, branch) in modules:
res = Statistics.select(AND(Statistics.q.Module == modid,
Statistics.q.Branch == branch,
Statistics.q.Language != None))
for stat in list(res):
- type = stat.Type
- if type not in ['ui', 'doc']: continue
-
- lang = stat.Language
- if lang not in stats:
- stats[lang] = {
- 'code' : lang,
- 'name' : lang,
- 'ui_translated' : 0,
- 'ui_fuzzy' : 0,
- 'ui_untranslated' : 0,
- 'doc_translated' : 0,
- 'doc_fuzzy' : 0,
- 'doc_untranslated' : 0,
- 'errors': [('error' , "There is no translation team for '%s' in Gnome." % lang)],
- }
-
- tr = stat.Translated
- fz = stat.Fuzzy
-
- stats[lang][type + '_translated'] += tr
- stats[lang][type + '_fuzzy'] += fz
- stats[lang][type + '_untranslated'] += un
+ if allmodules[stat.Module]['branch'][stat.Branch]['domain'].has_key(stat.Domain):
+ type = stat.Type
+ if type not in ['ui', 'doc']: continue
+
+ lang = stat.Language
+ if lang not in stats:
+ stats[lang] = {
+ 'code' : lang,
+ 'name' : lang,
+ 'ui_translated' : 0,
+ 'ui_fuzzy' : 0,
+ 'ui_untranslated' : 0,
+ 'doc_translated' : 0,
+ 'doc_fuzzy' : 0,
+ 'doc_untranslated' : 0,
+ 'errors': [('error' , "There is no translation team for '%s' in Gnome." % lang)],
+ }
+
+ tr = stat.Translated
+ fz = stat.Fuzzy
+
+ stats[lang][type + '_translated'] += tr
+ stats[lang][type + '_fuzzy'] += fz
+ stats[lang][type + '_untranslated'] += un
result = []
if totalpot:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]