MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / run_json

Function run_json

Scripts/Developer Base/Tree Explorer.py:1336–1364  ·  view source on GitHub ↗
(lang: str)

Source from the content-addressed store, hash-verified

1334 ignore=ignore,
1335 only=only,
1336 )
1337 print(text)
1338 export_path = prompt_text(lang, "prompt_export", "")
1339 export_text(lang, export_path, text)
1340
1341def run_json(lang: str) -> None:
1342 target = prompt_path(lang, Path("."))
1343 if not target.exists():
1344 print(t("err_path_missing", lang, path=target))
1345 return
1346
1347 show_size = yesno(lang, "prompt_sizes", True)
1348 hide_dot = yesno(lang, "prompt_hide_dot", False)
1349 include_hidden = not hide_dot
1350 depth = prompt_int(lang, 3)
1351 follow = yesno(lang, "prompt_follow", False)
1352 ignore = normalize_patterns(prompt_text(lang, "prompt_ignore", ""))
1353 only = normalize_patterns(prompt_text(lang, "prompt_only", ""))
1354
1355 obj = build_json(
1356 target,
1357 max_depth=depth,
1358 dirs_only=False,
1359 show_size=show_size,
1360 sort_by_size=False,
1361 include_hidden=include_hidden,
1362 follow_symlinks=follow,
1363 ignore=ignore,
1364 only=only,
1365 )
1366 out = _json.dumps(obj, ensure_ascii=False, indent=2)
1367 print(out)

Callers 1

menu_loopFunction · 0.70

Calls 9

printFunction · 0.85
prompt_pathFunction · 0.70
tFunction · 0.70
yesnoFunction · 0.70
prompt_intFunction · 0.70
normalize_patternsFunction · 0.70
prompt_textFunction · 0.70
build_jsonFunction · 0.70
export_textFunction · 0.70

Tested by

no test coverage detected