Skip to content

Commit

Permalink
Merge branch 'pygame-web:main' into panda3d
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p authored Sep 23, 2024
2 parents fa6d926 + 397141b commit 2429654
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/pygbag/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,28 @@
def filter(walked, ignore_dirs, ignore_files):
global dbg, IGNORE, SKIP_EXT, IGNORE_FILES
IGNORE.extend(ignore_dirs)

IGNORE_FILES = ignore_files

for folder, filenames in walked:
blocking = False

fx = Path(folder).as_posix()

# ignore .* folders
if folder.startswith("."):
if fx.startswith("."):
continue

for block in IGNORE:
if not block:
continue

if folder.match(block):
if dbg:
print("REJ 1", folder)
blocking = True
break

fx = folder.as_posix()

if fx.startswith(f"{block}/"):
if dbg:
print("REJ 2", folder)
Expand All @@ -62,17 +63,21 @@ def filter(walked, ignore_dirs, ignore_files):
continue

for filename in filenames:
fnx = Path(filename).as_posix()

# ignore .* files
if filename.startswith("."):
if fnx.startswith("."):
continue
if filename in [".gitignore"]:

if fnx in [".gitignore"]:
if dbg:
print("REJ 3", folder, filename)
continue
if filename in IGNORE_FILES:

if fnx in IGNORE_FILES:
continue

ext = filename.rsplit(".", 1)[-1].lower()
ext = fnx.rsplit(".", 1)[-1].lower()
if ext in SKIP_EXT:
if dbg:
print("REJ 4", folder, filename)
Expand Down

0 comments on commit 2429654

Please sign in to comment.