Skip to content

Commit

Permalink
reformat utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rsanchez87 committed Jul 17, 2024
1 parent 5fec0c6 commit b3e80c0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions fluster/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ def _win_site_data_dirs(appname: str) -> List[str]:
user_data_dir = _linux_user_data_dir


def find_by_ext(dest_dir, exts, excludes=None):
def find_by_ext(
dest_dir: str, exts: List[str], excludes: Optional[List[str]] = None
) -> Optional[str]:
"""Return name by file extension"""
excludes = excludes or []

Expand All @@ -187,7 +189,7 @@ def find_by_ext(dest_dir, exts, excludes=None):
for subdir, _, files in os.walk(dest_dir):
for filename in files:
excluded = False
filepath = subdir + os.sep + filename
filepath = os.path.join(subdir, filename)
if not filepath.endswith(ext) or "__MACOSX" in filepath:
continue
for excl in excludes:
Expand All @@ -199,7 +201,9 @@ def find_by_ext(dest_dir, exts, excludes=None):
return None


def find_by_ext_multiple(dest_dir, exts, excludes=None):
def find_by_ext_multiple(
dest_dir: str, exts: List[str], excludes: Optional[List[str]] = None
) -> List[str]:
"""Return multiple names by file extension"""
excludes = excludes or []
found_files = []
Expand All @@ -209,7 +213,7 @@ def find_by_ext_multiple(dest_dir, exts, excludes=None):
for subdir, _, files in os.walk(dest_dir):
for filename in files:
excluded = False
filepath = subdir + os.sep + filename
filepath = os.path.join(subdir, filename)
if not filepath.endswith(ext) or "__MACOSX" in filepath:
continue
for excl in excludes:
Expand Down

0 comments on commit b3e80c0

Please sign in to comment.