libv8 7.4.288.28.0beta1 → 7.8.279.23.0beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +0 -1
- data/lib/libv8/version.rb +1 -1
- data/vendor/depot_tools/annotated_gclient.py +2 -4
- data/vendor/depot_tools/auth.py +0 -2
- data/vendor/depot_tools/autoninja +1 -3
- data/vendor/depot_tools/autoninja.bat +1 -1
- data/vendor/depot_tools/autoninja.py +1 -3
- data/vendor/depot_tools/bb +1 -1
- data/vendor/depot_tools/bootstrap/win/manifest.txt +1 -1
- data/vendor/depot_tools/buildbucket.py +6 -8
- data/vendor/depot_tools/checkout.py +5 -7
- data/vendor/depot_tools/cipd +1 -1
- data/vendor/depot_tools/cipd_manifest.txt +4 -4
- data/vendor/depot_tools/cipd_manifest.versions +80 -80
- data/vendor/depot_tools/cit.py +7 -9
- data/vendor/depot_tools/clang_format.py +1 -4
- data/vendor/depot_tools/clang_format_merge_driver.py +7 -9
- data/vendor/depot_tools/compile_single_file.py +1 -3
- data/vendor/depot_tools/dart_format.py +2 -4
- data/vendor/depot_tools/depot-tools-auth.py +8 -10
- data/vendor/depot_tools/fix_encoding.py +2 -5
- data/vendor/depot_tools/gclient-new-workdir.py +0 -2
- data/vendor/depot_tools/gclient.py +9 -8
- data/vendor/depot_tools/gclient_scm.py +28 -54
- data/vendor/depot_tools/gclient_utils.py +4 -14
- data/vendor/depot_tools/gerrit_util.py +6 -8
- data/vendor/depot_tools/git_cache.py +37 -53
- data/vendor/depot_tools/git_cl.py +42 -115
- data/vendor/depot_tools/git_drover.py +1 -3
- data/vendor/depot_tools/git_find_releases.py +6 -8
- data/vendor/depot_tools/git_footers.py +5 -7
- data/vendor/depot_tools/git_freezer.py +1 -3
- data/vendor/depot_tools/git_map_branches.py +5 -7
- data/vendor/depot_tools/git_mark_merge_base.py +6 -8
- data/vendor/depot_tools/git_nav_downstream.py +5 -7
- data/vendor/depot_tools/git_number.py +1 -3
- data/vendor/depot_tools/git_rebase_update.py +43 -38
- data/vendor/depot_tools/git_reparent_branch.py +6 -8
- data/vendor/depot_tools/git_upstream_diff.py +2 -4
- data/vendor/depot_tools/gn.py +4 -6
- data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
- data/vendor/depot_tools/led +1 -1
- data/vendor/depot_tools/luci-auth +1 -1
- data/vendor/depot_tools/lucicfg +1 -1
- data/vendor/depot_tools/mac_toolchain +1 -1
- data/vendor/depot_tools/man/html/depot_tools.html +1 -1
- data/vendor/depot_tools/man/html/depot_tools_tutorial.html +22 -28
- data/vendor/depot_tools/man/html/git-cl.html +1 -1
- data/vendor/depot_tools/man/html/git-drover.html +18 -18
- data/vendor/depot_tools/man/html/git-footers.html +1 -1
- data/vendor/depot_tools/man/html/git-freeze.html +3 -3
- data/vendor/depot_tools/man/html/git-hyper-blame.html +1 -1
- data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
- data/vendor/depot_tools/man/html/git-map.html +1 -1
- data/vendor/depot_tools/man/html/git-mark-merge-base.html +1 -1
- data/vendor/depot_tools/man/html/git-nav-downstream.html +3 -3
- data/vendor/depot_tools/man/html/git-nav-upstream.html +6 -12
- data/vendor/depot_tools/man/html/git-new-branch.html +1 -1
- data/vendor/depot_tools/man/html/git-rebase-update.html +1 -20
- data/vendor/depot_tools/man/html/git-rename-branch.html +1 -1
- data/vendor/depot_tools/man/html/git-reparent-branch.html +1 -1
- data/vendor/depot_tools/man/html/git-retry.html +1 -1
- data/vendor/depot_tools/man/html/git-squash-branch.html +1 -1
- data/vendor/depot_tools/man/html/git-thaw.html +1 -1
- data/vendor/depot_tools/man/html/git-upstream-diff.html +6 -10
- data/vendor/depot_tools/man/man1/git-cl.1 +4 -4
- data/vendor/depot_tools/man/man1/git-drover.1 +21 -21
- data/vendor/depot_tools/man/man1/git-footers.1 +4 -4
- data/vendor/depot_tools/man/man1/git-freeze.1 +6 -6
- data/vendor/depot_tools/man/man1/git-hyper-blame.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map-branches.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map.1 +4 -4
- data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +4 -4
- data/vendor/depot_tools/man/man1/git-nav-downstream.1 +6 -6
- data/vendor/depot_tools/man/man1/git-nav-upstream.1 +9 -15
- data/vendor/depot_tools/man/man1/git-new-branch.1 +3 -3
- data/vendor/depot_tools/man/man1/git-rebase-update.1 +4 -14
- data/vendor/depot_tools/man/man1/git-rename-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-reparent-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-retry.1 +4 -4
- data/vendor/depot_tools/man/man1/git-squash-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +13 -7
- data/vendor/depot_tools/man/man7/depot_tools.7 +4 -4
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +27 -33
- data/vendor/depot_tools/man/src/filter_demo_output.py +1 -3
- data/vendor/depot_tools/man/src/git-rebase-update.txt +0 -7
- data/vendor/depot_tools/my_activity.py +11 -13
- data/vendor/depot_tools/my_reviews.py +29 -34
- data/vendor/depot_tools/ninjalog_uploader_wrapper.py +2 -4
- data/vendor/depot_tools/owners_finder.py +1 -3
- data/vendor/depot_tools/patch.py +1 -1
- data/vendor/depot_tools/post_build_ninja_summary.py +15 -17
- data/vendor/depot_tools/presubmit_canned_checks.py +1 -3
- data/vendor/depot_tools/presubmit_support.py +5 -10
- data/vendor/depot_tools/prpc +1 -1
- data/vendor/depot_tools/recipes/README.recipes.md +17 -17
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +6 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +4 -2
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +6 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-failed.json +4 -2
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_file.json +5 -25
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_mode.json +5 -23
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_verfile.json +5 -23
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +6 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +5 -1
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +6 -1
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +6 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/set_failure_hash_with_no_steps.json +3 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +6 -4
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +6 -4
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch.json +6 -4
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch_luci.json +6 -4
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +6 -4
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch_new.json +6 -4
- data/vendor/depot_tools/rietveld.py +1 -3
- data/vendor/depot_tools/roll_dep.py +0 -2
- data/vendor/depot_tools/roll_dep_svn.py +11 -14
- data/vendor/depot_tools/scm.py +5 -10
- data/vendor/depot_tools/split_cl.py +11 -13
- data/vendor/depot_tools/subprocess2.py +1 -1
- data/vendor/depot_tools/third_party/colorama/LICENSE.txt +1 -0
- data/vendor/depot_tools/third_party/colorama/README.chromium +5 -4
- data/vendor/depot_tools/third_party/colorama/README.txt +304 -0
- data/vendor/depot_tools/third_party/colorama/__init__.py +4 -3
- data/vendor/depot_tools/third_party/colorama/ansi.py +30 -82
- data/vendor/depot_tools/third_party/colorama/ansitowin32.py +37 -105
- data/vendor/depot_tools/third_party/colorama/initialise.py +15 -39
- data/vendor/depot_tools/third_party/colorama/win32.py +28 -46
- data/vendor/depot_tools/third_party/colorama/winterm.py +31 -80
- data/vendor/depot_tools/third_party/upload.py +1 -1
- data/vendor/depot_tools/upload_to_google_storage.py +6 -8
- data/vendor/depot_tools/vpython +1 -1
- data/vendor/depot_tools/watchlists.py +3 -5
- data/vendor/depot_tools/weekly +2 -4
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +36 -38
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +8 -10
- data/vendor/depot_tools/wtf +3 -5
- metadata +3 -3
- data/vendor/depot_tools/third_party/colorama/README.rst +0 -346
@@ -30,8 +30,6 @@ useful as the resulting zip can't be redistributed, and most will presumably
|
|
30
30
|
have a Pro license anyway).
|
31
31
|
"""
|
32
32
|
|
33
|
-
from __future__ import print_function
|
34
|
-
|
35
33
|
import collections
|
36
34
|
import glob
|
37
35
|
import json
|
@@ -411,14 +409,14 @@ def AddEnvSetup(files):
|
|
411
409
|
'win_sdk\\bin\\SetEnv.arm64.json'))
|
412
410
|
vs_version_file = os.path.join(tempdir, 'VS_VERSION')
|
413
411
|
with open(vs_version_file, 'wb') as version:
|
414
|
-
print
|
412
|
+
print >>version, VS_VERSION
|
415
413
|
files.append((vs_version_file, 'VS_VERSION'))
|
416
414
|
|
417
415
|
|
418
416
|
def RenameToSha1(output):
|
419
417
|
"""Determine the hash in the same way that the unzipper does to rename the
|
420
418
|
# .zip file."""
|
421
|
-
print
|
419
|
+
print 'Extracting to determine hash...'
|
422
420
|
tempdir = tempfile.mkdtemp()
|
423
421
|
old_dir = os.getcwd()
|
424
422
|
os.chdir(tempdir)
|
@@ -426,13 +424,13 @@ def RenameToSha1(output):
|
|
426
424
|
with zipfile.ZipFile(
|
427
425
|
os.path.join(old_dir, output), 'r', zipfile.ZIP_DEFLATED, True) as zf:
|
428
426
|
zf.extractall(rel_dir)
|
429
|
-
print
|
427
|
+
print 'Hashing...'
|
430
428
|
sha1 = get_toolchain_if_necessary.CalculateHash(rel_dir, None)
|
431
429
|
os.chdir(old_dir)
|
432
430
|
shutil.rmtree(tempdir)
|
433
431
|
final_name = sha1 + '.zip'
|
434
432
|
os.rename(output, final_name)
|
435
|
-
print
|
433
|
+
print 'Renamed %s to %s.' % (output, final_name)
|
436
434
|
|
437
435
|
|
438
436
|
def main():
|
@@ -456,7 +454,7 @@ def main():
|
|
456
454
|
files = BuildRepackageFileList(options.repackage_dir)
|
457
455
|
else:
|
458
456
|
if len(args) != 1 or args[0] not in ('2015', '2017'):
|
459
|
-
print
|
457
|
+
print 'Must specify 2015 or 2017'
|
460
458
|
parser.print_help();
|
461
459
|
return 1
|
462
460
|
|
@@ -464,7 +462,7 @@ def main():
|
|
464
462
|
if (not os.path.exists(os.path.join(options.override_dir, 'bin')) or
|
465
463
|
not os.path.exists(os.path.join(options.override_dir, 'include')) or
|
466
464
|
not os.path.exists(os.path.join(options.override_dir, 'lib'))):
|
467
|
-
print
|
465
|
+
print 'Invalid override directory - must contain bin/include/lib dirs'
|
468
466
|
return 1
|
469
467
|
|
470
468
|
global VS_VERSION
|
@@ -480,14 +478,14 @@ def main():
|
|
480
478
|
else:
|
481
479
|
VC_TOOLS = 'VC'
|
482
480
|
|
483
|
-
print
|
481
|
+
print 'Building file list for VS %s Windows %s...' % (VS_VERSION, WIN_VERSION)
|
484
482
|
files = BuildFileList(options.override_dir)
|
485
483
|
|
486
484
|
AddEnvSetup(files)
|
487
485
|
|
488
486
|
if False:
|
489
487
|
for f in files:
|
490
|
-
print
|
488
|
+
print f[0], '->', f[1]
|
491
489
|
return 0
|
492
490
|
|
493
491
|
output = 'out.zip'
|
data/vendor/depot_tools/wtf
CHANGED
@@ -5,8 +5,6 @@
|
|
5
5
|
|
6
6
|
"""Display active git branches and code changes in a chromiumos workspace."""
|
7
7
|
|
8
|
-
from __future__ import print_function
|
9
|
-
|
10
8
|
import gclient_utils
|
11
9
|
import os
|
12
10
|
import re
|
@@ -40,7 +38,7 @@ def show_dir(full_name, relative_name, color):
|
|
40
38
|
if lines_printed == 0:
|
41
39
|
show_name()
|
42
40
|
lines_printed += 1
|
43
|
-
print
|
41
|
+
print branch
|
44
42
|
|
45
43
|
status = subprocess.Popen(['git', 'status'],
|
46
44
|
cwd=full_name,
|
@@ -50,8 +48,8 @@ def show_dir(full_name, relative_name, color):
|
|
50
48
|
if lines_printed == 0:
|
51
49
|
show_name()
|
52
50
|
if lines_printed == 1:
|
53
|
-
print
|
54
|
-
print
|
51
|
+
print '---------------'
|
52
|
+
print status
|
55
53
|
|
56
54
|
|
57
55
|
def main():
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libv8
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.8.279.23.0beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Lowell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -708,7 +708,7 @@ files:
|
|
708
708
|
- vendor/depot_tools/third_party/boto/utils.py
|
709
709
|
- vendor/depot_tools/third_party/colorama/LICENSE.txt
|
710
710
|
- vendor/depot_tools/third_party/colorama/README.chromium
|
711
|
-
- vendor/depot_tools/third_party/colorama/README.
|
711
|
+
- vendor/depot_tools/third_party/colorama/README.txt
|
712
712
|
- vendor/depot_tools/third_party/colorama/__init__.py
|
713
713
|
- vendor/depot_tools/third_party/colorama/ansi.py
|
714
714
|
- vendor/depot_tools/third_party/colorama/ansitowin32.py
|
@@ -1,346 +0,0 @@
|
|
1
|
-
.. image:: https://img.shields.io/pypi/v/colorama.svg
|
2
|
-
:target: https://pypi.org/project/colorama/
|
3
|
-
:alt: Latest Version
|
4
|
-
|
5
|
-
.. image:: https://img.shields.io/pypi/pyversions/colorama.svg
|
6
|
-
:target: https://pypi.org/project/colorama/
|
7
|
-
:alt: Supported Python versions
|
8
|
-
|
9
|
-
.. image:: https://travis-ci.org/tartley/colorama.svg?branch=master
|
10
|
-
:target: https://travis-ci.org/tartley/colorama
|
11
|
-
:alt: Build Status
|
12
|
-
|
13
|
-
Download and docs:
|
14
|
-
https://pypi.org/project/colorama/
|
15
|
-
Source code & Development:
|
16
|
-
https://github.com/tartley/colorama
|
17
|
-
|
18
|
-
Description
|
19
|
-
===========
|
20
|
-
|
21
|
-
Makes ANSI escape character sequences (for producing colored terminal text and
|
22
|
-
cursor positioning) work under MS Windows.
|
23
|
-
|
24
|
-
ANSI escape character sequences have long been used to produce colored terminal
|
25
|
-
text and cursor positioning on Unix and Macs. Colorama makes this work on
|
26
|
-
Windows, too, by wrapping ``stdout``, stripping ANSI sequences it finds (which
|
27
|
-
would appear as gobbledygook in the output), and converting them into the
|
28
|
-
appropriate win32 calls to modify the state of the terminal. On other platforms,
|
29
|
-
Colorama does nothing.
|
30
|
-
|
31
|
-
Colorama also provides some shortcuts to help generate ANSI sequences
|
32
|
-
but works fine in conjunction with any other ANSI sequence generation library,
|
33
|
-
such as the venerable Termcolor (https://pypi.org/project/termcolor/)
|
34
|
-
or the fabulous Blessings (https://pypi.org/project/blessings/).
|
35
|
-
|
36
|
-
This has the upshot of providing a simple cross-platform API for printing
|
37
|
-
colored terminal text from Python, and has the happy side-effect that existing
|
38
|
-
applications or libraries which use ANSI sequences to produce colored output on
|
39
|
-
Linux or Macs can now also work on Windows, simply by calling
|
40
|
-
``colorama.init()``.
|
41
|
-
|
42
|
-
An alternative approach is to install ``ansi.sys`` on Windows machines, which
|
43
|
-
provides the same behaviour for all applications running in terminals. Colorama
|
44
|
-
is intended for situations where that isn't easy (e.g., maybe your app doesn't
|
45
|
-
have an installer.)
|
46
|
-
|
47
|
-
Demo scripts in the source code repository print some colored text using
|
48
|
-
ANSI sequences. Compare their output under Gnome-terminal's built in ANSI
|
49
|
-
handling, versus on Windows Command-Prompt using Colorama:
|
50
|
-
|
51
|
-
.. image:: https://github.com/tartley/colorama/raw/master/screenshots/ubuntu-demo.png
|
52
|
-
:width: 661
|
53
|
-
:height: 357
|
54
|
-
:alt: ANSI sequences on Ubuntu under gnome-terminal.
|
55
|
-
|
56
|
-
.. image:: https://github.com/tartley/colorama/raw/master/screenshots/windows-demo.png
|
57
|
-
:width: 668
|
58
|
-
:height: 325
|
59
|
-
:alt: Same ANSI sequences on Windows, using Colorama.
|
60
|
-
|
61
|
-
These screengrabs show that, on Windows, Colorama does not support ANSI 'dim
|
62
|
-
text'; it looks the same as 'normal text'.
|
63
|
-
|
64
|
-
|
65
|
-
License
|
66
|
-
=======
|
67
|
-
|
68
|
-
Copyright Jonathan Hartley 2013. BSD 3-Clause license; see LICENSE file.
|
69
|
-
|
70
|
-
|
71
|
-
Dependencies
|
72
|
-
============
|
73
|
-
|
74
|
-
None, other than Python. Tested on Python 2.7, 3.4, 3.5 and 3.6.
|
75
|
-
|
76
|
-
Usage
|
77
|
-
=====
|
78
|
-
|
79
|
-
Initialisation
|
80
|
-
--------------
|
81
|
-
|
82
|
-
Applications should initialise Colorama using:
|
83
|
-
|
84
|
-
.. code-block:: python
|
85
|
-
|
86
|
-
from colorama import init
|
87
|
-
init()
|
88
|
-
|
89
|
-
On Windows, calling ``init()`` will filter ANSI escape sequences out of any
|
90
|
-
text sent to ``stdout`` or ``stderr``, and replace them with equivalent Win32
|
91
|
-
calls.
|
92
|
-
|
93
|
-
On other platforms, calling ``init()`` has no effect (unless you request other
|
94
|
-
optional functionality; see "Init Keyword Args", below). By design, this permits
|
95
|
-
applications to call ``init()`` unconditionally on all platforms, after which
|
96
|
-
ANSI output should just work.
|
97
|
-
|
98
|
-
To stop using colorama before your program exits, simply call ``deinit()``.
|
99
|
-
This will restore ``stdout`` and ``stderr`` to their original values, so that
|
100
|
-
Colorama is disabled. To resume using Colorama again, call ``reinit()``; it is
|
101
|
-
cheaper to calling ``init()`` again (but does the same thing).
|
102
|
-
|
103
|
-
|
104
|
-
Colored Output
|
105
|
-
--------------
|
106
|
-
|
107
|
-
Cross-platform printing of colored text can then be done using Colorama's
|
108
|
-
constant shorthand for ANSI escape sequences:
|
109
|
-
|
110
|
-
.. code-block:: python
|
111
|
-
|
112
|
-
from colorama import Fore, Back, Style
|
113
|
-
print(Fore.RED + 'some red text')
|
114
|
-
print(Back.GREEN + 'and with a green background')
|
115
|
-
print(Style.DIM + 'and in dim text')
|
116
|
-
print(Style.RESET_ALL)
|
117
|
-
print('back to normal now')
|
118
|
-
|
119
|
-
...or simply by manually printing ANSI sequences from your own code:
|
120
|
-
|
121
|
-
.. code-block:: python
|
122
|
-
|
123
|
-
print('\033[31m' + 'some red text')
|
124
|
-
print('\033[39m') # and reset to default color
|
125
|
-
|
126
|
-
...or, Colorama can be used happily in conjunction with existing ANSI libraries
|
127
|
-
such as Termcolor:
|
128
|
-
|
129
|
-
.. code-block:: python
|
130
|
-
|
131
|
-
from colorama import init
|
132
|
-
from termcolor import colored
|
133
|
-
|
134
|
-
# use Colorama to make Termcolor work on Windows too
|
135
|
-
init()
|
136
|
-
|
137
|
-
# then use Termcolor for all colored text output
|
138
|
-
print(colored('Hello, World!', 'green', 'on_red'))
|
139
|
-
|
140
|
-
Available formatting constants are::
|
141
|
-
|
142
|
-
Fore: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
|
143
|
-
Back: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
|
144
|
-
Style: DIM, NORMAL, BRIGHT, RESET_ALL
|
145
|
-
|
146
|
-
``Style.RESET_ALL`` resets foreground, background, and brightness. Colorama will
|
147
|
-
perform this reset automatically on program exit.
|
148
|
-
|
149
|
-
|
150
|
-
Cursor Positioning
|
151
|
-
------------------
|
152
|
-
|
153
|
-
ANSI codes to reposition the cursor are supported. See ``demos/demo06.py`` for
|
154
|
-
an example of how to generate them.
|
155
|
-
|
156
|
-
|
157
|
-
Init Keyword Args
|
158
|
-
-----------------
|
159
|
-
|
160
|
-
``init()`` accepts some ``**kwargs`` to override default behaviour.
|
161
|
-
|
162
|
-
init(autoreset=False):
|
163
|
-
If you find yourself repeatedly sending reset sequences to turn off color
|
164
|
-
changes at the end of every print, then ``init(autoreset=True)`` will
|
165
|
-
automate that:
|
166
|
-
|
167
|
-
.. code-block:: python
|
168
|
-
|
169
|
-
from colorama import init
|
170
|
-
init(autoreset=True)
|
171
|
-
print(Fore.RED + 'some red text')
|
172
|
-
print('automatically back to default color again')
|
173
|
-
|
174
|
-
init(strip=None):
|
175
|
-
Pass ``True`` or ``False`` to override whether ansi codes should be
|
176
|
-
stripped from the output. The default behaviour is to strip if on Windows
|
177
|
-
or if output is redirected (not a tty).
|
178
|
-
|
179
|
-
init(convert=None):
|
180
|
-
Pass ``True`` or ``False`` to override whether to convert ANSI codes in the
|
181
|
-
output into win32 calls. The default behaviour is to convert if on Windows
|
182
|
-
and output is to a tty (terminal).
|
183
|
-
|
184
|
-
init(wrap=True):
|
185
|
-
On Windows, colorama works by replacing ``sys.stdout`` and ``sys.stderr``
|
186
|
-
with proxy objects, which override the ``.write()`` method to do their work.
|
187
|
-
If this wrapping causes you problems, then this can be disabled by passing
|
188
|
-
``init(wrap=False)``. The default behaviour is to wrap if ``autoreset`` or
|
189
|
-
``strip`` or ``convert`` are True.
|
190
|
-
|
191
|
-
When wrapping is disabled, colored printing on non-Windows platforms will
|
192
|
-
continue to work as normal. To do cross-platform colored output, you can
|
193
|
-
use Colorama's ``AnsiToWin32`` proxy directly:
|
194
|
-
|
195
|
-
.. code-block:: python
|
196
|
-
|
197
|
-
import sys
|
198
|
-
from colorama import init, AnsiToWin32
|
199
|
-
init(wrap=False)
|
200
|
-
stream = AnsiToWin32(sys.stderr).stream
|
201
|
-
|
202
|
-
# Python 2
|
203
|
-
print >>stream, Fore.BLUE + 'blue text on stderr'
|
204
|
-
|
205
|
-
# Python 3
|
206
|
-
print(Fore.BLUE + 'blue text on stderr', file=stream)
|
207
|
-
|
208
|
-
|
209
|
-
Status & Known Problems
|
210
|
-
=======================
|
211
|
-
|
212
|
-
I've personally only tested it on Windows XP (CMD, Console2), Ubuntu
|
213
|
-
(gnome-terminal, xterm), and OS X.
|
214
|
-
|
215
|
-
Some presumably valid ANSI sequences aren't recognised (see details below),
|
216
|
-
but to my knowledge nobody has yet complained about this. Puzzling.
|
217
|
-
|
218
|
-
See outstanding issues and wishlist:
|
219
|
-
https://github.com/tartley/colorama/issues
|
220
|
-
|
221
|
-
If anything doesn't work for you, or doesn't do what you expected or hoped for,
|
222
|
-
I'd love to hear about it on that issues list, would be delighted by patches,
|
223
|
-
and would be happy to grant commit access to anyone who submits a working patch
|
224
|
-
or two.
|
225
|
-
|
226
|
-
|
227
|
-
Recognised ANSI Sequences
|
228
|
-
=========================
|
229
|
-
|
230
|
-
ANSI sequences generally take the form:
|
231
|
-
|
232
|
-
ESC [ <param> ; <param> ... <command>
|
233
|
-
|
234
|
-
Where ``<param>`` is an integer, and ``<command>`` is a single letter. Zero or
|
235
|
-
more params are passed to a ``<command>``. If no params are passed, it is
|
236
|
-
generally synonymous with passing a single zero. No spaces exist in the
|
237
|
-
sequence; they have been inserted here simply to read more easily.
|
238
|
-
|
239
|
-
The only ANSI sequences that colorama converts into win32 calls are::
|
240
|
-
|
241
|
-
ESC [ 0 m # reset all (colors and brightness)
|
242
|
-
ESC [ 1 m # bright
|
243
|
-
ESC [ 2 m # dim (looks same as normal brightness)
|
244
|
-
ESC [ 22 m # normal brightness
|
245
|
-
|
246
|
-
# FOREGROUND:
|
247
|
-
ESC [ 30 m # black
|
248
|
-
ESC [ 31 m # red
|
249
|
-
ESC [ 32 m # green
|
250
|
-
ESC [ 33 m # yellow
|
251
|
-
ESC [ 34 m # blue
|
252
|
-
ESC [ 35 m # magenta
|
253
|
-
ESC [ 36 m # cyan
|
254
|
-
ESC [ 37 m # white
|
255
|
-
ESC [ 39 m # reset
|
256
|
-
|
257
|
-
# BACKGROUND
|
258
|
-
ESC [ 40 m # black
|
259
|
-
ESC [ 41 m # red
|
260
|
-
ESC [ 42 m # green
|
261
|
-
ESC [ 43 m # yellow
|
262
|
-
ESC [ 44 m # blue
|
263
|
-
ESC [ 45 m # magenta
|
264
|
-
ESC [ 46 m # cyan
|
265
|
-
ESC [ 47 m # white
|
266
|
-
ESC [ 49 m # reset
|
267
|
-
|
268
|
-
# cursor positioning
|
269
|
-
ESC [ y;x H # position cursor at x across, y down
|
270
|
-
ESC [ y;x f # position cursor at x across, y down
|
271
|
-
ESC [ n A # move cursor n lines up
|
272
|
-
ESC [ n B # move cursor n lines down
|
273
|
-
ESC [ n C # move cursor n characters forward
|
274
|
-
ESC [ n D # move cursor n characters backward
|
275
|
-
|
276
|
-
# clear the screen
|
277
|
-
ESC [ mode J # clear the screen
|
278
|
-
|
279
|
-
# clear the line
|
280
|
-
ESC [ mode K # clear the line
|
281
|
-
|
282
|
-
Multiple numeric params to the ``'m'`` command can be combined into a single
|
283
|
-
sequence::
|
284
|
-
|
285
|
-
ESC [ 36 ; 45 ; 1 m # bright cyan text on magenta background
|
286
|
-
|
287
|
-
All other ANSI sequences of the form ``ESC [ <param> ; <param> ... <command>``
|
288
|
-
are silently stripped from the output on Windows.
|
289
|
-
|
290
|
-
Any other form of ANSI sequence, such as single-character codes or alternative
|
291
|
-
initial characters, are not recognised or stripped. It would be cool to add
|
292
|
-
them though. Let me know if it would be useful for you, via the Issues on
|
293
|
-
GitHub.
|
294
|
-
|
295
|
-
|
296
|
-
Development
|
297
|
-
===========
|
298
|
-
|
299
|
-
Help and fixes welcome!
|
300
|
-
|
301
|
-
Running tests requires:
|
302
|
-
|
303
|
-
- Michael Foord's ``mock`` module to be installed.
|
304
|
-
- Tests are written using 2010-era updates to ``unittest``
|
305
|
-
|
306
|
-
To run tests::
|
307
|
-
|
308
|
-
python -m unittest discover -p *_test.py
|
309
|
-
|
310
|
-
This, like a few other handy commands, is captured in a ``Makefile``.
|
311
|
-
|
312
|
-
If you use nose to run the tests, you must pass the ``-s`` flag; otherwise,
|
313
|
-
``nosetests`` applies its own proxy to ``stdout``, which confuses the unit
|
314
|
-
tests.
|
315
|
-
|
316
|
-
|
317
|
-
Thanks
|
318
|
-
======
|
319
|
-
* Marc Schlaich (schlamar) for a ``setup.py`` fix for Python2.5.
|
320
|
-
* Marc Abramowitz, reported & fixed a crash on exit with closed ``stdout``,
|
321
|
-
providing a solution to issue #7's setuptools/distutils debate,
|
322
|
-
and other fixes.
|
323
|
-
* User 'eryksun', for guidance on correctly instantiating ``ctypes.windll``.
|
324
|
-
* Matthew McCormick for politely pointing out a longstanding crash on non-Win.
|
325
|
-
* Ben Hoyt, for a magnificent fix under 64-bit Windows.
|
326
|
-
* Jesse at Empty Square for submitting a fix for examples in the README.
|
327
|
-
* User 'jamessp', an observant documentation fix for cursor positioning.
|
328
|
-
* User 'vaal1239', Dave Mckee & Lackner Kristof for a tiny but much-needed Win7
|
329
|
-
fix.
|
330
|
-
* Julien Stuyck, for wisely suggesting Python3 compatible updates to README.
|
331
|
-
* Daniel Griffith for multiple fabulous patches.
|
332
|
-
* Oscar Lesta for a valuable fix to stop ANSI chars being sent to non-tty
|
333
|
-
output.
|
334
|
-
* Roger Binns, for many suggestions, valuable feedback, & bug reports.
|
335
|
-
* Tim Golden for thought and much appreciated feedback on the initial idea.
|
336
|
-
* User 'Zearin' for updates to the README file.
|
337
|
-
* John Szakmeister for adding support for light colors
|
338
|
-
* Charles Merriam for adding documentation to demos
|
339
|
-
* Jurko for a fix on 64-bit Windows CPython2.5 w/o ctypes
|
340
|
-
* Florian Bruhin for a fix when stdout or stderr are None
|
341
|
-
* Thomas Weininger for fixing ValueError on Windows
|
342
|
-
* Remi Rampin for better Github integration and fixes to the README file
|
343
|
-
* Simeon Visser for closing a file handle using 'with' and updating classifiers
|
344
|
-
to include Python 3.3 and 3.4
|
345
|
-
* Andy Neff for fixing RESET of LIGHT_EX colors.
|
346
|
-
* Jonathan Hartley for the initial idea and implementation.
|