From 596d3e20d7aea06abe13cd2c38cdf7a68353d085 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 19 Feb 2019 15:43:04 +0800 Subject: [PATCH] dashboard,browser: do not call get_user_config_dir() in argparse This caused two problems when building the docs: * the path printed in the docs depends on the machine where they are built * it pollutes ~/.config, and also breaks Nix builds --- artiq/frontend/artiq_browser.py | 6 +++--- artiq/frontend/artiq_dashboard.py | 4 +--- doc/manual/faq.rst | 6 ++++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/artiq/frontend/artiq_browser.py b/artiq/frontend/artiq_browser.py index 5076225c7..da5bead60 100755 --- a/artiq/frontend/artiq_browser.py +++ b/artiq/frontend/artiq_browser.py @@ -20,10 +20,8 @@ logger = logging.getLogger(__name__) def get_argparser(): - default_db_file = os.path.join(get_user_config_dir(), "artiq_browser.pyon") - parser = argparse.ArgumentParser(description="ARTIQ Browser") - parser.add_argument("--db-file", default=default_db_file, + parser.add_argument("--db-file", default=None, help="database file for local browser settings " "(default: %(default)s)") parser.add_argument("--browse-root", default="", @@ -132,6 +130,8 @@ class Browser(QtWidgets.QMainWindow): def main(): # initialize application args = get_argparser().parse_args() + if args.db_file is None: + args.db_file = os.path.join(get_user_config_dir(), "artiq_browser.pyon") widget_log_handler = log.init_log(args, "browser") app = QtWidgets.QApplication(["ARTIQ Browser"]) diff --git a/artiq/frontend/artiq_dashboard.py b/artiq/frontend/artiq_dashboard.py index 98d3c2e53..855781720 100755 --- a/artiq/frontend/artiq_dashboard.py +++ b/artiq/frontend/artiq_dashboard.py @@ -36,9 +36,7 @@ def get_argparser(): help="TCP port to connect to for broadcasts") parser.add_argument( "--db-file", default=None, - help="database file for local GUI settings, " - "by default in {} and dependant on master hostname".format( - get_user_config_dir())) + help="database file for local GUI settings") add_common_args(parser) return parser diff --git a/doc/manual/faq.rst b/doc/manual/faq.rst index 8df0258d8..a550392a8 100644 --- a/doc/manual/faq.rst +++ b/doc/manual/faq.rst @@ -107,3 +107,9 @@ The core device tests require the following TTL devices and connections: * ``loop_clock_in``: any input-capable TTL. Must be physically connected to ``loop_clock_out``. If TTL devices are missing, the corresponding tests are skipped. + +find the dashboard and browser configuration files are stored? +-------------------------------------------------------------- + +:: + python -c "from artiq.tools import get_user_config_dir; print(get_user_config_dir())"