kllk
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
This commit is contained in:
@@ -141,8 +141,8 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
try:
|
||||
import cmdlet_catalog as _catalog
|
||||
|
||||
CMDLET.arg[0].choices = _normalize_choice_list(_catalog.list_cmdlet_names())
|
||||
metadata = _catalog.list_cmdlet_metadata()
|
||||
CMDLET.arg[0].choices = _normalize_choice_list(_catalog.list_cmdlet_names(config=config))
|
||||
metadata = _catalog.list_cmdlet_metadata(config=config)
|
||||
except Exception:
|
||||
CMDLET.arg[0].choices = []
|
||||
metadata = {}
|
||||
|
||||
@@ -1104,10 +1104,11 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
# Use config from context or load it
|
||||
config_data = config if config else {}
|
||||
|
||||
storage_path = get_local_storage_path(config_data)
|
||||
if not storage_path:
|
||||
debug("Local storage path not configured.")
|
||||
return 1
|
||||
storage_path = get_local_storage_path(config_data) or _default_state_dir()
|
||||
try:
|
||||
Path(storage_path).mkdir(parents=True, exist_ok=True)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
with LocalLibrarySearchOptimizer(storage_path) as db:
|
||||
if db.save_playlist(playlist_name, clean_items):
|
||||
@@ -1720,12 +1721,14 @@ CMDLET = Cmdlet(
|
||||
CmdletArg(
|
||||
name="save",
|
||||
type="flag",
|
||||
description="Save current playlist to database"
|
||||
description="Save current playlist to database",
|
||||
requires_db=True,
|
||||
),
|
||||
CmdletArg(
|
||||
name="load",
|
||||
type="flag",
|
||||
description="List saved playlists"
|
||||
description="List saved playlists",
|
||||
requires_db=True,
|
||||
),
|
||||
CmdletArg(
|
||||
name="current",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"""Worker cmdlet: Display workers table in ResultTable format."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import sys
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timezone
|
||||
@@ -22,11 +21,11 @@ CMDLET = Cmdlet(
|
||||
summary="Display workers table in result table format.",
|
||||
usage=".worker [status] [-limit N] [@N]",
|
||||
arg=[
|
||||
CmdletArg("status", description="Filter by status: running, completed, error (default: all)"),
|
||||
CmdletArg("limit", type="integer", description="Limit results (default: 100)"),
|
||||
CmdletArg("@N", description="Select worker by index (1-based) and display full logs"),
|
||||
CmdletArg("-id", description="Show full logs for a specific worker"),
|
||||
CmdletArg("-clear", type="flag", description="Remove completed workers from the database"),
|
||||
CmdletArg("status", description="Filter by status: running, completed, error (default: all)", requires_db=True),
|
||||
CmdletArg("limit", type="integer", description="Limit results (default: 100)", requires_db=True),
|
||||
CmdletArg("@N", description="Select worker by index (1-based) and display full logs", requires_db=True),
|
||||
CmdletArg("-id", description="Show full logs for a specific worker", requires_db=True),
|
||||
CmdletArg("-clear", type="flag", description="Remove completed workers from the database", requires_db=True),
|
||||
],
|
||||
detail=[
|
||||
"- Shows all background worker tasks and their output",
|
||||
@@ -63,7 +62,7 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
selection_requested = bool(selection_indices) and isinstance(result, list) and len(result) > 0
|
||||
|
||||
if _has_help_flag(args_list):
|
||||
log(json.dumps(CMDLET, ensure_ascii=False, indent=2))
|
||||
ctx.emit(CMDLET.__dict__)
|
||||
return 0
|
||||
|
||||
options = _parse_worker_args(args_list)
|
||||
|
||||
Reference in New Issue
Block a user