whendone¶
Submodules¶
Package Contents¶
Classes¶
Attributes¶
- class whendone.WhenDone(telegram_token: str = '', slack_token: str = '')[source]¶
- format_time(seconds: float) str[source]¶
Format the time to display Seconds will be converted to the right time.
- Parameters:
seconds (float) – Amount of seconds the code did run.
- Returns:
formatted_time – Seconds formated to the right amount of time.
- Return type:
str
Examples
format_time(61)
- addSlackChatID(id: str) None[source]¶
Add Slack Chat ID, to send the message(s) to.
- Parameters:
id (str) – Slack chat ID obtained from Slack
Examples
notifier = WhenDone(telegram_token=’xxx’,slack_token=’xxx’) notifier.addSlackChatID(id=’X1234’)
- __dump_to_txt__(chat_ids)[source]¶
- Dump telegram chat ID’s to a .txt file, because Telegram Bot
will restart and forget the current ID’s. This will retrieve them and still succesfully send the message.
- Parameters:
chat_ids (json) – Telegram chat ID’s obtained from Telegram
- __getchatid__() List[str][source]¶
Will retrieve the chat ID’s retrieved from the chat-bot.
- Returns:
lst – Telegram chat ID’s obtained from Telegram
- Return type:
List[str]
- whendone.__version__¶