Skip to content

Commit

Permalink
[FIX-#131] Fix URWID UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Diefenbach authored Aug 9, 2019
2 parents cc136b1 + 7b1fdb7 commit fc4fb18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ keywords = "raiden, raiden-network"
[tool.flit.metadata.requires-extra]
# Extended dependencies required for development and testing. Flit installs
# these automatically.
test = ["pytest", "tox"]
test = ["pytest==4.5.0", "tox"]
dev = [
"black==19.3b0",
"flake8-bugbear==18.8.0",
Expand Down
4 changes: 2 additions & 2 deletions scenario_player/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from scenario_player.runner import ScenarioRunner
from scenario_player.services.common.app import ServiceProcess
from scenario_player.tasks.base import collect_tasks
from scenario_player.ui import ScenarioUI, enable_gui_formatting
from scenario_player.ui import ScenarioUI, attach_urwid_logbuffer
from scenario_player.utils import (
ChainConfigType,
DummyStream,
Expand Down Expand Up @@ -153,7 +153,7 @@ def run(

# If the output is a terminal, beautify our output.
if enable_ui:
enable_gui_formatting()
log_buffer = attach_urwid_logbuffer()

# Dynamically import valid Task classes from sceanrio_player.tasks package.
collect_tasks(tasks)
Expand Down
3 changes: 2 additions & 1 deletion scenario_player/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def set_success(self, success):
self._loop.screen.register_palette_entry("focus", "dark red", "default")


def enable_gui_formatting():
def attach_urwid_logbuffer():
"""Enable formatted text output for the console UI."""
log_buffer = UrwidLogWalker([])
for handler in logging.getLogger("").handlers:
Expand All @@ -296,3 +296,4 @@ def enable_gui_formatting():
)
handler.stream = log_buffer
break
return log_buffer

0 comments on commit fc4fb18

Please sign in to comment.