Skip to content

Commit

Permalink
added method that returns string of so file paths in a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederickDeny committed Feb 15, 2024
1 parent bc36d44 commit 69451e2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions e4s_cl/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,13 @@ def parse_bool(value, additional_true=None, additional_false=None):
raise TypeError
return bool(value)

def list_directory_sofiles(path: Path) -> str:
file_paths = ""
for file_path in path.iterdir():
if '.so' in file_path.suffixes: # Check if it is a library file
file_paths += str(file_path.absolute()) + ' '
return file_paths.rstrip()

def empty_dir(path: Path):
for file_path in path.iterdir():
try:
Expand All @@ -325,6 +332,9 @@ def create_symlink(path: Path, dest: Path):
dest_full_path = dest / path.name
if not dest_full_path.exists():
dest_full_path.symlink_to(path)
else:
LOGGER.warning(f'Did not create symlink of {path} as {path.name} is \
already symlinked')

def hline(title, *args, **kwargs):
"""Build a colorful horizontal rule for console output.
Expand Down

0 comments on commit 69451e2

Please sign in to comment.