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

tille at alioth.debian.org tille at alioth.debian.org
Sun Mar 30 07:58:08 UTC 2008


Author: tille
Date: 2008-03-30 07:58:07 +0000 (Sun, 30 Mar 2008)
New Revision: 1669

Modified:
   trunk/community/infrastructure/scripts/update-tasks
Log:
Enable building of tasks pages for other CDDs in proper directories.


Modified: trunk/community/infrastructure/scripts/update-tasks
===================================================================
--- trunk/community/infrastructure/scripts/update-tasks	2008-03-29 14:18:37 UTC (rev 1668)
+++ trunk/community/infrastructure/scripts/update-tasks	2008-03-30 07:58:07 UTC (rev 1669)
@@ -25,6 +25,13 @@
 
 CDD='debian-med'
 
+OUTPUTDIR = { 'debian-med'     : HTMLBASE+"/debian-med/static/tasks/",
+              'debian-edu'     : HTMLBASE+"/cdd/htdocs/science/tasks/",
+              'debian-gis'     : HTMLBASE+"/cdd/htdocs/gis/tasks/",
+              'debian-science' : HTMLBASE+"/cdd/htdocs/science/tasks/",
+            }
+TEMPLATEDIR = "/var/lib/gforge/chroot/home/groups/debian-med/htdocs/"
+
 ###
 # Template handlers
 ###
@@ -214,12 +221,11 @@
 cdeps=CddDependencies(CDD)
 cdeps.GetAllDependencies()
 
-base=HTMLBASE + '/' + CDD
 # Let's render the Tasks Page index, first
-f = open("%s/htdocs/tasks_idx.tmpl" % base)
+f = open(TEMPLATEDIR + "tasks_idx.tmpl")
 tmpl = HTMLTemplate.Template(renderIndex, f.read(), codecs=(None,None)) ##myEncoder, myDecoder))
 f.close()
-outputfile = "%s/static/tasks/index.php" % base
+outputfile = OUTPUTDIR[CDD] + "index.php"
 f = open(outputfile, "w")
 
 tasks        = cdeps.tasknames
@@ -235,12 +241,12 @@
 	pass
 
 # Let's render single pages now.
-f = open("%s/htdocs/tasks.tmpl" % base)
+f = open(TEMPLATEDIR + "tasks.tmpl")
 tmpl = HTMLTemplate.Template(renderTasks, f.read())
 f.close()
 
 for task in tasks:
-	outputfile = "%s/static/tasks/%s.php" % (base, task)
+	outputfile = OUTPUTDIR[CDD] + task + '.php'
 	f = open(outputfile, "w")
 
 	# This is to avoid useless <br>eaks before closing the cell




More information about the debian-med-commit mailing list