def auto_flush_input(counter): # Flush input after timeout. # (Used for flushing the enter key.) time.sleep(self.ttimeoutlen) if flush_counter[0] == counter: call_from_executor(flush_input)
def wait(): " Wait for timeout. " time.sleep(timeout) if len(self.key_buffer) > 0 and counter == self._keys_pressed: # (No keys pressed in the meantime.) call_from_executor(flush_keys)
def auto_flush_input(counter): # Flush input after timeout. # (Used for flushing the enter key.) time.sleep(self.ttimeoutlen) if flush_counter[0] == counter: call_from_executor(flush_input)
def wait(): " Wait for timeout. " time.sleep(self.timeout) if counter == self._keys_pressed: # (No keys pressed in the meantime.) call_from_executor(flush_keys)
def schedule_redraw(): # Call redraw in the eventloop (thread safe). # Usually with the high priority, in order to make the application # feel responsive, but this can be tuned by changing the value of # `max_render_postpone_time`. if self.max_render_postpone_time: _max_postpone_until = time.time() + self.max_render_postpone_time else: _max_postpone_until = None call_from_executor( redraw, _max_postpone_until=_max_postpone_until)
def schedule_redraw(): # Call redraw in the eventloop (thread safe). # Usually with the high priority, in order to make the application # feel responsive, but this can be tuned by changing the value of # `max_render_postpone_time`. if self.max_render_postpone_time: _max_postpone_until = time.time() + self.max_render_postpone_time else: _max_postpone_until = None call_from_executor( redraw, _max_postpone_until=_max_postpone_until)
def in_executor(): # Call reporter report_errors = report(self.location, document) def ready(): self._reporter_is_running = False # If the text has not been changed yet in the meantime, set # reporter errors. (We were running in another thread.) if text == self.buffer.text: self.report_errors = report_errors get_app().invalidate() else: # Restart reporter when the text was changed. self.run_reporter() call_from_executor(ready)
def in_executor(): # Call reporter report_errors = report(self.location, document) def ready(): self._reporter_is_running = False # If the text has not been changed yet in the meantime, set # reporter errors. (We were running in another thread.) if text == self.buffer.text: self.report_errors = report_errors get_app().invalidate() else: # Restart reporter when the text was changed. self.run_reporter() call_from_executor(ready)