Menu

Developer Notes

Daidalos

A collection of info that might be usefull for current or future Wrye Bash devs.

File Layout

**belt.py**
Implements the Bash-specific parser for Wizards. Also implements the UI elements for Wizards. Could be split into two files possibly, but the two components are inter-dependent, so it might be easier to just leave it.
**balt.py**
Common UI classes and other wx-wrapper classes. Examples are the hSizer, vSizer functions, which provide shorthand ways to define sizers and layouts. Other stuff like the askXXX() functions, and button() function. Most of these are thin-wrappers that just provide better default arguments, etc, although there are a few hard hitters, like balt.Tank
**bapi.py**
Python interface to the BAPI (wraps classes around BAPI calls, etc)
**barb.py**
Backup related code. Handles backing up and restoring settings.
**barg.py**
Command line arguments definitions and parsing.
**bash.py**
Startup code
**basher.py**
Pretty much all UI classes, user actions (menu commands, etc), default settings. This is one that could use some heavy refactoring.
**bashmon.py**
Console app, required for Wrye Morph. bashmon is a monitor program which handles requests from Breeze582000's OBSE extension. Current monitor commands are focused exclusively on shapeshifting the player.
**bass.py**
global app-wide constants. Used to avoid circular dependencies. Could probably move a bit of important constants here.
**bish.py**
Pretty much developer/modder command line tools. Contents are never guaranteed to remain the same, or even work. Sort of the trash bin for random code that shouldn't be part of Wrye Bash for most end users, but can be very useful for developers or advanced modders (in fact one function is needed for generating the Oblivion_ids.pkl and Skyrim_ids.pkl files). Luckily, this file doesn't get picked up by py2exe, so it's not included in the Standalone version.
**bolt.py**
Common functions and classes that are non-UI/wx related. Tons of utility classes in here - Path, GPath, BinaryFile, unicode functions, CsvReader, OmodFile, etc, etc. Could be split fairly easily into submodules.
**bosh.py**
BAIN code. PBash patchers. CBash patchers. Most of the nity-gritty details of Save file and non-patcher modfile manipulations. A bit of initialization code (settings dictionary, directories setup - bosh.dirs), ini parser, etc, etc. Some of the modfile reading/writing code is still here as well. Definitely needs some love.
**brec.py**
*most* of the modfile generic reading writing code (a little is still in bosh.py). Could split it up a little bit.
**bush.py**
Handles game detection, as well as importing values from the applicable game definition file as the 'bush.game' module. Also hold a lot of hard-coded data relating to mod file format stuff (the stuff is definitely applicable to Oblivion, and yet to be determined if it's applicable for Skyrim). Some of this isn't format specific, like "ABAT stands for Absorb Attribute", that sort of thing. Some of it is, like the Cobl exhaustion defines. This *used* to be a file containing Oblivion format/game defines/constants. It's been split off into oblivion.py/skyrim.py slowly as the applicable sections have been addressed.
**bweb.py**
Some internets communication code/parsing of specific webpages. Specifically, parsing a TESNexus page for files available. Since items here will be used with the multiprocessing module, it needs to not have any dependancies on the rest of Wrye Bash's files.
**cint.py**
CBash Python interface. Defines Python classes as wrappers around the CBash API. It's very hard to read, because it's been written in syntax to maximize performance everywhere possible, using statments like: self.formID = FormID.EmptyFormID() if master is None else master.formID if isinstance(master, FormID) else FormID.RawFormID(master) if objectID is None else FormID.UnvalidatedFormID(GPath(master), objectID) if isinstance(master, (basestring, Path)) else None Nuances of Python, statements like this actually evaluate faster than using traditional if/else blocks. Arguably though, just wrap that in parenthesis and Python's implicit line continuation in parenthesis would let you type that in a more readable manner: self.formID = (FormID.EmptyFormID() if master is None else master.formID if isinstance(mast,formID) else FormID.RawFormID(master) if objectID is None else FormID.UnvalidatedFormID(GPath(master), objectID) if isinstance(master, (basestring, Path)) else None) Other tricks, like: [(attr,reduce(getattr, attr.split('.'), self)) for parentRecord in parentRecords if reduce(getattr, attr.split('.'), self) != reduce(getattr, attr.split('.'), parentRecord)] Are just sooo much faster than the "naive" way, it's ridiculous.
**keywordWIZBAIN, keywordWIZBAIN2, settingsModul, wizSTC**
WIZBAIN/bash.ini editor stuff looks like.
**oblivion.py**, **skyrim.py**
Everything that's game-specific should go in here. Currently, Bash isn't quite like that, but for Skyrim it is mostly true.
**libbsa.py**
Python wrapper for libbsa
**liblo.py**
Python wrapper for liblo
**ScriptParser.py**
Code for necessary parsing of text into a script language. No keywords,functions,etc are defined here, this is just the framework for a parser (so it's pretty well refactored out of the main Bash code already).

Related

Wiki: Home