MCPcopy Create free account
hub / github.com/LabPy/lantz / internal

Method internal

lantz/ui/blocks/loop.py:90–109  ·  view source on GitHub ↗
(counter, overrun=False, schedule=QtCore.QTimer.singleShot)

Source from the content-addressed store, hash-verified

88 body = body or self.body
89
90 def internal(counter, overrun=False, schedule=QtCore.QTimer.singleShot):
91 if not self._active:
92 self.loop_done.emit(True)
93 return
94
95 st = time.time()
96 self.iteration.emit(counter, iterations, overrun)
97 body(counter, iterations, overrun)
98
99 if iterations and counter + 1 == iterations:
100 self._active = False
101 self.loop_done.emit(False)
102 return
103 elif not self._active:
104 self.loop_done.emit(True)
105 return
106
107 sleep = interval - (time.time() - st)
108 schedule(sleep * 1000 if sleep > 0 else 0,
109 lambda: self._internal_func(counter + 1, sleep < 0))
110
111 self._internal_func = internal
112 if timeout:

Callers

nothing calls this directly

Calls 2

emitMethod · 0.45
timeMethod · 0.45

Tested by

no test coverage detected