Skip to content

Commit

Permalink
(archives) listdir returns filenames without path
Browse files Browse the repository at this point in the history
  • Loading branch information
snake-biscuits committed Aug 25, 2024
1 parent 3d189c0 commit e61e8ea
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bsp_tool/archives/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ def path_tuple(path: str) -> Tuple[str]:
if folder.replace("\\", "/") in "./":
return self.namelist()
folder_tuple = path_tuple(folder)
return [
filename
for filename in self.namelist()
if path_tuple(filename)[:-1] == folder_tuple]
namelist_tuples = map(path_tuple, self.namelist())
return [tuple_[-1] for tuple_ in namelist_tuples if tuple_[:-1] == folder_tuple]

def search(self, pattern="*.bsp", case_sensitive=False):
pattern = pattern if case_sensitive else pattern.lower()
Expand Down

0 comments on commit e61e8ea

Please sign in to comment.