Exemplo n.º 1
0
    def _pause(self):
        d = Block._pause(self)

        complete = self._c.func  # i.e. _done
        self._c.cancel()
        remaining = self._c.getTime() - now()
        self._pauseTime = now()

        def on_resume():
            self._delay += now() - self._pauseTime
            self._c = reactor.callLater(remaining, complete)

            # TODO: announce new delay of round(self._delay, 4))

        self._onResume = on_resume

        return d
Exemplo n.º 2
0
    def getReferencedVariableNames(self):
        name, attr = variableName(self.getFieldValue('VAR', ''))

        return Block.getReferencedVariableNames(
            self, [name] if not self.disabled else [])
Exemplo n.º 3
0
    def getReferencedVariables(self):
        variable = self._getVariable()

        return Block.getReferencedVariables(
            self,
            [variable] if not self.disabled and variable is not None else [])
Exemplo n.º 4
0
    def getGlobalDeclarationNames(self):
        name = self._varName()

        return Block.getGlobalDeclarationNames(
            self, [name] if not self.disabled else [])
Exemplo n.º 5
0
    def _reset(self):
        return Block._reset(self)

        self._c = None
        self._start = 0
        self._delay = 0
Exemplo n.º 6
0
    def __init__(self, workspace, id):
        Block.__init__(self, workspace, id)

        self._c = None
        self._start = 0
        self._delay = 0