[med-svn] r1539 - trunk/community/infrastructure/scripts

tille at alioth.debian.org tille at alioth.debian.org
Sat Mar 8 07:39:59 UTC 2008


Author: tille
Date: 2008-03-08 07:39:59 +0000 (Sat, 08 Mar 2008)
New Revision: 1539

Modified:
   trunk/community/infrastructure/scripts/update-ddtp
Log:
Bring update-ddtp using cddtasktool.py into operation to not list prospective
packages in the DDTP list.  David, make sure you use the wrapper in the cron
script to avoid mails from cron


Modified: trunk/community/infrastructure/scripts/update-ddtp
===================================================================
--- trunk/community/infrastructure/scripts/update-ddtp	2008-03-08 07:31:57 UTC (rev 1538)
+++ trunk/community/infrastructure/scripts/update-ddtp	2008-03-08 07:39:59 UTC (rev 1539)
@@ -3,6 +3,7 @@
 #
 # This Python script is:
 #  (C) 2007, David Paleino <d.paleino at gmail.com>
+#  (C) 2008, David Paleino <d.paleino at gmail.com>, Andreas Tille <tille at debian.org>
 #
 # It is licensed under the terms of GNU General Public License (GPL)
 # v3, or any later revision.
@@ -14,8 +15,13 @@
 from datetime import datetime
 from email.Utils import formatdate
 import time
-from Tools import parseTasks, grep
+from sys import argv, exit, stderr
 
+from cddtasktools import CddDependencies, HTMLBASE, REPOS
+from Tools import grep
+
+CDD='debian-med'
+
 base = "/var/lib/gforge/chroot/home/groups/debian-med"
 #base = "/home/neo/tmp/debmed"
 ddtp_url = "http://ddtp.debian.net/debian/dists/sid/main/i18n/Translation-%s"
@@ -31,17 +37,6 @@
 longs = {}
 shorts = {}
 
-#['adun.app', 'amap-align', 'amide', 'arb', 'bioimagesuite', 'bioperl', 'biosquid', 'blast2', 'boxshade', 'chemtool', 
-#'cimg-dev', 'clustalw', 'clustalw-mpi', 'clustalx', 'ctn', 'ctn-dev', 'ctsim', 'cycle', 'dcmtk', 'dialign', 
-#'dialign-t', 'dicomnifti', 'emboss', 'fastdnaml', 'fastlink', 'garlic', 'gdpc', 'gff2aplot', 'gff2ps', 'ghemical', 
-#'gnumed-client', 'gromacs', 'hmmer', 'imagej', 'kalign', 'libbio-ruby', 'libfslio0', 'libfslio0-dev', 
-#'libinsighttoolkit-dev', 'libmdc2-dev', 'libminc0-dev', 'libncbi6-dev', 'libniftiio0', 'libniftiio0-dev', 'loki', 
-#'mcl', 'medcon', 'melting', 'mencal', 'minc-tools', 'mipe', 'molphy', 'mummer', 'muscle', 'ncbi-epcr', 
-#'ncbi-tools-bin', 'ncbi-tools-x11', 'nifti-bin', 'njplot', 'octave', 'octave2.1', 'paw++', 'perlprimer', 'phylip', 
-#'poa', 'primer3', 'probcons', 'proda', 'pymol', 'python-biopython', 'python-nifti', 'r-base', 'r-base-core', 
-#'r-cran-qtl', 'rasmol', 'readseq', 'seaview', 'sibsim4', 'sigma-align', 'sim4', 't-coffee', 'tigr-glimmer', 
-#'tm-align', 'tree-ppuzzle', 'tree-puzzle', 'treetool', 'treeviewx', 'wise', 'xmedcon', 'zope-zms']
-
 def force_fetch(packages, lang = langs):
 	global langs
 	
@@ -142,13 +137,16 @@
 def renderSingleTrans(node, lang, package):
 	node.name.raw = '<img src="/img/langs/%s.png" alt="%s" title="%s"/>' % (lang, lang, lang)
 	if dict[package][lang]:
-#		print "Lang: %s" % lang
-#		print "Package: %s" % package
-#		print "Dict: %s" % dict[package][lang]
-#		print "Short: %s" % shorts[package]
-#		print "Long: %s" % longs[package]
-		node.short.raw = shorts[package][lang]
-		node.long.raw = longs[package][lang]
+		#print "Lang: %s" % lang
+		#print "Package: %s" % package
+		#print "Dict: %s" % dict[package][lang]
+		#print "Short: %s" % shorts[package]
+		#print "Long: %s" % longs[package]
+		try:
+		    node.short.raw = shorts[package][lang]
+		    node.long.raw = longs[package][lang]
+		except:
+		    print "Language %s for package %s not available." % (lang, package)
 	else:
 		node.short.raw = '<?=_("untranslated")?>'
 		node.long.raw = '<?=_("untranslated")?><br /><?=_("Please follow the link below to start translating")?>:<br /><br /><a href="%s">%s</a>' % (trans_url % (lang, package), trans_url % (lang, package))
@@ -158,11 +156,20 @@
 	pos = url.rfind("/")
 	name = "%s/data/ddtp/%s" % (base, url[pos + 1:])
 	urlretrieve(url, name)
-	
-packages = parseTasks()
-#packages = ["adun.app", "gcc", "emboss-explorer"]
-packages.sort()
 
+if len(argv) <= 1 :
+	print >>stderr, "Warning: No CDD name given as command line argument.  Using %s." % CDD
+else:
+	if argv[1] not in REPOS.keys():
+		print >>stderr, "Unknown CDD name: %s. Don't know what to do." % CDD
+		exit(-1)
+	CDD = argv[1]
+
+cdeps=CddDependencies(CDD)
+cdeps.GetAllDependencies()
+
+packages = cdeps.GetAllDependantPackagesOfCDD()
+
 # XXX TODO HACK NEWS
 # Re-enable this to force-fetch the packages.
 # Shouldn't be done unless having talked to DDTSS admins.




More information about the debian-med-commit mailing list