mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Merge pull request #1360 from efiop/master
dagascii: use wait_for_input from asciimatics
This commit is contained in:
+9
-2
@@ -1,6 +1,5 @@
|
||||
import sys
|
||||
import math
|
||||
import select
|
||||
|
||||
from grandalf.graphs import Vertex, Edge, Graph
|
||||
from grandalf.layouts import SugiyamaLayout
|
||||
@@ -8,6 +7,8 @@ from grandalf.routing import route_with_lines, EdgeViewer
|
||||
|
||||
|
||||
class AsciiCanvas(object):
|
||||
TIMEOUT = 1
|
||||
|
||||
def __init__(self, cols, lines):
|
||||
assert cols > 1
|
||||
assert lines > 1
|
||||
@@ -64,7 +65,13 @@ class AsciiCanvas(object):
|
||||
|
||||
# NOTE: get_event() doesn't block by itself,
|
||||
# so we have to do the blocking ourselves.
|
||||
select.select([sys.stdin], [], [], None)
|
||||
#
|
||||
# NOTE: using formally private method while waiting for PR [1]
|
||||
# to get merged. After that need to adjust asciimatics version
|
||||
# requirements.
|
||||
#
|
||||
# [1] https://github.com/peterbrittain/asciimatics/pull/188
|
||||
screen._wait_for_input(self.TIMEOUT)
|
||||
|
||||
event = screen.get_event()
|
||||
if not isinstance(event, KeyboardEvent):
|
||||
|
||||
+1
-1
@@ -22,5 +22,5 @@ wheel>=0.31.1
|
||||
futures>=3.2.0; python_version == "2.7"
|
||||
grandalf==0.6
|
||||
pydot>=1.2.4
|
||||
asciimatics>=1.10.0
|
||||
asciimatics==1.10.0
|
||||
distro>=1.3.0
|
||||
|
||||
Reference in New Issue
Block a user