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


from PyQt5 import QtCore, QtGui, QtWidgets
from l5r.util import log
import l5r.dialogs as dialogs
            form.update_from_model()

    def edit_selected_weapon(self):
        form = self.form

        view_ = None
        try:
            view_ = self.sender().parent().property('source')
        except:
            log.ui.error("Edit weapon error", exc_info=1)
        if view_ is None:
            return
        sel_idx = view_.selectionModel().currentIndex()
        if not sel_idx.isValid():
            return
        sel_itm = view_.model().data(sel_idx, QtCore.Qt.UserRole)
        dlg = dialogs.CustomWeaponDialog(form.pc, form)
        dlg.edit_mode = True
        log.ui.debug('loading weap {0}, tags: {1}'.format(sel_itm.name, sel_itm.tags))
        dlg.load_item(sel_itm)
        if dlg.exec_() == QtWidgets.QDialog.Accepted:
            form.update_from_model()

    def remove_selected_weapon(self):
        form = self.form

        view_ = None
        try:
            view_ = self.sender().parent().property('source')
        except:

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


# Path: l5r/sinks/sink_3.py
from PyQt5 import QtCore, QtGui, QtWidgets
from l5r.util import log
import l5r.dialogs as dialogs

            form.update_from_model()

    def edit_selected_weapon(self):
        form = self.form

        view_ = None
        try:
            view_ = self.sender().parent().property('source')
        except:
            log.ui.error("Edit weapon error", exc_info=1)
        if view_ is None:
            return
        sel_idx = view_.selectionModel().currentIndex()
        if not sel_idx.isValid():
            return
        sel_itm = view_.model().data(sel_idx, QtCore.Qt.UserRole)
        dlg = dialogs.CustomWeaponDialog(form.pc, form)
        dlg.edit_mode = True
        log.ui.debug('loading weap {0}, tags: {1}'.format(sel_itm.name, sel_itm.tags))
        dlg.load_item(sel_itm)
        if dlg.exec_() == QtWidgets.QDialog.Accepted:
            form.update_from_model()

    def remove_selected_weapon(self):
        form = self.form

        view_ = None
        try:
            view_ = self.sender().parent().property('source')
        except:

            log.ui.error("Remove weapon error", exc_info=1)