Пример #1
0
def init(initLevel):
    """Initializes bosh environment to specified level. I.e., it initializes
    certain data arrays which can then be accessed by the function. It's typical
    to init to level 3, which gives access to all basic data arrays (plugins,
    modInfos and saveInfos.)

    initLevels:
        0: Settings
        1: plugins
        2: modInfos
        3: saveInfos"""
    # --Settings
    bosh.initDirs()
    bosh.initSettings(readOnly=True)
    bosh.falloutIni = bosh.FalloutIni()
    # --MwIniFile (initLevel >= 1)
    if initLevel < 1:
        return
    bosh.falloutIni = bosh.FalloutIni()
    # --ModInfos (initLevel >= 2)
    if initLevel < 2:
        return
    bosh.modInfos = bosh.ModInfos()
    bosh.modInfos.refresh()
    # --SaveInfos (initLevel >= 3)
    if initLevel < 3:
        return
    bosh.saveInfos = bosh.SaveInfos()
    bosh.saveInfos.refresh()
    # --Misc.
    if initLevel < 4:
        return
    bosh.screensData = bosh.ScreensData()
    bosh.screensData.refresh()
Пример #2
0
 def __init__(self):
     # --Init bosh stuff
     bosh.initBosh()
     bosh.initSettings(readOnly=True)
     bosh.oblivionIni = bosh.OblivionIni(bush.game.iniFiles[0])
     bosh.oblivionIni.mtime = 0
     bosh.modInfos = bosh.ModInfos()
     bosh.saveInfos = bosh.SaveInfos()  # --Create, but don't fill
     self.savesDir = None
     self.saves = {}
     self.update()
Пример #3
0
 def __init__(self):
     #--Init bosh stuff
     bosh.initBosh()
     bosh.initSettings(readOnly=True)
     bosh.oblivionIni = bosh.OblivionIni(bush.game.iniFiles[0])
     bosh.oblivionIni.mtime = 0
     bosh.modInfos = bosh.ModInfos()
     bosh.saveInfos = bosh.SaveInfos()  #--Create, but don't fill
     self.savesDir = None
     self.saves = {}
     self.update()
Пример #4
0
 def __init__(self):
     #--Init bosh stuff
     bosh.initBosh()
     bosh.initSettings(readOnly=True)
     bosh.falloutIni = bosh.FalloutIni()
     bosh.falloutIni.mtime = 0
     bosh.modInfos = bosh.ModInfos()
     bosh.saveInfos = bosh.SaveInfos() #--Create, but don't fill
     self.savesDir = None
     self.saves = {}
     self.update()
Пример #5
0
from optparse import OptionParser
import bosh
from bosh import formatInteger,formatDate
from bolt import GPath

parser = OptionParser(usage="usage: %prog [options] FILENAME(esm/p, without directory path)")
parser.add_option("-o", dest="outfile", help="output file", default="a.esp", metavar="FILE")
parser.add_option("-q", dest="quiet", help="quiet mode", default=False)
(opts, args) = parser.parse_args(sys.argv)
if len(args) != 2:
    parser.print_help()
    exit()

# init subsystem
bosh.initDirs()
bosh.initSettings(readOnly=True)
bosh.falloutIni = bosh.FalloutIni()
bosh.modInfos = bosh.ModInfos()
bosh.modInfos.refresh()

# create patch
patchInfo = bosh.ModInfo(bosh.modInfos.dir, GPath(opts.outfile))
patchInfo.mtime = max([time.time()]+[info.mtime for info in bosh.modInfos.values()])
loadFactory = bosh.LoadFactory(True,bosh.MreWeap)
patchFile = bosh.ModFile(patchInfo,loadFactory)
patchFile.tes4.author = 'firepower_autobalance.py'
patchFile.tes4.masters = [GPath('Fallout3.esm')]
patchFile.longFids = True

# source mod
fileInfo = bosh.ModInfo(bosh.modInfos.dir, GPath(args[1]))