local.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:dsub 作者: googlegenomics 项目源码 文件源码
def _read_task_metadata(self, task_dir):
    """Read the meta file containing core fields for dstat."""

    try:
      with open(os.path.join(task_dir, 'meta.yaml'), 'r') as f:
        meta = yaml.load('\n'.join(f.readlines()))

      # Make sure that create-time string is turned into a datetime
      meta['create-time'] = datetime.strptime(meta['create-time'],
                                              '%Y-%m-%d %H:%M:%S.%f')

      return meta
    except (IOError, OSError):
      # lookup_job_tasks may try to read the task metadata as a task is being
      # created. In that case, just catch the exception and return None.
      return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号