/[debian-med]/trunk/community/infrastructure/scripts/update-tasks
ViewVC logotype

Diff of /trunk/community/infrastructure/scripts/update-tasks

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1674 by tille, Sun Mar 30 07:58:07 2008 UTC revision 1675 by tille, Mon Mar 31 15:17:41 2008 UTC
# Line 15  import apt_inst Line 15  import apt_inst
15  import HTMLTemplate  import HTMLTemplate
16  import re  import re
17  from sys import argv, exit, stderr  from sys import argv, exit, stderr
18  from os import chmod  import os
19  from stat import S_IWGRP, S_IRUSR, S_IRGRP, S_IWUSR, S_IROTH  from stat import S_IWGRP, S_IRUSR, S_IRGRP, S_IWUSR, S_IROTH
20  import time  import time
21  from datetime import datetime  from datetime import datetime
# Line 26  from cddtasktools import CddDependencies Line 26  from cddtasktools import CddDependencies
26  CDD='debian-med'  CDD='debian-med'
27    
28  OUTPUTDIR = { 'debian-med'     : HTMLBASE+"/debian-med/static/tasks/",  OUTPUTDIR = { 'debian-med'     : HTMLBASE+"/debian-med/static/tasks/",
29                'debian-edu'     : HTMLBASE+"/cdd/htdocs/science/tasks/",                'debian-edu'     : HTMLBASE+"/cdd/htdocs/edu/tasks/",
30                'debian-gis'     : HTMLBASE+"/cdd/htdocs/gis/tasks/",                'debian-gis'     : HTMLBASE+"/cdd/htdocs/gis/tasks/",
31                'debian-science' : HTMLBASE+"/cdd/htdocs/science/tasks/",                'debian-science' : HTMLBASE+"/cdd/htdocs/science/tasks/",
32              }              }
# Line 225  cdeps.GetAllDependencies() Line 225  cdeps.GetAllDependencies()
225  f = open(TEMPLATEDIR + "tasks_idx.tmpl")  f = open(TEMPLATEDIR + "tasks_idx.tmpl")
226  tmpl = HTMLTemplate.Template(renderIndex, f.read(), codecs=(None,None)) ##myEncoder, myDecoder))  tmpl = HTMLTemplate.Template(renderIndex, f.read(), codecs=(None,None)) ##myEncoder, myDecoder))
227  f.close()  f.close()
228    
229    # Make sure OUTPUTDIR exists
230    if not os.access(OUTPUTDIR[CDD], os.W_OK):
231            try:
232                    os.makedirs(OUTPUTDIR[CDD])
233            except:
234                    print >> stderr, "Unable to create output directory", OUTPUTDIR[CDD]
235    
236  outputfile = OUTPUTDIR[CDD] + "index.php"  outputfile = OUTPUTDIR[CDD] + "index.php"
237  f = open(outputfile, "w")  f = open(outputfile, "w")
238    
# Line 235  task_details = cdeps.GetTaskDescDict() Line 243  task_details = cdeps.GetTaskDescDict()
243  f.write(tmpl.render(tasks))  f.write(tmpl.render(tasks))
244  f.close()  f.close()
245  try:  try:
246          chmod(outputfile,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH)          os.chmod(outputfile,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH)
247  except:  except:
248          # chmod is not allowed to other peoples files          # chmod is not allowed to other peoples files
249          pass          pass

Legend:
Removed from v.1674  
changed lines
  Added in v.1675

  ViewVC Help
Powered by ViewVC 1.1.5