-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·43 lines (37 loc) · 1.15 KB
/
test.py
File metadata and controls
executable file
·43 lines (37 loc) · 1.15 KB
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
#!/usr/bin/env python
#coding:utf-8
# Author : tuxpy
# Email : q8886888@qq.com.com
# Last modified : 2015-11-02 10:58:01
# Filename : test.py
# Description :
from __future__ import print_function, unicode_literals
from wiz.client import Wiz
from wiz.note import Note
def down_images(note):
assert isinstance(note, Note)
for image in note.data.images:
with open('/tmp/' + image.name, 'wb') as fd:
fd.write(image.data)
def down_attrs(note):
assert isinstance(note, Note)
for attr in note.data.attachments:
with open('/tmp/' + attr.name, 'wb') as fd:
fd.write(attr.data)
wiz = Wiz('q8886888@qq.com', 'zxc123')
note_count = 0
for notebook in wiz.ls_notebooks():
print('notebook', notebook.name)
for note in notebook.ls():
print(note.title)
note_count += 1
print(note_count)
# notebook = wiz.ls_notebooks()[0] # ls_notebooks 列出所有笔记本
# note = notebook.ls()[0] # notebook.ls 列出该笔记本下的所有笔记
# print(note.data.text) # 笔记数据,以文本形式列出
#
# down_images(note)
# down_attrs(note)
#
# print(wiz.find_notes('a*')[0].data.body)
#