RIP: base classes - layout is TEMPORARY:

Notice bash.bosh.modInfos in Mopy/bash/patcher/oblivion/patchers/base.py
RIP: CellImporter
Factoring out common strings:

How arere 'unused' used ? Why the differences in P/C patchers ? DOCS !
More could be factored out from the common dictionaries.
RIP:GraphicsPatcher with fixed imports
Wrapping:

Did not wrap dicts and comments though...
RIP:ActorImporter, wrapped

Fixing the imports from pycarm
Notice modInfos again

@@ -36,7 +36,2 @@
 from bash.patcher.base import Patcher
-from bosh import LoadFactory, modInfos, ModFile
-from brec import MreRecord
-from cint import _, ValidateDict
-from patcher.base import Patcher
-from patcher.oblivion.patchers.base import ImportPatcher, CBash_ImportPatcher

@@ -698,4 +693,4 @@ def initData(self,progress):
             temp_id_data = {}
-            if srcMod not in modInfos: continue
-            srcInfo = modInfos[srcMod]
+            if srcMod not in bash.bosh.modInfos: continue
+            srcInfo = bash.bosh.modInfos[srcMod]
             srcFile = ModFile(srcInfo,loadFactory)
@@ -719,3 +714,3 @@ def initData(self,progress):
             for master in masters:
-                if not master in modInfos: continue # or break filter mods
+                if not master in bash.bosh.modInfos: continue # or break filter mods
                 if master in cachedMasters:
@@ -723,3 +718,3 @@ def initData(self,progress):
                 else:
-                    masterInfo = modInfos[master]
+                    masterInfo = bash.bosh.modInfos[master]
                     masterFile = ModFile(masterInfo,loadFactory)
@@ -897,3 +892,3 @@ def _clog(self, log):  # type 11
                 type, sum(mod_count[type].values())))
-            for srcMod in modInfos.getOrdered(mod_count[type].keys()):
+            for srcMod in bash.bosh.modInfos.getOrdered(mod_count[type].keys()):
                 log(u'  * %s: %d' % (srcMod.s, mod_count[type][srcMod]))
[Import style]Relative imports to the rescue from bash/bash:

- from .... import bush or from ....bush import game [and couple others].
Performance vs readability etc
- defaultEyes should be in game/game

[fix]base.py: cyclic imports - Must wait till imports from patcher are out
of bosh:

----------------- Mopy/bash/patcher/oblivion/patchers/base.py -----------------
index c710eef..deb6e49 100644
@@ -25,2 +25,4 @@
 """This module contains oblivion base patcher classes.""" # TODO:DOCS
+import bash
+from ....bosh import PatchFile, getPatchesList, CBash_PatchFile, reModExt
 from ....patcher.base import AMultiTweakItem, AMultiTweaker, Patcher, \
@@ -28,4 +30,2 @@
     AImportPatcher
-from .... import bosh  # for modInfos, dirs
-from bosh import PatchFile, getPatchesList, CBash_PatchFile, reModExt

@@ -59,3 +59,3 @@ def _patchLog(self, log, count):
         log(self.logMsg % sum(count.values()))
-        for srcMod in bosh.modInfos.getOrdered(count.keys()):
+        for srcMod in bash.bosh.modInfos.getOrdered(count.keys()):
             log(u'  * %s: %d' % (srcMod.s, count[srcMod]))
@@ -90,3 +90,3 @@ def buildPatchLog(self,log):
         log(self.logMsg % sum(mod_count.values()))
-        for srcMod in bosh.modInfos.getOrdered(mod_count.keys()):
+        for srcMod in bash.bosh.modInfos.getOrdered(mod_count.keys()):
             log(u'  * %s: %d' % (srcMod.s,mod_count[srcMod]))
@@ -123,3 +123,3 @@ class ListPatcher(AListPatcher,Patcher):
     def _patchesList(self):
-        return bosh.dirs['patches'].list()
+        return bash.bosh.dirs['patches'].list()

@@ -210,3 +210,3 @@ def scan_more(self,modFile,record,bashTags):
                 if mod.GName in self.srcs:
