Make using tui.operations more convenient

This commit is contained in:
Kovid Goyal
2018-05-06 15:34:11 +05:30
parent ffc6e65392
commit d133ffac25
3 changed files with 56 additions and 40 deletions

View File

@@ -3,12 +3,16 @@
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
from kittens.tui.operations import commander
class Handler:
def _initialize(self, screen_size, quit_loop, wakeup, start_job):
self.screen_size, self.quit_loop = screen_size, quit_loop
self.wakeup = wakeup
self.start_job = start_job
self.cmd = commander(self)
def __enter__(self):
self.initialize()