Skip to content

Commit

Permalink
fixed string issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Gonzalez committed Jun 1, 2024
1 parent e12ff84 commit bd3ce8b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion hammer/sim/xcelium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,26 @@ def sim_xrun(self) -> bool:
return True

def retrieve_file_list(self, path, exts=[], relative=True) -> list:
return retrieve_files(path, exts, output_type="list")
file_list = []
extslower = [extension.lower() for extension in exts]
exts_proc = [f".{ext}" if ("." not in ext) else ext for ext in extslower]

for (root, directories, filenames) in os.walk(path):
for filename in filenames:
file_ext = (os.path.splitext(filename)[1]).lower()
rel_root = os.path.relpath(root)
if (relative):
filepath = os.path.join(rel_root, filename)
else:
filepath = f"{os.path.join(root, filename)}"

if (not exts):
file_list.append(filepath)
elif (file_ext in exts_proc):
file_list.append(filepath)

return file_list




Expand Down

0 comments on commit bd3ce8b

Please sign in to comment.