def save_as(self, event=None): textedit = self.get_current_textedit() file = Dialogs.set_save_file(self, "/home/yeison/Escritorio", self.get_tab("text")) if file: self.set_tab_text_changed(False) self.Files[self.noteBook.select()]["filename"] = file.name self.parent.title(os.getenv("NAME")+" - "+file.name) self.noteBook.tab(self.noteBook.select(), text=os.path.split(file.name)[1]) file.writelines(textedit.get("0.0", END)) file.close()
def save_as(self, event=None): textedit = self.get_current_textedit() file = Dialogs.set_save_file(self, "/home/yeison/Escritorio", self.get_tab("text")) if file: self.set_tab_text_changed(False) self.Files[self.noteBook.select()]["filename"] = file.name self.parent.title(os.getenv("NAME") + " - " + file.name) self.noteBook.tab(self.noteBook.select(), text=os.path.split(file.name)[1]) file.writelines(textedit.get("0.0", END)) file.close()
def save_file(self, event=None): textedit = self.get_current_textedit() filename = self.get_current_filename() if filename: file = open(filename, "w") else: file = Dialogs.set_save_file(self, "/home/yeison/Escritorio", self.get_tab("text")) if file: self.set_tab_text_changed(False) self.Files[self.noteBook.select()]["filename"] = file.name self.parent.title(os.getenv("NAME")+" - "+file.name) file.writelines(textedit.get("0.0", END)) file.close() return True return False
def save_file(self, event=None): textedit = self.get_current_textedit() filename = self.get_current_filename() if filename: file = open(filename, "w") else: file = Dialogs.set_save_file(self, "/home/yeison/Escritorio", self.get_tab("text")) if file: self.set_tab_text_changed(False) self.Files[self.noteBook.select()]["filename"] = file.name self.parent.title(os.getenv("NAME") + " - " + file.name) file.writelines(textedit.get("0.0", END)) file.close() return True return False