You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a container/type called Transient for non-live, disposable text regions. Ideally, it would have a max_lines value beyond which it might delete or hide earlier lines.
What problem does it solve for you?
Rich comes very close to solving this problem, but so far all the approaches I've seen for implementing this with the current rich api involve an unfortunate and large intrusion into the participating code.
Given the following:
--> Running CMake
-- CMake yadda
-- CMake foo
-- CMake bar
-- | Compiler foo
-- | Linker bar
--< CMake Ran: 3.1s
--> Running Ninja
-- Ninja working
-- [1/3] compile
-- [2/3] or compile not
-- [3/3] there is no error
--< Ninja Ran: 1.7s
--> Translating
-- Translation
-- in
-- progress
-- cookies
-- eaten
--< Translated: 5.4s
I would want to be able to do something like:
console = Console()
# This section will collapse to one line" --* Ran CMake: n.nns"
with Transient() console=console) as outer_tr, Timer() as build_timer, Status("Building"):
with Transient(console=outer_tr.console) as inner_tr:
with Timer() as cmake_timer, Status("Running CMake", console=inner_tr.console):
run_cmake()
inner_tr.replacement("== Ran CMake: {cmake_timer():.2f}s")
with Transient(console=outer_tr.console) as inner_tr:
with Timer() as ninja_timer, Status("Running Ninja", console=inner_tr.console):
run_ninja()
inner_tr.replacement("== Ran Ninja: {ninja_timer():.2f}s")
outer_tr.replacement("== Built: {build_timer():.2f}s")
...
Would iterate thru these appearances:
/ Building
/ Running CMake
- Building
-- CMake yadda
- Running CMake
\ Building
...
-- CMake yadda
-- CMake foo
-- CMake bar
-- | Compiler foo
-- | Linker bar
\ Running CMake
| Building
== Ran CMake: 3.1s
/ Building
== Ran CMake: 3.1s
/ Running Ninja
- Building
...
== Ran CMake: 3.1s
-- Ninja working
-- [1/3] compile
-- [2/3] or compile not
-- [3/3] there is no error
\ Running Ninja
| Building
== Ran CMake: 3.1s
== Ran Ninja: 1.7s
/ Building
== Built: 4.9s
And when the whole finishes, only the final "replacement" and any logged lines would be visible.
The text was updated successfully, but these errors were encountered:
How would you improve Rich?
Add a container/type called Transient for non-live, disposable text regions. Ideally, it would have a max_lines value beyond which it might delete or hide earlier lines.
What problem does it solve for you?
Rich comes very close to solving this problem, but so far all the approaches I've seen for implementing this with the current rich api involve an unfortunate and large intrusion into the participating code.
Given the following:
I would want to be able to do something like:
Would iterate thru these appearances:
...
...
And when the whole finishes, only the final "replacement" and any logged lines would be visible.
The text was updated successfully, but these errors were encountered: