Пример #1
0
    def onDefinitionsAnchorClicked(self, url):
        command, index = unicode(url.toString()).split(":")
        definition = self.state.definitions[int(index)]

        if command == "addFactExpression":
            markup = reader_util.buildFactMarkupExpression(
                definition.expression, definition.reading, definition.glossary, definition.sentence
            )
            self.ankiAddFact(markup)
        if command == "addFactReading":
            markup = reader_util.buildFactMarkupReading(definition.reading, definition.glossary, definition.sentence)
            self.ankiAddFact(markup)
        elif command == "copyDefinition":
            reader_util.copyDefinitions([definition])
Пример #2
0
 def onActionCopyAllDefinitions(self):
     reader_util.copyDefinitions(self.state.definitions)