Exemplo n.º 1
0
#!/usr/bin/env python
# encoding: utf-8

from Alfred import Items, Tools
from Notes import Search
import urllib

items = Items()
query = Tools.getArgv(1)
search = Search()

tasks = search.tasks(query)

if len(tasks) > 0:
    for file in tasks:
        file_title = file['title'] if file['title'] != str() else search.getNoteFilename(file['path'])
        items.setItem(
            arg=file['path'],
            subtitle=u'\u2192 {0} (\u2318 Open in The Archive, \u2325 Open in Default Editor)'.format(file['filename'].decode('utf-8')),
            title=file['todo'],
            type='file',
            valid=True,
            variables={
                "todo": file['todo'],
                "todo_query": query,
                "todo_status": file['status'],
            },
        )
        items.addMod(
            arg=file['path'],
            icon_path="icons/the-archive.png",
Exemplo n.º 2
0
#!/usr/bin/env python
# encoding: utf-8

from Alfred import Items, Tools
from Notes import Search

items = Items()
query = Tools.getArgv(1)
search = Search()

tasks = search.tasks(query)

if len(tasks) > 0:
    for file in tasks:
        file_title = file['title'] if file['title'] != str(
        ) else search.getNoteFilename(file['path'])
        items.setItem(
            arg=file['path'],
            subtitle=
            u'\u2192 {0} (\u2318 Open in The Archive, \u2325 Open in Default Editor)'
            .format(file['filename'].decode('utf-8')),
            title=file['todo'],
            type='file',
            valid=True,
            variables={
                "todo": file['todo'],
                "todo_query": query,
                "todo_status": file['status'],
            },
        )
        items.addMod(
Exemplo n.º 3
0
#!/usr/bin/env python
# encoding: utf-8

import random
import sys
from Notes import Search

search = Search()
sorted_file_list = search.getFilesListSorted()
file = random.choice(sorted_file_list)
output = search.getNoteFilename(file['path'])

sys.stdout.write(output)