Skip to content

Commit

Permalink
Better "Created Date" when importing new notes
Browse files Browse the repository at this point in the history
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
Richard Esplin committed Jan 8, 2013
1 parent 577d30a commit fba8592
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion geeknote.py
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion gnsync.py
Expand Up @@ -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']))
Expand Down

1 comment on commit fba8592

@esplinr
Copy link
Owner

@esplinr esplinr commented on fba8592 Jan 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing existing files are much more useful when the modification time is preserved as the Evernote creation time.

Please sign in to comment.