Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions Sailfish/ownNotes/python/ownnotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,11 @@ def saveNote(filepath, data, colorized=True):
with open(filepath, 'w', encoding='utf-8') as fh:
fh.write(_content)

# Note pushing removed to avoid the app locking up
# Perhaps this should be run in a different thread
#try:
# relpath = os.path.join(category, _getValidFilename(_title.strip()) + '.txt')
# sync.push_note(relpath)
#except Exception as err:
# logger.Logger().logger.error(str(err))
try:
relpath = os.path.join(category, _getValidFilename(_title.strip()) + '.txt')
sync.launch_push_note(relpath)
except Exception as err:
logger.Logger().logger.error(str(err))

return filepath

Expand Down Expand Up @@ -451,4 +449,4 @@ def get_last_sync_datetime():


if __name__ == '__init__':
print(getCategoryFromPath(os.path.join(NOTESPATH, 'test', 'blabla.txt')))
print(getCategoryFromPath(os.path.join(NOTESPATH, 'test', 'blabla.txt')))
4 changes: 2 additions & 2 deletions Sailfish/ownNotes/python/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def launch(self):
return True

def launch_push_note(self, path):
self.thread = threading.Thread(target=self._wpushNote, args=[path, ])
self.thread = threading.Thread(target=self.push_note, args=[path, ])
self.thread.start()
return True

Expand Down Expand Up @@ -696,4 +696,4 @@ def _set_running(self, b):

if __name__ == '__main__':
s = Sync()
s.sync()
s.sync()