mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
change terminal wrapper library from blessing to blessed to support running mach test-wpt on windows. (#35327)
Signed-off-by: rayguo17 <rayguo17@gmail.com>
This commit is contained in:
parent
e0689c1f0b
commit
18b43d48fc
4 changed files with 9 additions and 9 deletions
|
@ -9,9 +9,9 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
try:
|
||||
import blessings
|
||||
import blessed
|
||||
except ImportError:
|
||||
blessings = None
|
||||
blessed = None
|
||||
|
||||
import json
|
||||
import logging
|
||||
|
@ -93,7 +93,7 @@ class StructuredTerminalFormatter(StructuredHumanFormatter):
|
|||
|
||||
def set_terminal(self, terminal):
|
||||
self.terminal = terminal
|
||||
self._sgr0 = terminal.normal if terminal and blessings else ''
|
||||
self._sgr0 = terminal.normal if terminal and blessed else ''
|
||||
|
||||
def format(self, record):
|
||||
f = record.msg.format(**record.params)
|
||||
|
@ -172,11 +172,11 @@ class LoggingManager(object):
|
|||
|
||||
@property
|
||||
def terminal(self):
|
||||
if not self._terminal and blessings:
|
||||
if not self._terminal and blessed:
|
||||
# Sometimes blessings fails to set up the terminal. In that case,
|
||||
# silently fail.
|
||||
try:
|
||||
terminal = blessings.Terminal(stream=sys.stdout)
|
||||
terminal = blessed.Terminal(stream=sys.stdout)
|
||||
|
||||
if terminal.is_a_tty:
|
||||
self._terminal = terminal
|
||||
|
|
|
@ -29,7 +29,7 @@ setup(
|
|||
'Programming Language :: Python :: 3.10',
|
||||
],
|
||||
install_requires=[
|
||||
'blessings',
|
||||
'blessed',
|
||||
'mozfile',
|
||||
'mozprocess',
|
||||
'six',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue