提交 9d2f7d76 编写于 作者: L lujun

fix dy-load bug, test=develop

上级 94c4cd1a
...@@ -134,14 +134,19 @@ def _save_var_to_file(stat_dict, file_dir, file_name): ...@@ -134,14 +134,19 @@ def _save_var_to_file(stat_dict, file_dir, file_name):
def _load_var_from_file(file_dir): def _load_var_from_file(file_dir):
def walk_filename(file_dir): def walk_filename(file_dir):
base_path = os.path.join(file_dir)
var_name_list = [] var_name_list = []
if os.path.exists(file_dir) and os.path.exists(os.path.join(file_dir)): if os.path.exists(base_path):
base_path = os.path.join(file_dir) for dirpath, dirnames, filenames in os.walk(base_path):
for dirpath, dirnames, filenames in os.walk(os.path.join(file_dir)): pt = dirpath.replace(base_path, "", 1)
pt = dirpath.replace(base_path, "", 1)[1:] if pt.startswith("/") or pt.startswith("\\"):
pt = pt[1:]
for fth_name in filenames: for fth_name in filenames:
if fth_name[0] != '.': if fth_name[0] != '.':
var_name_list.append(os.path.join(pt, fth_name)) name_path = os.path.join(pt, fth_name)
if "\\" in name_path:
name_path = name_path.replace("\\", "/")
var_name_list.append(name_path)
return var_name_list return var_name_list
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册