Implement note creation

This commit is contained in:
2017-10-05 01:05:47 -06:00
parent ec6de719ab
commit e960c2d717
2 changed files with 22 additions and 3 deletions
+14
View File
@@ -1,4 +1,5 @@
from api import StandardNotesAPI
from uuid import uuid1
class ItemManager:
items = {}
@@ -65,6 +66,19 @@ class ItemManager:
item['dirty'] = True
self.syncItems()
def createNote(self, name, time):
uuid = str(uuid1())
content = dict(title=name, text='', references=[])
self.items[uuid] = dict(content_type='Note',
dirty=True,
auth_hash=None,
uuid=uuid,
created_at=time,
updated_at=time,
enc_item_key='',
content=content)
return 0
def __init__(self, username, password):
self.standard_notes = StandardNotesAPI(username, password)
self.syncItems()