# Path: l5r/util/settings.py
# class L5RCMSettings(object):
#     """A QSettings wrapper for easy access to application settings"""
# 
#     def __init__(self):
#         self._qsettings = QSettings()
# 
#         # Application settings
#         self._app = L5RCMSettings_App(self._qsettings)
#         # UI settings
#         self._ui = L5RCMSettings_UI(self._qsettings)
#         # PC export PDF generation settings
#         self._pc_export = L5RCMSettings_PcExport(self._qsettings)
#         # NPC export PDF generation settings
#         self._npc_export = L5RCMSettings_NpcExport(self._qsettings)
# 
#     @property
#     def app(self):
#         return self._app
# 
#     @property
#     def ui(self):
#         return self._ui
# 
#     @property
#     def pc_export(self):
#         return self._pc_export
# 
#     @property
#     def npc_export(self):
#         return self._npc_export
# 
#     def sync(self):
#         self._qsettings.sync()
# 
#     def load_defaults(self):
#         self._app.load_defaults()
#         self._ui.load_defaults()
#         self._pc_export.load_defaults()
#         self._npc_export.load_defaults()
# 
# Path: l5r/util/log.py
# def log_setup(base_path, base_name):


import l5r.api as api
import l5r.api.character
import l5r.api.character.schools
import l5r.api.data.powers
import l5r.api.data.schools
import l5r.api.data.spells
import l5r.api.rules
import l5r.models as models
from l5r.util.settings import L5RCMSettings
from l5r.util import log
        fields = {}

        # schools, bushi and samurai monk
        schools = []
        for s in api.character.schools.get_all():
            if api.data.schools.is_bushi(s) or api.data.schools.is_samurai_monk(s):
                schools.append(s)

        count = min(2, len(schools))
        for i in range(0, count):
            techs = api.character.schools.get_techs_by_school(schools[i])
            school = api.data.schools.get(schools[i])
            fields['BUSHI_SCHOOL_NM.%d' % i] = school.name

            for t in techs:
                thsc, tech = api.data.schools.get_technique(t)
                if not tech:
                    break
                rank = tech.rank - 1 if tech.rank > 0 else 0
                fields['BUSHI_TECH.%d.%d' % (rank, i)] = tech.name
                fields['BUSHI_TECH_TEXT.%d.%d' % (rank, i)] = tech.desc

        # kata
        katas = api.character.powers.get_all_kata()
        count = min(6, len(katas))
        for i in range(0, count):
            kata = api.data.powers.get_kata(katas[i])
            if not kata:
                break
            fields['KATA_NM.%d' % (i + 1)] = kata.name

# Path: l5r/util/settings.py
# class L5RCMSettings(object):
#     """A QSettings wrapper for easy access to application settings"""
# 
#     def __init__(self):
#         self._qsettings = QSettings()
# 
#         # Application settings
#         self._app = L5RCMSettings_App(self._qsettings)
#         # UI settings
#         self._ui = L5RCMSettings_UI(self._qsettings)
#         # PC export PDF generation settings
#         self._pc_export = L5RCMSettings_PcExport(self._qsettings)
#         # NPC export PDF generation settings
#         self._npc_export = L5RCMSettings_NpcExport(self._qsettings)
# 
#     @property
#     def app(self):
#         return self._app
# 
#     @property
#     def ui(self):
#         return self._ui
# 
#     @property
#     def pc_export(self):
#         return self._pc_export
# 
#     @property
#     def npc_export(self):
#         return self._npc_export
# 
#     def sync(self):
#         self._qsettings.sync()
# 
#     def load_defaults(self):
#         self._app.load_defaults()
#         self._ui.load_defaults()
#         self._pc_export.load_defaults()
#         self._npc_export.load_defaults()
# 
# Path: l5r/util/log.py
# def log_setup(base_path, base_name):


# Path: l5r/exporters/fdfexporter.py
import l5r.api as api
import l5r.api.character
import l5r.api.character.schools
import l5r.api.data.powers
import l5r.api.data.schools
import l5r.api.data.spells
import l5r.api.rules
import l5r.models as models
from l5r.util.settings import L5RCMSettings
from l5r.util import log

        fields = {}

        # schools, bushi and samurai monk
        schools = []
        for s in api.character.schools.get_all():
            if api.data.schools.is_bushi(s) or api.data.schools.is_samurai_monk(s):
                schools.append(s)

        count = min(2, len(schools))
        for i in range(0, count):
            techs = api.character.schools.get_techs_by_school(schools[i])
            school = api.data.schools.get(schools[i])
            fields['BUSHI_SCHOOL_NM.%d' % i] = school.name

            for t in techs:
                thsc, tech = api.data.schools.get_technique(t)
                if not tech:
                    break
                rank = tech.rank - 1 if tech.rank > 0 else 0
                fields['BUSHI_TECH.%d.%d' % (rank, i)] = tech.name
                fields['BUSHI_TECH_TEXT.%d.%d' % (rank, i)] = tech.desc

        # kata
        katas = api.character.powers.get_all_kata()
        count = min(6, len(katas))
        for i in range(0, count):
            kata = api.data.powers.get_kata(katas[i])
            if not kata:
                break
            fields['KATA_NM.%d' % (i + 1)] = kata.name

            fields['KATA_RING_MA.%d' %