def run(parsed): event = {"type": "reminder", "title": parsed['~message']} if '@date' in parsed: event['date'] = parsed['@date']['timestamp'] success = all(create_events([event])) post_notification( "Created reminder" if success else "Failed to create reminder")
def run(parsed): event = { "type": "reminder", "title": parsed['~message'] } if '@date' in parsed: event['date'] = parsed['@date']['timestamp'] success = all(create_events([event])) post_notification("Created reminder" if success else "Failed to create reminder")
def run(*args): event, from_date, to_date, location = args success = all( create_events([{ "type": "event", "title": event, "date": from_date, "endDate": to_date }])) post_notification("Created event" if success else "Failed to create event")
def run(result, abc): from copy_to_clipboard import copy_to_clipboard from post_notification import post_notification if result: copy_to_clipboard(result) post_notification("Copied GIF URL.")
def run(command, notification=None): import os os.system(command) if notification: from post_notification import post_notification post_notification(notification)
def run(string): os.system('echo "{0}" | pbcopy'.format(string.replace("\"", "\\\""))) post_notification("Copied date and timestamp to clipboard.")
def run(js): import post_notification, pasteboard pasteboard.set_text(js) post_notification.post_notification("Javascript snippet copied to clipboard", "Flashlight JS")
def run(*args): event, from_date, to_date, location = args success = all(create_events([{"type": "event", "title": event, "date": from_date, "endDate": to_date}])) post_notification("Created event" if success else "Failed to create event")
def run(js): import post_notification, pasteboard pasteboard.set_text(js) post_notification.post_notification( "Javascript snippet copied to clipboard", "Flashlight JS")