Example #1
0
 def exportList(self):
     filename = tkFileDialog.asksaveasfilename(filetypes = (("Tldr Files", "*.tldr"),), initialfile = self.lists_list_pane.get())
     if str(filename) == "":
         return
     export_list = self.db.getList(self.lists_list_pane.get())[0]
     word_list = self.db.getWords(self.lists_list_pane.get())
     word_dict = {}
     for word in word_list:
         word = word[0]
         word_record = self.db.getWord(word)[0]
         word_dict[word] = [word_record[2],word_record[3],word_record[4]]
     tldr_parse = TldrParser()
     tldr_parse.setWordList(word_dict)
     tldr_parse.setSource(export_list[2])
     tldr_parse.setDateEdited(str(date.today()))
     tldr_parse.setListSize(export_list[4])
     tldr_parse.writetldr(filename)