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

Function action_programs_install

Scripts/Developer Base/Mobile Desktop.py:1746–1863  ·  view source on GitHub ↗
(cfg: Dict)

Source from the content-addressed store, hash-verified

1744
1745
1746def action_programs_install(cfg: Dict) -> None:
1747 distro = pick_or_install_system_for_programs(cfg)
1748 if not distro:
1749 print(tr(cfg, "invalid"))
1750 pause(cfg)
1751 return
1752
1753 ensure_system_entry(cfg, distro)
1754 installed_pids = set(list_installed_programs(cfg, distro))
1755
1756 # --- Browser / filter menu so we can have a very large catalog without spamming the terminal
1757 print("\n" + tr(cfg, "programs_browser_title"))
1758 items = T[cfg.get("language","en")].get("programs_browser_menu", [
1759 "Show ALL programs",
1760 "Pick a category",
1761 "Search by name",
1762 "Install custom package (type any package name)",
1763 "Back"
1764 ])
1765 for i, item in enumerate(items, 1):
1766 print(f" {i}) {item}")
1767
1768 choice = input("\n" + tr(cfg, "choose")).strip()
1769
1770 if choice == "5":
1771 return
1772
1773 if choice == "4":
1774 pkg_prompt = tr(cfg, "programs_custom_prompt")
1775 pkg = input(pkg_prompt).strip()
1776 install_custom_package(cfg, distro, pkg)
1777 pause(cfg)
1778 return
1779
1780 view = list(PROGRAMS)
1781
1782 if choice == "2":
1783 # category
1784 cats = sorted({p.get("cat","Other") for p in PROGRAMS})
1785 print("\n" + tr(cfg, "programs_pick_category"))
1786 for i, c in enumerate(cats, 1):
1787 print(f" {i}) {c}")
1788 raw = input("\n" + tr(cfg, "choose")).strip()
1789 try:
1790 idx = int(raw)
1791 if not (1 <= idx <= len(cats)):
1792 raise ValueError
1793 cat = cats[idx - 1]
1794 view = [p for p in PROGRAMS if p.get("cat","Other") == cat]
1795 except Exception:
1796 print(tr(cfg, "invalid"))
1797 pause(cfg)
1798 return
1799
1800 elif choice == "3":
1801 q = input(tr(cfg, "programs_search_prompt")).strip().lower()
1802 if q:
1803 def _match(p):

Callers 1

mainFunction · 0.70

Calls 12

printFunction · 0.85
inputFunction · 0.85
trFunction · 0.70
pauseFunction · 0.70
ensure_system_entryFunction · 0.70
list_installed_programsFunction · 0.70
install_custom_packageFunction · 0.70
_matchFunction · 0.70
prog_nameFunction · 0.70
prog_descFunction · 0.70
install_programFunction · 0.70

Tested by

no test coverage detected