From d2fc53c1fa47fcc725441344ab230f4f75544f4e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Nov 2023 16:05:19 +0100 Subject: [PATCH] cmd history introduction --- .gitignore | 1 + eive_tmtc/config/hook.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 630695e..192f482 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ log /gps_log.txt /config/*.json +/.tmtc-history.txt /scex_conf.json /tmtc_conf.json /seqcnt*.txt diff --git a/eive_tmtc/config/hook.py b/eive_tmtc/config/hook.py index b499a30..8088464 100644 --- a/eive_tmtc/config/hook.py +++ b/eive_tmtc/config/hook.py @@ -1,8 +1,10 @@ from typing import Optional +from prompt_toolkit.history import FileHistory from tmtccmd import CcsdsTmtcBackend, HookBase from tmtccmd.com import ComInterface from tmtccmd.config import CmdTreeNode +from tmtccmd.config.hook import History from tmtccmd.util import ObjectIdDictT, RetvalDictT from eive_tmtc.config.definitions import SPACE_PACKET_IDS @@ -168,3 +170,6 @@ class EiveHookObject(HookBase): def get_retval_dict(self) -> RetvalDictT: return get_retval_dict() + + def get_cmd_history(self) -> Optional[History]: + return FileHistory(".tmtc-history.txt")