def get_list_and_task(task): target_list = None m = re.match('^(?P<list>.*?):.*', task) if m: target_list = m.group('list') task = task.replace(target_list+':','') target_list = helpers.cleanup_filename(target_list) return target_list, task.strip()
def generate_add_feedback(path, todo_file): todo_file = helpers.cleanup_filename(todo_file) return alfred.Item( attributes={ 'uid': uuid4(), 'arg': os.path.join(path, todo_file+default_format()), 'valid': 'yes' if todo_file != 'config' else 'no' }, title="New list '" + todo_file + "'", subtitle="Format is: " + default_format(), icon="todo_add.png" )