未验证 提交 be203c77 编写于 作者: C chenjian 提交者: GitHub

Fix a bug in get_vdl_log_file when logdir does not exist (#1002)

上级 d985994f
......@@ -64,17 +64,17 @@ def get_vdl_log_file(logdirs):
"exp2": "vdlrecords.1587375685.log"}
"""
walks = {}
walks_temp = {}
for logdir in logdirs:
for root, dirs, files in bfile.walk(logdir):
walks.update({root: files})
walks_temp = {}
for run, tags in walks.items():
tags_temp = [tag for tag in tags if
is_VDLRecord_file(path=bfile.join(run, tag), check=False)]
tags_temp.sort(reverse=True)
if len(tags_temp) > 0:
walks_temp.update({run: tags_temp[0]})
for run, tags in walks.items():
tags_temp = [tag for tag in tags if
is_VDLRecord_file(path=bfile.join(run, tag), check=False)]
tags_temp.sort(reverse=True)
if len(tags_temp) > 0:
walks_temp.update({run: tags_temp[0]})
return walks_temp
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册