mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 15:28:26 +01:00
Merge pull request #1211 from efiop/master
dagascii: import asciimatics only when needed
This commit is contained in:
+3
-3
@@ -2,9 +2,6 @@ import sys
|
||||
import math
|
||||
import select
|
||||
|
||||
from asciimatics.screen import Screen
|
||||
from asciimatics.event import KeyboardEvent
|
||||
|
||||
from grandalf.graphs import Vertex, Edge, Graph
|
||||
from grandalf.layouts import SugiyamaLayout
|
||||
from grandalf.routing import route_with_lines, EdgeViewer
|
||||
@@ -22,12 +19,15 @@ class AsciiCanvas(object):
|
||||
|
||||
def draw(self):
|
||||
if sys.stdout.isatty(): # pragma: no cover
|
||||
from asciimatics.screen import Screen
|
||||
Screen.wrapper(self._do_draw)
|
||||
else:
|
||||
for line in self.canvas:
|
||||
print(''.join(line))
|
||||
|
||||
def _do_draw(self, screen): # pragma: no cover
|
||||
from asciimatics.event import KeyboardEvent
|
||||
|
||||
offset_x = 0
|
||||
offset_y = 0
|
||||
smaxrow, smaxcol = screen.dimensions
|
||||
|
||||
Reference in New Issue
Block a user