예제 #1
0
def actionize(query):
	if len(query) <= 0:
		return
	have_tag = helpers.is_tag(query)
	have_todo = helpers.is_todo(query)

	if not (have_tag or have_todo):
		itemlist.save_todo(query)
	elif have_todo:
		itemlist.copy_todo_to_clipboard(helpers.extract_todo_id(query))
	elif have_tag:
		config.put('todo.tag.recent', "#"+helpers.extract_tag(query))
예제 #2
0
def actionize(query):
    if len(query) <= 0:
        return
    have_tag = helpers.is_tag(query)
    have_todo = helpers.is_todo(query)

    if not (have_tag or have_todo):
        itemlist.save_todo(query)
    elif have_todo:
        itemlist.copy_todo_to_clipboard(helpers.extract_todo_id(query))
    elif have_tag:
        config.put('todo.tag.recent', "#" + helpers.extract_tag(query))
예제 #3
0
파일: todo.py 프로젝트: BenziAhamed/todo
def actionize(query):
    if len(query) <= 0:
        return
    have_tag = helpers.is_tag(query)
    have_todo = helpers.is_todo(query)

    if not (have_tag or have_todo):
        itemlist.save_todo(query)
    elif have_todo:
        _id = helpers.extract_todo_id(query)

        # smart content is a bit rudimentary at the moment
        if smartcontent.smartcontent_enabled():
            smartcontent.perform_action(_id)
        else:
            itemlist.copy_todo_to_clipboard(_id)

    elif have_tag:
        config.put(ck.KEY_TAG_RECENT, "#"+helpers.extract_tag(query))
예제 #4
0
def perform_action(_id):
    content = itemlist.get_todo(_id)['title']
    (action, content) = analyse_content(content)
    smartcontent_actions = {
        'copy_to_clipboard': lambda _id, content: itemlist.copy_todo_to_clipboard(_id),
        'open_url': lambda _id, content: open_url(content),
        'open_file': lambda _id, content: open_url(content),
        'open_dir': lambda _id, content: open_url(content)
    }
    smartcontent_actions[action](_id, content)