From fcc85562a7d62c28f7d3502fec9dec1d48122f34 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Sat, 21 Nov 2020 14:42:26 +0100 Subject: [PATCH] added tweaking (+/- delta) to Adjustable --- slic/core/adjustable/adjustable.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slic/core/adjustable/adjustable.py b/slic/core/adjustable/adjustable.py index 452e3e98..b305f460 100644 --- a/slic/core/adjustable/adjustable.py +++ b/slic/core/adjustable/adjustable.py @@ -25,6 +25,12 @@ class Adjustable(BaseAdjustable, SpecConvenience): return self.current_task.stop() + def tweak(self, delta, *args, **kwargs): + value = self.get_current_value() + value += delta + return self.set_target_value(value, *args, **kwargs) + + def __call__(self, value=None): if value is not None: return self.set_target_value(value)