New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
telegram: add delete()
when leave=False
#1189
Conversation
Add an option for delete bar message with the deleteMessage method in Bot API.
Ideally this would be used when |
Codecov Report
@@ Coverage Diff @@
## master #1189 +/- ##
=======================================
Coverage 89.88% 89.88%
=======================================
Files 26 26
Lines 1710 1710
Branches 284 284
=======================================
Hits 1537 1537
Misses 128 128
Partials 45 45 |
if self.disable: | ||
return | ||
super(tqdm_telegram, self).close() | ||
if not (self.leave or (self.leave is None and self.pos == 0)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
borrowing usual leave=None|False|True
logic here.
Potential future issue is if people want different behaviour for terminal & telegram outputs (leave one but not the other). They'd have to override the close()
method. Don't think we need to explicitly support/worry about that case for now.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the leave variable is perfect, it fits our needs, and yes the default behaviour would be leave = False
. In the meantime we don't worry about that case for terminal and telegram outputs. When the close()
method is called just delete the message from telegram and stop the bar from terminal.
delete()
when leave=False
- also misc minor tidy
d5758df
to
c36a011
Compare
Add an option for delete bar message with the deleteMessage method in Bot API.