Welcome to pushbullet_tools’s documentation!¶
-
pushbullet_tools.push_message.main()¶ Runs CLI
usage:
pbmsg config -t PUSHBULLET_API_TOKEN pbmsg push -m "Message to send" pbmsg push -t TOKEN -n MESSAGE_TITLE -m MESSAGE_BODY pgmsg push -l https://INSERT_WEBSITE.HERE pbmsg push -f /path/to/file
-
pushbullet_tools.push_message.push_alert(title='{hostname}', success_msg='Process complete!', fail_msg='{error}', closing_func=None)¶ contextmanager to wrap processes and report completion or errors
contextmanager that will send a push message to all pushbullet linked devices when the contained processes are complete or when they error. Can also assign functions to be executed after everything else regardless of error.
Example:
with push_alert(): do_some_stuff()
- Parameters
title (str) – title of the push messages sent. {hostname} will insert the active computer’s hostname. {username} will insert the current username.
success_msg (str) – notification text on success
fail_msg (str) – notification text on error, {error} will insert a short version of the error thrown
closing_func (function) – function to be executed on exit, regardless of error
-
pushbullet_tools.push_message.push_file(file_name, file_type, file_url, body='', token=None)¶ Send notification to pushbullet
- Parameters
file_name (str) – name of the file
file_type (str) – file MIME type of the file
file_url (str) – file download url
body (str) – (optional) message to go with file
token (str) – (optional), API token to use, otherwise uses API token from keyring
-
pushbullet_tools.push_message.push_link(title, body, url, token=None)¶ Send notification to pushbullet
- Parameters
title (str) – notification title
body (str) – body of notification
url (str) – link url to send
token (str) – (optional), API token to use, otherwise uses API token from keyring
-
pushbullet_tools.push_message.push_note(title, body, token=None)¶ Send notification to pushbullet
- Parameters
title (str) – notification title
body (str) – body of notification
token (str) – (optional), API token to use, otherwise uses API token from keyring
-
pushbullet_tools.push_message.setup(token: str)¶ Adds pushbullet API token to the keyring and sends test message
- Parameters
token (str) – API token for pushbullet