More autofomatting

Should be good on testpypi now
main
Marcus Sanatan 2026-01-27 01:41:07 -04:00
parent ad0dff3a46
commit 7685db8844
2 changed files with 8 additions and 4 deletions

View File

@ -474,7 +474,8 @@ def custom_tool(tool_name: str, params: str):
except json.JSONDecodeError as e: except json.JSONDecodeError as e:
print_error(f"Invalid JSON for params: {e}") print_error(f"Invalid JSON for params: {e}")
print_info("Example: --params '{\"key\":\"value\"}'") print_info("Example: --params '{\"key\":\"value\"}'")
print_info("Tip: wrap JSON in single quotes to avoid shell escaping issues.") print_info(
"Tip: wrap JSON in single quotes to avoid shell escaping issues.")
sys.exit(1) sys.exit(1)
try: try:
@ -486,14 +487,16 @@ def custom_tool(tool_name: str, params: str):
if result.get("success"): if result.get("success"):
print_success(f"Executed custom tool: {tool_name}") print_success(f"Executed custom tool: {tool_name}")
else: else:
message = (result.get("message") or result.get("error") or "").lower() message = (result.get("message")
or result.get("error") or "").lower()
if "not found" in message and "tool" in message: if "not found" in message and "tool" in message:
try: try:
tools_result = run_list_custom_tools(config) tools_result = run_list_custom_tools(config)
tools = tools_result.get("tools") tools = tools_result.get("tools")
if tools is None: if tools is None:
data = tools_result.get("data", {}) data = tools_result.get("data", {})
tools = data.get("tools") if isinstance(data, dict) else None tools = data.get("tools") if isinstance(
data, dict) else None
names = [ names = [
t.get("name") for t in tools if isinstance(t, dict) and t.get("name") t.get("name") for t in tools if isinstance(t, dict) and t.get("name")
] if isinstance(tools, list) else [] ] if isinstance(tools, list) else []

View File

@ -137,7 +137,8 @@ def info(path: str, compact: bool):
click.echo(f" Type: {data.get('prefabType', 'Unknown')}") click.echo(f" Type: {data.get('prefabType', 'Unknown')}")
click.echo(f" Root: {data.get('rootObjectName', 'N/A')}") click.echo(f" Root: {data.get('rootObjectName', 'N/A')}")
click.echo(f" GUID: {data.get('guid', 'N/A')}") click.echo(f" GUID: {data.get('guid', 'N/A')}")
click.echo(f" Components: {len(data.get('rootComponentTypes', []))}") click.echo(
f" Components: {len(data.get('rootComponentTypes', []))}")
click.echo(f" Children: {data.get('childCount', 0)}") click.echo(f" Children: {data.get('childCount', 0)}")
if data.get('isVariant'): if data.get('isVariant'):
click.echo(f" Variant of: {data.get('parentPrefab', 'N/A')}") click.echo(f" Variant of: {data.get('parentPrefab', 'N/A')}")