bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def loadData(self,record,ins,type,size,readId): target = self.getDefault() record.__getattribute__(self.attr).append(target) element = self.loaders[type] slots = ['recordType'] slots.extend(element.getSlotsUsed()) target.__slots__ = slots target.recordType = type element.loadData(target,ins,type,size,readId)
def loadData(self,record,ins,type,size,readId): if type in ('EPFD','EPFT','EPF2','EPF3','SCHR'): target = self.getDefault() record.__getattribute__(self.attr).append(target) else: target = record.__getattribute__(self.attr)[-1] element = self.loaders[type] slots = ['recordType'] slots.extend(element.getSlotsUsed()) target.__slots__ = slots target.recordType = type element.loadData(target,ins,type,size,readId)
479,000
def dumpData(self,record,out): target = record.__getattribute__(self.attr) if not target: return element = self.loaders[target.recordType] if not element: raise ModError(ins.inName,_('Unexpected type: %d') % target.recordType) element.dumpData(target,out)
def dumpData(self,record,out): target = record.__getattribute__(self.attr) if not target: return element = self.loaders[target.recordType] if not element: raise ModError(ins.inName,_('Unexpected type: %d') % target.recordType) element.dumpData(target,out)
479,001
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 # self.masters = {} #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreWeap,MreActi,MreAlch,MreAppa,MreArmo,MreBook,MreClot,MreCont,MreCrea,MreDoor,MreFlor,MreFurn,MreIngr,MreKeym,MreLigh,MreMisc,MreNpc,MreQust,MreSgst,MreSlgm,): recAttrs_class[recClass] = ('script',) self.longTypes = set(('WEAP','ACTI','ALCH','APPA','ARMO','BOOK','CLOT','CONT','CREA','DOOR','FLOR','FURN','INGR','KEYM','LIGH','MISC','NPC_','QUST','SGST','SLGM'))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 # self.masters = {} #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreWeap,MreActi,MreAlch,MreArmo,MreBook,MreCont,MreCrea,MreDoor,MreFlor,MreFurn,MreIngr,MreKeym,MreLigh,MreMisc,MreNpc,MreQust,MreTerm): recAttrs_class[recClass] = ('script',) self.longTypes = set(('WEAP','ACTI','ALCH','APPA','ARMO','BOOK','CLOT','CONT','CREA','DOOR','FLOR','FURN','INGR','KEYM','LIGH','MISC','NPC_','QUST','SGST','SLGM'))
479,002
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 # self.masters = {} #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreWeap,MreActi,MreAlch,MreAppa,MreArmo,MreBook,MreClot,MreCont,MreCrea,MreDoor,MreFlor,MreFurn,MreIngr,MreKeym,MreLigh,MreMisc,MreNpc,MreQust,MreSgst,MreSlgm,): recAttrs_class[recClass] = ('script',) self.longTypes = set(('WEAP','ACTI','ALCH','APPA','ARMO','BOOK','CLOT','CONT','CREA','DOOR','FLOR','FURN','INGR','KEYM','LIGH','MISC','NPC_','QUST','SGST','SLGM'))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 # self.masters = {} #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreWeap,MreActi,MreAlch,MreAppa,MreArmo,MreBook,MreClot,MreCont,MreCrea,MreDoor,MreFlor,MreFurn,MreIngr,MreKeym,MreLigh,MreMisc,MreNpc,MreQust,MreSgst,MreSlgm,): recAttrs_class[recClass] = ('script',) self.longTypes = set(('WEAP','ACTI','ALCH','APPA','ARMO','BOOK','CLOT','CONT','CREA','DOOR','FLOR','FURN','INGR','KEYM','LIGH','MISC','NPC_','QUST','SGST','SLGM'))
479,003
def copyPrev(size): ins.seek(-size,1) buff = ins.read(size) out.write(buff)
def copyPrev(size): ins.seek(-size,1) buff = ins.read(size) out.write(buff)
479,004
# def loadData(self,record,ins,type,size,readId):
# def loadData(self,record,ins,type,size,readId):
479,005
def scan(self): """Reports on contents.""" ins = bolt.StructFile(self.path.s,'rb') #--Header ins.seek(4*4) (self.folderCount,self.fileCount,lenFolderNames,lenFileNames,fileFlags,fileFlags2) = ins.unpack('6I',recHeaderSize) #--FolderInfos (Initial) folderInfos = self.folderInfos = [] for index in range(self.folderCount): hash,subFileCount,offset = ins.unpack('Q2I',16) folderInfos.append([hash,subFileCount,offset]) #--Update folderInfos for index,folderInfo in enumerate(folderInfos): fileInfos = [] folderName = cstrip(ins.read(ins.unpack('B',1)[0])) folderInfos[index].extend((folderName,fileInfos)) for index in range(folderInfo[1]): filePos = ins.tell() hash,size,offset = ins.unpack('Q2I',16) fileInfos.append([hash,size,offset,'',filePos]) #--File Names fileNames = ins.read(lenFileNames) fileNames = fileNames.split('\x00')[:-1] namesIter = iter(fileNames) for folderInfo in folderInfos: fileInfos = folderInfo[-1] for index,fileInfo in enumerate(fileInfos): fileInfo[3] = namesIter.next() #--Done ins.close()
def scan(self): """Reports on contents.""" ins = bolt.StructFile(self.path.s,'rb') #--Header ins.seek(4*4) (self.folderCount,self.fileCount,lenFolderNames,lenFileNames,fileFlags) = ins.unpack('5I',20) #--FolderInfos (Initial) folderInfos = self.folderInfos = [] for index in range(self.folderCount): hash,subFileCount,offset = ins.unpack('Q2I',16) folderInfos.append([hash,subFileCount,offset]) #--Update folderInfos for index,folderInfo in enumerate(folderInfos): fileInfos = [] folderName = cstrip(ins.read(ins.unpack('B',1)[0])) folderInfos[index].extend((folderName,fileInfos)) for index in range(folderInfo[1]): filePos = ins.tell() hash,size,offset = ins.unpack('Q2I',16) fileInfos.append([hash,size,offset,'',filePos]) #--File Names fileNames = ins.read(lenFileNames) fileNames = fileNames.split('\x00')[:-1] namesIter = iter(fileNames) for folderInfo in folderInfos: fileInfos = folderInfo[-1] for index,fileInfo in enumerate(fileInfos): fileInfo[3] = namesIter.next() #--Done ins.close()
479,006
def resetMTimes(self): """Reset dates of bsa files to 'correct' values.""" #--Fix the data of a few archive files bsaTimes = ( ('Fallout - MenuVoices.bsa',1138575220), ('Fallout - Meshes.bsa',1139433736), ('Fallout - Misc.bsa',1138660560), ('Fallout - Sounds.bsa',1138162634), ('Fallout - Textures.bsa',1138162934), ('Fallout - Voices.bsa',1138166742), ) for bsaFile,mtime in bsaTimes: dirs['mods'].join(bsaFile).mtime = mtime
def resetMTimes(self): """Reset dates of bsa files to 'correct' values.""" #--Fix the data of a few archive files bsaTimes = ( ('Fallout - MenuVoices.bsa',1138575220), ('Fallout - Meshes.bsa',1139433736), ('Fallout - Misc.bsa',1138660560), ('Fallout - Sound.bsa',1138162634), ('Fallout - Textures.bsa',1138162934), ('Fallout - Voices.bsa',1138166742), ) for bsaFile,mtime in bsaTimes: dirs['mods'].join(bsaFile).mtime = mtime
479,007
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
def loadData(self,record,ins,type,size,readId): if size == 186: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
479,008
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
479,009
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
479,010
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
479,011
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
def loadData(self,record,ins,type,size,readId): if size == 102: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 86: #--Else 86 byte record (skips dispVelocity, #-- dispFalloff, dispDampner, dispSize, and damage #-- Two junk? bytes are tacked onto the end #-- Hex editing and the CS confirms that it is NOT #-- damage, so it is probably just filler unpacked = ins.unpack('11f3Bs3Bs3BsB3s6f2s',size,readId) elif size == 62: #--Else 62 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('11f3Bs3Bs3BsB3s2s',size,readId) elif size == 42: #--Else 42 byte record (skips most everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('10f2s',size,readId) elif size == 2: #--Else 2 byte record (skips everything #-- Two junk? bytes are tacked onto the end #-- No testing done, but assumed that its the same as the #-- previous truncated record. unpacked = ins.unpack('2s',size,readId) else: raise "Unexpected size encountered for WATR subrecord: %s" % size unpacked = unpacked[:-1] unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
479,012
def __init__(self): MultiTweakItem.__init__(self,_("Ingestibles"), _('Label ingestibles to sort by type. C: Chems, F: Food, S: Stimpack, A: Alcohol.'), 'ALCH', (_('F Radroach Meat'), '%s '), (_('F. Radroach Meat'), '%s. '), (_('F - Radroach Meat'),'%s - '), (_('(F) Radroach Meat'),'(%s) '), )
def __init__(self): MultiTweakItem.__init__(self,_("Ingestibles"), _('Label ingestibles to sort by type. C: Chems, F: Food, S: Stimpack, A: Alcohol.'), 'ALCH', (_('F Radroach Meat'), '\x07\x07\x07\x07\x07%s '), (_('F. Radroach Meat'), '\x07\x07\x07\x07\x07%s. '), (_('F - Radroach Meat'),'\x07\x07\x07\x07\x07%s - '), (_('(F) Radroach Meat'),'\x07\x07\x07\x07\x07(%s) '), )
479,013
def __init__(self): MultiTweakItem.__init__(self,_("Weapons"), _('Label ammo and weapons to sort by type and damage.'), 'WEAP', (_('S BB Gun'), '%s '), (_('S. BB Gun'), '%s. '), (_('S - BB Gun'),'%s - '), (_('(S) BB Gun'),'(%s) '), ('----','----'), (_('S10 BB Gun'), '%s%02d '), (_('S10. BB Gun'), '%s%02d. '), (_('S10 - BB Gun'),'%s%02d - '), (_('(S10) BB Gun'),'(%s%02d) '), )
def __init__(self): MultiTweakItem.__init__(self,_("Weapons"), _('Label ammo and weapons to sort by type and damage.'), 'WEAP', (_('S BB Gun'), '\x07\x07%s '), (_('S. BB Gun'), '\x07\x07%s. '), (_('S - BB Gun'),'\x07\x07%s - '), (_('(S) BB Gun'),'\x07\x07(%s) '), ('----','----'), (_('S10 BB Gun'), '%s%02d '), (_('S10. BB Gun'), '%s%02d. '), (_('S10 - BB Gun'),'%s%02d - '), (_('(S10) BB Gun'),'(%s%02d) '), )
479,014
def __init__(self): MultiTweakItem.__init__(self,_("Weapons"), _('Label ammo and weapons to sort by type and damage.'), 'WEAP', (_('S BB Gun'), '%s '), (_('S. BB Gun'), '%s. '), (_('S - BB Gun'),'%s - '), (_('(S) BB Gun'),'(%s) '), ('----','----'), (_('S10 BB Gun'), '%s%02d '), (_('S10. BB Gun'), '%s%02d. '), (_('S10 - BB Gun'),'%s%02d - '), (_('(S10) BB Gun'),'(%s%02d) '), )
def __init__(self): MultiTweakItem.__init__(self,_("Weapons"), _('Label ammo and weapons to sort by type and damage.'), 'WEAP', (_('S BB Gun'), '%s '), (_('S. BB Gun'), '%s. '), (_('S - BB Gun'),'%s - '), (_('(S) BB Gun'),'(%s) '), ('----','----'), (_('S10 BB Gun'), '\x07\x07%s%02d '), (_('S10. BB Gun'), '\x07\x07%s%02d. '), (_('S10 - BB Gun'),'\x07\x07%s%02d - '), (_('(S10) BB Gun'),'\x07\x07(%s%02d) '), )
479,015
def scanModFile(self,modFile,progress,patchFile): """Scans specified mod file to extract info. May add record to patch mod, but won't alter it.""" mapper = modFile.getLongMapper() #for blockType in ('AMMO','WEAP'): for blockType in ('WEAP',): modBlock = getattr(modFile,blockType) patchBlock = getattr(patchFile,blockType) id_records = patchBlock.id_records for record in modBlock.getActiveRecords(): if mapper(record.fid) not in id_records: record = record.getTypeCopy(mapper) patchBlock.setRecord(record)
def scanModFile(self,modFile,progress,patchFile): """Scans specified mod file to extract info. May add record to patch mod, but won't alter it.""" mapper = modFile.getLongMapper() #for blockType in ('AMMO','WEAP'):for blockType in ('AMMO','WEAP'): modBlock = getattr(modFile,blockType) patchBlock = getattr(patchFile,blockType) id_records = patchBlock.id_records for record in modBlock.getActiveRecords(): if mapper(record.fid) not in id_records: record = record.getTypeCopy(mapper) patchBlock.setRecord(record)
479,016
def buildPatch(self,log,progress,patchFile): """Edits patch file as desired. Will write to log.""" count = {} format = self.choiceValues[self.chosen][0] showStat = '%02d' in format keep = patchFile.getKeeper() codes = getattr(patchFile,'weaponTags','BESMUTL') #ammoFormat = format.replace('%02d','',1) # for record in patchFile.AMMO.records: # if not record.full: continue # if record.full[0] in '+-=.()[]': continue # record.full = ammoFormat % 'A' + record.full # keep(record.fid) # srcMod = record.fid[0] # count[srcMod] = count.get(srcMod,0) + 1 for record in patchFile.WEAP.records: if not record.full: continue if record.full[0] in '+-=.()[]': continue if not record.etype in range(0,7): continue type = codes[record.etype] if showStat: record.full = format % (type,record.damage) + record.full else: record.full = format % type + record.full keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log(_('* %s: %d') % (self.label,sum(count.values()))) for srcMod in modInfos.getOrdered(count.keys()): log(' * %s: %d' % (srcMod.s,count[srcMod]))
def buildPatch(self,log,progress,patchFile): """Edits patch file as desired. Will write to log.""" count = {} format = self.choiceValues[self.chosen][0] showStat = '%02d' in format keep = patchFile.getKeeper() codes = getattr(patchFile,'weaponTags','BESMUTL') #ammoFormat = format.replace('%02d','',1) # for record in patchFile.AMMO.records: # if not record.full: continue # if record.full[0] in '+-=.()[]': continue # record.full = ammoFormat % 'A' + record.full # keep(record.fid) # srcMod = record.fid[0] # count[srcMod] = count.get(srcMod,0) + 1 for record in patchFile.WEAP.records: if not record.full: continue if record.full[0] in '+-=.()[]': continue if not record.etype in range(0,7): continue type = codes[record.etype] if showStat: record.full = format % (type,record.damage) + record.full else: record.full = format % type + record.full keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log(_('* %s: %d') % (self.label,sum(count.values()))) for srcMod in modInfos.getOrdered(count.keys()): log(' * %s: %d' % (srcMod.s,count[srcMod]))
479,017
def buildPatch(self,log,progress,patchFile): """Edits patch file as desired. Will write to log.""" count = {} format = self.choiceValues[self.chosen][0] showStat = '%02d' in format keep = patchFile.getKeeper() codes = getattr(patchFile,'weaponTags','BESMUTL') #ammoFormat = format.replace('%02d','',1) # for record in patchFile.AMMO.records: # if not record.full: continue # if record.full[0] in '+-=.()[]': continue # record.full = ammoFormat % 'A' + record.full # keep(record.fid) # srcMod = record.fid[0] # count[srcMod] = count.get(srcMod,0) + 1 for record in patchFile.WEAP.records: if not record.full: continue if record.full[0] in '+-=.()[]': continue if not record.etype in range(0,7): continue type = codes[record.etype] if showStat: record.full = format % (type,record.damage) + record.full else: record.full = format % type + record.full keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log(_('* %s: %d') % (self.label,sum(count.values()))) for srcMod in modInfos.getOrdered(count.keys()): log(' * %s: %d' % (srcMod.s,count[srcMod]))
def buildPatch(self,log,progress,patchFile): """Edits patch file as desired. Will write to log.""" count = {} format = self.choiceValues[self.chosen][0] showStat = '%02d' in format keep = patchFile.getKeeper() codes = getattr(patchFile,'weaponTags','BESMUTL') #ammoFormat = format.replace('%02d','',1) # for record in patchFile.AMMO.records: # if not record.full: continue # if record.full[0] in '+-=.()[]': continue # record.full = ammoFormat % 'A' + record.full # keep(record.fid) # srcMod = record.fid[0] # count[srcMod] = count.get(srcMod,0) + 1 for record in patchFile.WEAP.records: if not record.full: continue if record.full[0] in '+-=.()[]': continue if not record.etype in range(0,7): continue type = codes[record.etype] if showStat: record.full = format % (type,record.damage) + record.full else: record.full = format % type + record.full keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log(_('* %s: %d') % (self.label,sum(count.values()))) for srcMod in modInfos.getOrdered(count.keys()): log(' * %s: %d' % (srcMod.s,count[srcMod]))
479,018
def buildPatch(self,log,progress,patchFile): """Edits patch file as desired. Will write to log.""" count = {} format = self.choiceValues[self.chosen][0] showStat = '%02d' in format keep = patchFile.getKeeper() codes = getattr(patchFile,'weaponTags','BESMUTL') #ammoFormat = format.replace('%02d','',1) # for record in patchFile.AMMO.records: # if not record.full: continue # if record.full[0] in '+-=.()[]': continue # record.full = ammoFormat % 'A' + record.full # keep(record.fid) # srcMod = record.fid[0] # count[srcMod] = count.get(srcMod,0) + 1 for record in patchFile.WEAP.records: if not record.full: continue if record.full[0] in '+-=.()[]': continue if not record.etype in range(0,7): continue type = codes[record.etype] if showStat: record.full = format % (type,record.damage) + record.full else: record.full = format % type + record.full keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log(_('* %s: %d') % (self.label,sum(count.values()))) for srcMod in modInfos.getOrdered(count.keys()): log(' * %s: %d' % (srcMod.s,count[srcMod]))
def buildPatch(self,log,progress,patchFile): """Edits patch file as desired. Will write to log.""" count = {} format = self.choiceValues[self.chosen][0] showStat = '%02d' in format keep = patchFile.getKeeper() codes = getattr(patchFile,'weaponTags','BESMUTL') #ammoFormat = format.replace('%02d','',1) # for record in patchFile.AMMO.records: # if not record.full: continue # if record.full[0] in '+-=.()[]': continue # record.full = ammoFormat % 'A' + record.full # keep(record.fid) # srcMod = record.fid[0] # count[srcMod] = count.get(srcMod,0) + 1 for record in patchFile.WEAP.records: if not record.full: continue if record.full[0] in '+-=.()[]': continue if not record.etype in range(0,7): continue type = codes[record.etype] if showStat: record.full = format % (type,record.damage) + record.full else: record.full = format % type + record.full keep(record.fid) srcMod = record.fid[0] count[srcMod] = count.get(srcMod,0) + 1 #--Log log(_('* %s: %d') % (self.label,sum(count.values()))) for srcMod in modInfos.getOrdered(count.keys()): log(' * %s: %d' % (srcMod.s,count[srcMod]))
479,019
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreActi,MreAlch,MreAmmo,MreFurn,MreMisc,MreMstt,MreProj,MreWeap): recAttrs_class[recClass] = ('destructable',) for recClass in (MreCont,MreDoor,): # TODO: MreTerm recAttrs_class[recClass] = ('destructable','script',) for recClass in (MreLigh,): recAttrs_class[recClass] = ('script',) for recClass in (MreStat,): recAttrs_class[recClass] = ('model',) self.longTypes = set(('ACTI','ALCH','AMMO','FURN','MISC','MSTT','PROJ','WEAP','CONT','DOOR','LIGH','STAT', 'DEBR','EXPL','MGEF','SCPT','SPEL','SOUN','NPC_','WATR','TXST','ENCH','FLST','IPDS','STAT',''))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreActi,MreAlch,MreAmmo,MreFurn,MreMisc,MreMstt,MreProj,MreWeap): recAttrs_class[recClass] = ('destructable',) for recClass in (MreCont,MreDoor,MreTerm): # TODO: MreTerm recAttrs_class[recClass] = ('destructable','script',) for recClass in (MreLigh,): recAttrs_class[recClass] = ('script',) for recClass in (MreStat,): recAttrs_class[recClass] = ('model',) self.longTypes = set(('ACTI','ALCH','AMMO','FURN','MISC','MSTT','PROJ','WEAP','CONT','DOOR','LIGH','STAT', 'DEBR','EXPL','MGEF','SCPT','SPEL','SOUN','NPC_','WATR','TXST','ENCH','FLST','IPDS','STAT',''))
479,020
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreActi,MreAlch,MreAmmo,MreFurn,MreMisc,MreMstt,MreProj,MreWeap): recAttrs_class[recClass] = ('destructable',) for recClass in (MreCont,MreDoor,): # TODO: MreTerm recAttrs_class[recClass] = ('destructable','script',) for recClass in (MreLigh,): recAttrs_class[recClass] = ('script',) for recClass in (MreStat,): recAttrs_class[recClass] = ('model',) self.longTypes = set(('ACTI','ALCH','AMMO','FURN','MISC','MSTT','PROJ','WEAP','CONT','DOOR','LIGH','STAT', 'DEBR','EXPL','MGEF','SCPT','SPEL','SOUN','NPC_','WATR','TXST','ENCH','FLST','IPDS','STAT',''))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreActi,MreAlch,MreAmmo,MreFurn,MreMisc,MreMstt,MreProj,MreWeap): recAttrs_class[recClass] = ('destructable',) for recClass in (MreCont,MreDoor,): # TODO: MreTerm recAttrs_class[recClass] = ('destructable','script',) for recClass in (MreLigh,): recAttrs_class[recClass] = ('script',) for recClass in (MreStat,): recAttrs_class[recClass] = ('model',) self.longTypes = set(('ACTI','ALCH','AMMO','FURN','MISC','MSTT','PROJ','WEAP','CONT','DOOR','LIGH','STAT', 'DEBR','EXPL','MGEF','SCPT','SPEL','SOUN','NPC_','WATR','TXST','ENCH','FLST','IPDS','STAT',''))
479,021
def Execute(self,event=None): """Do the patch.""" self.EndModal(wx.ID_OK) patchName = self.patchInfo.name progress = balt.Progress(patchName.s,(' '*60+'\n')) try: #--Save configs patchConfigs = {'ImportedMods':set()} for patcher in self.patchers: patcher.saveConfig(patchConfigs) bosh.modInfos.table.setItem(patchName,'bash.patch.configs',patchConfigs) #--Do it log = bolt.LogFile(cStringIO.StringIO()) nullProgress = bolt.Progress() patchers = [patcher for patcher in self.patchers if patcher.isEnabled] patchFile = bosh.PatchFile(self.patchInfo,patchers) patchFile.initData(SubProgress(progress,0,0.1)) #try to speed this up! patchFile.initFactories(SubProgress(progress,0.1,0.2)) #no speeding needed/really possible (less than 1/4 second even with large LO) patchFile.scanLoadMods(SubProgress(progress,0.2,0.8)) #try to speed this up! patchFile.buildPatch(log,SubProgress(progress,0.8,0.9))#no speeding needed/really possible (less than 1/4 second even with large LO) #--Save progress(0.9,patchName.s+_('\nSaving...')) patchFile.safeSave() #--Cleanup self.patchInfo.refresh() modList.RefreshUI(patchName) #--Done progress.Destroy() #--Readme and log log.setHeader(None) log('{{CSS:wtxt_sand_small.css}}') logValue = log.out.getvalue() readme = bosh.modInfos.dir.join('Docs',patchName.sroot+'.txt') readme.open('w').write(logValue) bosh.modInfos.table.setItem(patchName,'doc',readme) #--Convert log/readme to wtxt and show log docsDir = bosh.modInfos.dir.join('Docs') bolt.WryeText.genHtml(readme,None,docsDir) balt.showWryeLog(self.parent,readme.root+'.html',patchName.s,icons=bashBlue) #--Select? message = _("Activate %s?") % (patchName.s,) if bosh.modInfos.isSelected(patchName) or balt.askYes(self.parent,message,patchName.s): try: oldFiles = bosh.modInfos.ordered[:] bosh.modInfos.select(patchName) changedFiles = bolt.listSubtract(bosh.modInfos.ordered,oldFiles) if len(changedFiles) > 1: statusBar.SetText(_("Masters Activated: ") + `len(changedFiles)-1`) except bosh.PluginsFullError: balt.showError(self,_("Unable to add mod %s because load list is full." ) % (fileName.s,)) modList.RefreshUI() except bosh.FileEditError, error: progress.Destroy() balt.showError(self,str(error),_("File Edit Error")) except: progress.Destroy() raise
def Execute(self,event=None): """Do the patch.""" self.EndModal(wx.ID_OK) patchName = self.patchInfo.name progress = balt.Progress(patchName.s,(' '*60+'\n')) try: #--Save configs patchConfigs = {'ImportedMods':set()} for patcher in self.patchers: patcher.saveConfig(patchConfigs) bosh.modInfos.table.setItem(patchName,'bash.patch.configs',patchConfigs) #--Do it log = bolt.LogFile(cStringIO.StringIO()) nullProgress = bolt.Progress() patchers = [patcher for patcher in self.patchers if patcher.isEnabled] patchFile = bosh.PatchFile(self.patchInfo,patchers) patchFile.initData(SubProgress(progress,0,0.1)) #try to speed this up! patchFile.initFactories(SubProgress(progress,0.1,0.2)) #no speeding needed/really possible (less than 1/4 second even with large LO) patchFile.scanLoadMods(SubProgress(progress,0.2,0.8)) #try to speed this up! patchFile.buildPatch(log,SubProgress(progress,0.8,0.9))#no speeding needed/really possible (less than 1/4 second even with large LO) #--Save progress(0.9,patchName.s+_('\nSaving...')) while True: try: patchFile.safeSave() except WindowsError: message = _("The patch cannot be written to (Data\\%s).\nIt might be locking by other processes.\nDo you want to retry or cancel?") % (patchName.s,) if balt.askWarning(self,fill(message,80),_("Couldn't write ")+patchName.s): continue raise break #--Cleanup self.patchInfo.refresh() modList.RefreshUI(patchName) #--Done progress.Destroy() #--Readme and log log.setHeader(None) log('{{CSS:wtxt_sand_small.css}}') logValue = log.out.getvalue() readme = bosh.modInfos.dir.join('Docs',patchName.sroot+'.txt') readme.open('w').write(logValue) bosh.modInfos.table.setItem(patchName,'doc',readme) #--Convert log/readme to wtxt and show log docsDir = bosh.modInfos.dir.join('Docs') bolt.WryeText.genHtml(readme,None,docsDir) balt.showWryeLog(self.parent,readme.root+'.html',patchName.s,icons=bashBlue) #--Select? message = _("Activate %s?") % (patchName.s,) if bosh.modInfos.isSelected(patchName) or balt.askYes(self.parent,message,patchName.s): try: oldFiles = bosh.modInfos.ordered[:] bosh.modInfos.select(patchName) changedFiles = bolt.listSubtract(bosh.modInfos.ordered,oldFiles) if len(changedFiles) > 1: statusBar.SetText(_("Masters Activated: ") + `len(changedFiles)-1`) except bosh.PluginsFullError: balt.showError(self,_("Unable to add mod %s because load list is full." ) % (fileName.s,)) modList.RefreshUI() except bosh.FileEditError, error: progress.Destroy() balt.showError(self,str(error),_("File Edit Error")) except: progress.Destroy() raise
479,022
def dumpData(self,record,out): """Conditionally dumps data.""" if record.entryType == 7 and self.subType == 'RDMD': MelOptStruct.dumpData(self,record,out)
def dumpData(self,record,out): """Conditionally dumps data.""" if record.entryType == 7 and self.subType == 'RDMD': MelOptStruct.dumpData(self,record,out)
479,023
def loadData(self,record,ins,type,size,readId): MelStruct.loadData(self,record,ins,type,size,readId) record.staticAtten = 0 record.stopTime = 0 record.startTime = 0
def loadData(self,record,ins,type,size,readId): MelStruct.loadData(self,record,ins,type,size,readId) record.staticAtten = 0 record.stopTime = 0 record.startTime = 0
479,024
def dumpData(self,record,out): return
def dumpData(self,record,out): return
479,025
def getEffectsSummary(self,mgef_school=None,mgef_name=None): """Return a text description of magic effects.""" mgef_school = mgef_school or bush.mgef_school mgef_name = mgef_name or bush.mgef_name buff = cStringIO.StringIO() avEffects = bush.actorValueEffects aValues = bush.actorValues buffWrite = buff.write if self.effects: school = mgef_school[self.effects[0].name] buffWrite(bush.actorValues[20+school] + '\n') for index,effect in enumerate(self.effects): if effect.scriptEffect: effectName = effect.scriptEffect.full or 'Script Effect' else: effectName = mgef_name[effect.name] if effect.name in avEffects: effectName = re.sub(_('(Attribute|Skill)'),aValues[effect.actorValue],effectName) buffWrite('o+*'[effect.recipient]+' '+effectName) if effect.magnitude: buffWrite(' '+`effect.magnitude`+'m') if effect.area: buffWrite(' '+`effect.area`+'a') if effect.duration > 1: buffWrite(' '+`effect.duration`+'d') buffWrite('\n') return buff.getvalue()
def getEffectsSummary(self,mgef_school=None,mgef_name=None): """Return a text description of magic effects.""" mgef_school = mgef_school or bush.mgef_school mgef_name = mgef_name or bush.mgef_name buff = cStringIO.StringIO() avEffects = bush.actorValueEffects aValues = bush.actorValues buffWrite = buff.write if self.effects: school = mgef_school[self.effects[0].name] buffWrite(bush.actorValues[20+school] + '\n') for index,effect in enumerate(self.effects): if effect.scriptEffect: effectName = effect.scriptEffect.full or 'Script Effect' else: effectName = mgef_name[effect.name] if effect.name in avEffects: effectName = re.sub(_('(Attribute|Skill)'),aValues[effect.actorValue],effectName) buffWrite('o+*'[effect.recipient]+' '+effectName) if effect.magnitude: buffWrite(' '+`effect.magnitude`+'m') if effect.area: buffWrite(' '+`effect.area`+'a') if effect.duration > 1: buffWrite(' '+`effect.duration`+'d') buffWrite('\n') return buff.getvalue()
479,026
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
479,027
def dumpData(self,record,out): if not record.flags.isInterior: MelOptStruct.dumpData(self,record,out)
def dumpData(self,record,out): if not record.flags.isInterior: MelOptStruct.dumpData(self,record,out)
479,028
def dumpData(self,record,out): if not record.flags.isInterior: MelOptStruct.dumpData(self,record,out)
def dumpData(self,record,out): if not record.flags.isInterior: MelOptStruct.dumpData(self,record,out)
479,029
def dumpData(self,record,out): if not record.flags.isInterior: MelOptStruct.dumpData(self,record,out)
def dumpData(self,record,out): if not record.flags.isInterior: MelOptStruct.dumpData(self,record,out)
479,030
def loadData(self,record,ins,type,size,readId): if size == 52: MelStruct.loadData(self,record,ins,type,size,readId) return #--Else 42 byte record (skips trainSkill, trainLevel,unused1... unpacked = ins.unpack('2iI7i2I',size,readId) unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
def loadData(self,record,ins,type,size,readId): if size == 52: MelStruct.loadData(self,record,ins,type,size,readId) return #--Else 42 byte record (skips trainSkill, trainLevel,unused1... unpacked = ins.unpack('2iI7i2I',size,readId) unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
479,031
def loadData(self,record,ins,type,size,readId): if size == 52: MelStruct.loadData(self,record,ins,type,size,readId) return #--Else 42 byte record (skips trainSkill, trainLevel,unused1... unpacked = ins.unpack('2iI7i2I',size,readId) unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
def loadData(self,record,ins,type,size,readId): if size == 52: MelStruct.loadData(self,record,ins,type,size,readId) return #--Else 42 byte record (skips trainSkill, trainLevel,unused1... unpacked = ins.unpack('2iI7i2I',size,readId) unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked, record.flags.getTrueAttrs()
479,032
def writeToText(self,textPath): """Exports type_id_name to specified text file.""" textPath = GPath(textPath) type_id_name = self.type_id_name type_id_sname = self.type_id_sname out = textPath.open('w') for type in sorted(type_id_name): if type in self.hasShortNameTypes: headFormat = '"%s","%s","%s","%s","%s","%s"\n' rowFormat = '"%s","%s","0x%06X","%s","%s","%s"\n' out.write(headFormat % (_('Type'),_('Mod Name'),_('ObjectIndex'),_('Editor Id'),_('Name'),_('Short Name'))) else: headFormat = '"%s","%s","%s","%s","%s"\n' rowFormat = '"%s","%s","0x%06X","%s","%s"\n' out.write(headFormat % (_('Type'),_('Mod Name'),_('ObjectIndex'),_('Editor Id'),_('Name'))) id_name = type_id_name[type] id_sname = type_id_sname.get(type, {}) longids = id_name.keys() longids.sort(key=lambda a: id_name[a][0]) longids.sort(key=itemgetter(0)) for longid in longids: eid,name = id_name[longid] if type in self.hasShortNameTypes: eid2,sname = id_sname.get(longid,(eid,'')) out.write(rowFormat % (type,longid[0].s,longid[1],eid,name,sname)) else: out.write(rowFormat % (type,longid[0].s,longid[1],eid,name)) out.close()
def writeToText(self,textPath): """Exports type_id_name to specified text file.""" textPath = GPath(textPath) type_id_name = self.type_id_name type_id_sname = self.type_id_sname out = textPath.open('w') for type in sorted(type_id_name): if type in self.hasShortNameTypes: headFormat = '"%s","%s","%s","%s","%s","%s"\n' rowFormat = '"%s","%s","0x%06X","%s","%s","%s"\n' out.write(headFormat % (_('Type'),_('Mod Name'),_('ObjectIndex'),_('Editor Id'),_('Name'),_('Short Name'))) else: headFormat = '"%s","%s","%s","%s","%s"\n' rowFormat = '"%s","%s","0x%06X","%s","%s"\n' out.write(headFormat % (_('Type'),_('Mod Name'),_('ObjectIndex'),_('Editor Id'),_('Name'))) id_name = type_id_name[type] id_sname = type_id_sname.get(type, {}) longids = id_name.keys() longids.sort(key=lambda a: id_name[a][0]) longids.sort(key=itemgetter(0)) for longid in longids: eid,name = id_name[longid] if type in self.hasShortNameTypes: eid2,sname = id_sname.get(longid,(eid,'')) out.write(rowFormat % (type,longid[0].s,longid[1],eid,name.replace('"', '""'),sname.replace('"', '""'))) else: out.write(rowFormat % (type,longid[0].s,longid[1],eid,name)) out.close()
479,033
def writeToText(self,textPath): """Exports type_id_name to specified text file.""" textPath = GPath(textPath) type_id_name = self.type_id_name type_id_sname = self.type_id_sname out = textPath.open('w') for type in sorted(type_id_name): if type in self.hasShortNameTypes: headFormat = '"%s","%s","%s","%s","%s","%s"\n' rowFormat = '"%s","%s","0x%06X","%s","%s","%s"\n' out.write(headFormat % (_('Type'),_('Mod Name'),_('ObjectIndex'),_('Editor Id'),_('Name'),_('Short Name'))) else: headFormat = '"%s","%s","%s","%s","%s"\n' rowFormat = '"%s","%s","0x%06X","%s","%s"\n' out.write(headFormat % (_('Type'),_('Mod Name'),_('ObjectIndex'),_('Editor Id'),_('Name'))) id_name = type_id_name[type] id_sname = type_id_sname.get(type, {}) longids = id_name.keys() longids.sort(key=lambda a: id_name[a][0]) longids.sort(key=itemgetter(0)) for longid in longids: eid,name = id_name[longid] if type in self.hasShortNameTypes: eid2,sname = id_sname.get(longid,(eid,'')) out.write(rowFormat % (type,longid[0].s,longid[1],eid,name,sname)) else: out.write(rowFormat % (type,longid[0].s,longid[1],eid,name)) out.close()
def writeToText(self,textPath): """Exports type_id_name to specified text file.""" textPath = GPath(textPath) type_id_name = self.type_id_name type_id_sname = self.type_id_sname out = textPath.open('w') for type in sorted(type_id_name): if type in self.hasShortNameTypes: headFormat = '"%s","%s","%s","%s","%s","%s"\n' rowFormat = '"%s","%s","0x%06X","%s","%s","%s"\n' out.write(headFormat % (_('Type'),_('Mod Name'),_('ObjectIndex'),_('Editor Id'),_('Name'),_('Short Name'))) else: headFormat = '"%s","%s","%s","%s","%s"\n' rowFormat = '"%s","%s","0x%06X","%s","%s"\n' out.write(headFormat % (_('Type'),_('Mod Name'),_('ObjectIndex'),_('Editor Id'),_('Name'))) id_name = type_id_name[type] id_sname = type_id_sname.get(type, {}) longids = id_name.keys() longids.sort(key=lambda a: id_name[a][0]) longids.sort(key=itemgetter(0)) for longid in longids: eid,name = id_name[longid] if type in self.hasShortNameTypes: eid2,sname = id_sname.get(longid,(eid,'')) out.write(rowFormat % (type,longid[0].s,longid[1],eid,name,sname)) else: out.write(rowFormat % (type,longid[0].s,longid[1],eid,name.replace('"', '""'))) out.close()
479,034
# def loadData(self,record,ins,type,size,readId):
# def loadData(self,record,ins,type,size,readId):
479,035
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
479,036
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
479,037
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
def loadData(self,record,ins,type,size,readId): if size == 136: MelStruct.loadData(self,record,ins,type,size,readId) return elif size == 124: #--Else 124 byte record (skips sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIffI',size,readId) elif size == 120: #--Else 120 byte record (skips resistType, sightUsage, semiAutomaticFireDelayMin and semiAutomaticFireDelayMax... unpacked = ins.unpack('Iff4B5fI4BffII11fIIff',size,readId) else: raise "Unexpected size encountered for WEAP:DNAM subrecord: %s" % size unpacked += self.defaults[len(unpacked):] setter = record.__setattr__ for attr,value,action in zip(self.attrs,unpacked,self.actions): if callable(action): value = action(value) setter(attr,value) if self._debug: print unpacked
479,038
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bloodSprayPath','bloodDecalPath') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','enchantEffect','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imagespaceModifier','light','impactdataset','placedImpactObject') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ'))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bodyPartData','impactDataset') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','enchantEffect','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imagespaceModifier','light','impactdataset','placedImpactObject') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ'))
479,039
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bloodSprayPath','bloodDecalPath') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','enchantEffect','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imagespaceModifier','light','impactdataset','placedImpactObject') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ'))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bloodSprayPath','bloodDecalPath') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','objectDisplayShader','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imagespaceModifier','light','impactdataset','placedImpactObject') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ'))
479,040
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bloodSprayPath','bloodDecalPath') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','enchantEffect','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imagespaceModifier','light','impactdataset','placedImpactObject') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ'))
def initPatchFile(self,patchFile,loadMods): """Prepare to handle specified patch mod. All functions are called after this.""" Patcher.initPatchFile(self,patchFile,loadMods) self.id_data = {} #--Names keyed by long fid. self.srcClasses = set() #--Record classes actually provided by src mods/files. self.sourceMods = self.getConfigChecked() self.isActive = len(self.sourceMods) != 0 #--Type Fields recAttrs_class = self.recAttrs_class = {} for recClass in (MreBsgn,MreLscr, MreClas, MreLtex, MreRegn): recAttrs_class[recClass] = ('iconPath',) for recClass in (MreActi, MreDoor, MreFlor, MreFurn, MreGras, MreStat): recAttrs_class[recClass] = ('model',) for recClass in (MreAlch, MreAmmo, MreAppa, MreBook, MreIngr, MreKeym, MreLigh, MreMisc, MreSgst, MreSlgm, MreTree): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model') for recClass in (MreWeap,): recAttrs_class[recClass] = ('largeIconPath','smallIconPath','model','shellCasingModel','scopeModel','worldModel','firstPersonModel','animationType','gripAnimation','reloadAnimation') for recClass in (MreArmo, MreClot): recAttrs_class[recClass] = ('maleBody','maleWorld','maleIconPath','maleIcon','femaleBody','femaleWorld','femaleIconPath','femaleIcon','flags') for recClass in (MreCrea,): recAttrs_class[recClass] = ('model','bodyParts','nift_p','bloodSprayPath','bloodDecalPath') for recClass in (MreMgef,): recAttrs_class[recClass] = ('iconPath','model','effectShader','enchantEffect','light') for recClass in (MreEfsh,): recAttrs_class[recClass] = ('particleTexture','fillTexture') for recClass in (MreTxst,): recAttrs_class[recClass] = ('baseImage','normalMap','environmentMapMask','growMap','parallaxMap','environmentMap','decalData','flags') for recClass in (MreExpl,): recAttrs_class[recClass] = ('imageSpaceModifier','light','impactDataset','placedImpactObject') for recClass in (MreIpct,): recAttrs_class[recClass] = ('model','effectDuration','effectOrientation','angleThreshold','placementRadius','flags','minWidth','maxWidth','minHeight','maxHeight','depth','shininess','parallaxScale','parallaxPasses','decalFlags','red','green','blue','textureSet') for recClass in (MreIpds,): recAttrs_class[recClass] = ('stone','dirt','grass','metal','wood','organic','cloth','water','hollowMetal','organicBug','organicGlow') for recClass in (MreProj,): recAttrs_class[recClass] = ('model','light','muzzleFlash','explosion','muzzleFlashDuration','fadeDuration','muzzleFlashPath') #--Needs Longs self.longTypes = set(('BSGN','LSCR','CLAS','LTEX','REGN','ACTI','DOOR','FLOR','FURN','GRAS','STAT','ALCH','AMMO','BOOK','INGR','KEYM','LIGH','MISC','SGST','SLGM','WEAP','TREE','ARMO','CLOT','CREA','MGEF','EFSH','TXST','EXPL','IPCT','IPDS','PROJ'))
479,041
def getColor(hit_c): global hit_count_max global hit_count_min global hit_count_logmin global hit_count_logrange log_v = math.floor(math.log(hit_c)/math.log(2)) log_rebase = log_v - hit_count_logmin color_intensity=log_rebase*(255 / hit_count_logrange) rgb_str = 'rgb('+str(int(color_intensity))+',0,0)' return ImageColor.getrgb(rgb_str)
def getColor(hit_c): global hit_count_max global hit_count_min global hit_count_logmin global hit_count_logrange log_v = math.floor(math.log(hit_c)/math.log(2)) log_rebase = log_v - hit_count_logmin color_intensity=log_rebase*(255 / hit_count_logrange) color_rgb = color_table[int(log_rebase)] return ImageColor.getrgb(color_table[int(log_rebase)])
479,042
def getColor(hit_c): global hit_count_max global hit_count_min global hit_count_logmin global hit_count_logrange log_v = math.floor(math.log(hit_c)/math.log(2)) log_rebase = log_v - hit_count_logmin color_intensity=log_rebase*(255 / hit_count_logrange) rgb_str = 'rgb('+str(int(color_intensity))+',0,0)' return ImageColor.getrgb(rgb_str)
def getColor(hit_c): global hit_count_max global hit_count_min global hit_count_logmin global hit_count_logrange log_v = math.floor(math.log(hit_c)/math.log(2)) log_rebase = log_v - hit_count_logmin color_intensity=log_rebase*(255 / hit_count_logrange) rgb_str = 'rgb('+str(int(color_intensity))+',0,0)' return ImageColor.getrgb(rgb_str)
479,043
def announce_post(irc, feed, entry): global CHANNEL print 'NEW POST: %s: %s (%s)' % (entry.title, entry.link.replace("http://www.streetgeek.com.au/portal/modules.php?name=Forums&file=viewtopic&p=", "http://fj.streetgeek.com.au/"), feed) irc.action(CHANNEL, 'found a new post on %s: %s: %s' % (str(feed), str(entry.title.strip()), str(entry.link.strip().replace("http://www.streetgeek.com.au/portal/modules.php?name=Forums&file=viewtopic&p=", "http://fj.streetgeek.com.au/"))))
def announce_post(irc, feed, entry): global CHANNEL link = str(entry.link.replace("http://www.streetgeek.com.au/portal/modules.php?name=Forums&file=viewtopic&p=", "http://fj.streetgeek.com.au/")) print 'NEW POST: %s: %s (%s)' % (entry.title, link, feed) irc.action(CHANNEL, 'found a new post on %s: %s: %s' % (str(feed), str(entry.title), link))
479,044
def handle_ctcp(event, match): global message_buffer, MAX_MESSAGES, CHANNEL if event.channel == CHANNEL: if event.args[0] == "ACTION": message_buffer.append([event.nick, msg[:200], True]) message_buffer = message_buffer[-MAX_MESSAGES:] return
def handle_ctcp(event, match): global message_buffer, MAX_MESSAGES, CHANNEL if event.channel == CHANNEL: if event.args[0] == "ACTION": message_buffer.append([event.nick, event.text[:200], True]) message_buffer = message_buffer[-MAX_MESSAGES:] return
479,045
def cleanup(self): # do some cleanup tasks to free some memory # hopefully python's resource counter will properly detect the object as something # that can be disposed of to_delete = [] for channel in self.channels.values(): if len(channel.members) == 0: to_delete.append(channel) for channel in to_delete: self.channels.remove(channel) del to_delete
def cleanup(self): # do some cleanup tasks to free some memory # hopefully python's resource counter will properly detect the object as something # that can be disposed of to_delete = [] for channel in self.channels.values(): if len(channel.members) == 0: to_delete.append(channel) for channel in to_delete: del self.channels[channel.name] del to_delete
479,046
def handle_pubmsg(connection, event): global message_buffer, MAX_MESSAGES, last_message, flooders nick = event.source().partition("!")[0] msg = event.arguments()[0] if msg.startswith('s/'): # handle regex parts = msg.split('/') # now flood protect! now = datetime.now() delta = now - last_message last_message = now if delta < timedelta(seconds=5): # 5 seconds between requests # any more are ignored print "Flood protection hit, %s of %s seconds were waited" % (delta.seconds, timedelta(seconds=5).seconds) if event.source() in flooders: # user has recently sent a command connection.kick(event.target(), nick, 'Flood protection activated') else: flooders.append(event.source()) connection.notice(nick, 'Flood protection active, ignoring your request and adding you to "flooders" list until the cooldown has expired. If you persist you will be kicked from the channel. I won\'t respond to ANYONE until people have stopped issuing commands for a few seconds.') return else: # add user to "flooders" list, clear existing ones flooders = [event.source(),] if len(message_buffer) == 0: connection.privmsg(event.target(), '%s: message buffer is empty' % nick) return if len(parts) == 3: connection.privmsg(event.target(), '%s: invalid regular expression, you forgot the trailing slash, dummy' % nick) return if len(parts) != 4: # not a valid regex connection.privmsg(event.target(), '%s: invalid regular expression, not the right amount of slashes' % nick) return # find messages matching the string if len(parts[1]) == 0: connection.privmsg(event.target(), '%s: original string is empty' % nick) return ignore_case = 'i' in parts[3] e = None try: if ignore_case: e = re.compile(parts[1], re.I) else: e = re.compile(parts[1]) except Exception, ex: connection.privmsg(event.target(), '%s: failure compiling regular expression: %s' % (nick, ex)) return # now we have a valid regular expression matcher! for x in range(len(message_buffer)-1, -1, -1): if e.search(message_buffer[x][1]) != None: # match found! new_message = [] # replace the message in the buffer try: new_message = [message_buffer[x][0], e.sub(parts[2], message_buffer[x][1]).replace('\n','').replace('\r','')[:200]] del message_buffer[x] message_buffer.append(new_message) except Exception, ex: connection.privmsg(event.target(), '%s: failure replacing: %s' % (nick, ex)) return # now print the new text print new_message connection.privmsg(event.target(), ('<%s> %s' % (new_message[0], new_message[1]))[:200]) return # no match found connection.privmsg(event.target(), '%s: no match found' % nick) else: # add to buffer message_buffer.append([nick, msg[:200]]) # trim the buffer message_buffer = message_buffer[-MAX_MESSAGES:]
def handle_pubmsg(connection, event): global message_buffer, MAX_MESSAGES, last_message, flooders nick = event.source().partition("!")[0] msg = event.arguments()[0] if msg.startswith('s/'): # handle regex parts = msg.split('/') # now flood protect! now = datetime.now() delta = now - last_message last_message = now if delta < timedelta(seconds=5): # 5 seconds between requests # any more are ignored print "Flood protection hit, %s of %s seconds were waited" % (delta.seconds, timedelta(seconds=5).seconds) if event.source() in flooders: # user has recently sent a command connection.kick(event.target(), nick, 'Flood protection activated') else: flooders.append(event.source()) connection.notice(nick, 'Flood protection active, ignoring your request and adding you to "flooders" list until the cooldown has expired. If you persist you will be kicked from the channel. I won\'t respond to ANYONE until people have stopped issuing commands for a few seconds.') return else: # add user to "flooders" list, clear existing ones flooders = [event.source(),] if len(message_buffer) == 0: connection.privmsg(event.target(), '%s: message buffer is empty' % nick) return if len(parts) == 3: connection.privmsg(event.target(), '%s: invalid regular expression, you forgot the trailing slash, dummy' % nick) return if len(parts) != 4: # not a valid regex connection.privmsg(event.target(), '%s: invalid regular expression, not the right amount of slashes' % nick) return # find messages matching the string if len(parts[1]) == 0: connection.privmsg(event.target(), '%s: original string is empty' % nick) return ignore_case = 'i' in parts[3] e = None try: if ignore_case: e = re.compile(parts[1], re.I) else: e = re.compile(parts[1]) except Exception, ex: connection.privmsg(event.target(), '%s: failure compiling regular expression: %s' % (nick, ex)) return # now we have a valid regular expression matcher! for x in range(len(message_buffer)-1, -1, -1): if e.search(message_buffer[x][1]) != None: # match found! new_message = [] # replace the message in the buffer try: new_message = [message_buffer[x][0], e.sub(parts[2], message_buffer[x][1]).replace('\n','').replace('\r','')[:200]] del message_buffer[x] message_buffer.append(new_message) except Exception, ex: connection.privmsg(event.target(), '%s: failure replacing: %s' % (nick, ex)) return # now print the new text print new_message connection.privmsg(event.target(), ('<%s> %s' % (new_message[0], new_message[1]))[:200]) return # no match found connection.privmsg(event.target(), '%s: no match found' % nick) else: # add to buffer message_buffer.append([nick, msg[:200]]) # trim the buffer message_buffer = message_buffer[-MAX_MESSAGES:]
479,047
def start_channels(self, chans): self._startChannels = chans self.bind(self._welcome_join, RPL_WELCOME)
def start_channels(self, chans): self._startChannels = chans
479,048
def handle_pubmsg(connection, event): global message_buffer, MAX_MESSAGES, last_message nick = event.source().partition("!")[0] msg = event.arguments()[0] if msg.startswith('s/'): # handle regex parts = msg.split('/') # now flood protect! now = datetime.now() delta = now - last_message last_message = now if delta < timedelta(seconds=5): # 5 seconds between requests # any more are ignored print "Flood protection hit, %s of %s seconds were waited" % (delta.seconds, timedelta(seconds=5).seconds) connection.kick(event.target(), nick, 'Flood protection activated') return if len(message_buffer) == 0: connection.privmsg(event.target(), '%s: message buffer is empty' % nick) return if len(parts) == 3: connection.privmsg(event.target(), '%s: invalid regular expression, you forgot the trailing slash, dummy' % nick) return if len(parts) != 4: # not a valid regex connection.privmsg(event.target(), '%s: invalid regular expression, not the right amount of slashes' % nick) return # find messages matching the string if len(parts[1]) == 0: connection.privmsg(event.target(), '%s: original string is empty' % nick) return ignore_case = 'i' in parts[3] e = None try: if ignore_case: e = re.compile(parts[1], re.I) else: e = re.compile(parts[1], re.I) except Exception, ex: connection.privmsg(event.target(), '%s: failure compiling regular expression: %s' % (nick, ex)) return # now we have a valid regular expression matcher! for x in range(len(message_buffer)-1, -1, -1): if e.search(message_buffer[x][1]) != None: # match found! new_message = [] # replace the message in the buffer try: new_message = [message_buffer[x][0], e.sub(parts[2], message_buffer[x][1]).replace('\n','').replace('\r','')[:200]] del message_buffer[x] message_buffer.append(new_message) except Exception, ex: connection.privmsg(event.target(), '%s: failure replacing: %s' % (nick, ex)) return # now print the new text print new_message connection.privmsg(event.target(), ('<%s> %s' % (new_message[0], new_message[1]))[:200]) return # no match found connection.privmsg(event.target(), '%s: no match found' % nick) else: # add to buffer message_buffer.append([nick, msg[:200]]) # trim the buffer message_buffer = message_buffer[-MAX_MESSAGES:]
def handle_pubmsg(connection, event): global message_buffer, MAX_MESSAGES, last_message nick = event.source().partition("!")[0] msg = event.arguments()[0] if msg.startswith('s/'): # handle regex parts = msg.split('/') # now flood protect! now = datetime.now() delta = now - last_message last_message = now if delta < timedelta(seconds=5): # 5 seconds between requests # any more are ignored print "Flood protection hit, %s of %s seconds were waited" % (delta.seconds, timedelta(seconds=5).seconds) connection.kick(event.target(), nick, 'Flood protection activated') return if len(message_buffer) == 0: connection.privmsg(event.target(), '%s: message buffer is empty' % nick) return if len(parts) == 3: connection.privmsg(event.target(), '%s: invalid regular expression, you forgot the trailing slash, dummy' % nick) return if len(parts) != 4: # not a valid regex connection.privmsg(event.target(), '%s: invalid regular expression, not the right amount of slashes' % nick) return # find messages matching the string if len(parts[1]) == 0: connection.privmsg(event.target(), '%s: original string is empty' % nick) return ignore_case = 'i' in parts[3] e = None try: if ignore_case: e = re.compile(parts[1]) else: e = re.compile(parts[1]) except Exception, ex: connection.privmsg(event.target(), '%s: failure compiling regular expression: %s' % (nick, ex)) return # now we have a valid regular expression matcher! for x in range(len(message_buffer)-1, -1, -1): if e.search(message_buffer[x][1]) != None: # match found! new_message = [] # replace the message in the buffer try: new_message = [message_buffer[x][0], e.sub(parts[2], message_buffer[x][1]).replace('\n','').replace('\r','')[:200]] del message_buffer[x] message_buffer.append(new_message) except Exception, ex: connection.privmsg(event.target(), '%s: failure replacing: %s' % (nick, ex)) return # now print the new text print new_message connection.privmsg(event.target(), ('<%s> %s' % (new_message[0], new_message[1]))[:200]) return # no match found connection.privmsg(event.target(), '%s: no match found' % nick) else: # add to buffer message_buffer.append([nick, msg[:200]]) # trim the buffer message_buffer = message_buffer[-MAX_MESSAGES:]
479,049
def handle_pubmsg(connection, event): global message_buffer, MAX_MESSAGES, last_message, flooders nick = event.source().partition("!")[0] msg = event.arguments()[0] if msg.startswith('s/'): # handle regex parts = msg.split('/') # now flood protect! now = datetime.now() delta = now - last_message last_message = now if delta < timedelta(seconds=5): # 5 seconds between requests # any more are ignored print "Flood protection hit, %s of %s seconds were waited" % (delta.seconds, timedelta(seconds=5).seconds) if event.source() in flooders: # user has recently sent a command connection.kick(event.target(), nick, 'Flood protection activated') else: flooders.append(event.source()) connection.notice(nick, 'Flood protection active, ignoring your request and adding you to "flooders" list until the cooldown has expired. If you persist you will be kicked from the channel. I won\'t respond to ANYONE until people have stopped issuing commands for a few seconds.') return else: # add user to "flooders" list, clear existing ones flooders = [event.source(),] if len(message_buffer) == 0: connection.privmsg(event.target(), '%s: message buffer is empty' % nick) return if len(parts) == 3: connection.privmsg(event.target(), '%s: invalid regular expression, you forgot the trailing slash, dummy' % nick) return if len(parts) != 4: # not a valid regex connection.privmsg(event.target(), '%s: invalid regular expression, not the right amount of slashes' % nick) return # find messages matching the string if len(parts[1]) == 0: connection.privmsg(event.target(), '%s: original string is empty' % nick) return ignore_case = 'i' in parts[3] e = None try: if ignore_case: e = re.compile(parts[1], re.I) else: e = re.compile(parts[1]) except Exception, ex: connection.privmsg(event.target(), '%s: failure compiling regular expression: %s' % (nick, ex)) return # now we have a valid regular expression matcher! for x in range(len(message_buffer)-1, -1, -1): if e.search(message_buffer[x][1]) != None: # match found! new_message = [] # replace the message in the buffer try: new_message = [message_buffer[x][0], e.sub(parts[2], message_buffer[x][1]).replace('\n','').replace('\r','')[:200]] del message_buffer[x] message_buffer.append(new_message) except Exception, ex: connection.privmsg(event.target(), '%s: failure replacing: %s' % (nick, ex)) return # now print the new text print new_message connection.privmsg(event.target(), ('<%s> %s' % (new_message[0], new_message[1]))[:200]) return # no match found connection.privmsg(event.target(), '%s: no match found' % nick) else: # add to buffer message_buffer.append([nick, msg[:200]]) # trim the buffer message_buffer = message_buffer[-MAX_MESSAGES:]
def handle_pubmsg(connection, event): global message_buffer, MAX_MESSAGES, last_message, flooders nick = event.source().partition("!")[0] msg = event.arguments()[0] if msg.startswith('s/'): # handle regex parts = msg.split('/') # now flood protect! now = datetime.now() delta = now - last_message last_message = now if delta < timedelta(seconds=5): # 5 seconds between requests # any more are ignored print "Flood protection hit, %s of %s seconds were waited" % (delta.seconds, timedelta(seconds=5).seconds) if event.source() in flooders: # user has recently sent a command connection.kick(event.target(), nick, 'Flood protection activated') else: flooders.append(event.source()) connection.notice(nick, 'Flood protection active, ignoring your request and adding you to "flooders" list until the cooldown has expired. If you persist you will be kicked from the channel. I won\'t respond to ANYONE until people have stopped issuing commands for a few seconds.') return else: # add user to "flooders" list, clear existing ones flooders = [event.source(),] if len(message_buffer) == 0: connection.privmsg(event.target(), '%s: message buffer is empty' % nick) return if len(parts) == 3: connection.privmsg(event.target(), '%s: invalid regular expression, you forgot the trailing slash, dummy' % nick) return if len(parts) != 4: # not a valid regex connection.privmsg(event.target(), '%s: invalid regular expression, not the right amount of slashes' % nick) return # find messages matching the string if len(parts[1]) == 0: connection.privmsg(event.target(), '%s: original string is empty' % nick) return ignore_case = 'i' in parts[3] e = None try: if ignore_case: e = re.compile(parts[1], re.I) else: e = re.compile(parts[1]) except Exception, ex: connection.privmsg(event.target(), '%s: failure compiling regular expression: %s' % (nick, ex)) return # now we have a valid regular expression matcher! for x in range(len(message_buffer)-1, -1, -1): if e.search(message_buffer[x][1]) != None: # match found! new_message = [] # replace the message in the buffer try: new_message = [message_buffer[x][0], e.sub(parts[2], message_buffer[x][1]).replace('\n','').replace('\r','')[:200]] del message_buffer[x] message_buffer.append(new_message) except Exception, ex: connection.privmsg(event.target(), '%s: failure replacing: %s' % (nick, ex)) return # now print the new text print new_message connection.privmsg(event.target(), ('<%s> %s' % (new_message[0], new_message[1]))[:200]) return # no match found connection.privmsg(event.target(), '%s: no match found' % nick) else: # add to buffer message_buffer.append([nick, msg[:200]]) # trim the buffer message_buffer = message_buffer[-MAX_MESSAGES:]
479,050
def populate(self, obj, texList): self.name = obj.name.replace(".", "_")
def populate(self, obj, texList): self.name = obj.name.replace(".", "_")
479,051
def save(self, directory):
def save(self, directory):
479,052
def getModel(self):
defself.textures = cal3dTextures() getModel(self):
479,053
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
479,054
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
479,055
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
479,056
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
479,057
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
479,058
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
def prettify_title(title): title = title.lower() title = NON_CHAR.sub('-', title) return title
479,059
def findBestColor(measured_color_red, measured_color_green, measured_color_blue, target_color): """ findBestColor returns a color, which is nearest targetColor. * measured_color -- contains the measured colors for each channel * target_color """ voltage_color_list = [] voltage_color_list.extend( measured_color_red ) voltage_color_list.extend( measured_color_green ) voltage_color_list.extend( measured_color_blue ) return min(voltage_color_list, key=(lambda a: xyYnorm(a[1])))
def findBestColor(measured_color_red, measured_color_green, measured_color_blue, target_color): """ findBestColor returns a color, which is nearest targetColor. * measured_color -- contains the measured colors for each channel * target_color """ voltage_color_list = [] voltage_color_list.extend( measured_color_red ) voltage_color_list.extend( measured_color_green ) voltage_color_list.extend( measured_color_blue ) return min(voltage_color_list, key=(lambda a: xyYnorm(xyYdiff(a[1], target_color))))
479,060
def info(self, pkg, chkdistro): if not pkg.strip(): return '' _pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum() or x in '.-_+']) if len(pkg.strip().split()) > 1: distro = ''.join([x for x in pkg.strip().split(None,2)[1] if x.isalnum() or x in '-._+']) if not distro: distro = chkdistro if distro not in self.distros: return "%r is not a valid distribution: %s" % (distro, ", ".join(self.distros))
def info(self, pkg, chkdistro): if not pkg.strip(): return '' _pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum() or x in '.-_+']) if len(pkg.strip().split()) > 1: distro = ''.join([x for x in pkg.strip().split(None,2)[1] if x.isalnum() or x in '-._+']) if distro not in self.distros: return "%r is not a valid distribution: %s" % (distro, ", ".join(self.distros))
479,061
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,062
def privmsg(self, irc, msg, user): channel = self.__getChannel(msg.args[0]) text = self.space_re.subn(' ', msg.args[1].strip())[0] if text[0] == self.registryValue("prefixchar"): text = text[1:].strip() if user and text[0] in str(conf.supybot.reply.whenAddressedBy.get('chars')): return (cmd, rest) = (text.split(' ', 1) + [None])[:2] if cmd not in ("find", "info"): return if not rest: return (term, rest) = (rest.split(' ', 1) + [None])[:2] if cmd == "find": self.real_find(irc, msg, [], term, rest) else: self.real_info(irc, msg, [], term, rest)
def privmsg(self, irc, msg, user): channel = self.__getChannel(msg.args[0]) text = self.space_re.subn(' ', msg.args[1].strip())[0] if text[0] == self.registryValue("prefixchar"): text = text[1:].strip() if user and text[0] in list(conf.supybot.reply.whenAddressedBy.chars()): return (cmd, rest) = (text.split(' ', 1) + [None])[:2] if cmd not in ("find", "info"): return if not rest: return (term, rest) = (rest.split(' ', 1) + [None])[:2] if cmd == "find": self.real_find(irc, msg, [], term, rest) else: self.real_info(irc, msg, [], term, rest)
479,063
def privmsg(self, irc, msg, user): channel = self.__getChannel(msg.args[0]) text = self.space_re.subn(' ', msg.args[1].strip())[0] if text[0] == self.registryValue("prefixchar"): text = text[1:].strip() if user and text[0] in str(conf.supybot.reply.whenAddressedBy.get('chars')): return (cmd, rest) = (text.split(' ', 1) + [None])[:2] if cmd not in ("find", "info"): return if not rest: return (term, rest) = (rest.split(' ', 1) + [None])[:2] if cmd == "find": self.real_find(irc, msg, [], term, rest) else: self.real_info(irc, msg, [], term, rest)
def privmsg(self, irc, msg, user): channel = self.__getChannel(msg.args[0]) text = self.space_re.subn(' ', msg.args[1].strip())[0] if text[0] == self.registryValue("prefixchar"): text = text[1:].strip() if user and text[0] in str(conf.supybot.reply.whenAddressedBy.get('chars')): return (cmd, rest) = (text.split(' ', 1) + [None])[:2] if cmd not in my_commands: return if not rest: return (term, rest) = (rest.split(' ', 1) + [None])[:2] if cmd == "find": self.real_find(irc, msg, [], term, rest) else: self.real_info(irc, msg, [], term, rest)
479,064
def chanmsg(self, irc, msg, user): channel = self.__getChannel(msg.args[0]) text = self.space_re.subn(' ', msg.args[1].strip())[0] if text[0] != self.registryValue("prefixchar", channel): return text = text[1:] (cmd, rest) = (text.split(' ', 1) + [None])[:2] if cmd not in ("find", "info"): return if not rest: return (term, rest) = (rest.split(' ', 1) + [None])[:2] if cmd == "find": self.real_find(irc, msg, [], term, rest) else: self.real_info(irc, msg, [], term, rest)
def chanmsg(self, irc, msg, user): channel = self.__getChannel(msg.args[0]) text = self.space_re.subn(' ', msg.args[1].strip())[0] if text[0] != self.registryValue("prefixchar", channel): return text = text[1:] (cmd, rest) = (text.split(' ', 1) + [None])[:2] if cmd not in my_commands: return if not rest: return (term, rest) = (rest.split(' ', 1) + [None])[:2] if cmd == "find": self.real_find(irc, msg, [], term, rest) else: self.real_info(irc, msg, [], term, rest)
479,065
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) channel = self.__getChannel(msg.args[0]) reply_chars = tuple([self.registryValue("prefixchar", channel)] + list(conf.supybot.reply.whenAddressedBy.chars.get(channel))) my_commands = self.listCommands() if user if not channel and text[0] == self.registryValue("prefixchar") msg.args = (msg.args[0], text[1:]) return msg if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
479,066
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in reply_chars: return msg if not text[1:5] in ("info", "find"): return msg
479,067
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in my_commands: return msg
479,068
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
479,069
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
479,070
def makeSource(release): return """deb http://archive.ubuntu.com/ubuntu/ %s main restricted universe multiverse
def makeSource(release): return """deb http://archive.ubuntu.com/ubuntu/ %s main restricted universe multiverse
479,071
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,072
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,073
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,074
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,075
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,076
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,077
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,078
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,079
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,080
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,081
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,082
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default)
479,083
def real_info(self, irc, msg, args, package, release): """<package> [<release>]
def real_info(self, irc, msg, args, package, release): """<package> [<release>]
479,084
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg
479,085
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) channel = self.__getChannel(msg.args[0]) reply_chars = tuple([self.registryValue("prefixchar", channel)] + list(conf.supybot.reply.whenAddressedBy.chars.get(channel))) my_commands = self.listCommands() if user if not channel and text[0] == self.registryValue("prefixchar") msg.args = (msg.args[0], text[1:]) return msg if channel: if text[0] not in reply_chars: return msg if not text[1:5] in my_commands: return msg
def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) channel = self.__getChannel(msg.args[0]) reply_chars = tuple([self.registryValue("prefixchar", channel)] + list(conf.supybot.reply.whenAddressedBy.chars.get(channel))) my_commands = self.listCommands() if user: if not channel and text[0] == self.registryValue("prefixchar"): msg.args = (msg.args[0], text[1:]) return msg if channel: if text[0] not in reply_chars: return msg if not text[1:5] in my_commands: return msg
479,086
def setUp(cls): fiveconfigure.debug_mode = True ztc.installPackage(zopyx.imgmap) fiveconfigure.debug_mode = False
def setUp(cls): fiveconfigure.debug_mode = True ztc.installPackage(zopyx.tinymceplugins.imgmap) fiveconfigure.debug_mode = False
479,087
def test_suite(): return unittest.TestSuite([ # Unit tests #doctestunit.DocFileSuite( # 'README.txt', package='zopyx.imgmap', # setUp=testing.setUp, tearDown=testing.tearDown), #doctestunit.DocTestSuite( # module='zopyx.imgmap.mymodule', # setUp=testing.setUp, tearDown=testing.tearDown), # Integration tests that use PloneTestCase #ztc.ZopeDocFileSuite( # 'README.txt', package='zopyx.imgmap', # test_class=TestCase), #ztc.FunctionalDocFileSuite( # 'browser.txt', package='zopyx.imgmap', # test_class=TestCase), ])
def test_suite(): return unittest.TestSuite([ # Unit tests #doctestunit.DocFileSuite( # 'README.txt', package='zopyx.imgmap', # setUp=testing.setUp, tearDown=testing.tearDown), #doctestunit.DocTestSuite( # module='zopyx.imgmap.mymodule', # setUp=testing.setUp, tearDown=testing.tearDown), # Integration tests that use PloneTestCase #ztc.ZopeDocFileSuite( # 'README.txt', package='zopyx.imgmap', # test_class=TestCase), #ztc.FunctionalDocFileSuite( # 'browser.txt', package='zopyx.imgmap', # test_class=TestCase), ])
479,088
def test_suite(): return unittest.TestSuite([ # Unit tests #doctestunit.DocFileSuite( # 'README.txt', package='zopyx.imgmap', # setUp=testing.setUp, tearDown=testing.tearDown), #doctestunit.DocTestSuite( # module='zopyx.imgmap.mymodule', # setUp=testing.setUp, tearDown=testing.tearDown), # Integration tests that use PloneTestCase #ztc.ZopeDocFileSuite( # 'README.txt', package='zopyx.imgmap', # test_class=TestCase), #ztc.FunctionalDocFileSuite( # 'browser.txt', package='zopyx.imgmap', # test_class=TestCase), ])
def test_suite(): return unittest.TestSuite([ # Unit tests #doctestunit.DocFileSuite( # 'README.txt', package='zopyx.imgmap', # setUp=testing.setUp, tearDown=testing.tearDown), #doctestunit.DocTestSuite( # module='zopyx.imgmap.mymodule', # setUp=testing.setUp, tearDown=testing.tearDown), # Integration tests that use PloneTestCase #ztc.ZopeDocFileSuite( # 'README.txt', package='zopyx.imgmap', # test_class=TestCase), #ztc.FunctionalDocFileSuite( # 'browser.txt', package='zopyx.imgmap', # test_class=TestCase), ])
479,089
def test_suite(): return unittest.TestSuite([ # Unit tests #doctestunit.DocFileSuite( # 'README.txt', package='zopyx.imgmap', # setUp=testing.setUp, tearDown=testing.tearDown), #doctestunit.DocTestSuite( # module='zopyx.imgmap.mymodule', # setUp=testing.setUp, tearDown=testing.tearDown), # Integration tests that use PloneTestCase #ztc.ZopeDocFileSuite( # 'README.txt', package='zopyx.imgmap', # test_class=TestCase), #ztc.FunctionalDocFileSuite( # 'browser.txt', package='zopyx.imgmap', # test_class=TestCase), ])
def test_suite(): return unittest.TestSuite([ # Unit tests #doctestunit.DocFileSuite( # 'README.txt', package='zopyx.imgmap', # setUp=testing.setUp, tearDown=testing.tearDown), #doctestunit.DocTestSuite( # module='zopyx.imgmap.mymodule', # setUp=testing.setUp, tearDown=testing.tearDown), # Integration tests that use PloneTestCase #ztc.ZopeDocFileSuite( # 'README.txt', package='zopyx.imgmap', # test_class=TestCase), #ztc.FunctionalDocFileSuite( # 'browser.txt', package='zopyx.imgmap', # test_class=TestCase), ])
479,090
def test_suite(): return unittest.TestSuite([ # Unit tests #doctestunit.DocFileSuite( # 'README.txt', package='zopyx.imgmap', # setUp=testing.setUp, tearDown=testing.tearDown), #doctestunit.DocTestSuite( # module='zopyx.imgmap.mymodule', # setUp=testing.setUp, tearDown=testing.tearDown), # Integration tests that use PloneTestCase #ztc.ZopeDocFileSuite( # 'README.txt', package='zopyx.imgmap', # test_class=TestCase), #ztc.FunctionalDocFileSuite( # 'browser.txt', package='zopyx.imgmap', # test_class=TestCase), ])
def test_suite(): return unittest.TestSuite([ # Unit tests #doctestunit.DocFileSuite( # 'README.txt', package='zopyx.imgmap', # setUp=testing.setUp, tearDown=testing.tearDown), #doctestunit.DocTestSuite( # module='zopyx.imgmap.mymodule', # setUp=testing.setUp, tearDown=testing.tearDown), # Integration tests that use PloneTestCase #ztc.ZopeDocFileSuite( # 'README.txt', package='zopyx.imgmap', # test_class=TestCase), #ztc.FunctionalDocFileSuite( # 'browser.txt', package='zopyx.imgmap', # test_class=TestCase), ])
479,091
def __call__(self):
def __call__(self):
479,092
def __call__(self):
def __call__(self):
479,093
def __init__(self, parent=None): QWidget.__init__(self, parent)
def __init__(self, parent=None): QWidget.__init__(self, parent)
479,094
def update_label_buttons(self): label_vlayout = self.create_choice_list("Labels") self.label_buttongroup = QButtonGroup() for label_name in self.label_names: button = QPushButton(label_name) button.setFlat(True) button.setCheckable(True) button.clicked.connect(self.clickedLabelButton) label_vlayout.addWidget(button) self.label_buttongroup.addButton(button) if label_name == self.last_checked_label: button.setChecked(True)
def update_label_buttons(self): label_vlayout = self.create_choice_list("Labels") self.label_buttongroup = QButtonGroup() for label_name in self.label_names: button = QPushButton(label_name) button.setFlat(True) button.setCheckable(True) button.clicked.connect(self.clickedLabelButton) label_vlayout.addWidget(button) self.label_buttongroup.addButton(button) if label_name == self.last_checked_label: button.setChecked(True)
479,095
def update_label_buttons(self): label_vlayout = self.create_choice_list("Labels") self.label_buttongroup = QButtonGroup() for label_name in self.label_names: button = QPushButton(label_name) button.setFlat(True) button.setCheckable(True) button.clicked.connect(self.clickedLabelButton) label_vlayout.addWidget(button) self.label_buttongroup.addButton(button) if label_name == self.last_checked_label: button.setChecked(True)
def update_label_buttons(self): label_vlayout = self.create_choice_list("Labels") self.label_buttongroup = QButtonGroup() for label_name in self.label_names: button = QPushButton(label_name) button.setFlat(True) button.setCheckable(True) button.clicked.connect(self.clickedLabelButton) label_vlayout.addWidget(button) self.label_buttongroup.addButton(button) if label_name == self.last_checked_label: button.setChecked(True)
479,096
def update_buttons(self): layout = self.hlayout.takeAt(1) for button in self.property_buttons: button.hide() del button
def update_buttons(self): layout = self.hlayout.takeAt(1) for button in self.property_buttons: button.hide() del button
479,097
def update_buttons(self): layout = self.hlayout.takeAt(1) for button in self.property_buttons: button.hide() del button
def update_buttons(self): layout = self.hlayout.takeAt(1) for button in self.property_buttons: button.hide() del button
479,098
def get_checked_label_button(self): return self.label_buttongroup.checkedButton()
def get_checked_label_button(self): return self.label_buttongroup.checkedButton()
479,099