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

Function run_settings_list_menu

Scripts/Settings.py:7750–7783  ·  view source on GitHub ↗

Settings menu using list style (curses)

()

Source from the content-addressed store, hash-verified

7748 return session
7749 raise ValueError('This session is not accepting input right now.')
7750
7751
7752def create_job(label, command, cwd, kind='process', real_termux=False):
7753 session_id = next_session_id('job')
7754 log_file = os.path.join(LOGS_DIR, session_id + '.log')
7755 pid_file = os.path.join(PIDS_DIR, session_id + '.pid')
7756 exit_file = os.path.join(EXITS_DIR, session_id + '.exit')
7757 job = {
7758 'id': session_id,
7759 'label': label,
7760 'command': command,
7761 'started_at': now_iso(),
7762 'log_file': log_file,
7763 'pid_file': pid_file,
7764 'exit_file': exit_file,
7765 'running': True,
7766 'exit_code': None,
7767 'real_termux': real_termux,
7768 'cwd': cwd,
7769 'cwd_file': '',
7770 'interactive': False,
7771 'kind': kind,
7772 'closed': False
7773 }
7774 with STATE_LOCK:
7775 jobs = _prune_job_history(load_jobs())
7776 jobs[session_id] = job
7777 save_jobs(jobs)
7778 with open(log_file, 'w', encoding='utf-8') as handle:
7779 handle.write('[' + now_iso() + '] Starting: ' + command + '\n')
7780 return job
7781
7782
7783def build_wrapper_script(job, shell_command, cwd):
7784 wrapper_path = os.path.join(WRAPPERS_DIR, job['id'] + '.sh')
7785 content = """#!/data/data/com.termux/files/usr/bin/bash
7786set +e

Callers 1

run_settings_menuFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected