Store page to the notebook using Notebook API
Using Notebook API, I want to store a page with content to a notebook. But I am not able to store the page to the notebook. The script I tried is as below:
import zim.notebook as zn
import zim.fs as fs
f_path = fs.FilePath(
dir_nb = fs.Dir(f_path) #create Dir object to store notebook contents
nb = zn.Notebook(dir = dir_nb) #create the Notebook with directory
# now let us create a New Page
#check for correct path by resolving the path
path = nb.resolve_
print 'name of this page is ' + path.name
newpage = zn.Page(path) #use this path to create a page
newpage.readonly = False #set the page to write-able mode
text_content = 'some content for the page' #content for the page
newpage.
nb.store_
I get this error
*******
No handlers could be found for logger "zim.notebook"
name of this page is thispaper
Traceback (most recent call last):
File "create_
nb.
File "/usr/lib/
store.
File "/usr/lib/
page._store()
AttributeError: 'Page' object has no attribute '_store'
*******
I expect there for a folder and file name "thispaper" to create in /home/fubar/
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Zim Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jaap Karssenberg
- Solved:
- Last query:
- Last reply: