Last active
November 25, 2018 02:04
-
-
Save jbwhaley/85934b5fdc522457cf29 to your computer and use it in GitHub Desktop.
A simple script to view all system notifications scheduled by Pythonista.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# forGetter Version 1.1 | |
## A simple script to view all system notifications scheduled by Pythonista. | |
## Currently running it from Launch Center Pro. | |
import notification | |
import console | |
import datetime | |
import webbrowser | |
# Global variables | |
header = "Scheduled Notifications\n" | |
scheduled = notification.get_scheduled() | |
output_list = [] | |
url = 'launch://' | |
# Run the logic | |
if scheduled == []: | |
console.hud_alert('None.', 'error') | |
else: | |
for i in scheduled: | |
ms = i[u'message'] | |
ts = i[u'fire_date'] | |
ts = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S') | |
item = ms + ":\n" + ts + "\n" | |
output_list.append(item) | |
output_string = "\n".join(output_list) | |
console.alert(header, output_string, 'Done?', hide_cancel_button=True) | |
webbrowser.open(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Will display a list of all currently scheduled Pythonista notifications; designed as a useful supplement to my QuickRemind script. Use with Launch Center Pro as is, or remove the last line if you prefer to run it directly in Pythonista.