def _check_paths(self):
if not os.path.exists(self.data_file):
raise click.UsageError("Data file not found: %s\n" % self.data_file)
if self.template_file is not None and not os.path.exists(self.template_file):
raise click.UsageError("Template file not found: %s\n" % self.template_file)
if os.path.exists(self.output_dir) and not os.access(self.output_dir, os.W_OK):
raise click.UsageError("Output is not writable: %s\n" % self.output_dir)
if not os.path.exists(self.output_dir):
os.makedirs(self.output_dir)
评论列表
文章目录