Example #1
0
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")
Example #2
0
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")
Example #3
0
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")
Example #4
0
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.")
Example #5
0
def run(command, notification=None):
	import os
	os.system(command)
	if notification:
		from post_notification import post_notification
		post_notification(notification)
Example #6
0
def run(string):
    os.system('echo "{0}" | pbcopy'.format(string.replace("\"", "\\\"")))
    post_notification("Copied date and timestamp to clipboard.")
Example #7
0
def run(js):
    import post_notification, pasteboard
    pasteboard.set_text(js)
    post_notification.post_notification("Javascript snippet copied to clipboard", "Flashlight JS")
Example #8
0
def run(string):
    os.system('echo "{0}" | pbcopy'.format(string.replace("\"", "\\\"")))
    post_notification("Copied date and timestamp to clipboard.")
Example #9
0
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")
Example #10
0
def run(js):
    import post_notification, pasteboard
    pasteboard.set_text(js)
    post_notification.post_notification(
        "Javascript snippet copied to clipboard", "Flashlight JS")