-
Notifications
You must be signed in to change notification settings - Fork 0
/
Yinxiang.py
55 lines (37 loc) · 1.21 KB
/
Yinxiang.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-08-20 18:20:19
# @Author : Tom Hu ([email protected])
# @Link : http://h1994st.com
# @Version : 1.0
from pprint import pprint
from Evernote import Evernote
import Config
class Yinxiang(Evernote):
'''
Default user: covert_tom ([email protected])
'''
def __init__(self, **kwargs):
kwargs.setdefault('service_host', Config.Yinxiang('host'))
kwargs.setdefault('token', Config.Yinxiang('token'))
super(Yinxiang, self).__init__(**kwargs)
def description(self):
return 'username={!r}, email={!r}, server_host={!r}, token={!r}, sandbox={!r}'.format(
Config.Yinxiang('username'), Config.Yinxiang('email'),
Config.Yinxiang('host'), Config.Yinxiang('token'), False)
def test_yinxiang():
e = Yinxiang()
# Read all
pprint(e.receive_all())
print 'Input file: ./data/eva_time_data_2.in'
with open('data/eva_time_data_2.in', 'r') as fp:
content = fp.read()
print e.send(content)
# time.sleep(3)
pprint(e.receive_all())
# Delete all
e.delete_all()
# Read all
pprint(e.receive_all())
if __name__ == '__main__':
test_yinxiang()