Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 7 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 17, 2012
@kakkyz81 remove g:evervim_sortnotes. fix #291
because it not work over 50 notes.
it changed always sort by update.
048acc5
Commits on Apr 22, 2012
@kakkyz81 add paginate on notesbynotebook, notesbytag.
Notesbyqurey remains.
0bcfcf1
@kakkyz81 comment fix 5db9baa
@kakkyz81 little fix indent etc. d137569
Commits on Apr 23, 2012
@kakkyz81 paginate on query. fix #290 183a6e7
Commits on Apr 28, 2012
@kakkyz81 fix #293
Command to keymap for user custmize.
But, paging command would be buffer local command.
Set defautl map(">","<") on setup list buffers(__EVERVIM_LIST__).

���[�U�[�J�X�^�}�C�Y��o����悤�ɃR�}���h����s����B
�������A�ړ��R�}���h�͊�{�I�Ƀo�b�t�@���[�J���̂ق����g���₷�����Ȃ�
�ŁA�o�b�t�@��Z�b�g�A�b�v����ꏊ�Ń}�b�s���O����悤�ɂ����B
dd7f5ee
@kakkyz81 document for paginate. fix #292 10a628d
View
51 autoload/evervim.vim
@@ -1,9 +1,7 @@
"=============================================================================
" File: evervim.vim
" Author: kakkyz <kakkyz81@gmail.com>
-" Last Change: 2011-05-05
-" Version: 0.1
-" WebPage: httpevervim#//github.com/kakkyz81/evervim
+" WebPage: http://kakkyz81.github.com/evervim/
" License: MIT
"
"scriptencoding utf-8
@@ -52,7 +50,8 @@ function! evervim#notesByNotebook() " {{{
setlocal modifiable
python Evervimmer.getInstance().notesByNotebook()
setlocal nomodifiable
-
+ set ft=notes
+
map <silent> <buffer> <CR> :call evervim#getNote()<CR>
endfunction
"}}}
@@ -63,7 +62,8 @@ function! evervim#notesByTag() " {{{
setlocal modifiable
python Evervimmer.getInstance().notesByTag()
setlocal nomodifiable
-
+ set ft=notesbytag
+
map <silent> <buffer> <CR> :call evervim#getNote()<CR>
endfunction
"}}}
@@ -91,7 +91,7 @@ function! evervim#setBufAutocmdWhenWritePost() " {{{
augroup END
endfunction
"}}}
-"}}}
+
function! evervim#updateNote() " {{{
python Evervimmer.getInstance().updateNote()
endfunction
@@ -103,6 +103,7 @@ function! evervim#notebookList() " {{{
setlocal modifiable
python Evervimmer.getInstance().listNotebooks()
setlocal nomodifiable
+ set ft=notebooks
map <silent> <buffer> <CR> :call evervim#notesByNotebook()<CR>
endfunction
@@ -114,10 +115,45 @@ function! evervim#evervimSearchByQuery(word) " {{{
setlocal modifiable
python Evervimmer.getInstance().searchByQuery()
setlocal nomodifiable
+ set ft=notesbyquery
map <silent> <buffer> <CR> :call evervim#getNote()<CR>
endfunction
"}}}
+
+function! evervim#pageNext() " {{{
+ if &ft != 'notes' && &ft != 'notesbytag' && &ft != 'notesbyquery'
+ return
+ endif
+
+ setlocal modifiable
+ if &ft == 'notes'
+ python Evervimmer.getInstance().notesByNotebookNextpage()
+ elseif &ft == 'notesbytag'
+ python Evervimmer.getInstance().notesByTagNextpage()
+ elseif &ft == 'notesbyquery'
+ python Evervimmer.getInstance().searchByQueryNextpage()
+ endif
+ setlocal nomodifiable
+endfunction
+"}}}
+"
+function! evervim#pagePrev() " {{{
+ if &ft != 'notes' && &ft != 'notesbytag' && &ft != 'notesbyquery'
+ return
+ endif
+
+ setlocal modifiable
+ if &ft == 'notes'
+ python Evervimmer.getInstance().notesByNotebookPrevpage()
+ elseif &ft == 'notesbytag'
+ python Evervimmer.getInstance().notesByTagPrevpage()
+ elseif &ft == 'notesbyquery'
+ python Evervimmer.getInstance().searchByQueryPrevpage()
+ endif
+ setlocal nomodifiable
+endfunction
+"}}}
function! evervim#isTitle() " {{{
let l:current = line('.')
@@ -175,6 +211,7 @@ function! evervim#listTags() " {{{
setlocal modifiable
python Evervimmer.getInstance().listTags()
setlocal nomodifiable
+ set ft=taglists
map <silent> <buffer> <CR> :call evervim#notesByTag()<CR>
endfunction
@@ -194,6 +231,8 @@ function! evervim#listBufSetup() " {{{
setlocal buftype=nofile
setlocal nowrap
setlocal nonumber
+ nmap <silent> <buffer> > :<C-u>EvervimPageNext<CR>
+ nmap <silent> <buffer> < :<C-u>EvervimPagePrev<CR>
endif
endfunction
"}}}
View
23 doc/evervim.jax
@@ -85,6 +85,16 @@ pythonが有効かどうかは、
検索文字列の書式は以下を参考にせよ
http://dev.evernote.com/documentation/cloud/chapters/search_grammar.php#Search_Terms
+:EvervimPageNext *:EvervimPageNext*
+ 複数ページがある場合に、次のページへ移動する。
+ このコマンドはリスト表示のバッファ(__EVERVIM_LIST__)で
+ ">" にマッピングされて いる。
+
+:EvervimPagePrev *:EvervimPagePrev*
+ 複数ページがある場合に、前のページへ移動する。
+ このコマンドはリスト表示のバッファ(__EVERVIM_LIST__)で
+ "<" にマッピングされて いる。
+
:EvervimCreateNote *:EvervimCreateNote*
新規ノートを保存するためのバッファが開かれる。
バッファの保存時にノートがEvernoteに保存される
@@ -125,13 +135,6 @@ g:evervim_usemarkdown *g:evervim_usemarkdown*
初期値は'1'である。これは、markdown形式を用いるということであ
る。
-g:evervim_sortnotes *g:evervim_sortnotes*
- ノートの一覧のソート順を示す。とりうる値は以下。
- (updated | created | title) (asc | desc)
-
- 初期値は'updated desc'である。
- これは、更新日の降順という意味である。
-
g:evervim_sortbooks *g:evervim_sortnotebooks*
ノートブックの一覧のソート順を示す。とりうる値は以下。
(name | serviceCreated | serviceUpdated) (asc | desc)
@@ -176,5 +179,11 @@ Ver.0.2.0:2012-04-10
Ver.0.2.1:2012-04-14
- add g:evervim_asyncupdate , use thread when buffer write for speed up.
+Ver.0.2.2:2012-04-18
+- remove g:evervim_sortnotes, because it not work over 50 notes.
+ it changed always sort by update.
+
+Ver.0.3.0:2012-04-24
+- paginate on notes on notebook,tags and search by query.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0:
View
21 doc/evervim.txt
@@ -78,6 +78,14 @@ COMMAND *evervim-commands*
See formatting of searchword.
http://dev.evernote.com/documentation/cloud/chapters/search_grammar.php#Search_Terms
+:EvervimPageNext *:EvervimPageNext*
+ Move next page on multi page buffer.
+ This command is mapped ">" on list buffer(__EVERVIM_LIST__).
+
+:EvervimPagePrev *:EvervimPagePrev*
+ Move prev page on multi page buffer.
+ This command is mapped "<" on list buffer(__EVERVIM_LIST__).
+
:EvervimCreateNote *:EvervimCreateNote*
Open new buffer to edit new note.
when buffer saved, note is saved on evernote.
@@ -116,13 +124,6 @@ g:evervim_usemarkdown *g:evervim_usemarkdown*
defalult is '1'. It means use markdown.
-g:evervim_sortnotes *g:evervim_sortnotes*
- Sort pattern of notes. It can use below values.
- (updated | created | title) (asc | desc)
-
- Default is 'updated desc'.
- It means updated desc.
-
g:evervim_sortbooks *g:evervim_sortnotebooks*
Sort pattern of notebooks. It can use below values.
(name | serviceCreated | serviceUpdated) (asc | desc)
@@ -169,5 +170,11 @@ Ver.0.2.0:2012-04-10
Ver.0.2.1:2012-04-14
- add g:evervim_asyncupdate , use thread when buffer write for speed up.
+Ver.0.2.2:2012-04-18
+- remove g:evervim_sortnotes, because it not work over 50 notes.
+ it changed always sort by update.
+
+Ver.0.3.0:2012-04-24
+- paginate on notes on notebook,tags and search by query.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0:
View
6 plugin/evervim.vim
@@ -31,10 +31,6 @@ if !exists('g:evervim_password')
let g:evervim_password = ''
endif
-if !exists('g:evervim_sortnotes') " (updated|created|title) (asc|desc)
- let g:evervim_sortnotes = 'updated desc'
-endif
-
if !exists('g:evervim_sortnotebooks') " (name|serviceCreated|serviceUpdated) (asc|desc)
let g:evervim_sortnotebooks = 'name asc'
endif
@@ -66,6 +62,8 @@ function! s:setCommand() " {{{
command! EvervimCreateNote call evervim#createNoteBuf()
command! EvervimListTags call s:listTags()
command! EvervimReloadPref call s:setPref()
+ command! EvervimPageNext call evervim#pageNext()
+ command! EvervimPagePrev call evervim#pagePrev()
endfunction
"}}}
View
46 plugin/py/evernoteapi.py
@@ -25,6 +25,7 @@ class EvernoteAPI(object):
""" interface to evernote API """
# CLASS CONSTANT {{{
MAXNOTES = LimitConstants.EDAM_USER_NOTES_MAX
+ PAGEMAX = 50
NOTECONTENT_HEADER = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note>'
NOTECONTENT_FOOTER = '</en-note>'
#}}}
@@ -93,34 +94,43 @@ def getNote(self, note): # {{{
return returnNote
#}}}
- def notesByQuery(self, query): # {{{
+ def notesByQuery(self, query, page=0): # {{{
"""
return note by query.
query format see http://www.evernote.com/about/developer/api/evernote-api.htm#_Toc290381026
"""
noteFilter = NoteStore.NoteFilter()
noteFilter.words = query
+ noteFilter.order = Types.NoteSortOrder.UPDATED
+ offset = page * EvernoteAPI.PAGEMAX
authToken = self.__getAuthToken()
- return self.__getNoteStore().findNotes(authToken, noteFilter, offset=0, maxNotes=EvernoteAPI.MAXNOTES).notes
+ noteList = self.__getNoteStore().findNotes(authToken, noteFilter, offset=offset, maxNotes=EvernoteAPI.MAXNOTES)
+ return self.__NoteList2EvernoteList(noteList)
#}}}
- def notesByNotebook(self, notebook): # {{{
+ def notesByNotebook(self, notebook, page=0): # {{{
""" return note by notebook(notebook object). TODO:edit noteFilter more """
noteFilter = NoteStore.NoteFilter()
noteFilter.notebookGuid = notebook.guid
+ noteFilter.order = Types.NoteSortOrder.UPDATED
+ offset = page * EvernoteAPI.PAGEMAX
authToken = self.__getAuthToken()
- return self.__getNoteStore().findNotes(authToken, noteFilter, offset=0, maxNotes=EvernoteAPI.MAXNOTES).notes
+ noteList = self.__getNoteStore().findNotes(authToken, noteFilter, offset=offset, maxNotes=EvernoteAPI.MAXNOTES)
+ return self.__NoteList2EvernoteList(noteList)
#}}}
- def notesByTag(self, tag): # {{{
+ def notesByTag(self, tag, page=0): # {{{
""" return note by tag(tag object). TODO:edit noteFilter more """
noteFilter = NoteStore.NoteFilter()
noteFilter.tagGuids = [tag.guid]
+ noteFilter.order = Types.NoteSortOrder.UPDATED
+ offset = page * EvernoteAPI.PAGEMAX
authToken = self.__getAuthToken()
- return self.__getNoteStore().findNotes(authToken, noteFilter, offset=0, maxNotes=EvernoteAPI.MAXNOTES).notes
+ noteList = self.__getNoteStore().findNotes(authToken, noteFilter, offset=offset, maxNotes=EvernoteAPI.MAXNOTES)
+ return self.__NoteList2EvernoteList(noteList)
#}}}
def listNotebooks(self): # {{{
@@ -223,8 +233,32 @@ def __getNoteStore(self): # {{{
return self.noteStore
#}}}
+
+ def __NoteList2EvernoteList(self, noteList): # {{{
+ """ get evernoteList from NoteList. """
+ returnList = EvernoteList()
+ returnList.elem = noteList.notes
+ returnList.maxcount = noteList.totalNotes
+ # note count start by 0 because it - 1.
+ returnList.maxpages = (noteList.totalNotes - 1) / EvernoteAPI.PAGEMAX
+ if noteList.startIndex == 0:
+ returnList.currentpage = 0
+ else:
+ returnList.currentpage = noteList.startIndex / EvernoteAPI.PAGEMAX
+
+ return returnList
+ #}}}
+
#### end class.
+
+class EvernoteList(object):
+ def __init__(self):
+ self.elem = []
+ self.maxcount = None
+ self.maxpages = None
+ self.currentpage = None
+
#### CONSTANT
# {{{
CONSUMER_KEY = 'kakkyz2'
View
67 plugin/py/evernoteapi_test.py
@@ -4,6 +4,7 @@
# License: MIT
import unittest
from evernoteapi import EvernoteAPI
+from evernoteapi import EvernoteList
import evernote.edam.type.ttypes as Types
import json
@@ -79,7 +80,7 @@ def testNotesByTag(self): # {{{
tags = self.api.listTags()
notes = []
for tag in tags:
- [notes.append(note) for note in self.api.notesByTag(tag)]
+ [notes.append(note) for note in self.api.notesByTag(tag).elem]
# less more 1 notes
self.assertNotEquals(0, len(notes))
for note in notes:
@@ -90,15 +91,15 @@ def testNotesByNotebook(self): # {{{
notebooks = self.api.listNotebooks()
notes = []
for notebook in notebooks:
- [notes.append(note) for note in self.api.notesByNotebook(notebook)]
+ [notes.append(note) for note in self.api.notesByNotebook(notebook).elem]
# less more 1 notes
self.assertNotEquals(0, len(notes))
for note in notes:
self.assertTrue(hasattr(note, 'guid'))
#}}}
def testNotesByQuery(self): # {{{
- notes = self.api.notesByQuery('日本語')
+ notes = self.api.notesByQuery('日本語').elem
# less more 1 notes
self.assertNotEquals(0, len(notes))
for note in notes:
@@ -152,12 +153,67 @@ def testWhenUpdateNoteTagDelete(self): # {{{
#}}}
def __getOneNote(self): # {{{
- notes = self.api.notesByQuery('日本語')
+ notes = self.api.notesByQuery('日本語').elem
self.assertNotEquals(0, len(notes))
for note in notes:
return note
#}}}
+ def testEvernoteList(self): # {{{
+ evernoteList = EvernoteList()
+ self.assertTrue(hasattr(evernoteList, 'elem'))
+ self.assertTrue(hasattr(evernoteList, 'maxcount'))
+ self.assertTrue(hasattr(evernoteList, 'maxpages'))
+ self.assertTrue(hasattr(evernoteList, 'currentpage'))
+ #}}}
+
+ def testNoteList2EvernoteList(self): # {{{
+ class dummy(object):
+ pass
+
+ noteList = dummy()
+ setattr(noteList , 'notes', [])
+ setattr(noteList , 'totalNotes', 1)
+ setattr(noteList , 'startIndex', 0)
+ # test of private method!
+ evernoteList = self.api._EvernoteAPI__NoteList2EvernoteList(noteList)
+ self.assertEqual(evernoteList.maxpages, 0)
+ self.assertEqual(evernoteList.currentpage, 0)
+
+ setattr(noteList , 'totalNotes', 50) # 0 - 50 -> 0 ( 0 is none )
+ evernoteList = self.api._EvernoteAPI__NoteList2EvernoteList(noteList)
+ self.assertEqual(evernoteList.maxpages, 0)
+
+ setattr(noteList , 'totalNotes', 51) # 51 - 100 -> 1
+ evernoteList = self.api._EvernoteAPI__NoteList2EvernoteList(noteList)
+ self.assertEqual(evernoteList.maxpages, 1)
+
+ setattr(noteList , 'totalNotes', 100) # 101 - 150 -> 2
+ evernoteList = self.api._EvernoteAPI__NoteList2EvernoteList(noteList)
+ self.assertEqual(evernoteList.maxpages, 1)
+
+ setattr(noteList , 'totalNotes', 151)
+ evernoteList = self.api._EvernoteAPI__NoteList2EvernoteList(noteList)
+ self.assertEqual(evernoteList.maxpages, 3)
+
+ setattr(noteList , 'startIndex', 49) # 0 - 49 -> 0index is start from 0
+ evernoteList = self.api._EvernoteAPI__NoteList2EvernoteList(noteList)
+ self.assertEqual(evernoteList.currentpage, 0)
+
+ setattr(noteList , 'startIndex', 50) # 50 - 99 -> 1
+ evernoteList = self.api._EvernoteAPI__NoteList2EvernoteList(noteList)
+ self.assertEqual(evernoteList.currentpage, 1)
+
+ setattr(noteList , 'startIndex', 100)
+ evernoteList = self.api._EvernoteAPI__NoteList2EvernoteList(noteList)
+ self.assertEqual(evernoteList.currentpage, 2)
+
+ setattr(noteList , 'startIndex', 101)
+ evernoteList = self.api._EvernoteAPI__NoteList2EvernoteList(noteList)
+ self.assertEqual(evernoteList.currentpage, 2)
+
+ #}}}
+
if __name__ == '__main__':
from time import localtime, strftime
print '\n**' + strftime("%a, %d %b %Y %H:%M:%S", localtime()) + '**\n'
@@ -176,6 +232,7 @@ def __getOneNote(self): # {{{
#
# 個別でテストするとき
# suite = unittest.TestSuite()
-# suite.addTest(TestEvernoteAPI('testAuth'))
+# suite.addTest(TestEvernoteAPI('testNotesByNotebook'))
+# suite.addTest(TestEvernoteAPI('testNoteList2EvernoteList'))
# suite.addTest(TestEvernoteAPI('testRefreshAuth'))
# unittest.TextTestRunner().run(suite)
View
1 plugin/py/evervim_editor.py
@@ -19,7 +19,6 @@ def __init__(self):
self.workdir = None
self.username = None
self.password = None
- self.sortnotes = None
self.sortnotebooks = None
self.sorttags = None
self.xmlindent = None
View
1 plugin/py/evervim_editor_test.py
@@ -31,7 +31,6 @@ def testPref(self): # {{{
self.assertIsNone(pref.workdir)
self.assertIsNone(pref.username)
self.assertIsNone(pref.password)
- self.assertIsNone(pref.sortnotes)
self.assertIsNone(pref.sortnotebooks)
self.assertIsNone(pref.sorttags)
self.assertIsNone(pref.xmlindent)
View
115 plugin/py/evervimmer.py
@@ -34,6 +34,8 @@ def getInstance(self):
notes = []
notebooks = []
tags = []
+ maxpages = 0
+ currentpage = 0
editor = EvervimEditor.getInstance()
pref = EvervimPref.getInstance()
@@ -43,7 +45,6 @@ def setPref(self): # {{{
self.pref.workdir = vim.eval("g:evervim_workdir")
self.pref.username = vim.eval("g:evervim_username")
self.pref.password = vim.eval("g:evervim_password")
- self.pref.sortnotes = vim.eval("g:evervim_sortnotes")
self.pref.sortnotebooks = vim.eval("g:evervim_sortnotebooks")
self.pref.sorttags = vim.eval("g:evervim_sorttags")
self.pref.xmlindent = vim.eval("g:evervim_xmlindent")
@@ -64,36 +65,72 @@ def auth(self): # {{{
Evervimmer.editor.api.auth()
#}}}
- def notesByNotebook(self): # {{{
+ def notesByNotebook(self, notebook=None): # {{{
""" get notelist by notebook """
- selectnotebook = Evervimmer.notebooks[self.__getArrayIndexByCurrentLine()]
- Evervimmer.notes = Evervimmer.editor.api.notesByNotebook(selectnotebook)
- self.sortNotes()
+
+ if notebook == None: # notebook is selected on list.( else then use currentNotebook for paginate.)
+ self.currentNotebook = Evervimmer.notebooks[self.__getArrayIndexByCurrentLine()]
+ self.currentpage = 0
+
+ noteList = Evervimmer.editor.api.notesByNotebook(self.currentNotebook, self.currentpage)
+ self.__setNoteListPrameter(noteList)
notetitles = [self.__changeEncodeToBuffer(note.title) for note in Evervimmer.notes]
self.__setBufferList(notetitles,
- " [notebook:%s]" % self.__changeEncodeToBuffer(selectnotebook.name))
+ " [notebook:%s(%s)] page:%s/%s [\">\":next, \"<\":prev]" % (self.__changeEncodeToBuffer(self.currentNotebook.name) ,
+ Evervimmer.maxcount,
+ Evervimmer.currentpage + 1,
+ Evervimmer.maxpages + 1
+ ))
#}}}
- def sortNotes(self): # {{{
- sortOpt = vim.eval('g:evervim_sortnotes').split()
- if sortOpt[1] == 'asc':
- Evervimmer.notes.sort(lambda a, b: cmp(getattr(a, sortOpt[0]),
- getattr(b, sortOpt[0])))
- else:
- Evervimmer.notes.sort(lambda a, b: cmp(getattr(b, sortOpt[0]),
- getattr(a, sortOpt[0])))
+ def notesByNotebookNextpage(self): # {{{
+ if self.currentpage == self.maxpages:
+ return
+ self.currentpage += 1
+ self.notesByNotebook(self.currentNotebook)
#}}}
- def notesByTag(self): # {{{
- selecttag = Evervimmer.tags[self.__getArrayIndexByCurrentLine()]
- Evervimmer.notes = Evervimmer.editor.api.notesByTag(selecttag)
- self.sortNotes()
+ def notesByNotebookPrevpage(self): # {{{
+ if self.currentpage == 0:
+ return
+
+ self.currentpage -= 1
+ self.notesByNotebook(self.currentNotebook)
+ #}}}
+
+ def notesByTag(self, tag=None): # {{{
+ if tag == None:
+ self.currentTag = Evervimmer.tags[self.__getArrayIndexByCurrentLine()]
+ self.currentpage = 0
+
+ noteList = Evervimmer.editor.api.notesByTag(self.currentTag, self.currentpage)
+ self.__setNoteListPrameter(noteList)
notetitles = [self.__changeEncodeToBuffer(note.title) for note in Evervimmer.notes]
self.__setBufferList(notetitles,
- " [tag:%s]" % self.__changeEncodeToBuffer(selecttag.name))
+ " [tag:%s(%s)] page:%s/%s [\">\":next, \"<\":prev]" % (self.__changeEncodeToBuffer(self.currentTag.name) ,
+ Evervimmer.maxcount,
+ Evervimmer.currentpage + 1,
+ Evervimmer.maxpages + 1
+ ))
+ #}}}
+
+ def notesByTagNextpage(self): # {{{
+ if self.currentpage == self.maxpages:
+ return
+
+ self.currentpage += 1
+ self.notesByTag(self.currentTag)
+ #}}}
+
+ def notesByTagPrevpage(self): # {{{
+ if self.currentpage == 0:
+ return
+
+ self.currentpage -= 1
+ self.notesByTag(self.currentTag)
#}}}
def listNotebooks(self): # {{{
@@ -156,14 +193,37 @@ def updateNote(self): # {{{
Evervimmer.editor.api.updateNote(Evervimmer.currentnote)
#}}}
- def searchByQuery(self): # {{{
- query = vim.eval("a:word")
- Evervimmer.notes = Evervimmer.editor.api.notesByQuery(query)
- self.sortNotes()
+ def searchByQuery(self, query=None): # {{{
+ if query == None:
+ self.query = vim.eval("a:word")
+ self.currentpage = 0
+
+ noteList = Evervimmer.editor.api.notesByQuery(self.query, self.currentpage)
+ self.__setNoteListPrameter(noteList)
notetitles = [self.__changeEncodeToBuffer(note.title) for note in Evervimmer.notes]
- self.__setBufferList(notetitles, " [query:%s]" % query)
+ self.__setBufferList(notetitles,
+ " [query:%s(%s)] page:%s/%s [\">\":next, \"<\":prev]" % (self.__changeEncodeToBuffer(self.query) ,
+ Evervimmer.maxcount,
+ Evervimmer.currentpage + 1,
+ Evervimmer.maxpages + 1
+ ))
+ #}}}
+ def searchByQueryNextpage(self): # {{{
+ if self.currentpage == self.maxpages:
+ return
+
+ self.currentpage += 1
+ self.searchByQuery(self.query)
+ #}}}
+
+ def searchByQueryPrevpage(self): # {{{
+ if self.currentpage == 0:
+ return
+
+ self.currentpage -= 1
+ self.searchByQuery(self.query)
#}}}
def createNote(self): # {{{
@@ -232,3 +292,10 @@ def __changeEncodeToBuffer(self, string): # {{{
return unicode(string, 'utf-8').encode(self.pref.encoding)
except:
return string
+
+ def __setNoteListPrameter(self, noteList): # {{{
+ """ set host variable from noteList """
+ Evervimmer.notes = noteList.elem
+ Evervimmer.maxpages = noteList.maxpages
+ Evervimmer.currentpage = noteList.currentpage
+ Evervimmer.maxcount = noteList.maxcount

No commit comments for this range

Something went wrong with that request. Please try again.