Skip to content

Commit

Permalink
Merge pull request #246 from b225ccc/master
Browse files Browse the repository at this point in the history
Add note sort order option
  • Loading branch information
Vitaliy Rodnenko committed Dec 25, 2014
2 parents 76d4928 + eec0178 commit 4423092
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions geeknote/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
CONSUMER_SECRET_SANDBOX = "ed0fcc0c97c032a5"
# !!! DO NOT EDIT !!! <<<

# can be one of: UPDATED, CREATED, RELEVANCE, TITLE, UPDATE_SEQUENCE_NUMBER
NOTE_SORT_ORDER = "UPDATED"

# Evernote config

VERSION = 0.1
Expand Down
2 changes: 2 additions & 0 deletions geeknote/geeknote.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class GeekNote(object):
userStoreUri = config.USER_STORE_URI
consumerKey = config.CONSUMER_KEY
consumerSecret = config.CONSUMER_SECRET
noteSortOrder = config.NOTE_SORT_ORDER
authToken = None
userStore = None
noteStore = None
Expand Down Expand Up @@ -157,6 +158,7 @@ def removeUser(self):
def findNotes(self, keywords, count, createOrder=False, offset=0):
""" WORK WITH NOTEST """
noteFilter = NoteStore.NoteFilter(order=Types.NoteSortOrder.RELEVANCE)
noteFilter.order = getattr(Types.NoteSortOrder, self.noteSortOrder)
if createOrder:
noteFilter.order = Types.NoteSortOrder.CREATED

Expand Down

0 comments on commit 4423092

Please sign in to comment.