Example #1
0
File: ui.py Project: vijo/sqink
    def __onConfirm(self, note):
        parent= self.__parentWindow
        if not note.title:
            parent.showError("A title is required")
            raise ValidationError

        noteProvider= parent.noteProvider()
        if note.uuid:
            noteProvider.update(renderHtml(note))
        else:
            note.uuid= uuid()
            note.createdOn= note.lastModified
            noteProvider.add(renderHtml(note))
        self.__note= note
        parent.reload(True, True)
        parent.showStatus("Note saved")
Example #2
0
    def testUuidShouldSucceed(self):
        result= uuid()

        self.assertTrue(isUuid(result))
        self.assertEqual(str, type(result))