From 9b8b7fb424488b59f30bf22c43ef4db4756c9e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Sat, 29 Jun 2024 17:05:34 +0300 Subject: [PATCH] d --- v5/desktop_SequentialTimer.py | 4 ++-- v5/main-gui.py | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/v5/desktop_SequentialTimer.py b/v5/desktop_SequentialTimer.py index ae687c4..f4708b9 100644 --- a/v5/desktop_SequentialTimer.py +++ b/v5/desktop_SequentialTimer.py @@ -3,7 +3,7 @@ import time class desktop_SequentialTimer(): def __init__(self): self.activeTimeout = None - self.ctrl = None + self.callback = None self.queue = [] #} @@ -26,7 +26,7 @@ class desktop_SequentialTimer(): value = self.queue[0][2] self.queue.pop(0) self.activeTimeout = None - self.ctrl.set(key, value) + self.callback(key, value) #} #} diff --git a/v5/main-gui.py b/v5/main-gui.py index abc4620..4df07a1 100644 --- a/v5/main-gui.py +++ b/v5/main-gui.py @@ -75,16 +75,15 @@ ctrl.registerFunctions([ memory_selectItem, ]) -def printOutput(c): - if c.recentField.startswith("output"): - print(c.field(c.recentField)) -ctrl.registerCallback(printOutput) +def printDbg(c): + print(f"Dbg key/value: '{c.recentField}'/'{c.field(c.recentField)}'") +ctrl.registerCallback(printDbg) ctrl.registerFieldCallback("exit", lambda c: sys.exit(0)) p = desktop_Platform() p.ctrl = ctrl p.sequentialTimer = desktop_SequentialTimer() -p.sequentialTimer.ctrl = ctrl +p.sequentialTimer.callback = lambda key, value: ctrl.set(key, value) # Copy context to platform. # And process lots of functions that are interested in changes.