web/webconfig.py
changeset 10614 57dfde80df11
parent 10568 3914388b2d0f
child 10666 7f6b5f023884
equal deleted inserted replaced
10613:8d9fe02387e3 10614:57dfde80df11
   458         rdir, filename = split(rpath)
   458         rdir, filename = split(rpath)
   459         if rdir:
   459         if rdir:
   460             staticdir = join(staticdir, rdir)
   460             staticdir = join(staticdir, rdir)
   461             if not isdir(staticdir) and 'w' in mode:
   461             if not isdir(staticdir) and 'w' in mode:
   462                 os.makedirs(staticdir)
   462                 os.makedirs(staticdir)
   463         return file(join(staticdir, filename), mode)
   463         return open(join(staticdir, filename), mode)
   464 
   464 
   465     def static_file_add(self, rpath, data):
   465     def static_file_add(self, rpath, data):
   466         stream = self.static_file_open(rpath)
   466         stream = self.static_file_open(rpath)
   467         stream.write(data)
   467         stream.write(data)
   468         stream.close()
   468         stream.close()