Skip to content

Commit d2d8e92

Browse files
committed
More type renames
Not sure what is the best name for those
1 parent 099c09d commit d2d8e92

3 files changed

Lines changed: 24 additions & 23 deletions

File tree

Mopy/bash/bosh/_mergeability.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ def isPBashMergeable(modInfo, minfos, reasons):
103103
#--New record
104104
lenMasters = len(modFile.tes4.masters)
105105
newblocks = []
106-
for type,block in modFile.tops.iteritems():
106+
for top_type,block in modFile.tops.iteritems():
107107
for record in block.getActiveRecords():
108108
if record.fid >> 24 >= lenMasters:
109109
if record.flags1.deleted: continue #if new records exist but are deleted just skip em.
110110
if not verbose: return False
111-
newblocks.append(type)
111+
newblocks.append(top_type)
112112
break
113113
if newblocks: reasons.append(_(u'New record(s) in block(s): ')+u', '.join(sorted(newblocks))+u'.')
114114
dependent = [name.s for name, info in minfos.iteritems()

Mopy/bash/bosh/mods_metadata.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -991,15 +991,15 @@ def copyPrev(size):
991991
while not ins.atEnd():
992992
subprogress(ins.tell())
993993
header = ins.unpackRecHeader()
994-
type,size = header.recType,header.size
995-
#(type,size,flags,fid,uint2) = ins.unpackRecHeader()
996-
if type == 'GRUP':
994+
rec_type,rec_size = header.recType,header.size
995+
#(rec_type,rec_size,flags,fid,uint2) = ins.unpackRecHeader()
996+
if rec_type == 'GRUP':
997997
if header.groupType != 0:
998998
pass
999999
elif header.label not in ('CELL','WRLD'):
1000-
copy(size-header.__class__.rec_header_size)
1000+
copy(rec_size-header.__class__.rec_header_size)
10011001
else:
1002-
if doUDR and header.flags1 & 0x20 and type in {
1002+
if doUDR and header.flags1 & 0x20 and rec_type in {
10031003
'ACRE', #--Oblivion only
10041004
'ACHR','REFR', #--Both
10051005
'NAVM','PGRE','PHZD', #--Skyrim only
@@ -1008,22 +1008,22 @@ def copyPrev(size):
10081008
out.seek(-header.__class__.rec_header_size,1)
10091009
out.write(header.pack())
10101010
changed = True
1011-
if doFog and type == 'CELL':
1012-
nextRecord = ins.tell() + size
1011+
if doFog and rec_type == 'CELL':
1012+
nextRecord = ins.tell() + rec_size
10131013
while ins.tell() < nextRecord:
10141014
subprogress(ins.tell())
10151015
(nextType,nextSize) = ins.unpackSubHeader()
10161016
copyPrev(6)
10171017
if nextType != 'XCLL':
10181018
copy(nextSize)
10191019
else:
1020-
color,near,far,rotXY,rotZ,fade,clip = ins.unpack('=12s2f2l2f',size,'CELL.XCLL')
1020+
color,near,far,rotXY,rotZ,fade,clip = ins.unpack('=12s2f2l2f',rec_size,'CELL.XCLL')
10211021
if not (near or far or clip):
10221022
near = 0.0001
10231023
changed = True
10241024
out.write(struct_pack('=12s2f2l2f', color, near, far, rotXY, rotZ, fade, clip))
10251025
else:
1026-
copy(size)
1026+
copy(rec_size)
10271027
#--Save
10281028
retry = _(u'Bash encountered an error when saving %s.') + u'\n\n' \
10291029
+ _(u'The file is in use by another process such as TES4Edit.'

Mopy/bash/brec.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,10 @@ def close(self): self.out.close()
376376
def pack(self,format,*data):
377377
self.out.write(struct_pack(format, *data))
378378

379-
def packSub(self,type,data,*values):
379+
def packSub(self, sub_rec_type, data, *values):
380380
"""Write subrecord header and data to output stream.
381-
Call using either packSub(type,data) or packSub(type,format,values).
381+
Call using either packSub(sub_rec_type,data) or
382+
packSub(sub_rec_type,format,values).
382383
Will automatically add a prefacing XXXX size subrecord to handle data
383384
with size > 0xFFFF."""
384385
try:
@@ -387,17 +388,16 @@ def packSub(self,type,data,*values):
387388
outWrite = self.out.write
388389
lenData = len(data)
389390
if lenData <= 0xFFFF:
390-
outWrite(struct_pack('=4sH', type, lenData))
391-
outWrite(data)
391+
outWrite(struct_pack('=4sH', sub_rec_type, lenData))
392392
else:
393393
outWrite(struct_pack('=4sHI', 'XXXX', 4, lenData))
394-
outWrite(struct_pack('=4sH', type, 0))
395-
outWrite(data)
394+
outWrite(struct_pack('=4sH', sub_rec_type, 0))
395+
outWrite(data)
396396
except Exception as e:
397397
print e
398-
print self,type,data,values
398+
print self,sub_rec_type,data,values
399399

400-
def packSub0(self,type,data):
400+
def packSub0(self, sub_rec_type, data):
401401
"""Write subrecord header plus zero terminated string to output
402402
stream."""
403403
if data is None: return
@@ -406,16 +406,17 @@ def packSub0(self,type,data):
406406
lenData = len(data) + 1
407407
outWrite = self.out.write
408408
if lenData < 0xFFFF:
409-
outWrite(struct_pack('=4sH', type, lenData))
409+
outWrite(struct_pack('=4sH', sub_rec_type, lenData))
410410
else:
411411
outWrite(struct_pack('=4sHI', 'XXXX', 4, lenData))
412-
outWrite(struct_pack('=4sH', type, 0))
412+
outWrite(struct_pack('=4sH', sub_rec_type, 0))
413413
outWrite(data)
414414
outWrite('\x00')
415415

416-
def packRef(self,type,fid):
416+
def packRef(self, sub_rec_type, fid):
417417
"""Write subrecord header and fid reference."""
418-
if fid is not None: self.out.write(struct_pack('=4sHI', type, 4, fid))
418+
if fid is not None:
419+
self.out.write(struct_pack('=4sHI', sub_rec_type, 4, fid))
419420

420421
def writeGroup(self,size,label,groupType,stamp):
421422
if type(label) is str:

0 commit comments

Comments
 (0)