gui,browser: save state in home folder

This commit is contained in:
Sebastien Bourdeauducq 2016-04-15 19:05:12 +08:00
parent e1a229028d
commit d4ba525c9d
3 changed files with 18 additions and 4 deletions

View File

@ -34,6 +34,8 @@ unreleased [2.x]
Experiments no longer need to do it explicitly.
* The result folders are formatted "%Y-%m-%d/%H instead of "%Y-%m-%d/%H-%M".
(i.e. grouping by day and then by hour, instead of by day and then by minute)
* GUI tools save their state file in the user's home directory instead of the
current directory.
unreleased [1.0rc3]

View File

@ -15,10 +15,16 @@ from artiq.browser import datasets, files
def get_argparser():
if os.name == "nt":
default_db_file = os.path.expanduser("~\\artiq_browser.pyon")
else:
default_db_file = os.path.expanduser("~/.artiq_browser.pyon")
parser = argparse.ArgumentParser(description="ARTIQ Browser")
parser.add_argument(
"--db-file", default="artiq_browser.pyon",
help="database file for local browser settings")
"--db-file", default=default_db_file,
help="database file for local browser settings "
"(default: %(default)s)")
parser.add_argument("PATH", nargs="?", help="browse path or file")
verbosity_args(parser)
return parser

View File

@ -18,6 +18,11 @@ from artiq.dashboard import (experiments, shortcuts, explorer,
def get_argparser():
if os.name == "nt":
default_db_file = os.path.expanduser("~\\artiq_dashboard.pyon")
else:
default_db_file = os.path.expanduser("~/.artiq_dashboard.pyon")
parser = argparse.ArgumentParser(description="ARTIQ Dashboard")
parser.add_argument(
"-s", "--server", default="::1",
@ -29,8 +34,9 @@ def get_argparser():
"--port-control", default=3251, type=int,
help="TCP port to connect to for control")
parser.add_argument(
"--db-file", default="artiq_dashboard.pyon",
help="database file for local GUI settings")
"--db-file", default=default_db_file,
help="database file for local GUI settings "
"(default: %(default)s)")
verbosity_args(parser)
return parser