Convert Blender-Purge to a more generic Blender-Crawl Tool #42

Merged
Nick Alberelli merged 34 commits from feature/blender-crawl into main 2023-05-17 15:38:47 +02:00
Showing only changes of commit ba0e35614d - Show all commits

View File

@ -80,13 +80,8 @@ def exception_handler(func):
f"\n# Error: {error}"
"\n# Program will be cancelled."
)
cancel_program
return func_wrapper
def cancel_program() -> None:
print("# Exiting blender-crawl")
sys.exit(0)
return func_wrapper
def find_default_blender():
output = subprocess.check_output(['whereis', 'blender'])
@ -307,7 +302,7 @@ def run_blender_crawl(args: argparse.Namespace) -> int:
# Can only happen on folder here.
if not files:
print("# Found no .blend files to crawl")
cancel_program()
sys.exit(0)
# Sort.
files.sort(key=lambda f: f.name)
@ -315,7 +310,7 @@ def run_blender_crawl(args: argparse.Namespace) -> int:
# Prompt confirm.
if not yes:
if not prompt_confirm(files):
cancel_program()
sys.exit(0)
# crawl each file two times.