mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 01:08:10 +02:00
Get rid of the timers infrastructure
It is not needed with a pure state machine. Note that drag scrolling still has to be ported from using timers.
This commit is contained in:
@@ -7,7 +7,7 @@ from unittest import skipIf
|
||||
|
||||
from kitty.config import build_ansi_color_table, defaults
|
||||
from kitty.fast_data_types import (
|
||||
REVERSE, ColorProfile, Cursor as C, HistoryBuf, LineBuf, Timers,
|
||||
REVERSE, ColorProfile, Cursor as C, HistoryBuf, LineBuf,
|
||||
sprite_map_set_layout, sprite_map_set_limits, sprite_position_for
|
||||
)
|
||||
from kitty.utils import sanitize_title, wcwidth
|
||||
@@ -367,23 +367,3 @@ class TestDataTypes(BaseTest):
|
||||
a = []
|
||||
hb.as_ansi(a.append)
|
||||
self.ae(a, ['\x1b[0m' + str(hb.line(i)) + '\n' for i in range(hb.count - 1, -1, -1)])
|
||||
|
||||
def test_timers(self):
|
||||
t = Timers()
|
||||
a = []
|
||||
t.add(10, a.append, (1,))
|
||||
t.add(0, a.append, (2,))
|
||||
t.add_if_missing(20, a.append, (3,))
|
||||
self.ae(t.timeout(), 0)
|
||||
t.call(), t.call()
|
||||
self.ae(a, [2])
|
||||
del a[:]
|
||||
t.add(200, a.append, (4,))
|
||||
d = t.timeout()
|
||||
self.assertGreater(d, 8)
|
||||
self.assertLess(d, 10.1)
|
||||
t.call()
|
||||
self.ae(a, [])
|
||||
t.add(0, a.append, (5,))
|
||||
t.call()
|
||||
self.ae(a, [5])
|
||||
|
||||
Reference in New Issue
Block a user