[Cdd-commits] r1122 - cdd/trunk/webtools

CDD Subversion Commit noreply at alioth.debian.org
Sun Oct 5 07:26:36 UTC 2008


Author: tille
Date: Sun Oct  5 07:26:36 2008
New Revision: 1122

Modified:
   cdd/trunk/webtools/bugs.py
Log:
Query also for bugs of meta package itself


Modified: cdd/trunk/webtools/bugs.py
==============================================================================
--- cdd/trunk/webtools/bugs.py	(original)
+++ cdd/trunk/webtools/bugs.py	Sun Oct  5 07:26:36 2008
@@ -4,6 +4,10 @@
 import os
 from sys import argv, exit, stderr
 from btsutils.debbugs import debbugs
+import gettext
+
+from genshi.template import TemplateLoader
+from genshi import Markup
 
 from distasktools import DisDependencies, ReadConfig
 
@@ -15,13 +19,25 @@
 bts = debbugs()
 
 class PackageBugs:
-    # Store list of bugs aof a package
+    # Store list of bugs of a package
 
     def __init__(self, pkgname):
-        self.pkgname = pkgname
+        self.pkgname = None
 	self.bugs    = []      # open bugs
 	self.done    = []      # closed bugs
 
+	bugs = bts.query('src:' + pkgname)
+	if bugs:
+		for bug in bugs:
+			if bug.getStatus() == 'done':
+				self.done.append(bug)
+			else:
+				self.bugs.append(bug)
+		self.pkgname = pkgname
+
+# Initialize i18n
+domain = 'dis-webtools'
+gettext.install(domain)
 
 cdeps=DisDependencies(argv[1])
 if cdeps.data['pkglist'] == '':
@@ -32,16 +48,16 @@
 
 data = cdeps.data
 data['tasks']            = cdeps.GetTaskDescDict()
-#if data['advertising'] != None:
-#	# If data['advertising'] is enclosed in _() gettext tries to ask for translations of 'advertising'
-#	# which makes no sense.  That's why this is masked by an extra string variable
-#	advertising = data['advertising']
-#	##data['projectadvertising'] = _(advertising) # Hopefully translation will work this way ...
-#	# Genshi needs explicite information that it is dealing with an UTF-8 string which should not be changed
-#	advertising = _(advertising)
-#	data['projectadvertising'] = Markup(unicode(advertising))# , 'utf-8'))
-#else:
-#	data['projectadvertising'] = None
+if data['advertising'] != None:
+	# If data['advertising'] is enclosed in _() gettext tries to ask for translations of 'advertising'
+	# which makes no sense.  That's why this is masked by an extra string variable
+	advertising = data['advertising']
+	##data['projectadvertising'] = _(advertising) # Hopefully translation will work this way ...
+	# Genshi needs explicite information that it is dealing with an UTF-8 string which should not be changed
+	advertising = _(advertising)
+	data['projectadvertising'] = Markup(unicode(advertising))# , 'utf-8'))
+else:
+	data['projectadvertising'] = None
 
 bugsdir='bugs'
 os.system("mkdir -p %s" % (bugsdir))
@@ -49,15 +65,13 @@
 allbugs = {}
 for task in packages.keys():
 	pkgbugs = []
+	# query bugs of meta package name
+	pkgbug = PackageBugs(data['tasks'][task].metapkg.pkg)
+	if pkgbug.pkgname:
+		pkgbugs.append(pkgbug)
 	for pkg in packages[task]:
-		bugs = bts.query('src:' + pkg)
-		if bugs:
-			pkgbug = PackageBugs(pkg)
-			for bug in bugs:
-				if bug.getStatus() == 'done':
-					pkgbug.done.append(bug)
-				else:
-					pkgbug.bugs.append(bug)
+		pkgbug = PackageBugs(pkg)
+		if pkgbug.pkgname:
 			pkgbugs.append(pkgbug)
 	if pkgbugs:
 		allbugs[task] = pkgbugs



More information about the Cdd-commits mailing list