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

Function action_programs_remove

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

Source from the content-addressed store, hash-verified

1864
1865
1866def action_programs_remove(cfg: Dict) -> None:
1867 installed = get_installed_distros()
1868 if not installed:
1869 print("\n" + tr(cfg, "installed"))
1870 print(" " + tr(cfg, "none_installed"))
1871 pause(cfg)
1872 return
1873
1874 print("\n" + tr(cfg, "installed"))
1875 distro = pick_from_list(tr(cfg, "pick_system"), installed)
1876 if not distro:
1877 print(tr(cfg, "invalid"))
1878 pause(cfg)
1879 return
1880 ensure_system_entry(cfg, distro)
1881 installed_pids = list_installed_programs(cfg, distro)
1882
1883 print("\n" + tr(cfg, "programs_installed_list"))
1884 if not installed_pids:
1885 print(" " + tr(cfg, "none"))
1886 pause(cfg)
1887 return
1888
1889 # show installed with names
1890 display = []
1891 for pid in installed_pids:
1892 p = get_program_by_id(pid)
1893 display.append((pid, prog_name(cfg, p) if p else pid))
1894 for i, (_, name) in enumerate(display, 1):
1895 print(f" {i}) {name}")
1896
1897 try:
1898 idx = int(input("\n" + tr(cfg, "programs_pick")).strip())
1899 if not (1 <= idx <= len(display)):
1900 raise ValueError
1901 pid = display[idx - 1][0]
1902 except Exception:
1903 print(tr(cfg, "invalid"))
1904 pause(cfg)
1905 return
1906
1907 remove_program(cfg, distro, pid)
1908 pause(cfg)
1909
1910def action_update(cfg: Dict) -> None:
1911 installed = get_installed_distros()

Callers 1

mainFunction · 0.70

Calls 11

printFunction · 0.85
inputFunction · 0.85
get_installed_distrosFunction · 0.70
trFunction · 0.70
pauseFunction · 0.70
pick_from_listFunction · 0.70
ensure_system_entryFunction · 0.70
list_installed_programsFunction · 0.70
get_program_by_idFunction · 0.70
prog_nameFunction · 0.70
remove_programFunction · 0.70

Tested by

no test coverage detected