Merge pull request #1360 from efiop/master

dagascii: use wait_for_input from asciimatics
This commit is contained in:
Ruslan Kuprieiev
2018-11-23 03:01:43 +02:00
committed by GitHub
3 changed files with 11 additions and 4 deletions
+9 -2
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -22,7 +22,7 @@ install_requires = [
"jsonpath-rw==1.4.0",
"requests>=2.18.4",
"grandalf==0.6",
"asciimatics>=1.10.0",
"asciimatics==1.10.0",
"distro>=1.3.0",
]