forked from M-Labs/artiq
1
0
Fork 0

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
This commit is contained in:
Sebastien Bourdeauducq 2019-02-19 15:43:04 +08:00
parent 40a0cf806d
commit 596d3e20d7
3 changed files with 10 additions and 6 deletions

View File

@ -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"])

View File

@ -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

View File

@ -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())"