commit ac5f67ff73629a2d943182fb8cafda54afbda1db
parent 0a7171453cabef24768f77b1bb0e73b756a5a715
Author: Isak Lindhé <isak.e.lindhe@gmail.com>
Date: Fri, 15 Feb 2019 07:31:01 +0100
confable prompt
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/config.py b/src/config.py
@@ -19,6 +19,9 @@ def get_or_gen_config(config_path: Path = CONFIG_DIR / 'svtxtv.conf'):
'ut':'104',
'innehÄll':'700',
}
+ cfg['general'] = {
+ 'prompt': 'txtv> ',
+ }
if not CONFIG_DIR.exists():
CONFIG_DIR.mkdir()
cfg.write(open(config_path, 'w'))
diff --git a/src/txtv.py b/src/txtv.py
@@ -68,12 +68,13 @@ def match_command(arg: str, interactive=False):
return None, None
-def interactive(start_page: Page, cfg=None):
+def interactive(start_page: Page, cfg):
start_page.show()
state = dict(page=start_page)
while True:
try:
- raw = input('> ').strip().lower()
+ prompt = cfg.get('general', 'prompt')
+ raw = input(prompt or '> ').strip().lower()
if cfg:
raw = apply_aliases(raw, cfg)
if raw == '':