From 33c2d475c87dbfc0a755ad44f46b77cc32ddbc48 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Wed, 26 May 2021 12:20:24 +0200 Subject: [PATCH] allow adding several pvs at once --- director.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/director.py b/director.py index cc7774a..25b3fcb 100644 --- a/director.py +++ b/director.py @@ -20,16 +20,18 @@ class Director: doc.add_root(layout) + def on_add_pv(self, attr, old, new): + print(f"CB Add PV: attribute \"{attr}\" changed from \"{old}\" to \"{new}\"") + new = new.replace(",", " ").split() + new = reversed(new) + self.add_pvs(*new) + + def add_pvs(self, *pvnames): for n in pvnames: self.add_pv(n) - def on_add_pv(self, attr, old, new): - print("CB Add PV:", attr, old, new) - self.add_pv(new) - - def add_pv(self, pvname): print("Add PV:", pvname)