Stable output filenames for batch runs

Currently, the output filenames for batches always include batch_time:


    def gen_filename(self, settings, batch, argset, rep):
        filename = "batch-%s-%s-%s" % (
            settings.BATCH_NAME,
            batch['batch_time'],
            batch.get('filename_extra', "%s-%s" % (argset, rep))
        )
        return clean_path(filename)

On one hand, this ensures that output filenames are unique, but on the other hand, one can't create stable links to the output filenames that don't change between runs, for example in a static HTML or markdown file.

What I could do is add a filename_no_time or similar parameter that if set to anything "truthy" (maybe if s in [ '1', 'true', 'yes' ]), excludes the time from the filename, then it's up to people to properly set filename_extra.

Would you be ok if I do that, or do you have any other suggestions for this?

该提问来源于开源项目:tohojo/flent

查看全部
weixin_39613089
weixin_39613089
2020/12/01 14:50
  • 点赞
  • 收藏
  • 回答
    私信

3个回复