mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +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
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import blessings
|
import blessed
|
||||||
except ImportError:
|
except ImportError:
|
||||||
blessings = None
|
blessed = None
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
@ -93,7 +93,7 @@ class StructuredTerminalFormatter(StructuredHumanFormatter):
|
||||||
|
|
||||||
def set_terminal(self, terminal):
|
def set_terminal(self, terminal):
|
||||||
self.terminal = 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):
|
def format(self, record):
|
||||||
f = record.msg.format(**record.params)
|
f = record.msg.format(**record.params)
|
||||||
|
@ -172,11 +172,11 @@ class LoggingManager(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def terminal(self):
|
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,
|
# Sometimes blessings fails to set up the terminal. In that case,
|
||||||
# silently fail.
|
# silently fail.
|
||||||
try:
|
try:
|
||||||
terminal = blessings.Terminal(stream=sys.stdout)
|
terminal = blessed.Terminal(stream=sys.stdout)
|
||||||
|
|
||||||
if terminal.is_a_tty:
|
if terminal.is_a_tty:
|
||||||
self._terminal = terminal
|
self._terminal = terminal
|
||||||
|
|
|
@ -29,7 +29,7 @@ setup(
|
||||||
'Programming Language :: Python :: 3.10',
|
'Programming Language :: Python :: 3.10',
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'blessings',
|
'blessed',
|
||||||
'mozfile',
|
'mozfile',
|
||||||
'mozprocess',
|
'mozprocess',
|
||||||
'six',
|
'six',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Ensure all versions are pinned for repeatability,
|
# Ensure all versions are pinned for repeatability,
|
||||||
# since `--system-site-packages` is enabled
|
# since `--system-site-packages` is enabled
|
||||||
|
|
||||||
blessings == 1.7
|
blessed == 1.20.0
|
||||||
distro == 1.4
|
distro == 1.4
|
||||||
mozinfo == 1.2.3
|
mozinfo == 1.2.3
|
||||||
mozlog == 8.0.0
|
mozlog == 8.0.0
|
||||||
|
|
|
@ -238,8 +238,8 @@ class ServoFormatter(mozlog.formatters.base.BaseFormatter, ServoHandler):
|
||||||
self.clear_eol = DEFAULT_CLEAR_EOL_CODE
|
self.clear_eol = DEFAULT_CLEAR_EOL_CODE
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import blessings
|
import blessed
|
||||||
self.terminal = blessings.Terminal()
|
self.terminal = blessed.Terminal()
|
||||||
self.move_up = self.terminal.move_up
|
self.move_up = self.terminal.move_up
|
||||||
self.clear_eol = self.terminal.clear_eol
|
self.clear_eol = self.terminal.clear_eol
|
||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue