def setup_output_path(self):
"""
Called on task startup to copy all static resources into the output
path (and to make sure the output path exists as a directory).
"""
self.logger.info('setting up output path')
try:
self.output_path.mkdir()
except FileExistsError:
pass
try:
(self.output_path / 'simple').mkdir()
except FileExistsError:
pass
for filename in resource_listdir(__name__, 'static'):
with (self.output_path / filename).open('wb') as f:
source = resource_stream(__name__, 'static/' + filename)
f.write(source.read())
source.close()
评论列表
文章目录