[supervision] Add settings selector. (#2959)

This commit is contained in:
Fabien-B
2022-12-16 15:58:44 +01:00
committed by GitHub
parent bf4adb45a2
commit ce19885a1e
5 changed files with 59 additions and 11 deletions
+6
View File
@@ -18,6 +18,12 @@ PAPARAZZI_HOME = os.getenv("PAPARAZZI_HOME", PAPARAZZI_SRC)
CONF_DIR = os.path.join(PAPARAZZI_HOME, "conf/")
def removeprefix(string: str, prefix: str, /) -> str:
if string.startswith(prefix):
return string[len(prefix):]
else:
return string[:]
# TODO: make it work with shell program such as vim.
def edit_file(file_path, prefix=CONF_DIR):
path = prefix + file_path