Rip: Base Patcher classes - see comments:

- Layout is _temporary_ - since bush can detect packages (`oblivion/` as
 opposed to `oblivion.py`) the patcher/oblivion/* modules must be moved
 to game/ovlivion/* ones. Will do this in a final commit though as most of the
 work on this and later branches are based on this layout plus I need the import
 fixes that come later on. See fc37bf6c98255c6b0c15de0989505df0ceb0748c (here we
 follow solution 1) and issues #65 and #124 for a discussion.
- modInfos is None if I import it directly so I need to import bash.bosh.
 Performance concerns. Also does the same hold for bosh.dirs ?
- the patchers class hierarchy is still pretty much at stake (see #124). Nothing
 is final in patcher/base.py or in patcher/oblivion/patchers/base.py.
- also if record_groups.py belongs to oblivion/ is not clear to me
- note to self: http://stackoverflow.com/a/25699674/281545

Base classes moved from bosh.py to patcher/base.py:

_Abstract_Patcher
Patcher
CBash_Patcher
AListPatcher
AMultiTweaker
AAliasesPatcher [bosh need not import _Abstract_Patcher any more]
AMultiTweakItem: notice this is not an _Abstract_Patcher subclass !

File moves:

Mopy/bash/patcher/RecordGroups.py -> Mopy/bash/patcher/oblivion/record_groups.py
RIP: AssortedTweaks - had to fix the imports manually:

modInfos, _ from cint and all that:

@@ -29,8 +29,8 @@
 import re
-from bolt import GPath
-from bosh import modInfos, MultiTweaker, CBash_MultiTweaker
-from brec import MreRecord
-import bush
-from cint import _, MGEFCode
-from patcher.base import AMultiTweakItem
+from bash.bolt import GPath
+from bash.bosh import MultiTweaker, CBash_MultiTweaker
+from bash.brec import MreRecord
+import bash.bush
+from bash.cint import MGEFCode
+from bash.patcher.base import AMultiTweakItem

@@ -57,3 +57,3 @@ def buildPatchLog(self,log):
         log(self.logMsg % sum(mod_count.values()))
-        for srcMod in modInfos.getOrdered(mod_count.keys()):
+        for srcMod in bash.bosh.modInfos.getOrdered(mod_count.keys()):
             log(u'  * %s: %d' % (srcMod.s,mod_count[srcMod]))
@@ -770,3 +770,3 @@ def buildPatch(self,log,progress,patchFile):
         log.setHeader(self.logHeader)
-        for srcMod in modInfos.getOrdered(count.keys()):
+        for srcMod in bash.bosh.modInfos.getOrdered(count.keys()):
             log(u'  * %s: %d' % (srcMod.s,count[srcMod]))
@@ -802,3 +802,3 @@ def buildPatchLog(self,log):
         log.setHeader(self.logHeader)
-        for srcMod in modInfos.getOrdered(mod_count.keys()):
+        for srcMod in bash.bosh.modInfos.getOrdered(mod_count.keys()):
             log(u'  * %s: %d' % (srcMod.s,mod_count[srcMod]))
@@ -895,3 +895,3 @@ def _patchLog(self,log,count,weight):
         log(self.logMsg % sum(count.values()))
-        for srcMod in modInfos.getOrdered(count.keys()):
+        for srcMod in bash.bosh.modInfos.getOrdered(count.keys()):
             log(u'  * %s: %d' % (srcMod.s,count[srcMod]))
@@ -907,3 +907,3 @@ def buildPatchLog(self,log):
         log(self.logMsg % sum(mod_count.values()))
-        for srcMod in modInfos.getOrdered(mod_count.keys()):
+        for srcMod in bash.bosh.modInfos.getOrdered(mod_count.keys()):
             log(u'  * %s: %d' % (srcMod.s,mod_count[srcMod]))
@@ -2367,3 +2367,3 @@ class AssortedTweaker(MultiTweaker):
     defaultConfig = {'isEnabled':True}
-    if bush.game.fsName == u'Oblivion':
+    if bash.bush.game.fsName == u'Oblivion':
         tweaks = sorted([
Wrapping:

Make this as separate commits because they are semi hand made and _may_
introduce bugs.
Warns/Typos - a possible bug:

Notice the line with  CORSPE instead of CORPSE - is it intentional ?

- Assignment can be replaced with augmented assignment
- Simplify chained comparison
- Dictionary contains duplicate keys 'AMMO'
- Remove redundant parentheses

See #62.
RIP: NamesTweaker and co - wrapped as I went.

Did not wrap commented out sections though - are those needed ?
Typos  - warns:

- Remove redundant parentheses
- type was shadowing built in
Base patchers for oblivion:

Again comments on the layout being temporary and hierarchy undefined apply.

 # This is the 2nd commit message:

    The import system still escapes me (+ modInfos needs some thought)

----------------- Mopy/bash/patcher/oblivion/patchers/base.py -----------------
index 2e1772f..96c8169 100644
@@ -25,2 +25,3 @@
 """This module contains oblivion base patcher classes.""" # TODO:DOCS
+import bash
 from bash.patcher.base import AMultiTweakItem

----------- Mopy/bash/patcher/oblivion/patchers/multitweak_names.py -----------
index 81d2e60..d25eed9 100644
@@ -29,2 +29,3 @@
 import re
+import bash # had to do this so bash.bosh.modInfos is resolved (DUH)
 from bash.bosh import MultiTweaker, CBash_MultiTweaker
@@ -846,3 +847,3 @@ def buildPatch(self,log,progress,patchFile):
         log(u'* %s: %d' % (self.label,sum(count.values())))
-        for srcMod in modInfos.getOrdered(count.keys()):
+        for srcMod in bash.bosh.modInfos.getOrdered(count.keys()):
             log(u'  * %s: %d' % (srcMod.s,count[srcMod]))
RIP:GmstTweaker:

Imports fix:

---------- Mopy/bash/patcher/oblivion/patchers/multitweak_settings.py ----------
index a7d50fc..d9dc98c 100644
@@ -27,7 +27,8 @@
 for game settings, said the oracle at Delphi.""" # TODO:DOCS
-from bolt import SubProgress, StateError
-from bosh import MultiTweaker, CBash_MultiTweaker
-from brec import MreRecord, ModReader
-import bush
-from patcher.oblivion.patchers.base import MultiTweakItem, CBash_MultiTweakItem
+from bash.bolt import SubProgress, StateError, deprint
+from bash.bosh import MultiTweaker, CBash_MultiTweaker
+from bash.brec import MreRecord, ModReader
+import bash.bush
+from bash.patcher.oblivion.patchers.base import MultiTweakItem, \
+    CBash_MultiTweakItem

@@ -82,3 +83,3 @@ def buildPatch(self,patchFile,keep,log):
         eids = ((self.key,),self.key)[isinstance(self.key,tuple)]
-        isOblivion = bush.game.fsName.lower() == u'oblivion'
+        isOblivion = bash.bush.game.fsName.lower() == u'oblivion'
         for eid,value in zip(eids,self.choiceValues[self.chosen]):
@@ -196,4 +197,4 @@ def getConfig(self,configs):
         tweaksAppend = self.tweaks.append
-        for cls,tweaks in [(GlobalsTweak,bush.game.GlobalsTweaks),
-                           (GmstTweak,bush.game.GmstTweaks)]:
+        for cls,tweaks in [(GlobalsTweak,bash.bush.game.GlobalsTweaks),
+                           (GmstTweak,bash.bush.game.GmstTweaks)]:
             for tweak in tweaks:
@@ -257,4 +258,4 @@ def getConfig(self,configs):
         tweaksAppend = self.tweaks.append
-        for cls,tweaks in [(CBash_GlobalsTweak,bush.game.GlobalsTweaks),
-                           (CBash_GmstTweak,bush.game.GmstTweaks)]:
+        for cls,tweaks in [(CBash_GlobalsTweak,bash.bush.game.GlobalsTweaks),
+                           (CBash_GmstTweak,bash.bush.game.GmstTweaks)]:
             for tweak in tweaks:
GmstTweaker: Warns, wrapping
RIP: ClothesTweaker
ClothesTweaker: Warns, wrap
RIP:TweakActors, this completes Patchers30
RIP:RacePatcher - Unwrapped:

Imports fix (+ some wrapping):

----------- Mopy/bash/patcher/oblivion/patchers/races_multitweaks.py -----------
index 0fa7417..8315fdc 100644
@@ -32,10 +32,11 @@
 import re
-from bolt import SubProgress, BoltError, GPath, deprint
-from bosh import SpecialPatcher, DoublePatcher, PatchFile, LoadFactory, ModFile, \
-    CBash_DoublePatcher, CBash_ListPatcher
-from brec import MreRecord, MelObject, strFid
-import bush
-from cint import ValidateDict, FormID
-from patcher.base import AMultiTweakItem, Patcher
-from patcher.oblivion.patchers.base import MultiTweakItem, CBash_MultiTweakItem
+from bash.bolt import SubProgress, BoltError, GPath, deprint
+from bash.bosh import SpecialPatcher, DoublePatcher, PatchFile, LoadFactory, \
+    ModFile, CBash_DoublePatcher, CBash_ListPatcher
+from bash.brec import MreRecord, MelObject, strFid
+import bash.bush
+from bash.cint import ValidateDict, FormID
+from bash.patcher.base import AMultiTweakItem, Patcher
+from bash.patcher.oblivion.patchers.base import MultiTweakItem, \
+    CBash_MultiTweakItem
 # FIXME : move SpecialPatcher, DoublePatcher, CBash_DoublePatcher,
@@ -737,3 +738,4 @@ def getAutoItems(self):
             if autoRe.match(modInfo.name.s) or (autoKey & set(modInfo.getBashTags())):
-                if bush.fullLoadOrder[modInfo.name] > bush.fullLoadOrder[PatchFile.patchName]: continue
+                if bash.bush.fullLoadOrder[modInfo.name] > \
+                        bash.bush.fullLoadOrder[PatchFile.patchName]: continue
                 autoItems.append(modInfo.name)
@@ -1086,3 +1088,5 @@ def setRaceEyeMesh(race,rightPath,leftPath):
             if (race.flags.playable or race.fid == (GPath(u'Oblivion.esm'), 0x038010)) and race.eyes:
-                defaultEyes[race.fid] = [x for x in bush.defaultEyes.get(race.fid,[]) if x in race.eyes]
+                defaultEyes[race.fid] = [x for x in
+                                         bash.bush.defaultEyes.get(race.fid,
+                                             []) if x in race.eyes]
                 if not defaultEyes[race.fid]:
@@ -1576,5 +1580,11 @@ def setRaceEyeMesh(race,rightPath,leftPath):
                             raceChanged = True
-                        defaultEyes[recordId] = [x for x in bush.defaultEyes.get(recordId,[]) if x in currentEyes] or currentEyes
-                        defaultMaleHair[recordId] = [x for x in currentHairs if x in maleHairs]
-                        defaultFemaleHair[recordId] = [x for x in currentHairs if x in femaleHairs]
+                        defaultEyes[recordId] = [x for x in
+                                                 bash.bush.defaultEyes.get(
+                                                     recordId, []) if
+                                                 x in currentEyes] or \
+                                                currentEyes
+                        defaultMaleHair[recordId] = [x for x in currentHairs if
+                                                     x in maleHairs]
+                        defaultFemaleHair[recordId] = [x for x in currentHairs
+                                                       if x in femaleHairs]
RacePatcher: Wrapping, warnings

Took all day
[bosh]Warn: set creation replaced with literal
[bosh]Warn: redundant parentheses
[bosh]Warn: assignment replaced with augmented assignment
Nitpick:

Typos, wrap, newlines, also proper CamelCase (ARaceTweaker_BiggerOrcsandNords)
[Common code]AVORB_NPCSkeletonPatcher._initSkeletonCollections()
C/P MultiTweaker in patcher/oblivion/patchers/base.py