1

Fixing bugs related to adding kana-only cards, bumping version

Former-commit-id: 298b5275a85d3f60b118846c6fc7b9885702c48a
This commit is contained in:
Alex Yatskov 2013-12-22 13:57:05 -08:00
parent 72459ba337
commit 4194570cd4
3 changed files with 20 additions and 11 deletions

View File

@ -17,5 +17,5 @@
c = { c = {
'appVersion': '0.11b', 'appVersion': '0.12b',
} }

View File

@ -398,6 +398,9 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
def ankiIsFactValid(self, profile, markup): def ankiIsFactValid(self, profile, markup):
if markup is None:
return False
if self.anki is None: if self.anki is None:
return False return False

View File

@ -96,30 +96,36 @@ def splitTags(tags):
def markupVocabExp(definition): def markupVocabExp(definition):
if definition['reading']:
summary = u'{expression} [{reading}]'.format(**definition)
else:
summary = u'{expression}'.format(**definition)
return { return {
'expression': definition['expression'], 'expression': definition['expression'],
'reading': definition['reading'], 'reading': definition['reading'] or unicode(),
'glossary': definition['glossary'], 'glossary': definition['glossary'],
'sentence': definition.get('sentence'), 'sentence': definition.get('sentence'),
'summary': u'{expression} [{reading}]'.format(**definition) 'summary': summary
} }
def markupVocabReading(definition): def markupVocabReading(definition):
return { if definition['reading']:
'expression': definition['reading'], return {
'reading': unicode(), 'expression': definition['reading'],
'glossary': definition['glossary'], 'reading': unicode(),
'sentence': definition.get('sentence'), 'glossary': definition['glossary'],
'summary': definition['reading'] 'sentence': definition.get('sentence'),
} 'summary': definition['reading']
}
def copyVocabDef(definition): def copyVocabDef(definition):
if definition['reading']: if definition['reading']:
result = u'{expression}\t{reading}\t{glossary}\n'.format(**definition) result = u'{expression}\t{reading}\t{glossary}\n'.format(**definition)
else: else:
result = u'{expression}\t{meanings}\n'.format(**definition) result = u'{expression}\t{glossary}\n'.format(**definition)
QtGui.QApplication.clipboard().setText(result) QtGui.QApplication.clipboard().setText(result)