Skip to content

Commit

Permalink
Update hirros
Browse files Browse the repository at this point in the history
  • Loading branch information
pradal committed Mar 20, 2024
1 parent e5cccd2 commit 841cf90
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/rsml/hirros.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
import rsml


def walk(dir: str, recursive=True):
def walk(dir: str, recursive=True, force=False):
""" Traverse a set of directories and return rsml files.
Notes : rsml files are defined by 61_graph*.rsml
"""
dir = Path(dir)
fns = []
for rsml_file in ['61_graph_expertized.rsml', '61_graph.rsml']:
if fns and force:
continue
rsmls = dir.glob(rsml_file)
if rsmls :
fns.extend(rsmls)
Expand All @@ -34,12 +36,13 @@ def walk(dir: str, recursive=True):

final_fns = []
for fn in fns:
if (fn.parent/'80_graph_analysis.xlsx').exists():
continue
elif (fn.parent/'80_graph_expertized_analysis.xlsx').exists():
continue
else:
final_fns.append(fn)
if not force:
if (fn.parent/'80_graph_analysis.xlsx').exists():
continue
elif (fn.parent/'80_graph_expertized_analysis.xlsx').exists():
continue
final_fns.append(fn)

return final_fns

def read(fn):
Expand Down Expand Up @@ -271,7 +274,7 @@ def main():
dirs = [d for d in dirs if Path(d).exists()]

for d in dirs:
rsml_files = walk(dir=d, recursive=recursive)
rsml_files = walk(dir=d, recursive=recursive, force=True)
fns.extend(rsml_files)

print('Process files %s'%(' '.join(fns)))
Expand Down

0 comments on commit 841cf90

Please sign in to comment.