[Blends-commit] [SCM] website branch, master, updated. 05bccf857d1e9f9b46efdfcbbabf6e54ea7fc6c7

Andreas Tille tille at debian.org
Tue Aug 6 19:47:16 UTC 2013


The following commit has been merged in the master branch:
commit 278ba8faeff4b049910133a61aee8913e6889126
Author: Andreas Tille <tille at debian.org>
Date:   Tue Aug 6 09:38:20 2013 +0200

    Enable specifying Blend to draw by parameter

diff --git a/misc/team_analysis_tools/count-dependencies.py b/misc/team_analysis_tools/count-dependencies.py
index 2ee2c2e..2f28067 100755
--- a/misc/team_analysis_tools/count-dependencies.py
+++ b/misc/team_analysis_tools/count-dependencies.py
@@ -21,22 +21,19 @@ import matplotlib.cm as cmx
 
 debug=0
 
-# FIXME: Blend name should be parameter - currently only used for Debian Med
-BLEND='med'
-# BLEND='science'
-
 # Some tasks contain only a few dependencies which are just spoiling the 3D view
 # Make sure we are drawing a certain selection and all those tasks that might
 # have more dependencies than these
 DRAWTASKS = { 'med': ['bio', 'bio-dev', 'epi', 'practice', 'psychology'],
+              'science': ['astronomy', 'dataacquisition', 'distributedcomputing', 'electronics', 'engineering'], 
             }
 
-def TasksGetDrawList(tasks):
+def TasksGetDrawList(tasks, checklist):
     task_last = tasks[sorted(tasks.keys())[-1]]
     # evaluate minimum number of dependencies to draw
     min2draw = 100
     drawlist = []
-    for t in DRAWTASKS[BLEND]:
+    for t in checklist:
 	if task_last.nrecommended[t] < min2draw:
 	    min2draw = task_last.nrecommended[t]
     for r in task_last.recommends.keys():
@@ -48,7 +45,8 @@ def TasksGetDrawList(tasks):
 
 
 class taskscontent:
-    def __init__(self, version=None, date=None, htask=None, hrecommended=None):
+    def __init__(self, blend=None, version=None, date=None, htask=None, hrecommended=None):
+        self.blend      = blend
 	self.version	= version
 	self.date	= date
 	self.mxdate	= DateFrom(date)
@@ -64,7 +62,7 @@ class taskscontent:
 	self.ctrlfile	= None
 
     def add_recommends(self, package, recommends):
-        p = re.sub(BLEND+'-', '', package.encode('utf-8'))
+        p = re.sub(self.blend+'-', '', package.encode('utf-8'))
 
 	if not self.recommends.has_key(p):
 	    self.recommends[p] = []
@@ -72,7 +70,7 @@ class taskscontent:
 	    r = r.strip()
 	    # since we also need to investigate "Depends" for older metapackages we also
 	    # need to exclude the extra control packages
-	    if r.startswith(BLEND+'-common') or r.startswith(BLEND+'-config') or r.startswith(BLEND+'-tasks'):
+	    if r.startswith(self.blend+'-common') or r.startswith(self.blend+'-config') or r.startswith(self.blend+'-tasks'):
 		continue
 	    self.recommends[p].append(r)
 	self.nrecommended[p] = len(self.recommends[p])
@@ -87,9 +85,13 @@ class taskscontent:
 
 
 def main():
-    if len(argv) < 2:
-	print >>stderr, "Usage: %s <path_to_svn_export_of_blends_repository>" % argv[0]
+    if len(argv) < 3:
+	print >>stderr, "Usage: %s <path_to_svn_export_of_blends_repository> <blend>" % argv[0]
+	exit()
+    if argv[2] not in DRAWTASKS.keys():
+	print >>stderr, "This script is only prepared for %s" % str(VALIDBLENDS)
 	exit()
+    BLEND = argv[2]
     root = argv[1]+'/projects/'+BLEND+'/tags' 
     u_dirs = listdir(root)
 
@@ -113,7 +115,7 @@ def main():
 		mver['task'] = 'dental'
 	    if not mver['task'] in tasks_found:
 		tasks_found.append(mver['task'])
-	    task = taskscontent(mver['version'], mver['date'], mver['task'], mver['recommends'])
+	    task = taskscontent(BLEND, mver['version'], mver['date'], mver['task'], mver['recommends'])
 	    if tasks.has_key(task.datekey):
 		# try to match several single metapackages to what we know today as multibinary
 		mtask = tasks[task.datekey]
@@ -149,7 +151,7 @@ def main():
     	    if u != stanza['version']:
     		print >>stderr, "Dir %s does not fit changelog version %s" % (u, stanza['version'])
     	    else:
-    		task = taskscontent(u, stanza['date'])
+    		task = taskscontent(BLEND, u, stanza['date'])
 
     	# Try to read debian/control
     	ctrlfile = debiandir + 'control'
@@ -188,7 +190,7 @@ def main():
 
     tasks_found.sort()
 
-    drawlist = TasksGetDrawList(tasks)
+    drawlist = TasksGetDrawList(tasks, DRAWTASKS[BLEND])
 
     cNorm  = colors.Normalize(vmin=0, vmax=len(drawlist))
     jet = plt.get_cmap('jet')

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list