Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.57 KB | None | 0 0
  1.     def populateLists(self):
  2.         """
  3.         Runs the check functions and adds items to the list if needed
  4.         """
  5.         self.buttonHandlers = []
  6.         self.CheckFunctions = (('objects', trans.string('Diag', 1), DiagnosticToolDialog.UnusedTilesets, False),
  7.                        ('objects', trans.string('Diag', 2), DiagnosticToolDialog.ObjsInTileset, True),
  8.                        ('sprites', trans.string('Diag', 3), DiagnosticToolDialog.CrashSprites, False),
  9.                        ('sprites', trans.string('Diag', 4), DiagnosticToolDialog.CrashSpriteSettings, True),
  10.                        ('sprites', trans.string('Diag', 5), DiagnosticToolDialog.TooManySprites, False),
  11.                        ('entrances', trans.string('Diag', 6), DiagnosticToolDialog.DuplicateEntranceIDs, True),
  12.                        ('entrances', trans.string('Diag', 7), DiagnosticToolDialog.NoStartEntrance, True),
  13.                        ('entrances', trans.string('Diag', 8), DiagnosticToolDialog.EntranceTooCloseToZoneEdge, False),
  14.                        ('entrances', trans.string('Diag', 9), DiagnosticToolDialog.EntranceOutsideOfZone, False),
  15.                        ('zones', trans.string('Diag', 10), DiagnosticToolDialog.TooManyZones, True),
  16.                        ('zones', trans.string('Diag', 11), DiagnosticToolDialog.NoZones, True),
  17.                        ('zones', trans.string('Diag', 12), DiagnosticToolDialog.ZonesTooClose, True),
  18.                        ('zones', trans.string('Diag', 13), DiagnosticToolDialog.ZonesTooCloseToAreaEdges, True),
  19.                        ('zones', trans.string('Diag', 14), DiagnosticToolDialog.BiasNotEnabled, False),
  20.                        ('zones', trans.string('Diag', 15), DiagnosticToolDialog.ZonesTooBig, True),
  21.                        ('background', trans.string('Diag', 16), DiagnosticToolDialog.UnusedBackgrounds, False),
  22.                        )
  23.  
  24.         foundAnything = False
  25.         foundCritical = False
  26.         print("Beginning of populateLists")
  27.         for ico, desc, fxn, isCritical in self.CheckFunctions:
  28.             if fxn('c'):
  29.  
  30.                 foundAnything = True
  31.                 print("fxn('c') worked")
  32.                 if isCritical: foundCritical = True
  33.  
  34.                 item.setText(desc)
  35.                 if isCritical:
  36.                     self.diagnosticIcon.setIcon(GetIcon('autodiagnosticbad'))
  37.                     print("Uh oh!")
  38.                 else:          
  39.                     self.diagnosticIcon.setIcon(GetIcon('autodiagnosticgood'))
  40.                     item.fix = fxn
  41.                     print("Yay!")
  42.         print("after the for statement")
  43.  
  44.         '''if foundCritical: True, len(self.buttonHandlers)#   self.diagnosticIcon.setIcon(GetIcon('autodiagnosticbad'))
  45.         elif foundAnything: False, len(self.buttonHandlers)   #self.diagnosticIcon.setIcon(GetIcon('autodiagnosticwarning'))
  46.         return None, len(self.buttonHandlers)'''
  47.         if foundCritical: return True, len(self.buttonHandlers)
  48.         elif foundAnything: return False, len(self.buttonHandlers)
  49.         return None, len(self.buttonHandlers)
  50.         print("End of populateLists")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement