Convert Blender-Purge
to a more generic Blender-Crawl
Tool
#42
@ -80,14 +80,9 @@ def exception_handler(func):
|
|||||||
f"\n# Error: {error}"
|
f"\n# Error: {error}"
|
||||||
"\n# Program will be cancelled."
|
"\n# Program will be cancelled."
|
||||||
)
|
)
|
||||||
cancel_program
|
sys.exit(0)
|
||||||
return func_wrapper
|
return func_wrapper
|
||||||
|
|
||||||
|
|
||||||
def cancel_program() -> None:
|
|
||||||
print("# Exiting blender-crawl")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
def find_default_blender():
|
def find_default_blender():
|
||||||
output = subprocess.check_output(['whereis', 'blender'])
|
output = subprocess.check_output(['whereis', 'blender'])
|
||||||
|
|||||||
default_blender_str = f'/{str(output).split(" /")[1]}'
|
default_blender_str = f'/{str(output).split(" /")[1]}'
|
||||||
@ -307,7 +302,7 @@ def run_blender_crawl(args: argparse.Namespace) -> int:
|
|||||||
# Can only happen on folder here.
|
# Can only happen on folder here.
|
||||||
if not files:
|
if not files:
|
||||||
print("# Found no .blend files to crawl")
|
print("# Found no .blend files to crawl")
|
||||||
cancel_program()
|
sys.exit(0)
|
||||||
|
|
||||||
# Sort.
|
# Sort.
|
||||||
files.sort(key=lambda f: f.name)
|
files.sort(key=lambda f: f.name)
|
||||||
@ -315,7 +310,7 @@ def run_blender_crawl(args: argparse.Namespace) -> int:
|
|||||||
# Prompt confirm.
|
# Prompt confirm.
|
||||||
if not yes:
|
if not yes:
|
||||||
if not prompt_confirm(files):
|
if not prompt_confirm(files):
|
||||||
cancel_program()
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
# crawl each file two times.
|
# crawl each file two times.
|
||||||
|
Loading…
Reference in New Issue
Block a user
I don't think there is much of a reason to have this function?
When I look at the code, it seems like all calls to this could be replaced with
sys.exit(0)
without any loss.We handled this together on the phone! Issue has been resolved.
81083cdb01