Пример #1
0
def pbauthpocket(q):
    ret = pocket.getRequestCode()
    
    config = config_data()
    config['pocket_request_code'] = ret['code']
    
    with open(os.path.join(alfred.work(False), 'config.json'), 'w+') as myFile:
        myFile.write(json.dumps(config))
    
    result = [alfred.Item(title='Login!', subtitle='Login with Pocket.com (you will be taken to pocket.com)', attributes={'arg':ret['code'],'uid':alfred.uid(0)}, icon="icon.png")]
    alfred.write(alfred.xml(result))
Пример #2
0
def pbauthpocket(q):
    ret = pocket.getRequestCode()
    
    config = config_data()
    config['pocket_request_code'] = ret['code']
    
    with open(os.path.join(alfred.work(False), 'config.json'), 'w+') as myFile:
        myFile.write(json.dumps(config))
    
    result = [alfred.Item(title='Login!', subtitle='Login with Pocket.com (you will be taken to pocket.com)', attributes={'arg':ret['code'],'uid':alfred.uid(0)}, icon="icon.png")]
    alfred.write(alfred.xml(result))
Пример #3
0
def login():
	code = pocket.getRequestCode()
	with open('code.json', 'w') as myFile:
		myFile.write(json.dumps(code))

	results = [alfred.Item(
		attributes={'uid': alfred.uid(0), 'arg': code["code"]},
		title='Login!',
		icon='icon.png',
		subtitle=u'Login with Pocket.com (you will be taken to pocket.com)'
	)] # a single Alfred result
	xml = alfred.xml(results) # compiles the XML answer
	alfred.write(xml) # writes the XML back to Alfred
Пример #4
0
def login():
    code = pocket.getRequestCode()
    with open("code.json", "w") as myFile:
        myFile.write(json.dumps(code))

    results = [
        alfred.Item(
            attributes={"uid": alfred.uid(0), "arg": code["code"]},
            title="Login!",
            icon="icon.png",
            subtitle=u"Login with Pocket.com (you will be taken to pocket.com)",
        )
    ]  # a single Alfred result
    xml = alfred.xml(results)  # compiles the XML answer
    alfred.write(xml)  # writes the XML back to Alfred
Пример #5
0
def login():
    code = pocket.getRequestCode()
    with open('code.json', 'w') as myFile:
        myFile.write(json.dumps(code))

    results = [
        alfred.Item(
            attributes={
                'uid': alfred.uid(0),
                'arg': code["code"]
            },
            title='Login!',
            icon='icon.png',
            subtitle=u'Login with Pocket.com (you will be taken to pocket.com)'
        )
    ]  # a single Alfred result
    xml = alfred.xml(results)  # compiles the XML answer
    alfred.write(xml)  # writes the XML back to Alfred