From 265dbb1a579a7d9e8488ed7e5e1eb1a8ce86e713 Mon Sep 17 00:00:00 2001 From: l_samenv Date: Thu, 6 Mar 2025 15:37:20 +0100 Subject: [PATCH] gui: add org- and app-name to QtApplication for a better path name of stored configuration --- bin/frappy-gui | 2 +- frappy/client/interactive.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/frappy-gui b/bin/frappy-gui index b77791e..1ba9ff6 100755 --- a/bin/frappy-gui +++ b/bin/frappy-gui @@ -69,7 +69,7 @@ def main(argv=None): console.setLevel(loglevel) logger.addHandler(console) - app = QApplication(argv) + app = QApplication(argv, organizationName='frappy', applicationName='frappy_gui') win = MainWindow(args, logger) app.aboutToQuit.connect(win._onQuit) diff --git a/frappy/client/interactive.py b/frappy/client/interactive.py index 0ae14d0..21a1100 100644 --- a/frappy/client/interactive.py +++ b/frappy/client/interactive.py @@ -498,7 +498,7 @@ class Console(code.InteractiveConsole): history = None if readline: try: - history = expanduser(f'~/.frappy-{name}-history') + history = expanduser(f'~/.config/frappy/{name}-history') readline.read_history_file(history) except FileNotFoundError: pass @@ -538,10 +538,10 @@ def init(*nodes): return success -def interact(usage_tail=''): +def interact(usage_tail='', appname=None): empty = '_c0' not in clientenv.namespace print(USAGE.format( client_name='cli' if empty else '_c0', client_assign="\ncli = Client('localhost:5000')\n" if empty else '', tail=usage_tail)) - Console() + Console(name=f'cli-{appname}' if appname else 'cli')