mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add support colored text in Windows Console
This commit is contained in:
parent
9a3b61abe1
commit
fed0e94ec6
3 changed files with 7 additions and 0 deletions
|
@ -14,4 +14,7 @@ pyflakes == 0.8.1
|
||||||
# For test-webidl
|
# For test-webidl
|
||||||
ply == 3.8
|
ply == 3.8
|
||||||
|
|
||||||
|
# For Cross-platform colored terminal text
|
||||||
|
colorama == 0.3.7
|
||||||
|
|
||||||
-e python/tidy
|
-e python/tidy
|
||||||
|
|
|
@ -18,6 +18,7 @@ import StringIO
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from licenseck import MPL, APACHE, COPYRIGHT, licenses_toml, licenses_dep_toml
|
from licenseck import MPL, APACHE, COPYRIGHT, licenses_toml, licenses_dep_toml
|
||||||
|
import colorama
|
||||||
|
|
||||||
COMMENTS = ["// ", "# ", " *", "/* "]
|
COMMENTS = ["// ", "# ", " *", "/* "]
|
||||||
|
|
||||||
|
@ -785,8 +786,10 @@ def scan(only_changed_files=False, progress=True):
|
||||||
errors = itertools.chain(errors, dep_license_errors, wpt_lint_errors)
|
errors = itertools.chain(errors, dep_license_errors, wpt_lint_errors)
|
||||||
error = None
|
error = None
|
||||||
for error in errors:
|
for error in errors:
|
||||||
|
colorama.init()
|
||||||
print "\r\033[94m{}\033[0m:\033[93m{}\033[0m: \033[91m{}\033[0m".format(*error)
|
print "\r\033[94m{}\033[0m:\033[93m{}\033[0m: \033[91m{}\033[0m".format(*error)
|
||||||
print
|
print
|
||||||
if error is None:
|
if error is None:
|
||||||
|
colorama.init()
|
||||||
print "\033[92mtidy reported no errors.\033[0m"
|
print "\033[92mtidy reported no errors.\033[0m"
|
||||||
return int(error is not None)
|
return int(error is not None)
|
||||||
|
|
|
@ -16,6 +16,7 @@ VERSION = '0.1.0'
|
||||||
install_requires = [
|
install_requires = [
|
||||||
"flake8==2.4.1",
|
"flake8==2.4.1",
|
||||||
"toml==0.9.1",
|
"toml==0.9.1",
|
||||||
|
"colorama==0.3.7",
|
||||||
]
|
]
|
||||||
|
|
||||||
here = os.path.dirname(os.path.abspath(__file__))
|
here = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue