mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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',
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Ensure all versions are pinned for repeatability,
|
||||
# since `--system-site-packages` is enabled
|
||||
|
||||
blessings == 1.7
|
||||
blessed == 1.20.0
|
||||
distro == 1.4
|
||||
mozinfo == 1.2.3
|
||||
mozlog == 8.0.0
|
||||
|
|
|
@ -238,8 +238,8 @@ class ServoFormatter(mozlog.formatters.base.BaseFormatter, ServoHandler):
|
|||
self.clear_eol = DEFAULT_CLEAR_EOL_CODE
|
||||
|
||||
try:
|
||||
import blessings
|
||||
self.terminal = blessings.Terminal()
|
||||
import blessed
|
||||
self.terminal = blessed.Terminal()
|
||||
self.move_up = self.terminal.move_up
|
||||
self.clear_eol = self.terminal.clear_eol
|
||||
except Exception as exception:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue