Skip to content

Commit

Permalink
List images starting with dot (#2511)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Jan 25, 2024
1 parent 2477760 commit 39d8ff8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ def extension_filter(lst: list[str]) -> str:
def list_glob(directory: str, globexpr: str, ext_filter: list[str]) -> list[str]:
extension_expr = extension_filter(ext_filter)

flags = glob.EXTGLOB | glob.BRACE | glob.GLOBSTAR | glob.NEGATE
flags = glob.EXTGLOB | glob.BRACE | glob.GLOBSTAR | glob.NEGATE | glob.DOTGLOB

foo = list(glob.iglob(globexpr, root_dir=directory, flags=flags))

filtered = glob.globfilter(
glob.iglob(globexpr, root_dir=directory, flags=flags),
foo,
extension_expr,
flags=flags | glob.IGNORECASE,
)
Expand Down

0 comments on commit 39d8ff8

Please sign in to comment.