Skip to content

Commit

Permalink
Merge pull request #1993 from Textualize/ansi-to-win32
Browse files Browse the repository at this point in the history
Conversion of Segments to Windows Console API calls on legacy Windows platform
  • Loading branch information
willmcgugan committed Mar 9, 2022
2 parents 27c2ba6 + 91e0146 commit 1efc0f0
Show file tree
Hide file tree
Showing 13 changed files with 1,390 additions and 53 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,6 +2,7 @@
.pytype
.DS_Store
.vscode
.idea/
mypy_report
docs/build
docs/source/_build
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added ProgressColumn `MofNCompleteColumn` to display raw `completed/total` column (similar to DownloadColumn,
but displays values as ints, does not convert to floats or add bit/bytes units).
https://github.com/Textualize/rich/pull/1941
- Remove Colorama dependency, call Windows Console API from Rich https://github.com/Textualize/rich/pull/1993
- Add support for namedtuples to `Pretty` https://github.com/Textualize/rich/pull/2031

### Fixed
Expand Down
3 changes: 0 additions & 3 deletions mypy.ini
Expand Up @@ -9,8 +9,5 @@ ignore_missing_imports = True
[mypy-commonmark.*]
ignore_missing_imports = True

[mypy-colorama.*]
ignore_missing_imports = True

[mypy-ipywidgets.*]
ignore_missing_imports = True
65 changes: 55 additions & 10 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pyproject.toml
Expand Up @@ -31,7 +31,6 @@ typing-extensions = { version = ">=3.7.4, <5.0", python = "<3.8" }
dataclasses = { version = ">=0.7,<0.9", python = "<3.7" }
pygments = "^2.6.0"
commonmark = "^0.9.0"
colorama = "^0.4.0"
ipywidgets = { version = "^7.5.1", optional = true }


Expand Down
5 changes: 1 addition & 4 deletions rich/__main__.py
Expand Up @@ -226,10 +226,7 @@ def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
console.print(test_card)
taken = round((process_time() - start) * 1000.0, 1)

text = console.file.getvalue()
# https://bugs.python.org/issue37871
for line in text.splitlines(True):
print(line, end="")
Console().print(test_card)

print(f"rendered in {pre_cache_taken}ms (cold cache)")
print(f"rendered in {taken}ms (warm cache)")
Expand Down

0 comments on commit 1efc0f0

Please sign in to comment.