From 364e3d48ab6aa11cfca7504db4950dca9cad107b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 6 Apr 2016 17:21:35 +0800 Subject: [PATCH] applets/TitleApplet: support hierarchical datasets in titles --- artiq/applets/simple.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/artiq/applets/simple.py b/artiq/applets/simple.py index 56bad046a..b31415c40 100644 --- a/artiq/applets/simple.py +++ b/artiq/applets/simple.py @@ -236,7 +236,7 @@ class TitleApplet(SimpleApplet): self.argparser.add_argument("--title", default=None, help="set title (can be a Python format " "string where field names are dataset " - "names)") + "names, replace '.' with '/')") def args_init(self): SimpleApplet.args_init(self) @@ -248,12 +248,12 @@ class TitleApplet(SimpleApplet): break if not format_field: raise ValueError("Invalid title format string") - self.dataset_title.add(format_field) + self.dataset_title.add(format_field.replace("/", ".")) self.datasets |= self.dataset_title def emit_data_changed(self, data, mod_buffer): if self.args.title is not None: - title_values = {k: data.get(k, (False, None))[1] + title_values = {k.replace(".", "/"): data.get(k, (False, None))[1] for k in self.dataset_title} try: title = self.args.title.format(**title_values)