new lines fixes

This commit is contained in:
Will McGugan 2021-11-09 16:30:25 +00:00
parent 654f702ab7
commit 59d351168e
4 changed files with 11 additions and 4 deletions

View File

@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [10.13.1] - Unreleased
### Fixed
- Fixed progress speed not updating when total doesn't change
- Fixed superfluous new line in Status https://github.com/willmcgugan/rich/issues/1662
## [10.13.0] - 2021-11-07
### Added

View File

@ -159,8 +159,6 @@ class Live(JupyterMixin, RenderHook):
# jupyter last refresh must occur after console pop render hook
# i am not sure why this is needed
self.refresh()
if not self.console.is_interactive:
return self.console.print()
def __enter__(self) -> "Live":
self.start(refresh=self._renderable is not None)

View File

@ -645,6 +645,8 @@ class Progress(JupyterMixin):
def stop(self) -> None:
"""Stop the progress display."""
self.live.stop()
if not self.console.is_interactive:
self.console.print()
def __enter__(self) -> "Progress":
self.start()
@ -764,7 +766,7 @@ class Progress(JupyterMixin):
task = self._tasks[task_id]
completed_start = task.completed
if total is not None:
if total is not None and total != task.total:
task.total = total
task._reset()
if advance is not None:

View File

@ -158,7 +158,7 @@ def test_growing_display_file_console() -> None:
output = console.end_capture()
assert (
output
== "Step 0\nStep 1\nStep 2\nStep 3\nStep 4\nStep 5\nStep 6\nStep 7\nStep 8\nStep 9\n\n"
== "Step 0\nStep 1\nStep 2\nStep 3\nStep 4\nStep 5\nStep 6\nStep 7\nStep 8\nStep 9\n"
)