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

CDD Subversion Commit noreply at alioth.debian.org
Wed Jun 18 15:42:29 UTC 2008


Author: tille
Date: Wed Jun 18 15:42:29 2008
New Revision: 835

Modified:
   cdd/trunk/webtools/tasks.py
Log:
Fixing some bugs to really create reasonable index files.


Modified: cdd/trunk/webtools/tasks.py
==============================================================================
--- cdd/trunk/webtools/tasks.py	(original)
+++ cdd/trunk/webtools/tasks.py	Wed Jun 18 15:42:29 2008
@@ -61,6 +61,8 @@
               'debian-science' : HTMLBASE+"/cdd/htdocs/science/tasks/",
             }
 
+data['taskskeys'] = data['tasks'].keys()
+data['taskskeys'].sort()
 
 if not os.access(OUTPUTDIR[CDD], os.W_OK):
 	try:
@@ -121,12 +123,17 @@
 	for verbatim in VERBATIM:
 		data[verbatim] = Markup(data[verbatim])
 	for task in data['tasks'].keys():
+		print task
     		data['tasks'][task]['LongDesc'] = Markup(data['tasks'][task]['LongDesc'])
 
 	template = loader.load('tasks_idx.xhtml')
 
 	outputfile = OUTPUTDIR[CDD] + '/index_' + lang + '.html'
-	f = open('index_' + lang + '.html', 'w')
+	try:
+		os.unlink(outputfile)
+	except: # simply continue if file does not exist
+		pass
+	f = open(outputfile, 'w')
 	print >> f, template.generate(**data).render('xhtml')
 	f.close()
 



More information about the Cdd-commits mailing list