Skip to content
Browse files

Better "Created Date" when importing new notes

Use the unix mtime as the created date. It isn't the real created date, but it
is closer than the default (current) date and time.
  • Loading branch information...
1 parent 577d30a commit fba859223226c8bc523dea078d46a31954dbbf75 Richard Esplin committed Jan 8, 2013
Showing with 4 additions and 2 deletions.
  1. +2 −1 geeknote.py
  2. +2 −1 gnsync.py
View
3 geeknote.py
@@ -185,10 +185,11 @@ def loadNoteContent(self, note):
note.content = self.getNoteStore().getNoteContent(self.authToken, note.guid)
@EdamException
- def createNote(self, title, content, tags=None, notebook=None):
+ def createNote(self, title, content, tags=None, notebook=None, created=None):
note = Types.Note()
note.title = title
note.content = content
+ note.created = created
if tags:
note.tagNames = tags
View
3 gnsync.py
@@ -162,7 +162,8 @@ def _create_note(self, file_note):
result = GeekNote().createNote(
title=file_note['name'],
content=content,
- notebook=self.notebook_guid)
+ notebook=self.notebook_guid,
+ created=file_note['mtime'])
if result:
logger.info('Note "{0}" was created'.format(file_note['name']))

0 comments on commit fba8592

Please sign in to comment.
Something went wrong with that request. Please try again.