Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def populateLists(self):
- """
- Runs the check functions and adds items to the list if needed
- """
- self.buttonHandlers = []
- self.CheckFunctions = (('objects', trans.string('Diag', 1), DiagnosticToolDialog.UnusedTilesets, False),
- ('objects', trans.string('Diag', 2), DiagnosticToolDialog.ObjsInTileset, True),
- ('sprites', trans.string('Diag', 3), DiagnosticToolDialog.CrashSprites, False),
- ('sprites', trans.string('Diag', 4), DiagnosticToolDialog.CrashSpriteSettings, True),
- ('sprites', trans.string('Diag', 5), DiagnosticToolDialog.TooManySprites, False),
- ('entrances', trans.string('Diag', 6), DiagnosticToolDialog.DuplicateEntranceIDs, True),
- ('entrances', trans.string('Diag', 7), DiagnosticToolDialog.NoStartEntrance, True),
- ('entrances', trans.string('Diag', 8), DiagnosticToolDialog.EntranceTooCloseToZoneEdge, False),
- ('entrances', trans.string('Diag', 9), DiagnosticToolDialog.EntranceOutsideOfZone, False),
- ('zones', trans.string('Diag', 10), DiagnosticToolDialog.TooManyZones, True),
- ('zones', trans.string('Diag', 11), DiagnosticToolDialog.NoZones, True),
- ('zones', trans.string('Diag', 12), DiagnosticToolDialog.ZonesTooClose, True),
- ('zones', trans.string('Diag', 13), DiagnosticToolDialog.ZonesTooCloseToAreaEdges, True),
- ('zones', trans.string('Diag', 14), DiagnosticToolDialog.BiasNotEnabled, False),
- ('zones', trans.string('Diag', 15), DiagnosticToolDialog.ZonesTooBig, True),
- ('background', trans.string('Diag', 16), DiagnosticToolDialog.UnusedBackgrounds, False),
- )
- foundAnything = False
- foundCritical = False
- print("Beginning of populateLists")
- for ico, desc, fxn, isCritical in self.CheckFunctions:
- if fxn('c'):
- foundAnything = True
- print("fxn('c') worked")
- if isCritical: foundCritical = True
- item.setText(desc)
- if isCritical:
- self.diagnosticIcon.setIcon(GetIcon('autodiagnosticbad'))
- print("Uh oh!")
- else:
- self.diagnosticIcon.setIcon(GetIcon('autodiagnosticgood'))
- item.fix = fxn
- print("Yay!")
- print("after the for statement")
- '''if foundCritical: True, len(self.buttonHandlers)# self.diagnosticIcon.setIcon(GetIcon('autodiagnosticbad'))
- elif foundAnything: False, len(self.buttonHandlers) #self.diagnosticIcon.setIcon(GetIcon('autodiagnosticwarning'))
- return None, len(self.buttonHandlers)'''
- if foundCritical: return True, len(self.buttonHandlers)
- elif foundAnything: return False, len(self.buttonHandlers)
- return None, len(self.buttonHandlers)
- print("End of populateLists")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement