Allow write mode in rich.progress.Progress.open()
#3525
Unanswered
jordi-torrents
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now you can display the reading process of a file by using
rich.progress.Progress.open()
in read mode. This gives you the fraction of the file being loaded from the disk. It's cool.Then, it would be natural to ask for
open()
to allow also write mode. The task would not have atotal
value but it could still show the amount of bytes being writen and the writting speed. I went into the code and saw that it was explicitly forbiden by raising anUnsupportedOperation("write")
exception in therich.progress._Reader.write()
method.I adapted these classes in my project here and I managed them to also allow writting. It works beautifully. I haven't tested on many different scenarios but there seems to exist a simple solution with a simple implementation for writting.
So, why isn't writting allowed in the first place? Am I missing something? Would you be up for a PR to add write mode in
rich.progress.Progress.open()
?Beta Was this translation helpful? Give feedback.
All reactions