# 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
            flaw = flaws[i - 1]
            fields['DISADVANTAGE_NM.%d' % i] = flaw.name
            fields['DISADVANTAGE_PT.%d' % i] = abs(flaw.cost)

        # WEAPONS
        melee_weapons = f.melee_view_model .items
        range_weapons = [
            x for x in f.ranged_view_model.items if 'melee' not in x.tags]
        wl = zigzag(melee_weapons, range_weapons)

        count = min(2, len(wl))
        for i in range(1, count + 1):
            weap = wl[i - 1]
            fields['WEAP_TYPE.%d' % i] = weap.name
            if weap.base_atk != weap.max_atk:
                fields['WEAP_ATK.%d' %
                       i] = weap.base_atk + "/" + weap.max_atk
            else:
                fields['WEAP_ATK.%d' % i] = weap.base_atk
            if weap.base_dmg != weap.max_dmg:
                fields['WEAP_DMG.%d' %
                       i] = weap.base_dmg + "/" + weap.max_dmg
            else:
                fields['WEAP_DMG.%d' % i] = weap.base_dmg
            fields['WEAP_NOTES.%d' % i] = weap.desc

        # ARROWS
        arrows = f.arrow_view_model .items
        count = min(5, len(arrows))
        for i in range(1, count + 1):

# 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

            flaw = flaws[i - 1]
            fields['DISADVANTAGE_NM.%d' % i] = flaw.name
            fields['DISADVANTAGE_PT.%d' % i] = abs(flaw.cost)

        # WEAPONS
        melee_weapons = f.melee_view_model .items
        range_weapons = [
            x for x in f.ranged_view_model.items if 'melee' not in x.tags]
        wl = zigzag(melee_weapons, range_weapons)

        count = min(2, len(wl))
        for i in range(1, count + 1):
            weap = wl[i - 1]
            fields['WEAP_TYPE.%d' % i] = weap.name
            if weap.base_atk != weap.max_atk:
                fields['WEAP_ATK.%d' %
                       i] = weap.base_atk + "/" + weap.max_atk
            else:
                fields['WEAP_ATK.%d' % i] = weap.base_atk
            if weap.base_dmg != weap.max_dmg:
                fields['WEAP_DMG.%d' %
                       i] = weap.base_dmg + "/" + weap.max_dmg
            else:
                fields['WEAP_DMG.%d' % i] = weap.base_dmg
            fields['WEAP_NOTES.%d' % i] = weap.desc

        # ARROWS
        arrows = f.arrow_view_model .items
        count = min(5, len(arrows))
        for i in range(1, count + 1):

            ar = arrows[i - 1]