-                    tags = bosh.modInfos[mod.GName].getBashTags()
+                    tags = bash.bosh.modInfos[mod.GName].getBashTags()
                     self.scan(mod,conflict,tags)
@@ -225,3 +225,3 @@ def _clog(self,log):
         log(self.__class__.logMsg % sum(mod_count.values()))
-        for srcMod in bosh.modInfos.getOrdered(mod_count.keys()):
+        for srcMod in bash.bosh.modInfos.getOrdered(mod_count.keys()):
             log(u'  * %s: %d' % (srcMod.s,mod_count[srcMod]))
Relative imports:

- patcher/oblivion/record_groups.py
- patcher/oblivion/utilities.py and shadowing warnings:
	- csvFormat -> _csvFormat
Import Cells log - it should print the count per mod in PBash (to be reverted):

Unfortunately with the next commit this change made the P Import Cells log:

    Cells/Worlds Patched
      Modified Oblivion.esm Records: 428

Duh. So I reverted it later. Still the P/C logs should be made more similar -
currently:

CBash:
Import Cells
•  Cells/Worlds Patched: 428

•  OBSE-Storms & Sound.esp: 179

•  HiddenSkulls.esp: 1

•  Thieves Arsenal.esp: 10

•  Oscuro's_Oblivion_Overhaul.esp: 23

•  Oblivifall - Something's Not Right.esp: 1

•  Ivellon.esp: 3

•  Artefacts of the Ancestors.esp: 2

•  AyleidArrows.esp: 1

•  Dungeon.esp: 1

•  HauntedLairMod.esp: 1

•  Kragenir's Death Quest.esp: 89

•  KDQ - Rural Line Additions.esp: 1

•  LostSwordOfTheAylied.esp: 1

•  Quest For The Elements.esp: 2

•  QQuix - Divine Elegance Showroom.esp: 2

•  Reaper's Sexy Shower Everywhere.esp: 1

•  The Ayleid Steps.esp: 46

•  The_Tower_of_the_Lich_King-4492.esp: 1

•  thievery.esp: 13

•  Vampire Hunting - Order Of The Virtuous Blood.esp: 6

•  Blood&Mud.esp: 11

•  MannimarcoComplete.esp: 3

•  HeartOftheDead.esp: 4

•  NakedNord.esp: 3

•  bgMagicEV.esp: 1

•  bgMagicEVPaperChase.esp: 1

•  bgIntegrationEV.esp: 19

•  TheOubliette.esp: 2

PBash:

Import Cells
Source Mods
•  Unofficial Oblivion Patch.esp

•  Unofficial Shivering Isles Patch.esp

•  DLCThievesDen.esp

•  DLCThievesDen - Unofficial Patch.esp

•  DLCFrostcrag.esp

•  DLCFrostcrag - Unofficial Patch.esp

•  xuldarkforest.esp

•  xulArriusCreek.esp

•  xulCheydinhalFalls.esp

•  bgMagicEV.esp

Cells/Worlds Patched
•  Oblivion.esm: 428
Changed default in_plog() so P/C logs compare better:

TODO:Revert parent as, in Import Cells:

Cells/Worlds Patched
  Modified Oblivion.esm Records: 428

Duh
RIP: KFFZPatcher
RIP: NPCAIPackagePatcher unwrapped
Wrapping - extracted _insertPackage()
[New Function]Common code moved to new _buildPatch function:

Made methods static and defined modFileTops as this is what's used.
RIP: DeathItemPatcher with modinfos imports fix
_inner_loop for DeathItemPatcher + wrapping
RIP: ImportFactions
Wrapping
[ImportFactions]self.id_factions -> self.id_data to use _buildPatch:

Just extracted _inner-loop, _buildPatch did not manage due to:
- self.activeTypes is self.srcClasses in _buildPatch
- log parameters
Notice modFileTops = self.patchFile.tops. Local variables I left as
id_factions (except if I need to compare).
RIP: ImportRelations (wrapped, modInfos fixed)

_scanModFile and _buildPatch must wait