예제 #1
0
def main():
    (option, query) = alfred.args2()
    option_actions = {
        '-view': lambda q: generate_view(q)
    }
    option_actions[option](query)
    config.commit()
예제 #2
0
파일: setup.py 프로젝트: BenziAhamed/todo
def main():
    (command, data) = alfred.args2()
    if command == "-set-folder":
        update_todo_db_path(data)
    elif command == "-reset":
        reset()
    config.commit()
예제 #3
0
파일: formats.py 프로젝트: BenziAhamed/todo
def main():
    (option, query) = alfred.args2()
    option_actions = {
        '-view' : lambda x: generate_view(),
        '-set': lambda x: set_format(x)
    }
    option_actions[option](query)
    config.commit()
예제 #4
0
파일: import.py 프로젝트: BenziAhamed/todo
def main():
    (option, query) = alfred.args2()
    option_actions = {
        '-file': lambda x: import_from_file(query),
        '-clipboard': lambda x: import_from_clipboard()
    }
    option_actions[option](query)
    todo_config.commit()
예제 #5
0
def main():
    (option, query) = alfred.args2()
    option_actions = {
        # Features
        '-view': lambda q: generate_view(),
        '-toggle': lambda q: toggle_feature(q)
    }
    option_actions[option](query)
    config.commit()
예제 #6
0
파일: edit.py 프로젝트: BenziAhamed/todo
def main():
    (option, query) = alfred.args2()
    option_actions = {
        # Editing
        '-view': lambda q: editview.generate_view(q),
        '-action': lambda q: process_query(q)
    }
    option_actions[option](query)
    config.commit()
예제 #7
0
def main():
    (option, query) = alfred.args2()
    option_actions = {
        # Lists
        '-view': lambda q: generate_view(q),
        '-action': lambda q: action(q),
        '-delete': lambda q: delete_list(q)
    }
    option_actions[option](query)
    config.commit()
예제 #8
0
파일: export.py 프로젝트: BenziAhamed/todo
def main():
    if len(sys.argv) == 1:
        generate_export_view()
    else:
        format = sys.argv[1]
        tag = None
        if len(sys.argv) == 3:
            tag = sys.argv[2]
        if format == "txt":
            export_txt(_tag=tag)
    config.commit()
예제 #9
0
def main():
    (option, arg) = alfred.args2()
    if option == "-view":
        config.put('todo.db.destination_path', arg)
        generate_view(arg)
    elif option == "-migrate":
        migrate_todo_list(
            os.path.dirname(config.get(ck.KEY_TODO)),
            config.get('todo.db.destination_path'),
            arg
        )
    config.commit()
예제 #10
0
파일: todo.py 프로젝트: BenziAhamed/todo
def main():
    (option, query) = alfred.args2()
    option_actions = {
        # Clearing items
        '-c': lambda q: itemlist.clear_all_todos(),
        '-ct': lambda q: itemlist.clear_todos(done=False),
        '-cd': lambda q: itemlist.clear_todos(done=True),
        # Processing query input
        '-a': lambda q:	actionize(q),
        '-q': lambda q:	process_todo_query(q),
        '-r': lambda q:	itemlist.remove_item(q),
        # Item toggles
        '-p': lambda q:	toggle_pin(q),
        '-d': lambda q:	toggle_done(q)
    }
    option_actions[option](query)
    config.commit()
예제 #11
0
 def process_commit(self):
     config.commit()