i am so frustrated!
This commit is contained in:
parent
e9951989f9
commit
ac232008e8
7
bink.py
7
bink.py
@ -129,9 +129,6 @@ class App():
|
|||||||
self.update()
|
self.update()
|
||||||
self.loop.start()
|
self.loop.start()
|
||||||
|
|
||||||
def terminate(self):
|
|
||||||
raise InterruptedError
|
|
||||||
|
|
||||||
class ActionBox(urwid.ListBox):
|
class ActionBox(urwid.ListBox):
|
||||||
def keypress(self, size, key):
|
def keypress(self, size, key):
|
||||||
keyl = key.lower()
|
keyl = key.lower()
|
||||||
@ -140,7 +137,7 @@ class ActionBox(urwid.ListBox):
|
|||||||
elif keyl == "r":
|
elif keyl == "r":
|
||||||
app.update()
|
app.update()
|
||||||
elif keyl in ("q", "x"):
|
elif keyl in ("q", "x"):
|
||||||
app.terminate()
|
raise urwid.ExitMainLoop
|
||||||
elif keyl == " ":
|
elif keyl == " ":
|
||||||
super().keypress(size, "page down")
|
super().keypress(size, "page down")
|
||||||
elif keyl in ("j", "n", "ctrl n"):
|
elif keyl in ("j", "n", "ctrl n"):
|
||||||
@ -166,7 +163,7 @@ class ActionBox(urwid.ListBox):
|
|||||||
app = App()
|
app = App()
|
||||||
try:
|
try:
|
||||||
app.loop.run()
|
app.loop.run()
|
||||||
except (KeyboardInterrupt, InterruptedError):
|
except (KeyboardInterrupt, urwid.ExitMainLoop):
|
||||||
app.loop.stop()
|
app.loop.stop()
|
||||||
call("clear", shell=True)
|
call("clear", shell=True)
|
||||||
print("bye!")
|
print("bye!")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user