def restart_timer(self): self.cancel_timer() self._timer = GLib.timeout_add_seconds(self._timeout, self.on_timeout)