1

Can now import Kindle vocab decks

Former-commit-id: 79282c1efd08bc501505850d1613926f479a95b0
This commit is contained in:
Alex Yatskov 2014-12-20 20:39:24 +09:00
parent a8be8d8eb4
commit bd1fe47502
2 changed files with 13 additions and 2 deletions

View File

@ -552,7 +552,18 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
def importWordList(self, words):
pass
self.state.vocabDefs = list()
self.state.kanjiDefs = list()
for word in words:
if self.dockVocab.isVisible():
self.state.vocabDefs += self.language.dictionary.findTerm(word)
if self.dockKanji.isVisible():
self.state.kanjiDefs += self.language.findCharacters(word)
self.updateVocabDefs()
self.updateKanjiDefs()
def setStatus(self, status):

View File

@ -174,7 +174,7 @@ def buildVocabDef(definition, index, query):
reading = u'<span class = "reading">[{0}]<br/></span>'.format(definition['reading'])
rules = unicode()
if len(definition['rules']) > 0:
if definition.get('rules'):
rules = ' &lt; '.join(definition['rules'])
rules = '<span class = "rules">({0})<br/></span>'.format(rules)