546 shutil.rmtree(os.path.join(dirName, "__pycache__")) |
546 shutil.rmtree(os.path.join(dirName, "__pycache__")) |
547 for name in [f for f in os.listdir(dirName) |
547 for name in [f for f in os.listdir(dirName) |
548 if fnmatch.fnmatch(f, "*.pyc")]: |
548 if fnmatch.fnmatch(f, "*.pyc")]: |
549 os.remove(os.path.join(dirName, name)) |
549 os.remove(os.path.join(dirName, name)) |
550 |
550 |
551 # step 3: descent into subdirectories and delete them if empty |
551 # step 3: delete *.orig files |
|
552 for name in [f for f in os.listdir(dirName) |
|
553 if fnmatch.fnmatch(f, "*.orig")]: |
|
554 os.remove(os.path.join(dirName, name)) |
|
555 |
|
556 # step 4: descent into subdirectories and delete them if empty |
552 for name in os.listdir(dirName): |
557 for name in os.listdir(dirName): |
553 name = os.path.join(dirName, name) |
558 name = os.path.join(dirName, name) |
554 if os.path.isdir(name): |
559 if os.path.isdir(name): |
555 cleanupSource(name) |
560 cleanupSource(name) |
556 if len(os.listdir(name)) == 0: |
561 if len(os.listdir(name)) == 0: |