def __save_note_hook(self,obj,res,dat): '''Callback function for GEdit async save, as used in save_note and save_note_as''' dprint(3, "\nin save_note_hook...") result = Gedit.commands_save_document_finish(obj, res) dprint(3, "got result: " + str(result)) if result == True: path = GtkSource.File.get_location(obj.get_file()).get_path() note = None if not dat: note = self.__get_note_ref(path) if not note: note = self.__make_note_ref(obj,path) else: note = Note(dat) note.ID = path dprint(3, "...Note to be saved: " + str(note.ID)) if self.data.save_note_nowrite(note): dprint(1, "\nbinding save error") else: dprint(1, "\nSave did not occur")
def on_document_saved(self, doc, result, user_data): saved = Gedit.commands_save_document_finish(doc, result) if saved: self.save_next_document()