Add YAPF style + ignore, and format tracked Python files

This commit is contained in:
2025-12-29 18:42:02 -08:00
parent c019c00aed
commit 507946a3e4
108 changed files with 11664 additions and 6494 deletions

View File

@@ -1,7 +1,7 @@
from typing import List, Dict, Any
from cmdlet._shared import Cmdlet, CmdletArg
from config import load_config, save_config
from SYS.config import load_config, save_config
CMDLET = Cmdlet(
name=".config",
@@ -9,16 +9,24 @@ CMDLET = Cmdlet(
usage=".config [key] [value]",
arg=[
CmdletArg(
name="key", description="Configuration key to update (dot-separated)", required=False
name="key",
description="Configuration key to update (dot-separated)",
required=False
),
CmdletArg(
name="value",
description="New value for the configuration key",
required=False
),
CmdletArg(name="value", description="New value for the configuration key", required=False),
],
)
def flatten_config(
config: Dict[str, Any], parent_key: str = "", sep: str = "."
) -> List[Dict[str, Any]]:
def flatten_config(config: Dict[str,
Any],
parent_key: str = "",
sep: str = ".") -> List[Dict[str,
Any]]:
items = []
for k, v in config.items():
if k.startswith("_"): # Skip internal keys
@@ -126,9 +134,8 @@ def _run(piped_result: Any, args: List[str], config: Dict[str, Any]) -> int:
value = " ".join(args[1:])
# Remove quotes if present
if (value.startswith('"') and value.endswith('"')) or (
value.startswith("'") and value.endswith("'")
):
if (value.startswith('"') and value.endswith('"')) or (value.startswith("'")
and value.endswith("'")):
value = value[1:-1]
try: