Exemplo n.º 1
0
 def set_note_tags(self, key, tags):
     n = self.notes[key]
     old_tags = n.get('tags')
     tags = utils.sanitise_tags(tags)
     if tags != old_tags:
         n['tags'] = tags
         n['modifydate'] = time.time()
         self.notify_observers('change:note-status', utils.KeyValueObject(what='modifydate', key=key))
Exemplo n.º 2
0
 def add_note_tags(self, key, comma_seperated_tags):
     note = self.notes[key]
     note_tags = note.get('tags')
     new_tags = utils.sanitise_tags(comma_seperated_tags)
     note_tags.extend(new_tags)
     note['tags'] = note_tags
     note['modifydate'] = time.time()
     self.notify_observers('change:note-status',
                           utils.KeyValueObject(what='modifydate', key=key))
Exemplo n.º 3
0
 def set_note_tags(self, key, tags):
     n = self.notes[key]
     old_tags = n.get('tags')
     tags = utils.sanitise_tags(tags)
     if tags != old_tags:
         n['tags'] = tags
         n['modifydate'] = time.time()
         self.notify_observers(
             'change:note-status',
             utils.KeyValueObject(what='modifydate', key=key))
Exemplo n.º 4
0
    def is_note_different(self, note):
        """
        Determine if note would cause a UI update.
        """

        if self.get_text() != note.get('content'):
            return True

        tags = note.get('tags', [])
        # get list of string tags from ui
        ui_tags = utils.sanitise_tags(self.tags_entry_var.get())
        if ui_tags != tags:
            return True

        if bool(self.pinned_checkbutton_var.get()) != bool(utils.note_pinned(note)):
            return True
Exemplo n.º 5
0
    def is_note_different(self, note):
        """
        Determine if note would cause a UI update.
        """

        if self.get_text() != note.get('content'):
            return True

        tags = note.get('tags', [])
        # get list of string tags from ui
        ui_tags = utils.sanitise_tags(self.tags_entry_var.get())
        if ui_tags != tags:
            return True

        if bool(self.pinned_checkbutton_var.get()) != bool(utils.note_pinned(note)):
            return True