# Path: l5r/util/log.py
# def log_setup(base_path, base_name):


import sys
import l5r.api as api
import l5r.api.character.spells
import l5r.api.data.spells
from l5r.util import log
from PyQt5 import QtCore, QtGui, QtWidgets
        if self.get_spell() is not None:
            self.spell_changed.emit(self.get_spell())

    def get_spell(self):
        return self.cb_spell.itemData(self.cb_spell.currentIndex())

    def get_ring(self):
        return self.cb_element.itemData(self.cb_element.currentIndex())

    def get_mastery(self):
        return self.cb_mastery.itemData(self.cb_mastery.currentIndex()) or 0

    def can_learn(self):
        if not self.get_spell():
            return False
        else:
            return (
                api.character.spells.is_learnable(self.get_spell()) and
                self.match_element_restriction() and
                self.match_tag_restriction())

    def match_tag_restriction(self):
        if not self.tag:
            return True
        spell = self.get_spell()
        if not spell:
            return False
        return api.data.spells.has_tag(spell.id, self.tag, api.character.schools.get_current())

    def match_element_restriction(self):

# Path: l5r/util/log.py
# def log_setup(base_path, base_name):


# Path: l5r/widgets/spell_item_selection.py
import sys
import l5r.api as api
import l5r.api.character.spells
import l5r.api.data.spells
from l5r.util import log
from PyQt5 import QtCore, QtGui, QtWidgets

        if self.get_spell() is not None:
            self.spell_changed.emit(self.get_spell())

    def get_spell(self):
        return self.cb_spell.itemData(self.cb_spell.currentIndex())

    def get_ring(self):
        return self.cb_element.itemData(self.cb_element.currentIndex())

    def get_mastery(self):
        return self.cb_mastery.itemData(self.cb_mastery.currentIndex()) or 0

    def can_learn(self):
        if not self.get_spell():
            return False
        else:
            return (
                api.character.spells.is_learnable(self.get_spell()) and
                self.match_element_restriction() and
                self.match_tag_restriction())

    def match_tag_restriction(self):
        if not self.tag:
            return True
        spell = self.get_spell()
        if not spell:
            return False
        return api.data.spells.has_tag(spell.id, self.tag, api.character.schools.get_current())

    def match_element_restriction(self):

        if not self.element: