mirror of
https://github.com/9001/copyparty.git
synced 2026-04-12 23:32:32 -06:00
util: update exclude_dotfiles to honor .hidden
This commit is contained in:
parent
665a40ed0e
commit
67fd204003
|
|
@ -2389,14 +2389,22 @@ def load_dothidden(dpath: str) -> set[str]:
|
|||
return {}
|
||||
|
||||
|
||||
def exclude_dotfiles(filepaths: list[str]) -> list[str]:
|
||||
return [x for x in filepaths if not x.split("/")[-1].startswith(".")]
|
||||
def exclude_dotfiles(filepaths: list[str], dothidden: Optional[set[str]] = None) -> list[str]:
|
||||
return [
|
||||
x for x in filepaths
|
||||
if not x.split("/")[-1].startswith(".")
|
||||
and (dothidden is None or x.split("/")[-1] not in dothidden)
|
||||
]
|
||||
|
||||
|
||||
def exclude_dotfiles_ls(
|
||||
vfs_ls: list[tuple[str, os.stat_result]]
|
||||
vfs_ls: list[tuple[str, os.stat_result]], dothidden: Optional[set[str]] = None
|
||||
) -> list[tuple[str, os.stat_result]]:
|
||||
return [x for x in vfs_ls if not x[0].split("/")[-1].startswith(".")]
|
||||
return [
|
||||
x for x in vfs_ls
|
||||
if not x[0].split("/")[-1].startswith(".")
|
||||
and (dothidden is None or x[0].split("/")[-1] not in dothidden)
|
||||
]
|
||||
|
||||
|
||||
def odfusion(
|
||||
|
|
|
|||
Loading…
Reference in a new issue