Browse Source

formatting

Dave Schuyler 20 years ago
parent
commit
a2aa9486d1
40 changed files with 1027 additions and 1027 deletions
  1. 1 1
      direct/src/extensions/Mat3-extensions.py
  2. 13 13
      direct/src/extensions_native/CInterval_extensions.py
  3. 125 125
      direct/src/extensions_native/NodePath_extensions.py
  4. 1 1
      direct/src/extensions_native/VBase3_extensions.py
  5. 1 1
      direct/src/extensions_native/VBase4_extensions.py
  6. 6 6
      direct/src/extensions_native/extension_native_helpers.py
  7. 7 7
      direct/src/ffi/FFIExternalObject.py
  8. 21 21
      direct/src/ffi/FFIOverload.py
  9. 182 182
      direct/src/leveleditor/LevelEditor.py
  10. 10 10
      direct/src/leveleditor/PieMenu.py
  11. 5 5
      direct/src/particles/ParticleEffect.py
  12. 8 8
      direct/src/particles/Particles.py
  13. 13 13
      direct/src/particles/SpriteParticleRendererExt.py
  14. 35 35
      direct/src/pyinst/Builder.py
  15. 20 20
      direct/src/pyinst/archive.py
  16. 8 8
      direct/src/pyinst/archive_rt.py
  17. 18 18
      direct/src/pyinst/bindepend.py
  18. 2 2
      direct/src/pyinst/mkarchive.py
  19. 37 37
      direct/src/pyinst/resource.py
  20. 4 4
      direct/src/showbase/Pool.py
  21. 5 5
      direct/src/showbase/RandomNumGen.py
  22. 13 13
      direct/src/showbase/ShadowDemo.py
  23. 36 36
      direct/src/showbase/Transitions.py
  24. 6 6
      direct/src/showbase/pandaSqueezeTool.py
  25. 7 7
      direct/src/showbase/pandaSqueezer.py
  26. 10 10
      direct/src/task/Task.py
  27. 14 14
      direct/src/tkpanels/AnimPanel.py
  28. 42 42
      direct/src/tkpanels/DirectSessionPanel.py
  29. 26 26
      direct/src/tkpanels/FSMInspector.py
  30. 54 54
      direct/src/tkpanels/MopathRecorder.py
  31. 101 101
      direct/src/tkpanels/ParticlePanel.py
  32. 36 36
      direct/src/tkwidgets/AppShell.py
  33. 28 28
      direct/src/tkwidgets/Dial.py
  34. 27 27
      direct/src/tkwidgets/EntryScale.py
  35. 22 22
      direct/src/tkwidgets/Floater.py
  36. 9 9
      direct/src/tkwidgets/SceneGraphExplorer.py
  37. 15 15
      direct/src/tkwidgets/Slider.py
  38. 34 34
      direct/src/tkwidgets/Valuator.py
  39. 16 16
      direct/src/tkwidgets/VectorWidgets.py
  40. 9 9
      direct/src/tkwidgets/WidgetPropertiesDialog.py

+ 1 - 1
direct/src/extensions/Mat3-extensions.py

@@ -6,7 +6,7 @@
 
 
     def __repr__(self):
     def __repr__(self):
         return '%s(\n%s,\n%s,\n%s)' % (
         return '%s(\n%s,\n%s,\n%s)' % (
-            self.__class__.__name__,self.getRow(0).pPrintValues(), self.getRow(1).pPrintValues(), self.getRow(2).pPrintValues())
+            self.__class__.__name__, self.getRow(0).pPrintValues(), self.getRow(1).pPrintValues(), self.getRow(2).pPrintValues())
 
 
     def pPrintValues(self):
     def pPrintValues(self):
         """
         """

+ 13 - 13
direct/src/extensions_native/CInterval_extensions.py

@@ -5,7 +5,7 @@ from libdirect import *
 
 
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 notify = directNotify.newCategory("Interval")
 notify = directNotify.newCategory("Interval")
-Dtool_ObjectToDict(CInterval,"notify", notify)        
+Dtool_ObjectToDict(CInterval,"notify", notify)
 del notify
 del notify
 #####################################################################
 #####################################################################
 def setT(self, t):
 def setT(self, t):
@@ -16,26 +16,26 @@ def setT(self, t):
     self.privPostEvent()
     self.privPostEvent()
 
 
 Dtool_ObjectToDict(CInterval, "setT_Old", CInterval.setT)
 Dtool_ObjectToDict(CInterval, "setT_Old", CInterval.setT)
-Dtool_funcToMethod(setT, CInterval)        
+Dtool_funcToMethod(setT, CInterval)
 del setT
 del setT
 #####################################################################
 #####################################################################
-                       
+
 def play(self, t0 = 0.0, duration = None, scale = 1.0):
 def play(self, t0 = 0.0, duration = None, scale = 1.0):
         self.notify.error("using deprecated CInterval.play() interface")
         self.notify.error("using deprecated CInterval.play() interface")
         if duration:  # None or 0 implies full length
         if duration:  # None or 0 implies full length
             self.start(t0, t0 + duration, scale)
             self.start(t0, t0 + duration, scale)
         else:
         else:
             self.start(t0, -1, scale)
             self.start(t0, -1, scale)
-            
-Dtool_funcToMethod(play, CInterval)        
+
+Dtool_funcToMethod(play, CInterval)
 del play
 del play
 #####################################################################
 #####################################################################
 
 
 def stop(self):
 def stop(self):
         self.notify.error("using deprecated CInterval.stop() interface")
         self.notify.error("using deprecated CInterval.stop() interface")
         self.finish()
         self.finish()
-            
-Dtool_funcToMethod(stop, CInterval)        
+
+Dtool_funcToMethod(stop, CInterval)
 del stop
 del stop
 #####################################################################
 #####################################################################
 
 
@@ -43,7 +43,7 @@ def setFinalT(self):
         self.notify.error("using deprecated CInterval.setFinalT() interface")
         self.notify.error("using deprecated CInterval.setFinalT() interface")
         self.finish()
         self.finish()
 
 
-Dtool_funcToMethod(setFinalT, CInterval)        
+Dtool_funcToMethod(setFinalT, CInterval)
 del setFinalT
 del setFinalT
 #####################################################################
 #####################################################################
 
 
@@ -55,7 +55,7 @@ def privPostEvent(self):
             for func in self.setTHooks:
             for func in self.setTHooks:
                 func(t)
                 func(t)
 
 
-Dtool_funcToMethod(privPostEvent, CInterval)        
+Dtool_funcToMethod(privPostEvent, CInterval)
 del privPostEvent
 del privPostEvent
 #####################################################################
 #####################################################################
 
 
@@ -70,7 +70,7 @@ def popupControls(self, tl = None):
             tl = Toplevel()
             tl = Toplevel()
             tl.title('Interval Controls')
             tl.title('Interval Controls')
         outerFrame = Frame(tl)
         outerFrame = Frame(tl)
-        def entryScaleCommand(t,s=self):
+        def entryScaleCommand(t, s=self):
             s.setT(t)
             s.setT(t)
             s.pause()
             s.pause()
         self.es = es = EntryScale.EntryScale(
         self.es = es = EntryScale.EntryScale(
@@ -91,7 +91,7 @@ def popupControls(self, tl = None):
         # Stop/play buttons
         # Stop/play buttons
         def doPlay(s=self, es=es):
         def doPlay(s=self, es=es):
             s.resume(es.get())
             s.resume(es.get())
-                       
+
         stop = Button(bf, text = 'Stop',
         stop = Button(bf, text = 'Stop',
                       command = lambda s=self: s.pause())
                       command = lambda s=self: s.pause())
         play = Button(
         play = Button(
@@ -105,7 +105,7 @@ def popupControls(self, tl = None):
         bf.pack(expand = 1, fill = X)
         bf.pack(expand = 1, fill = X)
         outerFrame.pack(expand = 1, fill = X)
         outerFrame.pack(expand = 1, fill = X)
         # Add function to update slider during setT calls
         # Add function to update slider during setT calls
-        def update(t,es=es):
+        def update(t, es=es):
             es.set(t, fCommand = 0)
             es.set(t, fCommand = 0)
         if not hasattr(self, "setTHooks"):
         if not hasattr(self, "setTHooks"):
             self.setTHooks = []
             self.setTHooks = []
@@ -117,6 +117,6 @@ def popupControls(self, tl = None):
                 s.setTHooks.remove(u)
                 s.setTHooks.remove(u)
         tl.bind('<Destroy>', onDestroy)
         tl.bind('<Destroy>', onDestroy)
 
 
-Dtool_funcToMethod(popupControls, CInterval)        
+Dtool_funcToMethod(popupControls, CInterval)
 del popupControls
 del popupControls
 #####################################################################
 #####################################################################

+ 125 - 125
direct/src/extensions_native/NodePath_extensions.py

@@ -3,7 +3,7 @@ from extension_native_helpers import *
 from libpanda import *
 from libpanda import *
 
 
 ####################################################################
 ####################################################################
-#Dtool_funcToMethod(func, class)        
+#Dtool_funcToMethod(func, class)
 #del func
 #del func
 #####################################################################
 #####################################################################
 
 
@@ -17,7 +17,7 @@ def id(self):
         """Returns a unique id identifying the NodePath instance"""
         """Returns a unique id identifying the NodePath instance"""
         return self.getKey()
         return self.getKey()
 
 
-Dtool_funcToMethod(id, NodePath)        
+Dtool_funcToMethod(id, NodePath)
 del id
 del id
 #####################################################################
 #####################################################################
 
 
@@ -30,7 +30,7 @@ def getChildrenAsList(self):
         """Converts a node path's child NodePathCollection into a list"""
         """Converts a node path's child NodePathCollection into a list"""
         return self.getChildren().asList()
         return self.getChildren().asList()
 
 
-Dtool_funcToMethod(getChildrenAsList, NodePath)        
+Dtool_funcToMethod(getChildrenAsList, NodePath)
 del getChildrenAsList
 del getChildrenAsList
 #####################################################################
 #####################################################################
 
 
@@ -38,7 +38,7 @@ def printChildren(self):
         """Prints out the children of the bottom node of a node path"""
         """Prints out the children of the bottom node of a node path"""
         for child in self.getChildrenAsList():
         for child in self.getChildrenAsList():
             print child.getName()
             print child.getName()
-Dtool_funcToMethod(printChildren, NodePath)        
+Dtool_funcToMethod(printChildren, NodePath)
 del printChildren
 del printChildren
 #####################################################################
 #####################################################################
 
 
@@ -46,7 +46,7 @@ def removeChildren(self):
         """Deletes the children of the bottom node of a node path"""
         """Deletes the children of the bottom node of a node path"""
         for child in self.getChildrenAsList():
         for child in self.getChildrenAsList():
             child.removeNode()
             child.removeNode()
-Dtool_funcToMethod(removeChildren, NodePath)        
+Dtool_funcToMethod(removeChildren, NodePath)
 del removeChildren
 del removeChildren
 #####################################################################
 #####################################################################
 
 
@@ -58,16 +58,16 @@ def toggleVis(self):
         else:
         else:
             self.hide()
             self.hide()
             return 0
             return 0
-Dtool_funcToMethod(toggleVis, NodePath)        
+Dtool_funcToMethod(toggleVis, NodePath)
 del toggleVis
 del toggleVis
 #####################################################################
 #####################################################################
-            
+
 def showSiblings(self):
 def showSiblings(self):
         """Show all the siblings of a node path"""
         """Show all the siblings of a node path"""
         for sib in self.getParent().getChildrenAsList():
         for sib in self.getParent().getChildrenAsList():
             if sib.node() != self.node():
             if sib.node() != self.node():
                 sib.show()
                 sib.show()
-Dtool_funcToMethod(showSiblings, NodePath)        
+Dtool_funcToMethod(showSiblings, NodePath)
 del showSiblings
 del showSiblings
 #####################################################################
 #####################################################################
 
 
@@ -76,7 +76,7 @@ def hideSiblings(self):
         for sib in self.getParent().getChildrenAsList():
         for sib in self.getParent().getChildrenAsList():
             if sib.node() != self.node():
             if sib.node() != self.node():
                 sib.hide()
                 sib.hide()
-Dtool_funcToMethod(hideSiblings, NodePath)        
+Dtool_funcToMethod(hideSiblings, NodePath)
 del hideSiblings
 del hideSiblings
 #####################################################################
 #####################################################################
 
 
@@ -85,7 +85,7 @@ def showAllDescendants(self):
         self.show()
         self.show()
         for child in self.getChildrenAsList():
         for child in self.getChildrenAsList():
             child.showAllDescendants()
             child.showAllDescendants()
-Dtool_funcToMethod(showAllDescendants, NodePath)        
+Dtool_funcToMethod(showAllDescendants, NodePath)
 del showAllDescendants
 del showAllDescendants
 #####################################################################
 #####################################################################
 
 
@@ -93,7 +93,7 @@ def isolate(self):
         """Show the node path and hide its siblings"""
         """Show the node path and hide its siblings"""
         self.showAllDescendants()
         self.showAllDescendants()
         self.hideSiblings()
         self.hideSiblings()
-Dtool_funcToMethod(isolate, NodePath)        
+Dtool_funcToMethod(isolate, NodePath)
 del isolate
 del isolate
 #####################################################################
 #####################################################################
 
 
@@ -104,7 +104,7 @@ def remove(self):
         messenger.send('preRemoveNodePath', [self])
         messenger.send('preRemoveNodePath', [self])
         # Remove nodePath
         # Remove nodePath
         self.removeNode()
         self.removeNode()
-Dtool_funcToMethod(remove, NodePath)        
+Dtool_funcToMethod(remove, NodePath)
 del remove
 del remove
 #####################################################################
 #####################################################################
 
 
@@ -118,7 +118,7 @@ def lsNames(self):
             print type + "  " + name
             print type + "  " + name
             self.lsNamesRecurse()
             self.lsNamesRecurse()
 
 
-Dtool_funcToMethod(lsNames, NodePath)        
+Dtool_funcToMethod(lsNames, NodePath)
 del lsNames
 del lsNames
 #####################################################################
 #####################################################################
 def lsNamesRecurse(self, indentString=' '):
 def lsNamesRecurse(self, indentString=' '):
@@ -129,7 +129,7 @@ def lsNamesRecurse(self, indentString=' '):
             print indentString + type + "  " + name
             print indentString + type + "  " + name
             nodePath.lsNamesRecurse(indentString + " ")
             nodePath.lsNamesRecurse(indentString + " ")
 
 
-Dtool_funcToMethod(lsNamesRecurse, NodePath)        
+Dtool_funcToMethod(lsNamesRecurse, NodePath)
 del lsNamesRecurse
 del lsNamesRecurse
 #####################################################################
 #####################################################################
 def reverseLsNames(self):
 def reverseLsNames(self):
@@ -142,7 +142,7 @@ def reverseLsNames(self):
             print indentString + type + "  " + name
             print indentString + type + "  " + name
             indentString = indentString + " "
             indentString = indentString + " "
 
 
-Dtool_funcToMethod(reverseLsNames, NodePath)        
+Dtool_funcToMethod(reverseLsNames, NodePath)
 del reverseLsNames
 del reverseLsNames
 #####################################################################
 #####################################################################
 def getAncestry(self):
 def getAncestry(self):
@@ -155,16 +155,16 @@ def getAncestry(self):
         else:
         else:
             return [self]
             return [self]
 
 
-Dtool_funcToMethod(getAncestry, NodePath)        
+Dtool_funcToMethod(getAncestry, NodePath)
 del getAncestry
 del getAncestry
 #####################################################################
 #####################################################################
 def getTightBounds(self):
 def getTightBounds(self):
         from pandac.PandaModules import Point3
         from pandac.PandaModules import Point3
         v1 = Point3.Point3(0)
         v1 = Point3.Point3(0)
         v2 = Point3.Point3(0)
         v2 = Point3.Point3(0)
-        self.calcTightBounds(v1,v2)
+        self.calcTightBounds(v1, v2)
         return v1, v2
         return v1, v2
-Dtool_funcToMethod(getTightBounds, NodePath)        
+Dtool_funcToMethod(getTightBounds, NodePath)
 del getTightBounds
 del getTightBounds
 #####################################################################
 #####################################################################
 
 
@@ -191,13 +191,13 @@ def pPrintString(self, other = None):
                 otherString = '\n'
                 otherString = '\n'
             return (
             return (
                 "%s = {"%(self.getName()) +
                 "%s = {"%(self.getName()) +
-                otherString + 
+                otherString +
                 "  'Pos':   (%s),\n" % pos.pPrintValues() +
                 "  'Pos':   (%s),\n" % pos.pPrintValues() +
                 "  'Hpr':   (%s),\n" % hpr.pPrintValues() +
                 "  'Hpr':   (%s),\n" % hpr.pPrintValues() +
                 "  'Scale': (%s),\n" % scale.pPrintValues() +
                 "  'Scale': (%s),\n" % scale.pPrintValues() +
                 "  'Shear': (%s),\n" % shear.pPrintValues() +
                 "  'Shear': (%s),\n" % shear.pPrintValues() +
                 "}")
                 "}")
-Dtool_funcToMethod(pPrintString, NodePath)        
+Dtool_funcToMethod(pPrintString, NodePath)
 del pPrintString
 del pPrintString
 #####################################################################
 #####################################################################
 
 
@@ -210,12 +210,12 @@ def printPos(self, other = None, sd = 2):
         else:
         else:
             pos = self.getPos()
             pos = self.getPos()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setPos(' + otherString + 
+        print (self.getName() + '.setPos(' + otherString +
                formatString % pos[0] + ', ' +
                formatString % pos[0] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[2] +
                formatString % pos[2] +
                ')\n')
                ')\n')
-Dtool_funcToMethod(printPos, NodePath)        
+Dtool_funcToMethod(printPos, NodePath)
 del printPos
 del printPos
 #####################################################################
 #####################################################################
 
 
@@ -228,12 +228,12 @@ def printHpr(self, other = None, sd = 2):
         else:
         else:
             hpr = self.getHpr()
             hpr = self.getHpr()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setHpr(' + otherString + 
+        print (self.getName() + '.setHpr(' + otherString +
                formatString % hpr[0] + ', ' +
                formatString % hpr[0] + ', ' +
                formatString % hpr[1] + ', ' +
                formatString % hpr[1] + ', ' +
                formatString % hpr[2] +
                formatString % hpr[2] +
                ')\n')
                ')\n')
-Dtool_funcToMethod(printHpr, NodePath)        
+Dtool_funcToMethod(printHpr, NodePath)
 del printHpr
 del printHpr
 #####################################################################
 #####################################################################
 
 
@@ -246,13 +246,13 @@ def printScale(self, other = None, sd = 2):
         else:
         else:
             scale = self.getScale()
             scale = self.getScale()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setScale(' + otherString + 
+        print (self.getName() + '.setScale(' + otherString +
                formatString % scale[0] + ', ' +
                formatString % scale[0] + ', ' +
                formatString % scale[1] + ', ' +
                formatString % scale[1] + ', ' +
                formatString % scale[2] +
                formatString % scale[2] +
                ')\n')
                ')\n')
 
 
-Dtool_funcToMethod(printScale, NodePath)        
+Dtool_funcToMethod(printScale, NodePath)
 del printScale
 del printScale
 #####################################################################
 #####################################################################
 def printPosHpr(self, other = None, sd = 2):
 def printPosHpr(self, other = None, sd = 2):
@@ -266,7 +266,7 @@ def printPosHpr(self, other = None, sd = 2):
             pos = self.getPos()
             pos = self.getPos()
             hpr = self.getHpr()
             hpr = self.getHpr()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setPosHpr(' + otherString + 
+        print (self.getName() + '.setPosHpr(' + otherString +
                formatString % pos[0] + ', ' +
                formatString % pos[0] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[2] + ', ' +
                formatString % pos[2] + ', ' +
@@ -275,7 +275,7 @@ def printPosHpr(self, other = None, sd = 2):
                formatString % hpr[2] +
                formatString % hpr[2] +
                ')\n')
                ')\n')
 
 
-Dtool_funcToMethod(printPosHpr, NodePath)        
+Dtool_funcToMethod(printPosHpr, NodePath)
 del printPosHpr
 del printPosHpr
 #####################################################################
 #####################################################################
 def printPosHprScale(self, other = None, sd = 2):
 def printPosHprScale(self, other = None, sd = 2):
@@ -291,7 +291,7 @@ def printPosHprScale(self, other = None, sd = 2):
             hpr = self.getHpr()
             hpr = self.getHpr()
             scale = self.getScale()
             scale = self.getScale()
             otherString = ''
             otherString = ''
-        print (self.getName() + '.setPosHprScale(' + otherString + 
+        print (self.getName() + '.setPosHprScale(' + otherString +
                formatString % pos[0] + ', ' +
                formatString % pos[0] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[1] + ', ' +
                formatString % pos[2] + ', ' +
                formatString % pos[2] + ', ' +
@@ -303,7 +303,7 @@ def printPosHprScale(self, other = None, sd = 2):
                formatString % scale[2] +
                formatString % scale[2] +
                ')\n')
                ')\n')
 
 
-Dtool_funcToMethod(printPosHprScale, NodePath)        
+Dtool_funcToMethod(printPosHprScale, NodePath)
 del printPosHprScale
 del printPosHprScale
 #####################################################################
 #####################################################################
 
 
@@ -314,17 +314,17 @@ def printTransform(self, other = None, sd = 2, fRecursive = 0):
     if other == None:
     if other == None:
         transform = self.getTransform()
         transform = self.getTransform()
     else:
     else:
-        transform = self.getTransform(other)            
+        transform = self.getTransform(other)
     if transform.hasPos():
     if transform.hasPos():
         pos = transform.getPos()
         pos = transform.getPos()
         if not pos.almostEqual(Vec3(0)):
         if not pos.almostEqual(Vec3(0)):
             outputString = '%s.setPos(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
             outputString = '%s.setPos(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
-            print outputString % (pos[0], pos[1], pos[2]) 
+            print outputString % (pos[0], pos[1], pos[2])
     if transform.hasHpr():
     if transform.hasHpr():
         hpr = transform.getHpr()
         hpr = transform.getHpr()
         if not hpr.almostEqual(Vec3(0)):
         if not hpr.almostEqual(Vec3(0)):
             outputString = '%s.setHpr(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
             outputString = '%s.setHpr(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr)
-            print outputString % (hpr[0], hpr[1], hpr[2]) 
+            print outputString % (hpr[0], hpr[1], hpr[2])
     if transform.hasScale():
     if transform.hasScale():
         if transform.hasUniformScale():
         if transform.hasUniformScale():
             scale = transform.getUniformScale()
             scale = transform.getUniformScale()
@@ -340,63 +340,63 @@ def printTransform(self, other = None, sd = 2, fRecursive = 0):
         for child in self.getChildrenAsList():
         for child in self.getChildrenAsList():
             child.printTransform(other, sd, fRecursive)
             child.printTransform(other, sd, fRecursive)
 
 
-Dtool_funcToMethod(printTransform, NodePath)        
+Dtool_funcToMethod(printTransform, NodePath)
 del printTransform
 del printTransform
 #####################################################################
 #####################################################################
 
 
 
 
 def iPos(self, other = None):
 def iPos(self, other = None):
-        """ Set node path's pos to 0,0,0 """
+        """ Set node path's pos to 0, 0, 0 """
         if other:
         if other:
-            self.setPos(other, 0,0,0)
+            self.setPos(other, 0, 0, 0)
         else:
         else:
-            self.setPos(0,0,0)
-Dtool_funcToMethod(iPos, NodePath)        
+            self.setPos(0, 0, 0)
+Dtool_funcToMethod(iPos, NodePath)
 del iPos
 del iPos
 #####################################################################
 #####################################################################
 
 
 def iHpr(self, other = None):
 def iHpr(self, other = None):
-        """ Set node path's hpr to 0,0,0 """
+        """ Set node path's hpr to 0, 0, 0 """
         if other:
         if other:
-            self.setHpr(other, 0,0,0)
+            self.setHpr(other, 0, 0, 0)
         else:
         else:
-            self.setHpr(0,0,0)
+            self.setHpr(0, 0, 0)
 
 
-Dtool_funcToMethod(iHpr, NodePath)        
+Dtool_funcToMethod(iHpr, NodePath)
 del iHpr
 del iHpr
 #####################################################################
 #####################################################################
 def iScale(self, other = None):
 def iScale(self, other = None):
-        """ SEt node path's scale to 1,1,1 """
+        """ SEt node path's scale to 1, 1, 1 """
         if other:
         if other:
-            self.setScale(other, 1,1,1)
+            self.setScale(other, 1, 1, 1)
         else:
         else:
-            self.setScale(1,1,1)
+            self.setScale(1, 1, 1)
 
 
-Dtool_funcToMethod(iScale, NodePath)        
+Dtool_funcToMethod(iScale, NodePath)
 del iScale
 del iScale
 #####################################################################
 #####################################################################
 def iPosHpr(self, other = None):
 def iPosHpr(self, other = None):
-        """ Set node path's pos and hpr to 0,0,0 """
+        """ Set node path's pos and hpr to 0, 0, 0 """
         if other:
         if other:
-            self.setPosHpr(other,0,0,0,0,0,0)
+            self.setPosHpr(other, 0, 0, 0, 0, 0, 0)
         else:
         else:
-            self.setPosHpr(0,0,0,0,0,0)
+            self.setPosHpr(0, 0, 0, 0, 0, 0)
 
 
-Dtool_funcToMethod(iPosHpr, NodePath)        
+Dtool_funcToMethod(iPosHpr, NodePath)
 del iPosHpr
 del iPosHpr
 #####################################################################
 #####################################################################
 def iPosHprScale(self, other = None):
 def iPosHprScale(self, other = None):
-        """ Set node path's pos and hpr to 0,0,0 and scale to 1,1,1 """
+        """ Set node path's pos and hpr to 0, 0, 0 and scale to 1, 1, 1 """
         if other:
         if other:
-            self.setPosHprScale(other, 0,0,0,0,0,0,1,1,1)
+            self.setPosHprScale(other, 0, 0, 0, 0, 0, 0, 1, 1, 1)
         else:
         else:
-            self.setPosHprScale(0,0,0,0,0,0,1,1,1)
+            self.setPosHprScale(0, 0, 0, 0, 0, 0, 1, 1, 1)
 
 
     # private methods
     # private methods
-Dtool_funcToMethod(iPosHprScale, NodePath)        
+Dtool_funcToMethod(iPosHprScale, NodePath)
 del iPosHprScale
 del iPosHprScale
 #####################################################################
 #####################################################################
-            
+
 def __lerp(self, functorFunc, duration, blendType, taskName=None):
 def __lerp(self, functorFunc, duration, blendType, taskName=None):
         """
         """
         __lerp(self, functorFunc, float, string, string)
         __lerp(self, functorFunc, float, string, string)
@@ -409,7 +409,7 @@ def __lerp(self, functorFunc, duration, blendType, taskName=None):
         from direct.task import Task
         from direct.task import Task
         from direct.showbase import LerpBlendHelpers
         from direct.showbase import LerpBlendHelpers
         from direct.task.TaskManagerGlobal import taskMgr
         from direct.task.TaskManagerGlobal import taskMgr
-        
+
         # upon death remove the functorFunc
         # upon death remove the functorFunc
         def lerpUponDeath(task):
         def lerpUponDeath(task):
             # Try to break circular references
             # Try to break circular references
@@ -421,7 +421,7 @@ def __lerp(self, functorFunc, duration, blendType, taskName=None):
                 del task.lerp
                 del task.lerp
             except:
             except:
                 pass
                 pass
-        
+
         # make the task function
         # make the task function
         def lerpTaskFunc(task):
         def lerpTaskFunc(task):
             from pandac.PandaModules import Lerp
             from pandac.PandaModules import Lerp
@@ -441,7 +441,7 @@ def __lerp(self, functorFunc, duration, blendType, taskName=None):
                 return(done)
                 return(done)
             else:
             else:
                 return(cont)
                 return(cont)
-        
+
         # make the lerp task
         # make the lerp task
         lerpTask = Task.Task(lerpTaskFunc)
         lerpTask = Task.Task(lerpTaskFunc)
         lerpTask.init = 1
         lerpTask.init = 1
@@ -449,7 +449,7 @@ def __lerp(self, functorFunc, duration, blendType, taskName=None):
         lerpTask.duration = duration
         lerpTask.duration = duration
         lerpTask.blendType = LerpBlendHelpers.getBlend(blendType)
         lerpTask.blendType = LerpBlendHelpers.getBlend(blendType)
         lerpTask.uponDeath = lerpUponDeath
         lerpTask.uponDeath = lerpUponDeath
-        
+
         if (taskName == None):
         if (taskName == None):
             # don't spawn a task, return one instead
             # don't spawn a task, return one instead
             return lerpTask
             return lerpTask
@@ -458,7 +458,7 @@ def __lerp(self, functorFunc, duration, blendType, taskName=None):
             taskMgr.add(lerpTask, taskName)
             taskMgr.add(lerpTask, taskName)
             return lerpTask
             return lerpTask
 
 
-Dtool_funcToMethod(__lerp, NodePath)        
+Dtool_funcToMethod(__lerp, NodePath)
 del __lerp
 del __lerp
 #####################################################################
 #####################################################################
 def __autoLerp(self, functorFunc, time, blendType, taskName):
 def __autoLerp(self, functorFunc, time, blendType, taskName):
@@ -475,7 +475,7 @@ def __autoLerp(self, functorFunc, time, blendType, taskName):
         lerp.start()
         lerp.start()
         return lerp
         return lerp
 
 
-Dtool_funcToMethod(__autoLerp, NodePath)        
+Dtool_funcToMethod(__autoLerp, NodePath)
 del __autoLerp
 del __autoLerp
 #####################################################################
 #####################################################################
 
 
@@ -496,10 +496,10 @@ def lerpColor(self, *posArgs, **keyArgs):
             # bad args
             # bad args
             raise Exception("Error: NodePath.lerpColor: bad number of args")
             raise Exception("Error: NodePath.lerpColor: bad number of args")
 
 
-Dtool_funcToMethod(lerpColor, NodePath)        
+Dtool_funcToMethod(lerpColor, NodePath)
 del lerpColor
 del lerpColor
 #####################################################################
 #####################################################################
-            
+
 def lerpColorRGBA(self, r, g, b, a, time,
 def lerpColorRGBA(self, r, g, b, a, time,
                       blendType="noBlend", auto=None, task=None):
                       blendType="noBlend", auto=None, task=None):
         """lerpColorRGBA(self, float, float, float, float, float,
         """lerpColorRGBA(self, float, float, float, float, float,
@@ -523,7 +523,7 @@ def lerpColorRGBA(self, r, g, b, a, time,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-Dtool_funcToMethod(lerpColorRGBA, NodePath)        
+Dtool_funcToMethod(lerpColorRGBA, NodePath)
 del lerpColorRGBA
 del lerpColorRGBA
 #####################################################################
 #####################################################################
 def lerpColorRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time,
 def lerpColorRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time,
@@ -546,7 +546,7 @@ def lerpColorRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-Dtool_funcToMethod(lerpColorRGBARGBA, NodePath)        
+Dtool_funcToMethod(lerpColorRGBARGBA, NodePath)
 del lerpColorRGBARGBA
 del lerpColorRGBARGBA
 #####################################################################
 #####################################################################
 def lerpColorVBase4(self, endColor, time,
 def lerpColorVBase4(self, endColor, time,
@@ -569,7 +569,7 @@ def lerpColorVBase4(self, endColor, time,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-Dtool_funcToMethod(lerpColorVBase4, NodePath)        
+Dtool_funcToMethod(lerpColorVBase4, NodePath)
 del lerpColorVBase4
 del lerpColorVBase4
 #####################################################################
 #####################################################################
 def lerpColorVBase4VBase4(self, startColor, endColor, time,
 def lerpColorVBase4VBase4(self, startColor, endColor, time,
@@ -594,7 +594,7 @@ def lerpColorVBase4VBase4(self, startColor, endColor, time,
 
 
 
 
 
 
-Dtool_funcToMethod(lerpColorVBase4VBase4, NodePath)        
+Dtool_funcToMethod(lerpColorVBase4VBase4, NodePath)
 del lerpColorVBase4VBase4
 del lerpColorVBase4VBase4
 #####################################################################
 #####################################################################
     # user callable lerp methods
     # user callable lerp methods
@@ -614,8 +614,8 @@ def lerpColorScale(self, *posArgs, **keyArgs):
             # bad args
             # bad args
             raise Exception("Error: NodePath.lerpColorScale: bad number of args")
             raise Exception("Error: NodePath.lerpColorScale: bad number of args")
 
 
-            
-Dtool_funcToMethod(lerpColorScale, NodePath)        
+
+Dtool_funcToMethod(lerpColorScale, NodePath)
 del lerpColorScale
 del lerpColorScale
 #####################################################################
 #####################################################################
 def lerpColorScaleRGBA(self, r, g, b, a, time,
 def lerpColorScaleRGBA(self, r, g, b, a, time,
@@ -641,7 +641,7 @@ def lerpColorScaleRGBA(self, r, g, b, a, time,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-Dtool_funcToMethod(lerpColorScaleRGBA, NodePath)        
+Dtool_funcToMethod(lerpColorScaleRGBA, NodePath)
 del lerpColorScaleRGBA
 del lerpColorScaleRGBA
 #####################################################################
 #####################################################################
 def lerpColorScaleRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time,
 def lerpColorScaleRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time,
@@ -664,7 +664,7 @@ def lerpColorScaleRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-Dtool_funcToMethod(lerpColorScaleRGBARGBA, NodePath)        
+Dtool_funcToMethod(lerpColorScaleRGBARGBA, NodePath)
 del lerpColorScaleRGBARGBA
 del lerpColorScaleRGBARGBA
 #####################################################################
 #####################################################################
 def lerpColorScaleVBase4(self, endColor, time,
 def lerpColorScaleVBase4(self, endColor, time,
@@ -687,7 +687,7 @@ def lerpColorScaleVBase4(self, endColor, time,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-Dtool_funcToMethod(lerpColorScaleVBase4, NodePath)        
+Dtool_funcToMethod(lerpColorScaleVBase4, NodePath)
 del lerpColorScaleVBase4
 del lerpColorScaleVBase4
 #####################################################################
 #####################################################################
 def lerpColorScaleVBase4VBase4(self, startColor, endColor, time,
 def lerpColorScaleVBase4VBase4(self, startColor, endColor, time,
@@ -710,9 +710,9 @@ def lerpColorScaleVBase4VBase4(self, startColor, endColor, time,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-            
 
 
-Dtool_funcToMethod(lerpColorScaleVBase4VBase4, NodePath)        
+
+Dtool_funcToMethod(lerpColorScaleVBase4VBase4, NodePath)
 del lerpColorScaleVBase4VBase4
 del lerpColorScaleVBase4VBase4
 #####################################################################
 #####################################################################
 def lerpHpr(self, *posArgs, **keyArgs):
 def lerpHpr(self, *posArgs, **keyArgs):
@@ -729,8 +729,8 @@ def lerpHpr(self, *posArgs, **keyArgs):
         else:
         else:
             # bad args
             # bad args
             raise Exception("Error: NodePath.lerpHpr: bad number of args")
             raise Exception("Error: NodePath.lerpHpr: bad number of args")
-    
-Dtool_funcToMethod(lerpHpr, NodePath)        
+
+Dtool_funcToMethod(lerpHpr, NodePath)
 del lerpHpr
 del lerpHpr
 #####################################################################
 #####################################################################
 def lerpHprHPR(self, h, p, r, time, other=None,
 def lerpHprHPR(self, h, p, r, time, other=None,
@@ -768,8 +768,8 @@ def lerpHprHPR(self, h, p, r, time, other=None,
             return self.__lerp(functorFunc, time, blendType, task)
             return self.__lerp(functorFunc, time, blendType, task)
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
-    
-Dtool_funcToMethod(lerpHprHPR, NodePath)        
+
+Dtool_funcToMethod(lerpHprHPR, NodePath)
 del lerpHprHPR
 del lerpHprHPR
 #####################################################################
 #####################################################################
 def lerpHprVBase3(self, hpr, time, other=None,
 def lerpHprVBase3(self, hpr, time, other=None,
@@ -801,9 +801,9 @@ def lerpHprVBase3(self, hpr, time, other=None,
             return self.__lerp(functorFunc, time, blendType, task)
             return self.__lerp(functorFunc, time, blendType, task)
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
-        
 
 
-Dtool_funcToMethod(lerpHprVBase3, NodePath)        
+
+Dtool_funcToMethod(lerpHprVBase3, NodePath)
 del lerpHprVBase3
 del lerpHprVBase3
 #####################################################################
 #####################################################################
 def lerpPos(self, *posArgs, **keyArgs):
 def lerpPos(self, *posArgs, **keyArgs):
@@ -821,7 +821,7 @@ def lerpPos(self, *posArgs, **keyArgs):
             # bad number off args
             # bad number off args
             raise Exception("Error: NodePath.lerpPos: bad number of args")
             raise Exception("Error: NodePath.lerpPos: bad number of args")
 
 
-Dtool_funcToMethod(lerpPos, NodePath)        
+Dtool_funcToMethod(lerpPos, NodePath)
 del lerpPos
 del lerpPos
 #####################################################################
 #####################################################################
 def lerpPosXYZ(self, x, y, z, time, other=None,
 def lerpPosXYZ(self, x, y, z, time, other=None,
@@ -851,7 +851,7 @@ def lerpPosXYZ(self, x, y, z, time, other=None,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-Dtool_funcToMethod(lerpPosXYZ, NodePath)        
+Dtool_funcToMethod(lerpPosXYZ, NodePath)
 del lerpPosXYZ
 del lerpPosXYZ
 #####################################################################
 #####################################################################
 def lerpPosPoint3(self, pos, time, other=None,
 def lerpPosPoint3(self, pos, time, other=None,
@@ -879,7 +879,7 @@ def lerpPosPoint3(self, pos, time, other=None,
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
 
 
-Dtool_funcToMethod(lerpPosPoint3, NodePath)        
+Dtool_funcToMethod(lerpPosPoint3, NodePath)
 del lerpPosPoint3
 del lerpPosPoint3
 #####################################################################
 #####################################################################
 def lerpPosHpr(self, *posArgs, **keyArgs):
 def lerpPosHpr(self, *posArgs, **keyArgs):
@@ -897,7 +897,7 @@ def lerpPosHpr(self, *posArgs, **keyArgs):
             # bad number off args
             # bad number off args
             raise Exception("Error: NodePath.lerpPosHpr: bad number of args")
             raise Exception("Error: NodePath.lerpPosHpr: bad number of args")
 
 
-Dtool_funcToMethod(lerpPosHpr, NodePath)        
+Dtool_funcToMethod(lerpPosHpr, NodePath)
 del lerpPosHpr
 del lerpPosHpr
 #####################################################################
 #####################################################################
 def lerpPosHprPoint3VBase3(self, pos, hpr, time, other=None,
 def lerpPosHprPoint3VBase3(self, pos, hpr, time, other=None,
@@ -934,7 +934,7 @@ def lerpPosHprPoint3VBase3(self, pos, hpr, time, other=None,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-Dtool_funcToMethod(lerpPosHprPoint3VBase3, NodePath)        
+Dtool_funcToMethod(lerpPosHprPoint3VBase3, NodePath)
 del lerpPosHprPoint3VBase3
 del lerpPosHprPoint3VBase3
 #####################################################################
 #####################################################################
 def lerpPosHprXYZHPR(self, x, y, z, h, p, r, time, other=None,
 def lerpPosHprXYZHPR(self, x, y, z, h, p, r, time, other=None,
@@ -977,7 +977,7 @@ def lerpPosHprXYZHPR(self, x, y, z, h, p, r, time, other=None,
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
 
 
-Dtool_funcToMethod(lerpPosHprXYZHPR, NodePath)        
+Dtool_funcToMethod(lerpPosHprXYZHPR, NodePath)
 del lerpPosHprXYZHPR
 del lerpPosHprXYZHPR
 #####################################################################
 #####################################################################
 def lerpPosHprScale(self, pos, hpr, scale, time, other=None,
 def lerpPosHprScale(self, pos, hpr, scale, time, other=None,
@@ -1021,7 +1021,7 @@ def lerpPosHprScale(self, pos, hpr, scale, time, other=None,
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
 
 
-Dtool_funcToMethod(lerpPosHprScale, NodePath)        
+Dtool_funcToMethod(lerpPosHprScale, NodePath)
 del lerpPosHprScale
 del lerpPosHprScale
 #####################################################################
 #####################################################################
 def lerpScale(self, *posArgs, **keyArgs):
 def lerpScale(self, *posArgs, **keyArgs):
@@ -1039,7 +1039,7 @@ def lerpScale(self, *posArgs, **keyArgs):
             # bad number off args
             # bad number off args
             raise Exception("Error: NodePath.lerpScale: bad number of args")
             raise Exception("Error: NodePath.lerpScale: bad number of args")
 
 
-Dtool_funcToMethod(lerpScale, NodePath)        
+Dtool_funcToMethod(lerpScale, NodePath)
 del lerpScale
 del lerpScale
 #####################################################################
 #####################################################################
 def lerpScaleVBase3(self, scale, time, other=None,
 def lerpScaleVBase3(self, scale, time, other=None,
@@ -1067,7 +1067,7 @@ def lerpScaleVBase3(self, scale, time, other=None,
         else:
         else:
             return self.__lerp(functorFunc, time, blendType)
             return self.__lerp(functorFunc, time, blendType)
 
 
-Dtool_funcToMethod(lerpScaleVBase3, NodePath)        
+Dtool_funcToMethod(lerpScaleVBase3, NodePath)
 del lerpScaleVBase3
 del lerpScaleVBase3
 #####################################################################
 #####################################################################
 def lerpScaleXYZ(self, sx, sy, sz, time, other=None,
 def lerpScaleXYZ(self, sx, sy, sz, time, other=None,
@@ -1099,8 +1099,8 @@ def lerpScaleXYZ(self, sx, sy, sz, time, other=None,
 
 
 
 
 
 
-            
-Dtool_funcToMethod(lerpScaleXYZ, NodePath)        
+
+Dtool_funcToMethod(lerpScaleXYZ, NodePath)
 del lerpScaleXYZ
 del lerpScaleXYZ
 #####################################################################
 #####################################################################
 def place(self):
 def place(self):
@@ -1108,7 +1108,7 @@ def place(self):
         from direct.tkpanels import Placer
         from direct.tkpanels import Placer
         return Placer.place(self)
         return Placer.place(self)
 
 
-Dtool_funcToMethod(place, NodePath)        
+Dtool_funcToMethod(place, NodePath)
 del place
 del place
 #####################################################################
 #####################################################################
 def explore(self):
 def explore(self):
@@ -1116,7 +1116,7 @@ def explore(self):
         from direct.tkwidgets import SceneGraphExplorer
         from direct.tkwidgets import SceneGraphExplorer
         return SceneGraphExplorer.explore(self)
         return SceneGraphExplorer.explore(self)
 
 
-Dtool_funcToMethod(explore, NodePath)        
+Dtool_funcToMethod(explore, NodePath)
 del explore
 del explore
 #####################################################################
 #####################################################################
 def rgbPanel(self, cb = None):
 def rgbPanel(self, cb = None):
@@ -1124,21 +1124,21 @@ def rgbPanel(self, cb = None):
         from direct.tkwidgets import Slider
         from direct.tkwidgets import Slider
         return Slider.rgbPanel(self, cb)
         return Slider.rgbPanel(self, cb)
 
 
-Dtool_funcToMethod(rgbPanel, NodePath)        
+Dtool_funcToMethod(rgbPanel, NodePath)
 del rgbPanel
 del rgbPanel
 #####################################################################
 #####################################################################
 def select(self):
 def select(self):
         base.startDirect(fWantTk = 0)
         base.startDirect(fWantTk = 0)
         direct.select(self)
         direct.select(self)
 
 
-Dtool_funcToMethod(select, NodePath)        
+Dtool_funcToMethod(select, NodePath)
 del select
 del select
 #####################################################################
 #####################################################################
 def deselect(self):
 def deselect(self):
         base.startDirect(fWantTk = 0)
         base.startDirect(fWantTk = 0)
         direct.deselect(self)
         direct.deselect(self)
 
 
-Dtool_funcToMethod(deselect, NodePath)        
+Dtool_funcToMethod(deselect, NodePath)
 del deselect
 del deselect
 #####################################################################
 #####################################################################
 def showCS(self, mask = None):
 def showCS(self, mask = None):
@@ -1154,7 +1154,7 @@ def showCS(self, mask = None):
             if (mask == None or (np.node().getIntoCollideMask() & mask).getWord()):
             if (mask == None or (np.node().getIntoCollideMask() & mask).getWord()):
                 np.show()
                 np.show()
 
 
-Dtool_funcToMethod(showCS, NodePath)        
+Dtool_funcToMethod(showCS, NodePath)
 del showCS
 del showCS
 #####################################################################
 #####################################################################
 def hideCS(self, mask = None):
 def hideCS(self, mask = None):
@@ -1170,118 +1170,118 @@ def hideCS(self, mask = None):
             if (mask == None or (np.node().getIntoCollideMask() & mask).getWord()):
             if (mask == None or (np.node().getIntoCollideMask() & mask).getWord()):
                 np.hide()
                 np.hide()
 
 
-Dtool_funcToMethod(hideCS, NodePath)        
+Dtool_funcToMethod(hideCS, NodePath)
 del hideCS
 del hideCS
 #####################################################################
 #####################################################################
 def posInterval(self, *args, **kw):
 def posInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpPosInterval(self, *args, **kw)
         return LerpInterval.LerpPosInterval(self, *args, **kw)
-    
-Dtool_funcToMethod(posInterval, NodePath)        
+
+Dtool_funcToMethod(posInterval, NodePath)
 del posInterval
 del posInterval
 #####################################################################
 #####################################################################
 def hprInterval(self, *args, **kw):
 def hprInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpHprInterval(self, *args, **kw)
         return LerpInterval.LerpHprInterval(self, *args, **kw)
-    
-Dtool_funcToMethod(hprInterval, NodePath)        
+
+Dtool_funcToMethod(hprInterval, NodePath)
 del hprInterval
 del hprInterval
 #####################################################################
 #####################################################################
 def quatInterval(self, *args, **kw):
 def quatInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpQuatInterval(self, *args, **kw)
         return LerpInterval.LerpQuatInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(quatInterval, NodePath)        
+Dtool_funcToMethod(quatInterval, NodePath)
 del quatInterval
 del quatInterval
 #####################################################################
 #####################################################################
 def scaleInterval(self, *args, **kw):
 def scaleInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpScaleInterval(self, *args, **kw)
         return LerpInterval.LerpScaleInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(scaleInterval, NodePath)        
+Dtool_funcToMethod(scaleInterval, NodePath)
 del scaleInterval
 del scaleInterval
 #####################################################################
 #####################################################################
 def shearInterval(self, *args, **kw):
 def shearInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpShearInterval(self, *args, **kw)
         return LerpInterval.LerpShearInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(shearInterval, NodePath)        
+Dtool_funcToMethod(shearInterval, NodePath)
 del shearInterval
 del shearInterval
 #####################################################################
 #####################################################################
 def posHprInterval(self, *args, **kw):
 def posHprInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpPosHprInterval(self, *args, **kw)
         return LerpInterval.LerpPosHprInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(posHprInterval, NodePath)        
+Dtool_funcToMethod(posHprInterval, NodePath)
 del posHprInterval
 del posHprInterval
 #####################################################################
 #####################################################################
 def posQuatInterval(self, *args, **kw):
 def posQuatInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpPosQuatInterval(self, *args, **kw)
         return LerpInterval.LerpPosQuatInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(posQuatInterval, NodePath)        
+Dtool_funcToMethod(posQuatInterval, NodePath)
 del posQuatInterval
 del posQuatInterval
 #####################################################################
 #####################################################################
 def hprScaleInterval(self, *args, **kw):
 def hprScaleInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpHprScaleInterval(self, *args, **kw)
         return LerpInterval.LerpHprScaleInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(hprScaleInterval, NodePath)        
+Dtool_funcToMethod(hprScaleInterval, NodePath)
 del hprScaleInterval
 del hprScaleInterval
 #####################################################################
 #####################################################################
 def quatScaleInterval(self, *args, **kw):
 def quatScaleInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpQuatScaleInterval(self, *args, **kw)
         return LerpInterval.LerpQuatScaleInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(quatScaleInterval, NodePath)        
+Dtool_funcToMethod(quatScaleInterval, NodePath)
 del quatScaleInterval
 del quatScaleInterval
 #####################################################################
 #####################################################################
 def posHprScaleInterval(self, *args, **kw):
 def posHprScaleInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpPosHprScaleInterval(self, *args, **kw)
         return LerpInterval.LerpPosHprScaleInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(posHprScaleInterval, NodePath)        
+Dtool_funcToMethod(posHprScaleInterval, NodePath)
 del posHprScaleInterval
 del posHprScaleInterval
 #####################################################################
 #####################################################################
 def posQuatScaleInterval(self, *args, **kw):
 def posQuatScaleInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpPosQuatScaleInterval(self, *args, **kw)
         return LerpInterval.LerpPosQuatScaleInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(posQuatScaleInterval, NodePath)        
+Dtool_funcToMethod(posQuatScaleInterval, NodePath)
 del posQuatScaleInterval
 del posQuatScaleInterval
 #####################################################################
 #####################################################################
 def posHprScaleShearInterval(self, *args, **kw):
 def posHprScaleShearInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpPosHprScaleShearInterval(self, *args, **kw)
         return LerpInterval.LerpPosHprScaleShearInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(posHprScaleShearInterval, NodePath)        
+Dtool_funcToMethod(posHprScaleShearInterval, NodePath)
 del posHprScaleShearInterval
 del posHprScaleShearInterval
 #####################################################################
 #####################################################################
 def posQuatScaleShearInterval(self, *args, **kw):
 def posQuatScaleShearInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpPosQuatScaleShearInterval(self, *args, **kw)
         return LerpInterval.LerpPosQuatScaleShearInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(posQuatScaleShearInterval, NodePath)        
+Dtool_funcToMethod(posQuatScaleShearInterval, NodePath)
 del posQuatScaleShearInterval
 del posQuatScaleShearInterval
 #####################################################################
 #####################################################################
 def colorInterval(self, *args, **kw):
 def colorInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpColorInterval(self, *args, **kw)
         return LerpInterval.LerpColorInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(colorInterval, NodePath)        
+Dtool_funcToMethod(colorInterval, NodePath)
 del colorInterval
 del colorInterval
 #####################################################################
 #####################################################################
 def colorScaleInterval(self, *args, **kw):
 def colorScaleInterval(self, *args, **kw):
         from direct.interval import LerpInterval
         from direct.interval import LerpInterval
         return LerpInterval.LerpColorScaleInterval(self, *args, **kw)
         return LerpInterval.LerpColorScaleInterval(self, *args, **kw)
 
 
-Dtool_funcToMethod(colorScaleInterval, NodePath)        
+Dtool_funcToMethod(colorScaleInterval, NodePath)
 del colorScaleInterval
 del colorScaleInterval
 #####################################################################
 #####################################################################
-def attachCollisionSphere(self, name, cx,cy,cz,r, fromCollide, intoCollide):
+def attachCollisionSphere(self, name, cx, cy, cz, r, fromCollide, intoCollide):
         from pandac.PandaModules import CollisionSphere
         from pandac.PandaModules import CollisionSphere
         from pandac.PandaModules import CollisionNode
         from pandac.PandaModules import CollisionNode
-        coll = CollisionSphere.CollisionSphere(cx,cy,cz,r)
+        coll = CollisionSphere.CollisionSphere(cx, cy, cz, r)
         collNode = CollisionNode.CollisionNode(name)
         collNode = CollisionNode.CollisionNode(name)
         collNode.addSolid(coll)
         collNode.addSolid(coll)
         collNode.setFromCollideMask(fromCollide)
         collNode.setFromCollideMask(fromCollide)
@@ -1289,13 +1289,13 @@ def attachCollisionSphere(self, name, cx,cy,cz,r, fromCollide, intoCollide):
         collNodePath = self.attachNewNode(collNode)
         collNodePath = self.attachNewNode(collNode)
         return collNodePath
         return collNodePath
 
 
-Dtool_funcToMethod(attachCollisionSphere, NodePath)        
+Dtool_funcToMethod(attachCollisionSphere, NodePath)
 del attachCollisionSphere
 del attachCollisionSphere
 #####################################################################
 #####################################################################
-def attachCollisionSegment(self, name, ax,ay,az, bx,by,bz, fromCollide, intoCollide):
+def attachCollisionSegment(self, name, ax, ay, az, bx, by, bz, fromCollide, intoCollide):
         from pandac.PandaModules import CollisionSegment
         from pandac.PandaModules import CollisionSegment
         from pandac.PandaModules import CollisionNode
         from pandac.PandaModules import CollisionNode
-        coll = CollisionSegment.CollisionSegment(ax,ay,az, bx,by,bz)
+        coll = CollisionSegment.CollisionSegment(ax, ay, az, bx, by, bz)
         collNode = CollisionNode.CollisionNode(name)
         collNode = CollisionNode.CollisionNode(name)
         collNode.addSolid(coll)
         collNode.addSolid(coll)
         collNode.setFromCollideMask(fromCollide)
         collNode.setFromCollideMask(fromCollide)
@@ -1303,13 +1303,13 @@ def attachCollisionSegment(self, name, ax,ay,az, bx,by,bz, fromCollide, intoColl
         collNodePath = self.attachNewNode(collNode)
         collNodePath = self.attachNewNode(collNode)
         return collNodePath
         return collNodePath
 
 
-Dtool_funcToMethod(attachCollisionSegment, NodePath)        
+Dtool_funcToMethod(attachCollisionSegment, NodePath)
 del attachCollisionSegment
 del attachCollisionSegment
 #####################################################################
 #####################################################################
-def attachCollisionRay(self, name, ox,oy,oz, dx,dy,dz, fromCollide, intoCollide):
+def attachCollisionRay(self, name, ox, oy, oz, dx, dy, dz, fromCollide, intoCollide):
         from pandac.PandaModules import CollisionRay
         from pandac.PandaModules import CollisionRay
         from pandac.PandaModules import CollisionNode
         from pandac.PandaModules import CollisionNode
-        coll = CollisionRay.CollisionRay(ox,oy,oz, dx,dy,dz)
+        coll = CollisionRay.CollisionRay(ox, oy, oz, dx, dy, dz)
         collNode = CollisionNode.CollisionNode(name)
         collNode = CollisionNode.CollisionNode(name)
         collNode.addSolid(coll)
         collNode.addSolid(coll)
         collNode.setFromCollideMask(fromCollide)
         collNode.setFromCollideMask(fromCollide)
@@ -1317,7 +1317,7 @@ def attachCollisionRay(self, name, ox,oy,oz, dx,dy,dz, fromCollide, intoCollide)
         collNodePath = self.attachNewNode(collNode)
         collNodePath = self.attachNewNode(collNode)
         return collNodePath
         return collNodePath
 
 
-Dtool_funcToMethod(attachCollisionRay, NodePath)        
+Dtool_funcToMethod(attachCollisionRay, NodePath)
 del attachCollisionRay
 del attachCollisionRay
 #####################################################################
 #####################################################################
 def flattenMultitex(self, stateFrom = None, target = None,
 def flattenMultitex(self, stateFrom = None, target = None,
@@ -1337,6 +1337,6 @@ def flattenMultitex(self, stateFrom = None, target = None,
         else:
         else:
             mr.scan(self, stateFrom)
             mr.scan(self, stateFrom)
         mr.flatten(win)
         mr.flatten(win)
-Dtool_funcToMethod(flattenMultitex, NodePath)        
+Dtool_funcToMethod(flattenMultitex, NodePath)
 del flattenMultitex
 del flattenMultitex
 #####################################################################
 #####################################################################

+ 1 - 1
direct/src/extensions_native/VBase3_extensions.py

@@ -10,6 +10,6 @@ def pPrintValues(self):
     """
     """
     Pretty print
     Pretty print
     """
     """
-    return "% 10.4f, % 10.4f, % 10.4f" % (self[0],self[1],self[2])
+    return "% 10.4f, % 10.4f, % 10.4f" % (self[0], self[1], self[2])
 Dtool_funcToMethod(pPrintValues, VBase3)
 Dtool_funcToMethod(pPrintValues, VBase3)
 del pPrintValues
 del pPrintValues

+ 1 - 1
direct/src/extensions_native/VBase4_extensions.py

@@ -10,6 +10,6 @@ def pPrintValues(self):
     """
     """
     Pretty print
     Pretty print
     """
     """
-    return "% 10.4f, % 10.4f, % 10.4f, % 10.4f" % (self[0],self[1],self[2],self[3])
+    return "% 10.4f, % 10.4f, % 10.4f, % 10.4f" % (self[0], self[1], self[2], self[3])
 Dtool_funcToMethod(pPrintValues, VBase4)
 Dtool_funcToMethod(pPrintValues, VBase4)
 del pPrintValues
 del pPrintValues

+ 6 - 6
direct/src/extensions_native/extension_native_helpers.py

@@ -1,18 +1,18 @@
-###  Tools 
+###  Tools
 from libpandaexpress import *
 from libpandaexpress import *
 
 
 
 
-def Dtool_ObjectToDict(clas,name,obj):
-    clas.DtoolClassDict[name] = obj;            
+def Dtool_ObjectToDict(clas, name, obj):
+    clas.DtoolClassDict[name] = obj;
 
 
-def Dtool_funcToMethod(func,clas,method_name=None):
+def Dtool_funcToMethod(func, clas, method_name=None):
     """Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method.
     """Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method.
     The new method is accessible to any instance immediately."""
     The new method is accessible to any instance immediately."""
     func.im_class=clas
     func.im_class=clas
     func.im_func=func
     func.im_func=func
     func.im_self=None
     func.im_self=None
-    if not method_name: 
+    if not method_name:
             method_name = func.__name__
             method_name = func.__name__
-    clas.DtoolClassDict[method_name] = func;            
+    clas.DtoolClassDict[method_name] = func;
 
 
 
 

+ 7 - 7
direct/src/ffi/FFIExternalObject.py

@@ -25,7 +25,7 @@ def registerInTypeMap(pythonClass):
         WrapperClassMap[typeIndex] = pythonClass
         WrapperClassMap[typeIndex] = pythonClass
 
 
 
 
-def funcToMethod(func,clas,method_name=None):
+def funcToMethod(func, clas, method_name=None):
     """Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method.
     """Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method.
     The new method is accessible to any instance immediately."""
     The new method is accessible to any instance immediately."""
     func.im_class=clas
     func.im_class=clas
@@ -118,7 +118,7 @@ class FFIExternalObject:
         # type instead.
         # type instead.
         if typeHandle.getNumParentClasses() == 0:
         if typeHandle.getNumParentClasses() == 0:
             # This type has no parents!  That shouldn't happen.
             # This type has no parents!  That shouldn't happen.
-            FFIConstants.notify.warning("Unknown class type: %s has no parents!" % (typeHandle.getName()))            
+            FFIConstants.notify.warning("Unknown class type: %s has no parents!" % (typeHandle.getName()))
             return None
             return None
 
 
         parentType = typeHandle.getParentTowards(rootType, self)
         parentType = typeHandle.getParentTowards(rootType, self)
@@ -133,7 +133,7 @@ class FFIExternalObject:
             WrapperClassMap[typeHandle.getIndex()] = parentWrapperClass
             WrapperClassMap[typeHandle.getIndex()] = parentWrapperClass
 
 
         return parentWrapperClass
         return parentWrapperClass
-        
+
     def setPointer(self):
     def setPointer(self):
         # See what type it really is and downcast to that type (if necessary)
         # See what type it really is and downcast to that type (if necessary)
         # Look up the TypeHandle in the dict. get() returns None if it is not there
         # Look up the TypeHandle in the dict. get() returns None if it is not there
@@ -143,7 +143,7 @@ class FFIExternalObject:
             # This is an unknown class type.  Perhaps it derives from
             # This is an unknown class type.  Perhaps it derives from
             # a class type we know.
             # a class type we know.
             exactWrapperClass = self.lookUpNewType(self.getType(), self.getClassType())
             exactWrapperClass = self.lookUpNewType(self.getType(), self.getClassType())
-            
+
         # We do not need to downcast if we already have the same class
         # We do not need to downcast if we already have the same class
         if (exactWrapperClass and (exactWrapperClass != self.__class__)):
         if (exactWrapperClass and (exactWrapperClass != self.__class__)):
             # Create a new wrapper class instance
             # Create a new wrapper class instance
@@ -162,7 +162,7 @@ class FFIExternalObject:
             return exactObject
             return exactObject
         else:
         else:
             return self
             return self
- 
+
     def downcast(self, toClass):
     def downcast(self, toClass):
         fromClass = self.__class__
         fromClass = self.__class__
         #FFIConstants.notify.debug('downcast: downcasting from %s to %s' % \
         #FFIConstants.notify.debug('downcast: downcasting from %s to %s' % \
@@ -223,7 +223,7 @@ class FFIExternalObject:
 
 
     def __str__(self):
     def __str__(self):
         # This is a more complete version of printing which shows the object type
         # This is a more complete version of printing which shows the object type
-        # and pointer, plus the output from write() or output() whichever is defined        
+        # and pointer, plus the output from write() or output() whichever is defined
         # Print this info for all objects
         # Print this info for all objects
         baseRepr = ('[' + self.__class__.__name__ + ' at: ' + `self.this` + ']')
         baseRepr = ('[' + self.__class__.__name__ + ' at: ' + `self.this` + ']')
         # Lots of Panda classes have an write or output function defined that takes an Ostream
         # Lots of Panda classes have an write or output function defined that takes an Ostream
@@ -265,4 +265,4 @@ class FFIExternalObject:
 
 
 
 
 
 
-    
+

+ 21 - 21
direct/src/ffi/FFIOverload.py

@@ -1,4 +1,4 @@
-from direct.showbase.PythonUtil import *    
+from direct.showbase.PythonUtil import *
 from types import *
 from types import *
 import string
 import string
 import FFIConstants
 import FFIConstants
@@ -53,14 +53,14 @@ def getTypeName(classTypeDesc, typeDesc):
     # Atomic C++ types are type checked against the builtin
     # Atomic C++ types are type checked against the builtin
     # Python types. This code sorts out the mapping
     # Python types. This code sorts out the mapping
     if typeDesc.isAtomic():
     if typeDesc.isAtomic():
-        
+
         # Ints, bools, and chars are treated as ints.
         # Ints, bools, and chars are treated as ints.
         # Enums are special and are not atomic, see below
         # Enums are special and are not atomic, see below
         if ((typeDesc.atomicType == AT_int) or
         if ((typeDesc.atomicType == AT_int) or
             (typeDesc.atomicType == AT_bool) or
             (typeDesc.atomicType == AT_bool) or
             (typeDesc.atomicType == AT_char)):
             (typeDesc.atomicType == AT_char)):
             return 'IntType'
             return 'IntType'
-        
+
         # Floats and doubles are both floats in Python
         # Floats and doubles are both floats in Python
         elif ((typeDesc.atomicType == AT_float) or
         elif ((typeDesc.atomicType == AT_float) or
             (typeDesc.atomicType == AT_double)):
             (typeDesc.atomicType == AT_double)):
@@ -72,7 +72,7 @@ def getTypeName(classTypeDesc, typeDesc):
         # Strings are treated as Python strings
         # Strings are treated as Python strings
         elif ((typeDesc.atomicType == AT_string)):
         elif ((typeDesc.atomicType == AT_string)):
             return 'StringType'
             return 'StringType'
-        
+
         elif (typeDesc.atomicType == AT_void):
         elif (typeDesc.atomicType == AT_void):
             # Convert the void type to None type... I guess...
             # Convert the void type to None type... I guess...
             # So far we do not have any code that uses this
             # So far we do not have any code that uses this
@@ -80,7 +80,7 @@ def getTypeName(classTypeDesc, typeDesc):
 
 
         else:
         else:
             FFIConstants.notify.error("Unknown atomicType: %s" % (typeDesc.atomicType))
             FFIConstants.notify.error("Unknown atomicType: %s" % (typeDesc.atomicType))
-        
+
     # If the type is an enum, we really want to treat it like an int
     # If the type is an enum, we really want to treat it like an int
     # To handle this, the type will have __enum__ in the name
     # To handle this, the type will have __enum__ in the name
     # Usually it will start the typeName, but some typeNames have the
     # Usually it will start the typeName, but some typeNames have the
@@ -91,7 +91,7 @@ def getTypeName(classTypeDesc, typeDesc):
 
 
     # If it was not atomic or enum, it must be a class which is a
     # If it was not atomic or enum, it must be a class which is a
     # bit trickier because we output different things depending on the
     # bit trickier because we output different things depending on the
-    # scoping of the type. 
+    # scoping of the type.
     else:
     else:
 
 
         #   classTypeDesc  typeDesc fullNestedName Resulting TypeName
         #   classTypeDesc  typeDesc fullNestedName Resulting TypeName
@@ -103,11 +103,11 @@ def getTypeName(classTypeDesc, typeDesc):
         # 6   Inner         Inner     Outer.Inner    Outer.Inner
         # 6   Inner         Inner     Outer.Inner    Outer.Inner
         # 7   None          Other     Other          Other.Other
         # 7   None          Other     Other          Other.Other
 
 
-        # CASES 1,4, and 7 are the only ones that are different from the full
+        # CASES 1, 4, and 7 are the only ones that are different from the full
         # nested name, returning Other.Other
         # nested name, returning Other.Other
 
 
         returnNestedTypeNames = string.split(typeName, '.')
         returnNestedTypeNames = string.split(typeName, '.')
-        returnModuleName = returnNestedTypeNames[0] 
+        returnModuleName = returnNestedTypeNames[0]
 
 
         if classTypeDesc:
         if classTypeDesc:
             classTypeName = classTypeDesc.getFullNestedName()
             classTypeName = classTypeDesc.getFullNestedName()
@@ -145,7 +145,7 @@ def getInheritanceLevel(type, checkNested = 1):
         # A special case: PyObject * is always the most general
         # A special case: PyObject * is always the most general
         # object.  Everything is a PyObject.
         # object.  Everything is a PyObject.
         return -1
         return -1
-    
+
     # If this is a nested type, return the inheritance level of the outer type.
     # If this is a nested type, return the inheritance level of the outer type.
     if type.isNested:
     if type.isNested:
         # Check the level of your outer class
         # Check the level of your outer class
@@ -212,7 +212,7 @@ class FFIMethodArgumentTreeCollection:
         self.methodSpecList = methodSpecList
         self.methodSpecList = methodSpecList
         self.methodDict = {}
         self.methodDict = {}
         self.treeDict = {}
         self.treeDict = {}
-        
+
     def outputOverloadedMethodHeader(self, file, nesting):
     def outputOverloadedMethodHeader(self, file, nesting):
         # If one is static, we assume they all are.
         # If one is static, we assume they all are.
         # The current system does not support overloading static and non-static
         # The current system does not support overloading static and non-static
@@ -221,7 +221,7 @@ class FFIMethodArgumentTreeCollection:
         # they are not really constructors, they are instance methods that fill
         # they are not really constructors, they are instance methods that fill
         # in the this pointer.
         # in the this pointer.
         # Global functions do not need static versions
         # Global functions do not need static versions
-        if (self.methodSpecList[0].isStatic() and 
+        if (self.methodSpecList[0].isStatic() and
             (not self.methodSpecList[0].isConstructor())):
             (not self.methodSpecList[0].isConstructor())):
             indent(file, nesting, 'def ' +
             indent(file, nesting, 'def ' +
                    self.methodSpecList[0].name + '(*_args):\n')
                    self.methodSpecList[0].name + '(*_args):\n')
@@ -230,7 +230,7 @@ class FFIMethodArgumentTreeCollection:
                    self.methodSpecList[0].name + '(self, *_args):\n')
                    self.methodSpecList[0].name + '(self, *_args):\n')
         self.methodSpecList[0].outputCFunctionComment(file, nesting+2)
         self.methodSpecList[0].outputCFunctionComment(file, nesting+2)
         indent(file, nesting+2, 'numArgs = len(_args)\n')
         indent(file, nesting+2, 'numArgs = len(_args)\n')
-        
+
     def outputOverloadedMethodFooter(self, file, nesting):
     def outputOverloadedMethodFooter(self, file, nesting):
         # If this is a static method, we need to output a static version
         # If this is a static method, we need to output a static version
         # If one is static, we assume they all are.
         # If one is static, we assume they all are.
@@ -250,7 +250,7 @@ class FFIMethodArgumentTreeCollection:
                 indent(file, nesting,   "FFIExternalObject.funcToMethod("+methodName+','+ self.classTypeDesc.foreignTypeName+ ",'"+methodName+"')\n")
                 indent(file, nesting,   "FFIExternalObject.funcToMethod("+methodName+','+ self.classTypeDesc.foreignTypeName+ ",'"+methodName+"')\n")
                 indent(file, nesting,   'del '+methodName+'\n')
                 indent(file, nesting,   'del '+methodName+'\n')
                 indent(file, nesting, ' \n')
                 indent(file, nesting, ' \n')
-             
+
         indent(file, nesting+1, '\n')
         indent(file, nesting+1, '\n')
 
 
     def outputOverloadedStaticFooter(self, file, nesting):
     def outputOverloadedStaticFooter(self, file, nesting):
@@ -258,7 +258,7 @@ class FFIMethodArgumentTreeCollection:
         methodName = self.methodSpecList[0].name
         methodName = self.methodSpecList[0].name
         indent(file, nesting, self.classTypeDesc.foreignTypeName + '.' + methodName + ' = staticmethod(' + methodName + ')\n')
         indent(file, nesting, self.classTypeDesc.foreignTypeName + '.' + methodName + ' = staticmethod(' + methodName + ')\n')
         indent(file, nesting,'del ' +methodName+' \n\n')
         indent(file, nesting,'del ' +methodName+' \n\n')
-    
+
     def setup(self):
     def setup(self):
         for method in self.methodSpecList:
         for method in self.methodSpecList:
             numArgs = len(method.typeDescriptor.thislessArgTypes())
             numArgs = len(method.typeDescriptor.thislessArgTypes())
@@ -298,7 +298,7 @@ class FFIMethodArgumentTreeCollection:
 
 
         self.outputOverloadedMethodFooter(file, nesting)
         self.outputOverloadedMethodFooter(file, nesting)
 
 
-    
+
 
 
 class FFIMethodArgumentTree:
 class FFIMethodArgumentTree:
     """
     """
@@ -319,7 +319,7 @@ class FFIMethodArgumentTree:
         for methodSpec in self.methodSpecList:
         for methodSpec in self.methodSpecList:
             argTypes = methodSpec.typeDescriptor.thislessArgTypes()
             argTypes = methodSpec.typeDescriptor.thislessArgTypes()
             self.fillInArgTypes(argTypes, methodSpec)
             self.fillInArgTypes(argTypes, methodSpec)
-    
+
     def fillInArgTypes(self, argTypes, methodSpec):
     def fillInArgTypes(self, argTypes, methodSpec):
         # If the method takes no arguments, we will assign a type index of 0
         # If the method takes no arguments, we will assign a type index of 0
         if (len(argTypes) == 0):
         if (len(argTypes) == 0):
@@ -327,11 +327,11 @@ class FFIMethodArgumentTree:
                 FFIMethodArgumentTree(self.classTypeDesc,
                 FFIMethodArgumentTree(self.classTypeDesc,
                                       self.methodSpecList),
                                       self.methodSpecList),
                 methodSpec]
                 methodSpec]
-        
+
         else:
         else:
             self.argSpec = argTypes[0]
             self.argSpec = argTypes[0]
             typeDesc = self.argSpec.typeDescriptor.recursiveTypeDescriptor()
             typeDesc = self.argSpec.typeDescriptor.recursiveTypeDescriptor()
-            
+
             if (len(argTypes) == 1):
             if (len(argTypes) == 1):
                 # If this is the last parameter, we are a leaf node, so store the
                 # If this is the last parameter, we are a leaf node, so store the
                 # methodSpec in this dictionary
                 # methodSpec in this dictionary
@@ -375,7 +375,7 @@ class FFIMethodArgumentTree:
                 # Ok, we branch, it was worth a try though
                 # Ok, we branch, it was worth a try though
                 branches = 1
                 branches = 1
                 break
                 break
-            
+
             prevTree = subTree
             prevTree = subTree
             # Must only have one subtree, traverse it
             # Must only have one subtree, traverse it
             subTree = subTree.tree.values()[0][0]
             subTree = subTree.tree.values()[0][0]
@@ -439,9 +439,9 @@ class FFIMethodArgumentTree:
                     # Legal types for an int parameter include long.
                     # Legal types for an int parameter include long.
                     elif (typeName == 'IntType'):
                     elif (typeName == 'IntType'):
                         condition += (' or (isinstance(_args[' + `level` + '], LongType))')
                         condition += (' or (isinstance(_args[' + `level` + '], LongType))')
-                    
+
                 indent(file, nesting+2, 'if ' + condition + ':\n')
                 indent(file, nesting+2, 'if ' + condition + ':\n')
-                    
+
                 if (self.tree[typeDesc][0] is not None):
                 if (self.tree[typeDesc][0] is not None):
                     self.tree[typeDesc][0].traverse(file, nesting+1, level+1)
                     self.tree[typeDesc][0].traverse(file, nesting+1, level+1)
                 else:
                 else:

File diff suppressed because it is too large
+ 182 - 182
direct/src/leveleditor/LevelEditor.py


+ 10 - 10
direct/src/leveleditor/PieMenu.py

@@ -56,27 +56,27 @@ class PieMenu(NodePath, DirectObject):
 
 
         # Pop up menu
         # Pop up menu
         self.reparentTo(render2d)
         self.reparentTo(render2d)
-        self.setPos(self.originX,0.0,self.originY)
+        self.setPos(self.originX, 0.0, self.originY)
         # Compensate for window aspect ratio
         # Compensate for window aspect ratio
-        self.setScale(1.0, 1.0,1.0)
+        self.setScale(1.0, 1.0, 1.0)
         # Start drawing the selection line
         # Start drawing the selection line
         self.lines.reset()
         self.lines.reset()
-        self.lines.moveTo(0,0,0)
-        self.lines.drawTo(0,0,0)
+        self.lines.moveTo(0, 0, 0)
+        self.lines.drawTo(0, 0, 0)
         self.lines.create()
         self.lines.create()
 
 
         # Spawn task to update line and select new texture
         # Spawn task to update line and select new texture
         self.currItem = -1
         self.currItem = -1
         taskMgr.add(self.pieMenuTask, 'pieMenuTask')
         taskMgr.add(self.pieMenuTask, 'pieMenuTask')
 
 
-    def pieMenuTask(self,state):
+    def pieMenuTask(self, state):
         mouseX = self.dr.mouseX
         mouseX = self.dr.mouseX
         mouseY = self.dr.mouseY
         mouseY = self.dr.mouseY
         deltaX = mouseX - self.originX
         deltaX = mouseX - self.originX
         deltaY = mouseY - self.originY
         deltaY = mouseY - self.originY
 
 
         # Update the line
         # Update the line
-        #self.lines.setVertex(1,(deltaX/self.sfx),0.0,(deltaY/self.sfz))
+        #self.lines.setVertex(1, (deltaX/self.sfx), 0.0, (deltaY/self.sfz))
 
 
         # How far from starting point has user moved the cursor?
         # How far from starting point has user moved the cursor?
         if ((abs(deltaX) < 0.1) and (abs(deltaY) < 0.1)):
         if ((abs(deltaX) < 0.1) and (abs(deltaY) < 0.1)):
@@ -108,16 +108,16 @@ class PieMenu(NodePath, DirectObject):
         # Continue task
         # Continue task
         return Task.cont
         return Task.cont
 
 
-    def setInitialState(self,state):
+    def setInitialState(self, state):
         self.initialState = state
         self.initialState = state
 
 
     def getInitialState(self):
     def getInitialState(self):
         return self.initialState
         return self.initialState
 
 
-    def setItemOffset(self,newOffset):
+    def setItemOffset(self, newOffset):
         self.itemOffset = newOffset
         self.itemOffset = newOffset
 
 
-    def setUpdateOnlyOnChange(self,flag):
+    def setUpdateOnlyOnChange(self, flag):
         self.fUpdateOnlyOnChange = flag
         self.fUpdateOnlyOnChange = flag
 
 
 
 
@@ -170,4 +170,4 @@ class TextPieMenu(PieMenu):
         self.removeNode()
         self.removeNode()
 
 
 
 
-        
+

+ 5 - 5
direct/src/particles/ParticleEffect.py

@@ -6,7 +6,7 @@ from direct.directnotify import DirectNotifyGlobal
 
 
 class ParticleEffect(NodePath):
 class ParticleEffect(NodePath):
     notify = DirectNotifyGlobal.directNotify.newCategory('ParticleEffect')
     notify = DirectNotifyGlobal.directNotify.newCategory('ParticleEffect')
-    pid = 1 
+    pid = 1
 
 
     def __init__(self, name=None, particles=None):
     def __init__(self, name=None, particles=None):
         if name == None:
         if name == None:
@@ -53,7 +53,7 @@ class ParticleEffect(NodePath):
 
 
     def enable(self):
     def enable(self):
         # band-aid added for client crash - grw
         # band-aid added for client crash - grw
-        if hasattr(self, 'forceGroupDict') and hasattr(self, 'particlesDict'): 
+        if hasattr(self, 'forceGroupDict') and hasattr(self, 'particlesDict'):
             if (self.renderParent != None):
             if (self.renderParent != None):
                 for p in self.particlesDict.values():
                 for p in self.particlesDict.values():
                     p.setRenderParent(self.renderParent.node())
                     p.setRenderParent(self.renderParent.node())
@@ -75,7 +75,7 @@ class ParticleEffect(NodePath):
 
 
     def isEnabled(self):
     def isEnabled(self):
         """
         """
-        Note: this may be misleading if enable(),disable() not used
+        Note: this may be misleading if enable(), disable() not used
         """
         """
         return self.fEnabled
         return self.fEnabled
 
 
@@ -136,7 +136,7 @@ class ParticleEffect(NodePath):
 
 
     def getParticlesList(self):
     def getParticlesList(self):
         return self.particlesDict.values()
         return self.particlesDict.values()
-    
+
     def getParticlesNamed(self, name):
     def getParticlesNamed(self, name):
         return self.particlesDict.get(name, None)
         return self.particlesDict.get(name, None)
 
 
@@ -173,7 +173,7 @@ class ParticleEffect(NodePath):
         # Save all the particles to file
         # Save all the particles to file
         num = 0
         num = 0
         for p in self.particlesDict.values():
         for p in self.particlesDict.values():
-            target = 'p%d' % num 
+            target = 'p%d' % num
             num = num + 1
             num = num + 1
             f.write(target + ' = Particles.Particles(\'%s\')\n' % p.getName())
             f.write(target + ' = Particles.Particles(\'%s\')\n' % p.getName())
             p.printParams(f, target)
             p.printParams(f, target)

+ 8 - 8
direct/src/particles/Particles.py

@@ -332,11 +332,11 @@ class Particles(ParticleSystem):
             if(cbAttrib):
             if(cbAttrib):
                 cbMode = cbAttrib.getMode()
                 cbMode = cbAttrib.getMode()
                 if(cbMode > 0):
                 if(cbMode > 0):
-                    if(cbMode in (ColorBlendAttrib.MAdd,ColorBlendAttrib.MSubtract,ColorBlendAttrib.MInvSubtract)):
+                    if(cbMode in (ColorBlendAttrib.MAdd, ColorBlendAttrib.MSubtract, ColorBlendAttrib.MInvSubtract)):
                         cboa = cbAttrib.getOperandA()
                         cboa = cbAttrib.getOperandA()
                         cbob = cbAttrib.getOperandB()
                         cbob = cbAttrib.getOperandB()
-                        file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s,ColorBlendAttrib.%s,ColorBlendAttrib.%s)\n' %
-                                (cbmLut[cbMode],cboLut[cboa],cboLut[cbob]))
+                        file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s, ColorBlendAttrib.%s, ColorBlendAttrib.%s)\n' %
+                                (cbmLut[cbMode], cboLut[cboa], cboLut[cbob]))
                     else:
                     else:
                         file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s)\n' % cbmLut[cbMode])
                         file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s)\n' % cbmLut[cbMode])
             cim = self.renderer.getColorInterpolationManager()
             cim = self.renderer.getColorInterpolationManager()
@@ -366,7 +366,7 @@ class Particles(ParticleSystem):
                         file.write(targ+'.renderer.getColorInterpolationManager().addStepwave('+`t_b`+','+`t_e`+','+ \
                         file.write(targ+'.renderer.getColorInterpolationManager().addStepwave('+`t_b`+','+`t_e`+','+ \
                                    'Vec4('+`c_a[0]`+','+`c_a[1]`+','+`c_a[2]`+','+`c_a[3]`+'),' + \
                                    'Vec4('+`c_a[0]`+','+`c_a[1]`+','+`c_a[2]`+','+`c_a[3]`+'),' + \
                                    'Vec4('+`c_b[0]`+','+`c_b[1]`+','+`c_b[2]`+','+`c_b[3]`+'),' + \
                                    'Vec4('+`c_b[0]`+','+`c_b[1]`+','+`c_b[2]`+','+`c_b[3]`+'),' + \
-                                   `w_a`+','+`w_b`+')\n')            
+                                   `w_a`+','+`w_b`+')\n')
                     elif typ == 'ColorInterpolationFunctionSinusoid':
                     elif typ == 'ColorInterpolationFunctionSinusoid':
                         c_a = fun.getColorA()
                         c_a = fun.getColorA()
                         c_b = fun.getColorB()
                         c_b = fun.getColorB()
@@ -434,11 +434,11 @@ class Particles(ParticleSystem):
             if(cbAttrib):
             if(cbAttrib):
                 cbMode = cbAttrib.getMode()
                 cbMode = cbAttrib.getMode()
                 if(cbMode > 0):
                 if(cbMode > 0):
-                    if(cbMode in (ColorBlendAttrib.MAdd,ColorBlendAttrib.MSubtract,ColorBlendAttrib.MInvSubtract)):
+                    if(cbMode in (ColorBlendAttrib.MAdd, ColorBlendAttrib.MSubtract, ColorBlendAttrib.MInvSubtract)):
                         cboa = cbAttrib.getOperandA()
                         cboa = cbAttrib.getOperandA()
                         cbob = cbAttrib.getOperandB()
                         cbob = cbAttrib.getOperandB()
-                        file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s,ColorBlendAttrib.%s,ColorBlendAttrib.%s)\n' %
-                                (cbmLut[cbMode],cboLut[cboa],cboLut[cbob]))
+                        file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s, ColorBlendAttrib.%s, ColorBlendAttrib.%s)\n' %
+                                (cbmLut[cbMode], cboLut[cboa], cboLut[cbob]))
                     else:
                     else:
                         file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s)\n' % cbmLut[cbMode])
                         file.write(targ+'.renderer.setColorBlendMode(ColorBlendAttrib.%s)\n' % cbmLut[cbMode])
             cim = self.renderer.getColorInterpolationManager()
             cim = self.renderer.getColorInterpolationManager()
@@ -468,7 +468,7 @@ class Particles(ParticleSystem):
                         file.write(targ+'.renderer.getColorInterpolationManager().addStepwave('+`t_b`+','+`t_e`+','+ \
                         file.write(targ+'.renderer.getColorInterpolationManager().addStepwave('+`t_b`+','+`t_e`+','+ \
                                    'Vec4('+`c_a[0]`+','+`c_a[1]`+','+`c_a[2]`+','+`c_a[3]`+'),' + \
                                    'Vec4('+`c_a[0]`+','+`c_a[1]`+','+`c_a[2]`+','+`c_a[3]`+'),' + \
                                    'Vec4('+`c_b[0]`+','+`c_b[1]`+','+`c_b[2]`+','+`c_b[3]`+'),' + \
                                    'Vec4('+`c_b[0]`+','+`c_b[1]`+','+`c_b[2]`+','+`c_b[3]`+'),' + \
-                                   `w_a`+','+`w_b`+')\n')            
+                                   `w_a`+','+`w_b`+')\n')
                     elif typ == 'ColorInterpolationFunctionSinusoid':
                     elif typ == 'ColorInterpolationFunctionSinusoid':
                         c_a = fun.getColorA()
                         c_a = fun.getColorA()
                         c_b = fun.getColorB()
                         c_b = fun.getColorB()

+ 13 - 13
direct/src/particles/SpriteParticleRendererExt.py

@@ -33,7 +33,7 @@ class SpriteParticleRendererExt(SpriteParticleRenderer):
 
 
         t = loader.loadTexture(fileName)
         t = loader.loadTexture(fileName)
         if (t != None):
         if (t != None):
-            self.setTexture(t,t.getYSize())
+            self.setTexture(t, t.getYSize())
             self.setSourceTextureName(fileName)
             self.setSourceTextureName(fileName)
             return True
             return True
         else:
         else:
@@ -42,14 +42,14 @@ class SpriteParticleRendererExt(SpriteParticleRenderer):
 
 
     def addTextureFromFile(self, fileName = None):
     def addTextureFromFile(self, fileName = None):
         if(self.getNumAnims() == 0):
         if(self.getNumAnims() == 0):
-            return self.setTextureFromFile(fileName)            
-        
+            return self.setTextureFromFile(fileName)
+
         if fileName == None:
         if fileName == None:
             fileName = self.getSourceTextureName()
             fileName = self.getSourceTextureName()
 
 
         t = loader.loadTexture(fileName)
         t = loader.loadTexture(fileName)
         if (t != None):
         if (t != None):
-            self.addTexture(t,t.getYSize())
+            self.addTexture(t, t.getYSize())
             return True
             return True
         else:
         else:
             print "Couldn't find rendererSpriteTexture file: %s" % fileName
             print "Couldn't find rendererSpriteTexture file: %s" % fileName
@@ -79,14 +79,14 @@ class SpriteParticleRendererExt(SpriteParticleRenderer):
 
 
     def setTextureFromNode(self, modelName = None, nodeName = None, sizeFromTexels = False):
     def setTextureFromNode(self, modelName = None, nodeName = None, sizeFromTexels = False):
         if modelName == None:
         if modelName == None:
-            modelName = self.getSourceFileName()            
+            modelName = self.getSourceFileName()
             if nodeName == None:
             if nodeName == None:
                 nodeName = self.getSourceNodeName()
                 nodeName = self.getSourceNodeName()
-            
+
         # Load model and get texture
         # Load model and get texture
         m = loader.loadModelOnce(modelName)
         m = loader.loadModelOnce(modelName)
         if (m == None):
         if (m == None):
-            print "SpriteParticleRendererExt: Couldn't find model: %s!" % modelName 
+            print "SpriteParticleRendererExt: Couldn't find model: %s!" % modelName
             return False
             return False
 
 
         np = m.find(nodeName)
         np = m.find(nodeName)
@@ -100,20 +100,20 @@ class SpriteParticleRendererExt(SpriteParticleRenderer):
         self.setSourceNodeName(nodeName)
         self.setSourceNodeName(nodeName)
         m.removeNode()
         m.removeNode()
         return True
         return True
-        
+
     def addTextureFromNode(self, modelName = None, nodeName = None, sizeFromTexels = False):
     def addTextureFromNode(self, modelName = None, nodeName = None, sizeFromTexels = False):
         if(self.getNumAnims() == 0):
         if(self.getNumAnims() == 0):
-            return self.setTextureFromNode(modelName,nodeName,sizeFromTexels)
+            return self.setTextureFromNode(modelName, nodeName, sizeFromTexels)
 
 
         if modelName == None:
         if modelName == None:
-            modelName = self.getSourceFileName()            
+            modelName = self.getSourceFileName()
             if nodeName == None:
             if nodeName == None:
                 nodeName = self.getSourceNodeName()
                 nodeName = self.getSourceNodeName()
 
 
         # Load model and get texture
         # Load model and get texture
         m = loader.loadModelOnce(modelName)
         m = loader.loadModelOnce(modelName)
         if (m == None):
         if (m == None):
-            print "SpriteParticleRendererExt: Couldn't find model: %s!" % modelName 
+            print "SpriteParticleRendererExt: Couldn't find model: %s!" % modelName
             return False
             return False
 
 
         np = m.find(nodeName)
         np = m.find(nodeName)
@@ -121,9 +121,9 @@ class SpriteParticleRendererExt(SpriteParticleRenderer):
             print "SpriteParticleRendererExt: Couldn't find node: %s!" % nodeName
             print "SpriteParticleRendererExt: Couldn't find node: %s!" % nodeName
             m.removeNode()
             m.removeNode()
             return False
             return False
-        
+
         self.addFromNode(np, modelName, nodeName, sizeFromTexels)
         self.addFromNode(np, modelName, nodeName, sizeFromTexels)
         m.removeNode()
         m.removeNode()
 
 
         return True
         return True
-        
+

+ 35 - 35
direct/src/pyinst/Builder.py

@@ -64,8 +64,8 @@ class Target:
             self.toc.addFilter(tocfilter.ExtFilter(self.extypes))
             self.toc.addFilter(tocfilter.ExtFilter(self.extypes))
         if self.expatterns:
         if self.expatterns:
             self.toc.addFilter(tocfilter.PatternFilter(self.expatterns))
             self.toc.addFilter(tocfilter.PatternFilter(self.expatterns))
-        
-        ##------utilities------##                   
+
+        ##------utilities------##
     def dump(self):
     def dump(self):
         logfile.write("---- %s: %s -----\n" % (self.__class__.__name__, self.name))
         logfile.write("---- %s: %s -----\n" % (self.__class__.__name__, self.name))
         pprint.pprint(self.__dict__, logfile)
         pprint.pprint(self.__dict__, logfile)
@@ -93,17 +93,17 @@ class Target:
         pass
         pass
     def assemble(self):
     def assemble(self):
         pass
         pass
-        
+
 class PYZTarget(Target):
 class PYZTarget(Target):
     def __init__(self, cfg, sectnm, cnvrts):
     def __init__(self, cfg, sectnm, cnvrts):
         Target.__init__(self, cfg, sectnm, cnvrts)
         Target.__init__(self, cfg, sectnm, cnvrts)
-        # to use a PYZTarget, you'll need imputil and archive 
+        # to use a PYZTarget, you'll need imputil and archive
         archivebuilder.GetCompiled([os.path.join(pyinsthome, 'imputil.py')])
         archivebuilder.GetCompiled([os.path.join(pyinsthome, 'imputil.py')])
         print "pyinsthome:", pyinsthome
         print "pyinsthome:", pyinsthome
         imputil = resource.makeresource('imputil.py', [pyinsthome])
         imputil = resource.makeresource('imputil.py', [pyinsthome])
         self._dependencies.append(imputil)
         self._dependencies.append(imputil)
         archivebuilder.GetCompiled([os.path.join(pyinsthome, 'archive_rt.py')])
         archivebuilder.GetCompiled([os.path.join(pyinsthome, 'archive_rt.py')])
-        archmodule = resource.makeresource('archive_rt.py', [pyinsthome]) 
+        archmodule = resource.makeresource('archive_rt.py', [pyinsthome])
         self._dependencies.merge(archmodule.dependencies())
         self._dependencies.merge(archmodule.dependencies())
         self._dependencies.append(archmodule)
         self._dependencies.append(archmodule)
         self.toc.addFilter(archmodule)
         self.toc.addFilter(archmodule)
@@ -113,7 +113,7 @@ class PYZTarget(Target):
     def edit(self):
     def edit(self):
         if self.extypes:
         if self.extypes:
             print "PYZ target %s ignoring extypes = %s" % (self.__name__, self.extypes)
             print "PYZ target %s ignoring extypes = %s" % (self.__name__, self.extypes)
-            
+
     def gather(self):
     def gather(self):
         for script in self.dependencies:
         for script in self.dependencies:
             rsrc = resource.makeresource(script, self.pathprefix)
             rsrc = resource.makeresource(script, self.pathprefix)
@@ -134,17 +134,17 @@ class PYZTarget(Target):
         logfile.write("Applying the following filters:\n")
         logfile.write("Applying the following filters:\n")
         pprint.pprint(self.toc.filters, logfile)
         pprint.pprint(self.toc.filters, logfile)
         self.toc.filter()
         self.toc.filter()
-        
+
     def assemble(self):
     def assemble(self):
         contents = self.toc.toList()
         contents = self.toc.toList()
         if contents:
         if contents:
             lib = archive.ZlibArchive()
             lib = archive.ZlibArchive()
             lib.build(self.name, archivebuilder.GetCompiled(self.toc.toList()))
             lib.build(self.name, archivebuilder.GetCompiled(self.toc.toList()))
-        
+
 class CollectTarget(Target):
 class CollectTarget(Target):
     def __init__(self, cfg, sectnm, cnvrts):
     def __init__(self, cfg, sectnm, cnvrts):
         Target.__init__(self, cfg, sectnm, cnvrts)
         Target.__init__(self, cfg, sectnm, cnvrts)
-        
+
     _rsrcdict = {'COLLECT': resource.dirresource, 'PYZ': resource.zlibresource, 'CARCHIVE': resource.archiveresource}
     _rsrcdict = {'COLLECT': resource.dirresource, 'PYZ': resource.zlibresource, 'CARCHIVE': resource.archiveresource}
 
 
     def gather(self):
     def gather(self):
@@ -205,10 +205,10 @@ class CollectTarget(Target):
                 self.toc.merge(rsrc.contents())
                 self.toc.merge(rsrc.contents())
         logfile.write('ltoc after trees:\n')
         logfile.write('ltoc after trees:\n')
         pprint.pprint(self.toc.toList(), logfile)
         pprint.pprint(self.toc.toList(), logfile)
-        self.toc.addFilter(tocfilter.TypeFilter(['d'])) 
+        self.toc.addFilter(tocfilter.TypeFilter(['d']))
         logfile.write("Applying the following filters:\n")
         logfile.write("Applying the following filters:\n")
         pprint.pprint(self.toc.filters, logfile)
         pprint.pprint(self.toc.filters, logfile)
-        self.toc.filter() 
+        self.toc.filter()
         #don't dupe stuff in a zlib that's part of this target
         #don't dupe stuff in a zlib that's part of this target
         if self.zlib:
         if self.zlib:
            ztoc = ltoc.lTOC()
            ztoc = ltoc.lTOC()
@@ -220,7 +220,7 @@ class CollectTarget(Target):
                rsrc = self.toc[i]
                rsrc = self.toc[i]
                if isinstance(rsrc, resource.moduleresource) and rsrc in ztoc:
                if isinstance(rsrc, resource.moduleresource) and rsrc in ztoc:
                    del self.toc[i]
                    del self.toc[i]
-        
+
     def assemble(self):
     def assemble(self):
         if os.path.exists(self.name):
         if os.path.exists(self.name):
             if os.path.isdir(self.name):
             if os.path.isdir(self.name):
@@ -235,16 +235,16 @@ class CollectTarget(Target):
         for nm, path, typ in self.toc.toList():
         for nm, path, typ in self.toc.toList():
             shutil.copy2(path, self.name)
             shutil.copy2(path, self.name)
             if typ == 'z':
             if typ == 'z':
-                mysite.append('imputil.FuncImporter(archive.ZlibArchive("%s",0).get_code).install()' % nm)
+                mysite.append('imputil.FuncImporter(archive.ZlibArchive("%s", 0).get_code).install()' % nm)
         if mysite:
         if mysite:
             mysite.insert(0, 'import archive, imputil')
             mysite.insert(0, 'import archive, imputil')
             open(os.path.join(self.name, 'site.py'),'w').write(string.join(mysite, '\n'))
             open(os.path.join(self.name, 'site.py'),'w').write(string.join(mysite, '\n'))
-            
-            
+
+
 class ArchiveTarget(CollectTarget):
 class ArchiveTarget(CollectTarget):
     usefullname = 1
     usefullname = 1
     def __init__(self, cfg, sectnm, cnvrts):
     def __init__(self, cfg, sectnm, cnvrts):
-        CollectTarget.__init__(self, cfg, sectnm, cnvrts)  
+        CollectTarget.__init__(self, cfg, sectnm, cnvrts)
         archivebuilder.GetCompiled([os.path.join(pyinsthome, 'carchive_rt.py')])
         archivebuilder.GetCompiled([os.path.join(pyinsthome, 'carchive_rt.py')])
         carchmodule = resource.makeresource('carchive_rt.py', [pyinsthome])
         carchmodule = resource.makeresource('carchive_rt.py', [pyinsthome])
         self._dependencies.merge(carchmodule.dependencies())
         self._dependencies.merge(carchmodule.dependencies())
@@ -253,12 +253,12 @@ class ArchiveTarget(CollectTarget):
     def edit(self):
     def edit(self):
         if self.destdir:
         if self.destdir:
             print "Warning 'destdir = %s' ignored for %s" % (self.destdir, self.name)
             print "Warning 'destdir = %s' ignored for %s" % (self.destdir, self.name)
-            
+
     def gather(self):
     def gather(self):
         CollectTarget.gather(self)
         CollectTarget.gather(self)
-    
+
     _cdict = {'s':2,'m':1,'b':1,'x':1,'a':0,'z':0, 'p':1}
     _cdict = {'s':2,'m':1,'b':1,'x':1,'a':0,'z':0, 'p':1}
-    
+
     def assemble(self, pkgnm=None):
     def assemble(self, pkgnm=None):
         if pkgnm is None:
         if pkgnm is None:
             pkgnm = self.name
             pkgnm = self.name
@@ -276,7 +276,7 @@ class ArchiveTarget(CollectTarget):
         toc = toc + archivebuilder.GetCompiled(pytoc)
         toc = toc + archivebuilder.GetCompiled(pytoc)
         arch.build(pkgnm, toc)
         arch.build(pkgnm, toc)
         return arch
         return arch
-        
+
 class FullExeTarget(ArchiveTarget):
 class FullExeTarget(ArchiveTarget):
     usefullname = 0
     usefullname = 0
     def __init__(self, cfg, sectnm, cnvrts):
     def __init__(self, cfg, sectnm, cnvrts):
@@ -289,13 +289,13 @@ class FullExeTarget(ArchiveTarget):
             rsrc = resource.scriptresource(rsrc.name, rsrc.path)
             rsrc = resource.scriptresource(rsrc.name, rsrc.path)
             #print " resource is", `rsrc`
             #print " resource is", `rsrc`
             self.toc.merge(rsrc.binaries)
             self.toc.merge(rsrc.binaries)
-        ArchiveTarget.gather(self)        
+        ArchiveTarget.gather(self)
         if not self.zlib:
         if not self.zlib:
             self.toc.merge(rsrc.modules)
             self.toc.merge(rsrc.modules)
         self._dependencies = ltoc.lTOC()
         self._dependencies = ltoc.lTOC()
-        
+
     _cdict = {'s':2,'m':0,'b':1,'x':0,'a':0,'z':0}
     _cdict = {'s':2,'m':0,'b':1,'x':0,'a':0,'z':0}
-    _edict = { (1,1):'Runw_d.exe', (1,0):'Runw.exe', (0,1):'Run_d.exe', (0,0):'Run.exe'}
+    _edict = { (1, 1):'Runw_d.exe', (1, 0):'Runw.exe', (0, 1):'Run_d.exe', (0, 0):'Run.exe'}
 
 
     def assemble(self):
     def assemble(self):
         pkgname = tempfile.mktemp()
         pkgname = tempfile.mktemp()
@@ -333,11 +333,11 @@ class FullExeTarget(ArchiveTarget):
         else:
         else:
             copyFile([exe, pkgname], self.name)
             copyFile([exe, pkgname], self.name)
         #os.remove(pkgname)
         #os.remove(pkgname)
-        
+
 class ExeTarget(FullExeTarget):
 class ExeTarget(FullExeTarget):
     def __init__(self, cfg, sectnm, cnvrts):
     def __init__(self, cfg, sectnm, cnvrts):
         FullExeTarget.__init__(self, cfg, sectnm, cnvrts)
         FullExeTarget.__init__(self, cfg, sectnm, cnvrts)
-        
+
     def edit(self):
     def edit(self):
         if not self.script:
         if not self.script:
             raise ValueError, "EXE target %s requires 'script= <script>'" % self.__name__
             raise ValueError, "EXE target %s requires 'script= <script>'" % self.__name__
@@ -403,8 +403,8 @@ class InstallTarget(FullExeTarget):
                                    txt = open(s.path, 'r').read()
                                    txt = open(s.path, 'r').read()
                                    f.write(txt)
                                    f.write(txt)
             f.close()
             f.close()
-        
-dispatch = { 
+
+dispatch = {
                 'PYZ': PYZTarget,
                 'PYZ': PYZTarget,
                 'CARCHIVE': ArchiveTarget,
                 'CARCHIVE': ArchiveTarget,
                 'COLLECT': CollectTarget,
                 'COLLECT': CollectTarget,
@@ -413,7 +413,7 @@ dispatch = {
                 'FULLEXE': FullExeTarget,
                 'FULLEXE': FullExeTarget,
 }
 }
 
 
-        
+
 def makeTarget(cfg, section):
 def makeTarget(cfg, section):
     return dispatch[cfg.get(section, 'type')](cfg, section, optcnvrts)
     return dispatch[cfg.get(section, 'type')](cfg, section, optcnvrts)
 
 
@@ -430,7 +430,7 @@ optdefaults = { 'type':'PYZ',
                 'expatterns': '',
                 'expatterns': '',
                 'exstdlib': '0',
                 'exstdlib': '0',
                 'extypes': '',
                 'extypes': '',
-                'includes':'',          # PYZ 
+                'includes':'',          # PYZ
                 'packages':'',          # PYZ
                 'packages':'',          # PYZ
                 'destdir':'',           # COLLECT
                 'destdir':'',           # COLLECT
                 'pathprefix': '',
                 'pathprefix': '',
@@ -438,13 +438,13 @@ optdefaults = { 'type':'PYZ',
                 'debug': '0',
                 'debug': '0',
                 'support': '1', # include python20.dll & exceptons.pyc at a minimum
                 'support': '1', # include python20.dll & exceptons.pyc at a minimum
                 'icon': '',
                 'icon': '',
-}   
+}
 
 
 optcnvrts = {   'type':'',
 optcnvrts = {   'type':'',
-                'name': 'getstring',       
-                'exstdlib': 'getbool', 
+                'name': 'getstring',
+                'exstdlib': 'getbool',
                 'console': 'getbool',
                 'console': 'getbool',
-                'analyze': 'getbool', 
+                'analyze': 'getbool',
                 'debug': 'getbool',
                 'debug': 'getbool',
                 'includetk': 'getbool',
                 'includetk': 'getbool',
                 'userunw': 'getbool',
                 'userunw': 'getbool',
@@ -492,10 +492,10 @@ def main(opts, args):
             names = map(lambda x: getattr(x, 'name'), targets)
             names = map(lambda x: getattr(x, 'name'), targets)
             raise RuntimeError, "circular dependencies in %s" % `names`
             raise RuntimeError, "circular dependencies in %s" % `names`
         targets = filter(None, targets)
         targets = filter(None, targets)
-        
+
 def run(file):
 def run(file):
     main ([], file)
     main ([], file)
-    
+
 if __name__ == '__main__':
 if __name__ == '__main__':
     import getopt
     import getopt
     (opts, args) = getopt.getopt(sys.argv[1:], 'dv')
     (opts, args) = getopt.getopt(sys.argv[1:], 'dv')

+ 20 - 20
direct/src/pyinst/archive.py

@@ -17,7 +17,7 @@ import struct
 
 
 class Archive:
 class Archive:
   """ A base class for a repository of python code objects.
   """ A base class for a repository of python code objects.
-  
+
       The get_code method is used by imputil.FuntionImporter
       The get_code method is used by imputil.FuntionImporter
       to get code objects by name.
       to get code objects by name.
       Archives are flat namespaces, so conflict between module
       Archives are flat namespaces, so conflict between module
@@ -47,7 +47,7 @@ class Archive:
   ####### Sub-methods of __init__ - override as needed #############
   ####### Sub-methods of __init__ - override as needed #############
   def checkmagic(self):
   def checkmagic(self):
     """Verify version and validity of file.
     """Verify version and validity of file.
-    
+
         Overridable.
         Overridable.
         Check to see if the file object self.lib actually has a file
         Check to see if the file object self.lib actually has a file
         we understand.
         we understand.
@@ -61,7 +61,7 @@ class Archive:
 
 
   def loadtoc(self):
   def loadtoc(self):
     """Load the table of contents.
     """Load the table of contents.
-    
+
         Overridable.
         Overridable.
         Default: After magic comes an int (4 byte native) giving the
         Default: After magic comes an int (4 byte native) giving the
         position of the TOC within self.lib.
         position of the TOC within self.lib.
@@ -77,7 +77,7 @@ class Archive:
 
 
   def get_code(self, parent, modname, fqname):
   def get_code(self, parent, modname, fqname):
     """The import hook.
     """The import hook.
-    
+
        Called by imputil.FunctionImporter.
        Called by imputil.FunctionImporter.
        Override extract to tune getting code from the Archive."""
        Override extract to tune getting code from the Archive."""
     rslt = self.extract(fqname) # None if not found, (ispkg, code) otherwise
     rslt = self.extract(fqname) # None if not found, (ispkg, code) otherwise
@@ -91,7 +91,7 @@ class Archive:
   ####### Core method - Override as needed  #########
   ####### Core method - Override as needed  #########
   def extract(self, name):
   def extract(self, name):
     """ Get the object corresponding to name, or None.
     """ Get the object corresponding to name, or None.
-    
+
         NAME is the name as specified in an 'import name'.
         NAME is the name as specified in an 'import name'.
         'import a.b' will become:
         'import a.b' will become:
         extract('a') (return None because 'a' is not a code object)
         extract('a') (return None because 'a' is not a code object)
@@ -102,7 +102,7 @@ class Archive:
           self.toc[name] is pos
           self.toc[name] is pos
           self.lib has the code object marshal-ed at pos
           self.lib has the code object marshal-ed at pos
     """
     """
-    ispkg, pos = self.toc.get(name, (0,None))
+    ispkg, pos = self.toc.get(name, (0, None))
     if pos is None:
     if pos is None:
       return None
       return None
     self.lib.seek(self.start + pos)
     self.lib.seek(self.start + pos)
@@ -113,20 +113,20 @@ class Archive:
 
 
   def contents(self):
   def contents(self):
     """Return a list of the contents.
     """Return a list of the contents.
-    
+
        Default implementation assumes self.toc is a dict like object.
        Default implementation assumes self.toc is a dict like object.
     """
     """
     return self.toc.keys()
     return self.toc.keys()
 
 
   ########################################################################
   ########################################################################
   # Building
   # Building
-  
+
   ####### Top level method - shouldn't need overriding #######
   ####### Top level method - shouldn't need overriding #######
   def build(self, path, lTOC):
   def build(self, path, lTOC):
     """Create an archive file of name PATH from LTOC.
     """Create an archive file of name PATH from LTOC.
-    
+
        lTOC is a 'logical TOC' - a list of (name, path, ...)
        lTOC is a 'logical TOC' - a list of (name, path, ...)
-       where name is the internal (import) name, 
+       where name is the internal (import) name,
        and path is a file to get the object from, eg './a.pyc'.
        and path is a file to get the object from, eg './a.pyc'.
     """
     """
     self.path = path
     self.path = path
@@ -139,18 +139,18 @@ class Archive:
 
 
     if type(self.TOCTMPLT) == type({}):
     if type(self.TOCTMPLT) == type({}):
       self.toc = {}
       self.toc = {}
-    else:       # assume callable  
+    else:       # assume callable
       self.toc = self.TOCTMPLT()
       self.toc = self.TOCTMPLT()
 
 
     for tocentry in lTOC:
     for tocentry in lTOC:
       self.add(tocentry)   # the guts of the archive
       self.add(tocentry)   # the guts of the archive
 
 
-    tocpos = self.lib.tell() 
+    tocpos = self.lib.tell()
     self.save_toc(tocpos)
     self.save_toc(tocpos)
     if self.TRLLEN:
     if self.TRLLEN:
       self.save_trailer(tocpos)
       self.save_trailer(tocpos)
     if self.HDRLEN:
     if self.HDRLEN:
-      self.update_headers(tocpos) 
+      self.update_headers(tocpos)
     self.lib.close()
     self.lib.close()
 
 
 
 
@@ -161,7 +161,7 @@ class Archive:
       Override this to influence the mechanics of the Archive.
       Override this to influence the mechanics of the Archive.
        Assumes entry is a seq beginning with (nm, pth, ...) where
        Assumes entry is a seq beginning with (nm, pth, ...) where
        nm is the key by which we'll be asked for the object.
        nm is the key by which we'll be asked for the object.
-       pth is the name of where we find the object. 
+       pth is the name of where we find the object.
     """
     """
     if self.os is None:
     if self.os is None:
       import os
       import os
@@ -188,13 +188,13 @@ class Archive:
 
 
   def update_headers(self, tocpos):
   def update_headers(self, tocpos):
     """Update any header data.
     """Update any header data.
-    
+
        Default header is  MAGIC + Python's magic + tocpos"""
        Default header is  MAGIC + Python's magic + tocpos"""
     self.lib.seek(self.start)
     self.lib.seek(self.start)
     self.lib.write(self.MAGIC)
     self.lib.write(self.MAGIC)
     self.lib.write(self.pymagic)
     self.lib.write(self.pymagic)
     self.lib.write(struct.pack('=i', tocpos))
     self.lib.write(struct.pack('=i', tocpos))
-   
+
 ##############################################################
 ##############################################################
 #
 #
 # ZlibArchive - an archive with compressed entries
 # ZlibArchive - an archive with compressed entries
@@ -215,10 +215,10 @@ class ZlibArchive(Archive):
     # dynamic import so not imported if not needed
     # dynamic import so not imported if not needed
     global zlib
     global zlib
     import zlib
     import zlib
-   
+
   def extract(self, name):
   def extract(self, name):
     """Get the code object for NAME.
     """Get the code object for NAME.
-    
+
        Return None if name is not in the table of contents.
        Return None if name is not in the table of contents.
        Otherwise, return a tuple (ispkg, code)"""
        Otherwise, return a tuple (ispkg, code)"""
     (ispkg, pos, lngth) = self.toc.get(name, (0, None, 0))
     (ispkg, pos, lngth) = self.toc.get(name, (0, None, 0))
@@ -229,7 +229,7 @@ class ZlibArchive(Archive):
 
 
   def add(self, entry):
   def add(self, entry):
     """Add an entry.
     """Add an entry.
-    
+
        ENTRY is a sequence where entry[0] is name and entry[1] is full path name.
        ENTRY is a sequence where entry[0] is name and entry[1] is full path name.
        zlib compress the code object, and build a toc entry"""
        zlib compress the code object, and build a toc entry"""
     if self.os is None:
     if self.os is None:
@@ -243,4 +243,4 @@ class ZlibArchive(Archive):
     obj = zlib.compress(f.read(), self.LEVEL)
     obj = zlib.compress(f.read(), self.LEVEL)
     self.toc[nm] = (ispkg, self.lib.tell(), len(obj))
     self.toc[nm] = (ispkg, self.lib.tell(), len(obj))
     self.lib.write(obj)
     self.lib.write(obj)
- 
+

+ 8 - 8
direct/src/pyinst/archive_rt.py

@@ -98,7 +98,7 @@ class Archive:
           self.toc[name] is pos
           self.toc[name] is pos
           self.lib has the code object marshal-ed at pos
           self.lib has the code object marshal-ed at pos
     """
     """
-    ispkg, pos = self.toc.get(name, (0,None))
+    ispkg, pos = self.toc.get(name, (0, None))
     if pos is None:
     if pos is None:
       return None
       return None
     self.lib.seek(self.start + pos)
     self.lib.seek(self.start + pos)
@@ -116,7 +116,7 @@ class Archive:
 
 
   ########################################################################
   ########################################################################
   # Building
   # Building
-  
+
   ####### Top level method - shouldn't need overriding #######
   ####### Top level method - shouldn't need overriding #######
 ##  def build(self, path, lTOC):
 ##  def build(self, path, lTOC):
 ##    """Create an archive file of name 'path'.
 ##    """Create an archive file of name 'path'.
@@ -134,18 +134,18 @@ class Archive:
 ##
 ##
 ##    if type(self.TOCTMPLT) == type({}):
 ##    if type(self.TOCTMPLT) == type({}):
 ##      self.toc = {}
 ##      self.toc = {}
-##    else:       # assume callable  
+##    else:       # assume callable
 ##      self.toc = self.TOCTMPLT()
 ##      self.toc = self.TOCTMPLT()
 ##
 ##
 ##    for tocentry in lTOC:
 ##    for tocentry in lTOC:
 ##      self.add(tocentry)   # the guts of the archive
 ##      self.add(tocentry)   # the guts of the archive
 ##
 ##
-##    tocpos = self.lib.tell() 
+##    tocpos = self.lib.tell()
 ##    self.save_toc(tocpos)
 ##    self.save_toc(tocpos)
 ##    if self.TRLLEN:
 ##    if self.TRLLEN:
 ##      self.save_trailer(tocpos)
 ##      self.save_trailer(tocpos)
 ##    if self.HDRLEN:
 ##    if self.HDRLEN:
-##      self.update_headers(tocpos) 
+##      self.update_headers(tocpos)
 ##    self.lib.close()
 ##    self.lib.close()
 ##
 ##
 ##
 ##
@@ -184,7 +184,7 @@ class Archive:
 ##    self.lib.write(self.MAGIC)
 ##    self.lib.write(self.MAGIC)
 ##    self.lib.write(self.pymagic)
 ##    self.lib.write(self.pymagic)
 ##    self.lib.write(struct.pack('=i', tocpos))
 ##    self.lib.write(struct.pack('=i', tocpos))
-   
+
 ##############################################################
 ##############################################################
 #
 #
 # ZlibArchive - an archive with compressed entries
 # ZlibArchive - an archive with compressed entries
@@ -203,7 +203,7 @@ class ZlibArchive(Archive):
     # dynamic import so not imported if not needed
     # dynamic import so not imported if not needed
     global zlib
     global zlib
     import zlib
     import zlib
-   
+
   def extract(self, name):
   def extract(self, name):
     (ispkg, pos, lngth) = self.toc.get(name, (0, None, 0))
     (ispkg, pos, lngth) = self.toc.get(name, (0, None, 0))
     if pos is None:
     if pos is None:
@@ -223,4 +223,4 @@ class ZlibArchive(Archive):
 ##    obj = zlib.compress(f.read(), self.LEVEL)
 ##    obj = zlib.compress(f.read(), self.LEVEL)
 ##    self.toc[nm] = (ispkg, self.lib.tell(), len(obj))
 ##    self.toc[nm] = (ispkg, self.lib.tell(), len(obj))
 ##    self.lib.write(obj)
 ##    self.lib.write(obj)
-## 
+##

+ 18 - 18
direct/src/pyinst/bindepend.py

@@ -21,8 +21,8 @@ import tempfile
 import finder
 import finder
 
 
 seen = {}
 seen = {}
-excludes = {'KERNEL32.DLL':1, 
-      'ADVAPI.DLL':1, 
+excludes = {'KERNEL32.DLL':1,
+      'ADVAPI.DLL':1,
       'MSVCRT.DLL':1,
       'MSVCRT.DLL':1,
       'ADVAPI32.DLL':1,
       'ADVAPI32.DLL':1,
       'COMCTL32.DLL':1,
       'COMCTL32.DLL':1,
@@ -43,11 +43,11 @@ excludes = {'KERNEL32.DLL':1,
       'COMDLG32.DLL':1,
       'COMDLG32.DLL':1,
       'ZLIB.DLL':1,
       'ZLIB.DLL':1,
       'ODBC32.DLL':1,
       'ODBC32.DLL':1,
-      'VERSION.DLL':1}     
+      'VERSION.DLL':1}
 
 
 def getfullnameof(mod, xtrapath = None):
 def getfullnameof(mod, xtrapath = None):
   """Return the full path name of MOD.
   """Return the full path name of MOD.
-  
+
       MOD is the basename of a dll or pyd.
       MOD is the basename of a dll or pyd.
       XTRAPATH is a path or list of paths to search first.
       XTRAPATH is a path or list of paths to search first.
       Return the full path name of MOD.
       Return the full path name of MOD.
@@ -65,10 +65,10 @@ def getfullnameof(mod, xtrapath = None):
     if os.path.exists(npth):
     if os.path.exists(npth):
       return npth
       return npth
   return ''
   return ''
-  
+
 def getImports1(pth):
 def getImports1(pth):
     """Find the binary dependencies of PTH.
     """Find the binary dependencies of PTH.
-    
+
         This implementation (not used right now) uses the MSVC utility dumpbin"""
         This implementation (not used right now) uses the MSVC utility dumpbin"""
     rslt = []
     rslt = []
     tmpf = tempfile.mktemp()
     tmpf = tempfile.mktemp()
@@ -83,10 +83,10 @@ def getImports1(pth):
             rslt.append(string.strip(tokens[0]))
             rslt.append(string.strip(tokens[0]))
         i = i + 1
         i = i + 1
     return rslt
     return rslt
-    
+
 def getImports2(pth):
 def getImports2(pth):
     """Find the binary dependencies of PTH.
     """Find the binary dependencies of PTH.
-    
+
         This implementation walks through the PE header"""
         This implementation walks through the PE header"""
     import struct
     import struct
     rslt = []
     rslt = []
@@ -127,43 +127,43 @@ def getImports2(pth):
     except struct.error:
     except struct.error:
       print "bindepend cannot analyze %s - error walking thru pehdr"
       print "bindepend cannot analyze %s - error walking thru pehdr"
     return rslt
     return rslt
-    
+
 def Dependencies(lTOC):
 def Dependencies(lTOC):
   """Expand LTOC to include all the closure of binary dependencies.
   """Expand LTOC to include all the closure of binary dependencies.
-  
+
      LTOC is a logical table of contents, ie, a seq of tuples (name, path).
      LTOC is a logical table of contents, ie, a seq of tuples (name, path).
      Return LTOC expanded by all the binary dependencies of the entries
      Return LTOC expanded by all the binary dependencies of the entries
      in LTOC, except those listed in the module global EXCLUDES"""
      in LTOC, except those listed in the module global EXCLUDES"""
   for (nm, pth) in lTOC:
   for (nm, pth) in lTOC:
     fullnm = string.upper(os.path.basename(pth))
     fullnm = string.upper(os.path.basename(pth))
-    if seen.get(string.upper(nm),0):
+    if seen.get(string.upper(nm), 0):
       continue
       continue
     print "analyzing", nm
     print "analyzing", nm
     seen[string.upper(nm)] = 1
     seen[string.upper(nm)] = 1
     dlls = getImports(pth)
     dlls = getImports(pth)
     for lib in dlls:
     for lib in dlls:
         print " found", lib
         print " found", lib
-        if excludes.get(string.upper(lib),0):
+        if excludes.get(string.upper(lib), 0):
           continue
           continue
-        if seen.get(string.upper(lib),0):
+        if seen.get(string.upper(lib), 0):
           continue
           continue
         npth = getfullnameof(lib)
         npth = getfullnameof(lib)
         if npth:
         if npth:
           lTOC.append((lib, npth))
           lTOC.append((lib, npth))
         else:
         else:
-          print " lib not found:", lib, "dependency of", 
+          print " lib not found:", lib, "dependency of",
   return lTOC
   return lTOC
-  
-        
+
+
 ##if getfullnameof('dumpbin.exe') == '':
 ##if getfullnameof('dumpbin.exe') == '':
 ##    def getImports(pth):
 ##    def getImports(pth):
 ##        return getImports2(pth)
 ##        return getImports2(pth)
 ##else:
 ##else:
 ##    def getImports(pth):
 ##    def getImports(pth):
 ##        return getImports1(pth)
 ##        return getImports1(pth)
-        
+
 def getImports(pth):
 def getImports(pth):
     """Forwards to either getImports1 or getImports2
     """Forwards to either getImports1 or getImports2
     """
     """
     return getImports2(pth)
     return getImports2(pth)
- 
+

+ 2 - 2
direct/src/pyinst/mkarchive.py

@@ -4,11 +4,11 @@ import strop
 import zlib
 import zlib
 import os
 import os
 import marshal
 import marshal
-    
+
 class MkImporter:
 class MkImporter:
     def __init__(self, db, viewnm='pylib'):
     def __init__(self, db, viewnm='pylib'):
         self.db = db
         self.db = db
-        self.view = db.getas(viewnm+'[name:S,ispkg:I,code:M]') # an MkWrap view object
+        self.view = db.getas(viewnm+'[name:S, ispkg:I, code:M]') # an MkWrap view object
     def setImportHooks(self):
     def setImportHooks(self):
         imputil.FuncImporter(self.get_code).install()
         imputil.FuncImporter(self.get_code).install()
     def get_code(self, parent, modname, fqname):
     def get_code(self, parent, modname, fqname):

+ 37 - 37
direct/src/pyinst/resource.py

@@ -10,7 +10,7 @@ _cache = {}
 
 
 def makeresource(name, xtrapath=None):
 def makeresource(name, xtrapath=None):
     """Factory function that returns a resource subclass.
     """Factory function that returns a resource subclass.
-    
+
        NAME is the logical or physical name of a resource.
        NAME is the logical or physical name of a resource.
        XTRAPTH is a path or list of paths to search first.
        XTRAPTH is a path or list of paths to search first.
        return one of the resource subclasses.
        return one of the resource subclasses.
@@ -44,7 +44,7 @@ def makeresource(name, xtrapath=None):
 
 
 class resource:
 class resource:
     """ Base class for all resources.
     """ Base class for all resources.
-    
+
         contents() returns of list of what's contained (eg files in dirs)
         contents() returns of list of what's contained (eg files in dirs)
         dependencies() for Python resources returns a list of moduleresources
         dependencies() for Python resources returns a list of moduleresources
          and binaryresources """
          and binaryresources """
@@ -60,13 +60,13 @@ class resource:
         return "(%(name)s, %(path)s, %(typ)s)" % self.__dict__
         return "(%(name)s, %(path)s, %(typ)s)" % self.__dict__
     def contents(self):
     def contents(self):
         """A list of resources within this resource.
         """A list of resources within this resource.
-        
+
            Overridable.
            Overridable.
            Base implementation returns [self]"""
            Base implementation returns [self]"""
         return [self]
         return [self]
     def dependencies(self):
     def dependencies(self):
         """A list of resources this resource requires.
         """A list of resources this resource requires.
-        
+
            Overridable.
            Overridable.
            Base implementation returns []"""
            Base implementation returns []"""
         return []
         return []
@@ -76,30 +76,30 @@ class resource:
         return cmp((self.typ, self.name), (other.typ, other.name))
         return cmp((self.typ, self.name), (other.typ, other.name))
     def asFilter(self):
     def asFilter(self):
         """Create a tocfilter based on self.
         """Create a tocfilter based on self.
-        
+
            Pure virtual"""
            Pure virtual"""
         raise NotImplementedError
         raise NotImplementedError
     def asSource(self):
     def asSource(self):
         """Return self in source form.
         """Return self in source form.
-        
+
            Base implementation returns self"""
            Base implementation returns self"""
         return self
         return self
     def asBinary(self):
     def asBinary(self):
         """Return self in binary form.
         """Return self in binary form.
-        
+
            Base implementation returns self"""
            Base implementation returns self"""
         return self
         return self
 
 
 class pythonresource(resource):
 class pythonresource(resource):
     """An empty base class.
     """An empty base class.
-    
+
        Used to classify resources."""
        Used to classify resources."""
     pass
     pass
-         
-        
+
+
 class scriptresource(pythonresource):
 class scriptresource(pythonresource):
     """ A top-level python resource.
     """ A top-level python resource.
-    
+
         Has (lazily computed) attributes, modules and binaries, which together
         Has (lazily computed) attributes, modules and binaries, which together
         are the scripts dependencies() """
         are the scripts dependencies() """
     def __init__(self, name, fullname):
     def __init__(self, name, fullname):
@@ -141,25 +141,25 @@ class scriptresource(pythonresource):
         return tocfilter.ModFilter([self.name])
         return tocfilter.ModFilter([self.name])
     def asSource(self):
     def asSource(self):
         """Return self as a dataresource (ie, a text file wrapper)."""
         """Return self as a dataresource (ie, a text file wrapper)."""
-        r = dataresource(self.path) 
+        r = dataresource(self.path)
         r.name = apply(os.path.join, string.split(self.name, '.')[:-1]+[r.name])
         r.name = apply(os.path.join, string.split(self.name, '.')[:-1]+[r.name])
-        return r 
-               
+        return r
+
 class moduleresource(scriptresource):
 class moduleresource(scriptresource):
-    """ A module resource (differs from script in that it will generally 
+    """ A module resource (differs from script in that it will generally
         be worked with as a .pyc instead of in source form) """
         be worked with as a .pyc instead of in source form) """
     def __init__(self, name, fullname):
     def __init__(self, name, fullname):
         resource.__init__(self, name, fullname, 'm')
         resource.__init__(self, name, fullname, 'm')
     def asBinary(self):
     def asBinary(self):
         """Return self as a dataresource (ie, a binary file wrapper)."""
         """Return self as a dataresource (ie, a binary file wrapper)."""
-        r = dataresource(self.path) 
+        r = dataresource(self.path)
         r.name = os.path.basename(r.name)
         r.name = os.path.basename(r.name)
         r.typ = 'b'
         r.typ = 'b'
-        return r 
+        return r
     def asSource(self):
     def asSource(self):
         """Return self as a scriptresource (ie, uncompiled form)."""
         """Return self as a scriptresource (ie, uncompiled form)."""
         return scriptresource(self.name, self.path[:-1]).asSource()
         return scriptresource(self.name, self.path[:-1]).asSource()
-        
+
 class binaryresource(resource):
 class binaryresource(resource):
     """A .dll or .pyd.
     """A .dll or .pyd.
 
 
@@ -182,7 +182,7 @@ class binaryresource(resource):
     def asFilter(self):
     def asFilter(self):
         """Create a FileFilter from self."""
         """Create a FileFilter from self."""
         return tocfilter.FileFilter([self.name])
         return tocfilter.FileFilter([self.name])
-        
+
 class dataresource(resource):
 class dataresource(resource):
     """A subclass for arbitrary files. """
     """A subclass for arbitrary files. """
     def __init__(self, name, fullname=None):
     def __init__(self, name, fullname=None):
@@ -190,22 +190,22 @@ class dataresource(resource):
     def asFilter(self):
     def asFilter(self):
         """Create a FileFilter from self."""
         """Create a FileFilter from self."""
         return tocfilter.FileFilter([self.name])
         return tocfilter.FileFilter([self.name])
-        
+
 class archiveresource(dataresource):
 class archiveresource(dataresource):
     """A sublcass for CArchives. """
     """A sublcass for CArchives. """
     def __init__(self, name, fullname=None):
     def __init__(self, name, fullname=None):
         resource.__init__(self, name, fullname or name, 'a')
         resource.__init__(self, name, fullname or name, 'a')
-        
+
 class zlibresource(dataresource):
 class zlibresource(dataresource):
     """A subclass for ZlibArchives. """
     """A subclass for ZlibArchives. """
     def __init__(self, name, fullname=None):
     def __init__(self, name, fullname=None):
         resource.__init__(self, name, fullname or name, 'z')
         resource.__init__(self, name, fullname or name, 'z')
-        
+
 class dirresource(resource):
 class dirresource(resource):
     """A sublcass for a directory.
     """A sublcass for a directory.
 
 
-       Generally transformed to a list of files through 
-        contents() and filtered by file extensions or resource type. 
+       Generally transformed to a list of files through
+        contents() and filtered by file extensions or resource type.
         Note that contents() is smart enough to regard a .py and .pyc
         Note that contents() is smart enough to regard a .py and .pyc
         as the same resource. """
         as the same resource. """
     RECURSIVE = 0
     RECURSIVE = 0
@@ -226,7 +226,7 @@ class dirresource(resource):
                 elif ext == '.pyo' and (bnm + '.pyc' in flist):
                 elif ext == '.pyo' and (bnm + '.pyc' in flist):
                     pass
                     pass
                 else:
                 else:
-                    rsrc = makeresource(os.path.join(self.path,fnm))
+                    rsrc = makeresource(os.path.join(self.path, fnm))
                     if isinstance(rsrc, pkgresource):
                     if isinstance(rsrc, pkgresource):
                         rsrc = self.__class__(rsrc.path)
                         rsrc = self.__class__(rsrc.path)
                     if self.RECURSIVE:
                     if self.RECURSIVE:
@@ -241,22 +241,22 @@ class dirresource(resource):
                             self._contents.append(rsrc)
                             self._contents.append(rsrc)
                     else:
                     else:
                         self._contents.append(rsrc)
                         self._contents.append(rsrc)
-            except ValueError,e:
+            except ValueError, e:
                 raise RuntimeError, "Can't make resource from %s\n ValueError: %s" \
                 raise RuntimeError, "Can't make resource from %s\n ValueError: %s" \
                       % (os.path.join(self.path, fnm), `e.args`)
                       % (os.path.join(self.path, fnm), `e.args`)
         return self._contents
         return self._contents
     def asFilter(self):
     def asFilter(self):
         return tocfilter.DirFilter([self.path])
         return tocfilter.DirFilter([self.path])
-         
+
 class treeresource(dirresource):
 class treeresource(dirresource):
     """A subclass for a directory and subdirectories."""
     """A subclass for a directory and subdirectories."""
     RECURSIVE = 1
     RECURSIVE = 1
     def __init__(self, name, fullname=None):
     def __init__(self, name, fullname=None):
         dirresource.__init__(self, name, fullname)
         dirresource.__init__(self, name, fullname)
-    
+
 class pkgresource(pythonresource):
 class pkgresource(pythonresource):
     """A Python package.
     """A Python package.
-    
+
         Note that contents() can be fooled by fancy __path__ statements. """
         Note that contents() can be fooled by fancy __path__ statements. """
     def __init__(self, nm, fullname):
     def __init__(self, nm, fullname):
         resource.__init__(self, nm, fullname, 'p')
         resource.__init__(self, nm, fullname, 'p')
@@ -303,15 +303,15 @@ class pkgresource(pythonresource):
     def asFilter(self):
     def asFilter(self):
         """Create a PkgFilter from self."""
         """Create a PkgFilter from self."""
         return tocfilter.PkgFilter([os.path.dirname(self.path)])
         return tocfilter.PkgFilter([os.path.dirname(self.path)])
-        
-        
-        
-        
-        
-        
-        
+
+
+
+
+
+
+
 if __name__ == '__main__':
 if __name__ == '__main__':
     s = scriptresource('finder.py', './finder.py')
     s = scriptresource('finder.py', './finder.py')
     print "s.modules:", s.modules
     print "s.modules:", s.modules
     print "s.binaries:", s.binaries
     print "s.binaries:", s.binaries
-    
+

+ 4 - 4
direct/src/showbase/Pool.py

@@ -8,7 +8,7 @@ or be the same type.
 
 
 Internally the pool is implemented with 2 lists, free items and used items.
 Internally the pool is implemented with 2 lists, free items and used items.
 
 
-p = Pool([1,2,3,4,5])
+p = Pool([1, 2, 3, 4, 5])
 x = p.checkout()
 x = p.checkout()
 p.checkin(x)
 p.checkin(x)
 
 
@@ -20,7 +20,7 @@ from direct.directnotify import DirectNotifyGlobal
 class Pool:
 class Pool:
 
 
     notify = DirectNotifyGlobal.directNotify.newCategory("Pool")
     notify = DirectNotifyGlobal.directNotify.newCategory("Pool")
-    
+
     def __init__(self, free=None):
     def __init__(self, free=None):
         if free:
         if free:
             self.__free = free
             self.__free = free
@@ -107,8 +107,8 @@ class Pool:
                 cleanupFunc(item)
                 cleanupFunc(item)
         del self.__free
         del self.__free
         del self.__used
         del self.__used
-    
-    def __repr__(self):        
+
+    def __repr__(self):
         return "free = %s\nused = %s" % (self.__free, self.__used)
         return "free = %s\nused = %s" % (self.__free, self.__used)
 
 
 
 

+ 5 - 5
direct/src/showbase/RandomNumGen.py

@@ -18,10 +18,10 @@ class RandomNumGen:
 
 
     def __init__(self, seed):
     def __init__(self, seed):
         """seed must be an integer or another RandomNumGen"""
         """seed must be an integer or another RandomNumGen"""
-        if isinstance(seed,RandomNumGen):
+        if isinstance(seed, RandomNumGen):
             # seed this rng with the other rng
             # seed this rng with the other rng
             rng = seed
             rng = seed
-            seed = rng.randint(0,1L << 16)
+            seed = rng.randint(0, 1L << 16)
 
 
         self.notify.debug("seed: " + str(seed))
         self.notify.debug("seed: " + str(seed))
         seed = int(seed)
         seed = int(seed)
@@ -120,8 +120,8 @@ class RandomNumGen:
             raise ValueError, "empty range for randrange()"
             raise ValueError, "empty range for randrange()"
         return istart + istep*int(self.__rand(n))
         return istart + istep*int(self.__rand(n))
 
 
-    def randint(self, a,b):
-        """returns integer in [a,b]"""
+    def randint(self, a, b):
+        """returns integer in [a, b]"""
         assert a <= b
         assert a <= b
         range = b-a+1
         range = b-a+1
         r = self.__rand(range)
         r = self.__rand(range)
@@ -131,5 +131,5 @@ class RandomNumGen:
     # this function for important decision points where remote
     # this function for important decision points where remote
     # synchronicity is critical
     # synchronicity is critical
     def random(self):
     def random(self):
-        """returns random float in [0.0,1.0)"""
+        """returns random float in [0.0, 1.0)"""
         return float(self.__rng.getUint31()) / float(1L << 31)
         return float(self.__rng.getUint31()) / float(1L << 31)

+ 13 - 13
direct/src/showbase/ShadowDemo.py

@@ -9,7 +9,7 @@ This is meant primarily as a demonstration of multipass and
 multitexture rendering techniques.  It's not a particularly great
 multitexture rendering techniques.  It's not a particularly great
 way to do shadows.
 way to do shadows.
 """
 """
-    
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from direct.task import Task
 from direct.task import Task
 
 
@@ -18,7 +18,7 @@ sc = None
 class ShadowCaster:
 class ShadowCaster:
     texXSize = 128
     texXSize = 128
     texYSize = 128
     texYSize = 128
-    
+
     def __init__(self, lightPath, objectPath, filmX, filmY):
     def __init__(self, lightPath, objectPath, filmX, filmY):
         self.lightPath = lightPath
         self.lightPath = lightPath
         self.objectPath = objectPath
         self.objectPath = objectPath
@@ -75,7 +75,7 @@ class ShadowCaster:
         """ Specifies the part of the world that is to be considered
         """ Specifies the part of the world that is to be considered
         the ground: this is the part onto which the rendered texture
         the ground: this is the part onto which the rendered texture
         will be applied. """
         will be applied. """
-        
+
         if self.groundPath:
         if self.groundPath:
             self.groundPath.clearProjectTexture(self.stage)
             self.groundPath.clearProjectTexture(self.stage)
 
 
@@ -128,12 +128,12 @@ def avatarShadow():
         return Task.cont
         return Task.cont
 
 
     taskMgr.remove('shadowCamera')
     taskMgr.remove('shadowCamera')
-    taskMgr.add(shadowCameraRotate, 'shadowCamera')    
+    taskMgr.add(shadowCameraRotate, 'shadowCamera')
 
 
     global sc
     global sc
     if sc != None:
     if sc != None:
         sc.clear()
         sc.clear()
-        
+
     sc = ShadowCaster(lightPath, objectPath, 4, 6)
     sc = ShadowCaster(lightPath, objectPath, 4, 6)
 
 
     # Naively, just apply the shadow to everything in the world.  It
     # Naively, just apply the shadow to everything in the world.  It
@@ -147,7 +147,7 @@ def piratesAvatarShadow():
     # Force the lod to be 0 at all times
     # Force the lod to be 0 at all times
     base.localAvatar.getGeomNode().getChild(0).node().forceSwitch(0)
     base.localAvatar.getGeomNode().getChild(0).node().forceSwitch(0)
     return a
     return a
-    
+
 def arbitraryShadow(node):
 def arbitraryShadow(node):
     # Turn off the existing drop shadow, if any
     # Turn off the existing drop shadow, if any
     if hasattr(node, "dropShadow"):
     if hasattr(node, "dropShadow"):
@@ -174,12 +174,12 @@ def arbitraryShadow(node):
         return Task.cont
         return Task.cont
 
 
     taskMgr.remove('shadowCamera')
     taskMgr.remove('shadowCamera')
-    taskMgr.add(shadowCameraRotate, 'shadowCamera')    
+    taskMgr.add(shadowCameraRotate, 'shadowCamera')
 
 
     global sc
     global sc
     if sc != None:
     if sc != None:
         sc.clear()
         sc.clear()
-        
+
     sc = ShadowCaster(lightPath, objectPath, 100, 100)
     sc = ShadowCaster(lightPath, objectPath, 100, 100)
 
 
     # Naively, just apply the shadow to everything in the world.  It
     # Naively, just apply the shadow to everything in the world.  It
@@ -203,16 +203,16 @@ def arbitraryShadow(node):
 ##aNP = s.attachNewNode(a.upcastToPandaNode())
 ##aNP = s.attachNewNode(a.upcastToPandaNode())
 ##b.setLight(aNP)
 ##b.setLight(aNP)
 ##d = DirectionalLight("chernabogDirectionalLight")
 ##d = DirectionalLight("chernabogDirectionalLight")
-##d.setDirection(Vec3(0,1,0))
+##d.setDirection(Vec3(0, 1, 0))
 ##d.setColor(Vec4(1))
 ##d.setColor(Vec4(1))
 ###d.setColor(Vec4(0.9, 0.7, 0.7, 1.000))
 ###d.setColor(Vec4(0.9, 0.7, 0.7, 1.000))
 ##dNP = s.attachNewNode(d.upcastToPandaNode())
 ##dNP = s.attachNewNode(d.upcastToPandaNode())
 ##b.setLight(dNP)
 ##b.setLight(dNP)
 ##
 ##
-##ival = Sequence(LerpPosInterval(bs.lightPath, 0.0, Vec3(-200,0,50)),
-##                LerpPosInterval(bs.lightPath, 10.0, Vec3(-200,0,200)),
-##                LerpPosInterval(bs.lightPath, 10.0, Vec3(200,0,200)),
-##                LerpPosInterval(bs.lightPath, 10.0, Vec3(200,0,50)),
+##ival = Sequence(LerpPosInterval(bs.lightPath, 0.0, Vec3(-200, 0, 50)),
+##                LerpPosInterval(bs.lightPath, 10.0, Vec3(-200, 0, 200)),
+##                LerpPosInterval(bs.lightPath, 10.0, Vec3(200, 0, 200)),
+##                LerpPosInterval(bs.lightPath, 10.0, Vec3(200, 0, 50)),
 ##)
 ##)
 ##ival.loop()
 ##ival.loop()
 
 

+ 36 - 36
direct/src/showbase/Transitions.py

@@ -14,7 +14,7 @@ class Transitions:
     def __init__(self, loader,
     def __init__(self, loader,
                  model=None,
                  model=None,
                  scale=3.0,
                  scale=3.0,
-                 pos=Vec3(0,0,0)):
+                 pos=Vec3(0, 0, 0)):
         self.transitionIval = None
         self.transitionIval = None
         self.letterboxIval = None
         self.letterboxIval = None
         self.iris = None
         self.iris = None
@@ -24,15 +24,15 @@ class Transitions:
         self.imageScale = scale
         self.imageScale = scale
         self.imagePos = pos
         self.imagePos = pos
         if model:
         if model:
-            self.alphaOff = Vec4(1,1,1,0)
-            self.alphaOn = Vec4(1,1,1,1)
+            self.alphaOff = Vec4(1, 1, 1, 0)
+            self.alphaOn = Vec4(1, 1, 1, 1)
             model.setTransparency(1)
             model.setTransparency(1)
             self.lerpFunc = LerpColorScaleInterval
             self.lerpFunc = LerpColorScaleInterval
         else:
         else:
-            self.alphaOff = Vec4(0,0,0,0)
-            self.alphaOn = Vec4(0,0,0,1)
+            self.alphaOff = Vec4(0, 0, 0, 0)
+            self.alphaOn = Vec4(0, 0, 0, 1)
             self.lerpFunc = LerpColorInterval
             self.lerpFunc = LerpColorInterval
-            
+
         self.irisTaskName = "irisTask"
         self.irisTaskName = "irisTask"
         self.fadeTaskName = "fadeTask"
         self.fadeTaskName = "fadeTask"
         self.letterboxTaskName = "letterboxTask"
         self.letterboxTaskName = "letterboxTask"
@@ -41,7 +41,7 @@ class Transitions:
         if self.fadeModel:
         if self.fadeModel:
             self.fadeModel.removeNode()
             self.fadeModel.removeNode()
             self.fadeModel = None
             self.fadeModel = None
-            
+
     ##################################################
     ##################################################
     # Fade
     # Fade
     ##################################################
     ##################################################
@@ -51,18 +51,18 @@ class Transitions:
         self.fadeModel = model
         self.fadeModel = model
         # We have to change some default parameters for a custom fadeModel
         # We have to change some default parameters for a custom fadeModel
         self.imageScale = scale
         self.imageScale = scale
-        self.alphaOn = Vec4(1,1,1,1)
+        self.alphaOn = Vec4(1, 1, 1, 1)
 
 
         # Reload fade if its already been created
         # Reload fade if its already been created
         if self.fade:
         if self.fade:
             del self.fade
             del self.fade
             self.fade = None
             self.fade = None
             self.loadFade()
             self.loadFade()
-        
+
     def loadFade(self):
     def loadFade(self):
         if not self.fadeModel:
         if not self.fadeModel:
             self.fadeModel = loader.loadModel(self.FadeModelName)
             self.fadeModel = loader.loadModel(self.FadeModelName)
-            
+
         if self.fade == None:
         if self.fade == None:
             # We create a DirectFrame for the fade polygon, instead of
             # We create a DirectFrame for the fade polygon, instead of
             # simply loading the polygon model and using it directly,
             # simply loading the polygon model and using it directly,
@@ -75,14 +75,14 @@ class Transitions:
                 image = self.fadeModel,
                 image = self.fadeModel,
                 image_scale = self.imageScale,
                 image_scale = self.imageScale,
                 state = NORMAL,
                 state = NORMAL,
-                )                                    
+                )
 
 
     def fadeIn(self, t=0.5, finishIval=None):
     def fadeIn(self, t=0.5, finishIval=None):
         """
         """
         Play a fade in transition over t seconds.
         Play a fade in transition over t seconds.
         Places a polygon on the aspect2d plane then lerps the color
         Places a polygon on the aspect2d plane then lerps the color
         from black to transparent. When the color lerp is finished, it
         from black to transparent. When the color lerp is finished, it
-        parents the fade polygon to hidden. 
+        parents the fade polygon to hidden.
         """
         """
         self.noTransitions()
         self.noTransitions()
         self.loadFade()
         self.loadFade()
@@ -102,7 +102,7 @@ class Transitions:
             if finishIval:
             if finishIval:
                 self.transitionIval.append(finishIval)
                 self.transitionIval.append(finishIval)
             self.transitionIval.start()
             self.transitionIval.start()
-            
+
     def fadeOut(self, t=0.5, finishIval=None):
     def fadeOut(self, t=0.5, finishIval=None):
         """
         """
         Play a fade out transition over t seconds.
         Play a fade out transition over t seconds.
@@ -156,7 +156,7 @@ class Transitions:
         self.noTransitions()
         self.noTransitions()
         self.loadFade()
         self.loadFade()
         self.fade.reparentTo(aspect2d, FADE_SORT_INDEX)
         self.fade.reparentTo(aspect2d, FADE_SORT_INDEX)
-        self.fade.setColor(color)        
+        self.fade.setColor(color)
 
 
     def noFade(self):
     def noFade(self):
         """
         """
@@ -169,8 +169,8 @@ class Transitions:
             self.fade.detachNode()
             self.fade.detachNode()
 
 
     def setFadeColor(self, r, g, b):
     def setFadeColor(self, r, g, b):
-        self.alphaOn.set(r,g,b,1)
-        self.alphaOff.set(r,g,b,0)
+        self.alphaOn.set(r, g, b, 1)
+        self.alphaOff.set(r, g, b, 0)
 
 
 
 
     ##################################################
     ##################################################
@@ -180,7 +180,7 @@ class Transitions:
     def loadIris(self):
     def loadIris(self):
         if self.iris == None:
         if self.iris == None:
             self.iris = loader.loadModel(self.IrisModelName)
             self.iris = loader.loadModel(self.IrisModelName)
-            self.iris.setPos(0,0,0)
+            self.iris.setPos(0, 0, 0)
 
 
     def irisIn(self, t=0.5, finishIval=None):
     def irisIn(self, t=0.5, finishIval=None):
         """
         """
@@ -205,7 +205,7 @@ class Transitions:
             if finishIval:
             if finishIval:
                 self.transitionIval.append(finishIval)
                 self.transitionIval.append(finishIval)
             self.transitionIval.start()
             self.transitionIval.start()
-            
+
     def irisOut(self, t=0.5, finishIval=None):
     def irisOut(self, t=0.5, finishIval=None):
         """
         """
         Play an iris out transition over t seconds.
         Play an iris out transition over t seconds.
@@ -275,22 +275,22 @@ class Transitions:
                 guiId = 'letterboxTop',
                 guiId = 'letterboxTop',
                 relief = FLAT,
                 relief = FLAT,
                 state = NORMAL,
                 state = NORMAL,
-                frameColor = (0,0,0,1),
-                borderWidth = (0,0),
+                frameColor = (0, 0, 0, 1),
+                borderWidth = (0, 0),
                 frameSize = (-1, 1, 0, 0.2),
                 frameSize = (-1, 1, 0, 0.2),
-                pos = (0,0,0.8),
+                pos = (0, 0, 0.8),
                 )
                 )
             self.letterboxBottom = DirectFrame(
             self.letterboxBottom = DirectFrame(
                 parent = self.letterbox,
                 parent = self.letterbox,
                 guiId = 'letterboxBottom',
                 guiId = 'letterboxBottom',
                 relief = FLAT,
                 relief = FLAT,
                 state = NORMAL,
                 state = NORMAL,
-                frameColor = (0,0,0,1),
-                borderWidth = (0,0),
+                frameColor = (0, 0, 0, 1),
+                borderWidth = (0, 0),
                 frameSize = (-1, 1, 0, 0.2),
                 frameSize = (-1, 1, 0, 0.2),
-                pos = (0,0,-1),
+                pos = (0, 0, -1),
                 )
                 )
-                                    
+
     def noLetterbox(self):
     def noLetterbox(self):
         """
         """
         Removes any current letterbox tasks and parents the letterbox polygon away
         Removes any current letterbox tasks and parents the letterbox polygon away
@@ -309,16 +309,16 @@ class Transitions:
         self.loadLetterbox()
         self.loadLetterbox()
         if (t == 0):
         if (t == 0):
             self.letterbox.reparentTo(render2d, FADE_SORT_INDEX)
             self.letterbox.reparentTo(render2d, FADE_SORT_INDEX)
-            self.letterboxBottom.setPos(0,0,-1)
-            self.letterboxTop.setPos(0,0,0.8)
+            self.letterboxBottom.setPos(0, 0, -1)
+            self.letterboxTop.setPos(0, 0, 0.8)
         else:
         else:
             self.letterbox.reparentTo(render2d, FADE_SORT_INDEX)
             self.letterbox.reparentTo(render2d, FADE_SORT_INDEX)
             self.letterboxIval = Sequence(Parallel(LerpPosInterval(self.letterboxBottom, t,
             self.letterboxIval = Sequence(Parallel(LerpPosInterval(self.letterboxBottom, t,
-                                                          pos = Vec3(0,0,-1),
-                                                          startPos = Vec3(0,0,-1.2)),
+                                                          pos = Vec3(0, 0, -1),
+                                                          startPos = Vec3(0, 0, -1.2)),
                                           LerpPosInterval(self.letterboxTop, t,
                                           LerpPosInterval(self.letterboxTop, t,
-                                                          pos = Vec3(0,0,0.8),
-                                                          startPos = Vec3(0,0,1)),
+                                                          pos = Vec3(0, 0, 0.8),
+                                                          startPos = Vec3(0, 0, 1)),
                                           LerpColorInterval(self.letterbox, t,
                                           LerpColorInterval(self.letterbox, t,
                                                             color = self.alphaOn,
                                                             color = self.alphaOn,
                                                             startColor = self.alphaOff),
                                                             startColor = self.alphaOff),
@@ -328,7 +328,7 @@ class Transitions:
             if finishIval:
             if finishIval:
                 self.letterboxIval.append(finishIval)
                 self.letterboxIval.append(finishIval)
             self.letterboxIval.start()
             self.letterboxIval.start()
-            
+
     def letterboxOff(self, t=0.25, finishIval=None):
     def letterboxOff(self, t=0.25, finishIval=None):
         """
         """
         Move black bars away over t seconds.
         Move black bars away over t seconds.
@@ -340,11 +340,11 @@ class Transitions:
         else:
         else:
             self.letterbox.reparentTo(render2d, FADE_SORT_INDEX)
             self.letterbox.reparentTo(render2d, FADE_SORT_INDEX)
             self.letterboxIval = Sequence(Parallel(LerpPosInterval(self.letterboxBottom, t,
             self.letterboxIval = Sequence(Parallel(LerpPosInterval(self.letterboxBottom, t,
-                                                          pos = Vec3(0,0,-1.2),
-                                                          startPos = Vec3(0,0,-1)),
+                                                          pos = Vec3(0, 0, -1.2),
+                                                          startPos = Vec3(0, 0, -1)),
                                           LerpPosInterval(self.letterboxTop, t,
                                           LerpPosInterval(self.letterboxTop, t,
-                                                          pos = Vec3(0,0,1),
-                                                          startPos = Vec3(0,0,0.8)),
+                                                          pos = Vec3(0, 0, 1),
+                                                          startPos = Vec3(0, 0, 0.8)),
                                           LerpColorInterval(self.letterbox, t,
                                           LerpColorInterval(self.letterbox, t,
                                                             color = self.alphaOff,
                                                             color = self.alphaOff,
                                                             startColor = self.alphaOn),
                                                             startColor = self.alphaOn),

+ 6 - 6
direct/src/showbase/pandaSqueezeTool.py

@@ -2,11 +2,11 @@
 #
 #
 # SQUEEZE
 # SQUEEZE
 #
 #
-# squeeze a python program 
+# squeeze a python program
 #
 #
 # installation:
 # installation:
 # - use this script as is, or squeeze it using the following command:
 # - use this script as is, or squeeze it using the following command:
-# 
+#
 # python squeezeTool.py -1su -o squeeze -b squeezeTool squeezeTool.py
 # python squeezeTool.py -1su -o squeeze -b squeezeTool squeezeTool.py
 #
 #
 # notes:
 # notes:
@@ -307,11 +307,11 @@ def squeeze(app, start, filelist, outputDir):
                 fp = open(bootstrap, "w")
                 fp = open(bootstrap, "w")
                 fp.write('''\
                 fp.write('''\
 #%(localMagic)s %(archiveid)s
 #%(localMagic)s %(archiveid)s
-import ihooks,zlib,base64,marshal
+import ihooks, zlib, base64, marshal
 s=base64.decodestring("""
 s=base64.decodestring("""
 %(data)s""")
 %(data)s""")
 exec marshal.loads(%(zbegin)ss[:%(loaderlen)d]%(zend)s)
 exec marshal.loads(%(zbegin)ss[:%(loaderlen)d]%(zend)s)
-boot("%(app)s",s,%(size)d,%(loaderlen)d)
+boot("%(app)s", s, %(size)d, %(loaderlen)d)
 exec "import %(start)s"
 exec "import %(start)s"
 ''' % locals())
 ''' % locals())
                 bytes = fp.tell()
                 bytes = fp.tell()
@@ -334,7 +334,7 @@ exec "import %(start)s"
                 # Note: David Rose adjusted the following to be panda-specific.
                 # Note: David Rose adjusted the following to be panda-specific.
                 fp.write("""\
                 fp.write("""\
 #%(localMagic)s %(archiveid)s
 #%(localMagic)s %(archiveid)s
-import ihooks,zlib,marshal,os,sys
+import ihooks, zlib, marshal, os, sys
 
 
 import pandac
 import pandac
 
 
@@ -356,7 +356,7 @@ if archivePath == None:
 
 
 f=open(archivePath,"rb")
 f=open(archivePath,"rb")
 exec marshal.loads(%(zbegin)sf.read(%(loaderlen)d)%(zend)s)
 exec marshal.loads(%(zbegin)sf.read(%(loaderlen)d)%(zend)s)
-boot("%(app)s",f,%(size)d)
+boot("%(app)s", f, %(size)d)
 exec "from %(start)s import *"
 exec "from %(start)s import *"
 #exec "run()"
 #exec "run()"
 """ % locals())
 """ % locals())

+ 7 - 7
direct/src/showbase/pandaSqueezer.py

@@ -14,7 +14,7 @@ if __name__ == "__main__":
         print 'Usage: pass in -O for optimized'
         print 'Usage: pass in -O for optimized'
         print '       pass in -d directory'
         print '       pass in -d directory'
         sys.exit()
         sys.exit()
-    
+
     fOptimized = 0
     fOptimized = 0
     # Store the option values into our variables
     # Store the option values into our variables
     for opt in opts:
     for opt in opts:
@@ -24,7 +24,7 @@ if __name__ == "__main__":
             print 'Squeezing pyo files'
             print 'Squeezing pyo files'
         elif (flag == '-d'):
         elif (flag == '-d'):
             os.chdir(value)
             os.chdir(value)
-    
+
     def getSqueezeableFiles():
     def getSqueezeableFiles():
         fileList = os.listdir(".")
         fileList = os.listdir(".")
         newFileList = []
         newFileList = []
@@ -33,21 +33,21 @@ if __name__ == "__main__":
         else:
         else:
             targetFileExtension = ".pyc"
             targetFileExtension = ".pyc"
         for i in fileList:
         for i in fileList:
-            base,ext = os.path.splitext(i)
+            base, ext = os.path.splitext(i)
             if (ext == ".py"):
             if (ext == ".py"):
                 newFileList.append(i)
                 newFileList.append(i)
         return newFileList
         return newFileList
-    
+
     def squeezePandaFiles():
     def squeezePandaFiles():
         l = getSqueezeableFiles()
         l = getSqueezeableFiles()
         pandaSqueezeTool.squeeze("PandaModules", "PandaModulesUnsqueezed", l)
         pandaSqueezeTool.squeeze("PandaModules", "PandaModulesUnsqueezed", l)
-    
+
         # Clean up the source files now that they've been squeezed.  If
         # Clean up the source files now that they've been squeezed.  If
         # you don't like this behavior (e.g. if you want to inspect the
         # you don't like this behavior (e.g. if you want to inspect the
         # generated files), use genPyCode -n to avoid squeezing
         # generated files), use genPyCode -n to avoid squeezing
         # altogether.
         # altogether.
         for i in l:
         for i in l:
             os.unlink(i)
             os.unlink(i)
-    
-    
+
+
     squeezePandaFiles()
     squeezePandaFiles()

+ 10 - 10
direct/src/task/Task.py

@@ -65,7 +65,7 @@ def print_exc_plus():
             #We have to be careful not to cause a new error in our error
             #We have to be careful not to cause a new error in our error
             #printer! Calling str() on an unknown object could cause an
             #printer! Calling str() on an unknown object could cause an
             #error we don't want.
             #error we don't want.
-            try:                   
+            try:
                 print value
                 print value
             except:
             except:
                 print "<ERROR WHILE PRINTING VALUE>"
                 print "<ERROR WHILE PRINTING VALUE>"
@@ -209,8 +209,8 @@ def make_sequence(taskList):
                 # TaskManager.notify.debug('sequence done: ' + self.name)
                 # TaskManager.notify.debug('sequence done: ' + self.name)
                 frameFinished = 1
                 frameFinished = 1
                 taskDoneStatus = done
                 taskDoneStatus = done
-                
-        return taskDoneStatus 
+
+        return taskDoneStatus
 
 
     task = Task(func)
     task = Task(func)
     task.name = 'sequence'
     task.name = 'sequence'
@@ -309,7 +309,7 @@ class TaskManager:
     # TODO: there is a bit of a bug when you default this to 0. The first
     # TODO: there is a bit of a bug when you default this to 0. The first
     # task we make, the doLaterProcessor, needs to have this set to 1 or
     # task we make, the doLaterProcessor, needs to have this set to 1 or
     # else we get an error.
     # else we get an error.
-    taskTimerVerbose = 1 
+    taskTimerVerbose = 1
     extendedExceptions = 0
     extendedExceptions = 0
     pStatsTasks = 0
     pStatsTasks = 0
 
 
@@ -642,7 +642,7 @@ class TaskManager:
                 task.avgDt = 0
                 task.avgDt = 0
         return ret
         return ret
 
 
-    def __repeatDoMethod(self,task):
+    def __repeatDoMethod(self, task):
         """
         """
         Called when a task execute function returns Task.again because
         Called when a task execute function returns Task.again because
         it wants the task to execute again after the same or a modified
         it wants the task to execute again after the same or a modified
@@ -721,7 +721,7 @@ class TaskManager:
                     # assert TaskManager.notify.debug('step: moving %s from pending to taskList' % (task.name))
                     # assert TaskManager.notify.debug('step: moving %s from pending to taskList' % (task.name))
                     self.__addNewTask(task)
                     self.__addNewTask(task)
         self.pendingTaskDict.clear()
         self.pendingTaskDict.clear()
-    
+
     def step(self):
     def step(self):
         # assert TaskManager.notify.debug('step: begin')
         # assert TaskManager.notify.debug('step: begin')
         self.currentTime, self.currentFrame = self.__getTimeFrame()
         self.currentTime, self.currentFrame = self.__getTimeFrame()
@@ -766,7 +766,7 @@ class TaskManager:
 
 
         # Add new pending tasks
         # Add new pending tasks
         self.__addPendingTasksToTaskList()
         self.__addPendingTasksToTaskList()
-        
+
         # Restore default interrupt handler
         # Restore default interrupt handler
         signal.signal(signal.SIGINT, signal.default_int_handler)
         signal.signal(signal.SIGINT, signal.default_int_handler)
         if self.fKeyboardInterrupt:
         if self.fKeyboardInterrupt:
@@ -783,7 +783,7 @@ class TaskManager:
 
 
         if self.resumeFunc != None:
         if self.resumeFunc != None:
             self.resumeFunc()
             self.resumeFunc()
-        
+
         if self.stepping:
         if self.stepping:
             self.step()
             self.step()
         else:
         else:
@@ -906,7 +906,7 @@ class TaskManager:
         # The priority heap is not actually in order - it is a tree
         # The priority heap is not actually in order - it is a tree
         # Make a shallow copy so we can sort it
         # Make a shallow copy so we can sort it
         sortedDoLaterList = self.__doLaterList[:]
         sortedDoLaterList = self.__doLaterList[:]
-        sortedDoLaterList.sort(lambda a,b: cmp(a.wakeTime, b.wakeTime))
+        sortedDoLaterList.sort(lambda a, b: cmp(a.wakeTime, b.wakeTime))
         sortedDoLaterList.reverse()
         sortedDoLaterList.reverse()
         for task in sortedDoLaterList:
         for task in sortedDoLaterList:
             remainingTime = ((task.wakeTime) - self.currentTime)
             remainingTime = ((task.wakeTime) - self.currentTime)
@@ -954,7 +954,7 @@ class TaskManager:
 
 
     def __getTimeFrame(self):
     def __getTimeFrame(self):
         # WARNING: If you are testing tasks without an igLoop,
         # WARNING: If you are testing tasks without an igLoop,
-        # you must manually tick the clock        
+        # you must manually tick the clock
         # Ask for the time last frame
         # Ask for the time last frame
         return globalClock.getFrameTime(), globalClock.getFrameCount()
         return globalClock.getFrameTime(), globalClock.getFrameCount()
 
 

+ 14 - 14
direct/src/tkpanels/AnimPanel.py

@@ -99,7 +99,7 @@ class AnimPanel(AppShell):
             text = 'Toggle Enable',
             text = 'Toggle Enable',
             command = self.toggleAllControls)
             command = self.toggleAllControls)
         b.pack(side = RIGHT, expand = 0)
         b.pack(side = RIGHT, expand = 0)
-            
+
         b = self.createcomponent(
         b = self.createcomponent(
             'showSecondsButton', (), None,
             'showSecondsButton', (), None,
             Button, (self.menuFrame,),
             Button, (self.menuFrame,),
@@ -126,7 +126,7 @@ class AnimPanel(AppShell):
             width = 8,
             width = 8,
             command = self.resetAllToZero)
             command = self.resetAllToZero)
         self.toStartButton.pack(side = LEFT, expand = 1, fill = X)
         self.toStartButton.pack(side = LEFT, expand = 1, fill = X)
-        
+
         self.playButton = self.createcomponent(
         self.playButton = self.createcomponent(
             'playButton', (), None,
             'playButton', (), None,
             Button, (controlFrame,),
             Button, (controlFrame,),
@@ -148,7 +148,7 @@ class AnimPanel(AppShell):
             width = 8,
             width = 8,
             command = self.resetAllToEnd)
             command = self.resetAllToEnd)
         self.toEndButton.pack(side = LEFT, expand = 1, fill = X)
         self.toEndButton.pack(side = LEFT, expand = 1, fill = X)
-        
+
         self.loopVar = IntVar()
         self.loopVar = IntVar()
         self.loopVar.set(0)
         self.loopVar.set(0)
         self.loopButton = self.createcomponent(
         self.loopButton = self.createcomponent(
@@ -264,7 +264,7 @@ class AnimPanel(AppShell):
         getModelPath().prependDirectory(fileDirNameFN)
         getModelPath().prependDirectory(fileDirNameFN)
         for currActor in self['actorList']:
         for currActor in self['actorList']:
             # replace all currently loaded anims with specified one
             # replace all currently loaded anims with specified one
-#            currActor.unloadAnims(None,None,None)
+#            currActor.unloadAnims(None, None, None)
             currActor.loadAnims({fileBaseNameBase:fileBaseNameBase})
             currActor.loadAnims({fileBaseNameBase:fileBaseNameBase})
         self.clearActorControls()
         self.clearActorControls()
         self.createActorControls()
         self.createActorControls()
@@ -294,7 +294,7 @@ class AnimPanel(AppShell):
     def getActorControlAt(self, index):
     def getActorControlAt(self, index):
         return self.actorControlList[index]
         return self.actorControlList[index]
 
 
-    def enableActorControlAt(self,index):
+    def enableActorControlAt(self, index):
         self.getActorControlAt(index).enableControl()
         self.getActorControlAt(index).enableControl()
 
 
     def toggleAllControls(self):
     def toggleAllControls(self):
@@ -303,7 +303,7 @@ class AnimPanel(AppShell):
         else:
         else:
             self.enableActorControls()
             self.enableActorControls()
         self.fToggleAll = 1 - self.fToggleAll
         self.fToggleAll = 1 - self.fToggleAll
-        
+
     def enableActorControls(self):
     def enableActorControls(self):
         for actorControl in self.actorControlList:
         for actorControl in self.actorControlList:
             actorControl.enableControl()
             actorControl.enableControl()
@@ -312,7 +312,7 @@ class AnimPanel(AppShell):
         for actorControl in self.actorControlList:
         for actorControl in self.actorControlList:
             actorControl.disableControl()
             actorControl.disableControl()
 
 
-    def disableActorControlAt(self,index):
+    def disableActorControlAt(self, index):
         self.getActorControlAt(index).disableControl()
         self.getActorControlAt(index).disableControl()
 
 
     def displayFrameCounts(self):
     def displayFrameCounts(self):
@@ -371,18 +371,18 @@ class ActorControl(Pmw.MegaWidget):
         # Create component widgets
         # Create component widgets
         self._label = self.createcomponent(
         self._label = self.createcomponent(
             'label', (), None,
             'label', (), None,
-            Menubutton, (interior,),            
+            Menubutton, (interior,),
             font=('MSSansSerif', 14, 'bold'),
             font=('MSSansSerif', 14, 'bold'),
             relief = RAISED, bd = 1,
             relief = RAISED, bd = 1,
             activebackground = '#909090',
             activebackground = '#909090',
             text = self['text'])
             text = self['text'])
         # Top level menu
         # Top level menu
         labelMenu = Menu(self._label, tearoff = 0)
         labelMenu = Menu(self._label, tearoff = 0)
-        
+
         # Menu to select display mode
         # Menu to select display mode
         self.unitsVar = IntVar()
         self.unitsVar = IntVar()
         self.unitsVar.set(FRAMES)
         self.unitsVar.set(FRAMES)
-        displayMenu = Menu(labelMenu, tearoff = 0)        
+        displayMenu = Menu(labelMenu, tearoff = 0)
         displayMenu.add_radiobutton(label = 'Frame count',
         displayMenu.add_radiobutton(label = 'Frame count',
                                     value = FRAMES,
                                     value = FRAMES,
                                     variable = self.unitsVar,
                                     variable = self.unitsVar,
@@ -500,7 +500,7 @@ class ActorControl(Pmw.MegaWidget):
         else:
         else:
             self.minLabel['text'] = '0.0'
             self.minLabel['text'] = '0.0'
             self.maxLabel['text'] = "%.2f" % self.duration
             self.maxLabel['text'] = "%.2f" % self.duration
-            self.frameControl.configure(from_ = 0.0, 
+            self.frameControl.configure(from_ = 0.0,
                                         to = self.duration,
                                         to = self.duration,
                                         resolution = 0.01)
                                         resolution = 0.01)
 
 
@@ -600,13 +600,13 @@ class ActorControl(Pmw.MegaWidget):
         # This flag forces self.currT to be updated to new value
         # This flag forces self.currT to be updated to new value
         self.fOneShot = 1
         self.fOneShot = 1
         self.goToT(0)
         self.goToT(0)
-        
+
     def resetToEnd(self):
     def resetToEnd(self):
         # This flag forces self.currT to be updated to new value
         # This flag forces self.currT to be updated to new value
         self.fOneShot = 1
         self.fOneShot = 1
         self.goToT(self.duration)
         self.goToT(self.duration)
-        
-        
+
+
 """
 """
 # EXAMPLE CODE
 # EXAMPLE CODE
 from direct.actor import Actor
 from direct.actor import Actor

+ 42 - 42
direct/src/tkpanels/DirectSessionPanel.py

@@ -37,7 +37,7 @@ class DirectSessionPanel(AppShell):
 
 
         # Call superclass initialization function
         # Call superclass initialization function
         AppShell.__init__(self, parent)
         AppShell.__init__(self, parent)
-        
+
         # Active light
         # Active light
         if len(direct.lights) > 0:
         if len(direct.lights) > 0:
             name = direct.lights.getNameList()[0]
             name = direct.lights.getNameList()[0]
@@ -75,7 +75,7 @@ class DirectSessionPanel(AppShell):
             ('DIRECT_redo', self.redoHook),
             ('DIRECT_redo', self.redoHook),
             ('DIRECT_pushRedo', self.pushRedoHook),
             ('DIRECT_pushRedo', self.pushRedoHook),
             ('DIRECT_redoListEmpty', self.redoListEmptyHook),
             ('DIRECT_redoListEmpty', self.redoListEmptyHook),
-            ('DIRECT_selectedNodePath',self.selectedNodePathHook),
+            ('DIRECT_selectedNodePath', self.selectedNodePathHook),
             ('DIRECT_addLight', self.addLight),
             ('DIRECT_addLight', self.addLight),
             ]
             ]
         for event, method in self.actionEvents:
         for event, method in self.actionEvents:
@@ -86,7 +86,7 @@ class DirectSessionPanel(AppShell):
         interior = self.interior()
         interior = self.interior()
         # Add placer commands to menubar
         # Add placer commands to menubar
         self.menuBar.addmenu('DIRECT', 'Direct Session Panel Operations')
         self.menuBar.addmenu('DIRECT', 'Direct Session Panel Operations')
-        
+
         self.directEnabled = BooleanVar()
         self.directEnabled = BooleanVar()
         self.directEnabled.set(1)
         self.directEnabled.set(1)
         self.menuBar.addmenuitem('DIRECT', 'checkbutton',
         self.menuBar.addmenuitem('DIRECT', 'checkbutton',
@@ -94,7 +94,7 @@ class DirectSessionPanel(AppShell):
                                  label = 'Enable',
                                  label = 'Enable',
                                  variable = self.directEnabled,
                                  variable = self.directEnabled,
                                  command = self.toggleDirect)
                                  command = self.toggleDirect)
-        
+
         self.directGridEnabled = BooleanVar()
         self.directGridEnabled = BooleanVar()
         self.directGridEnabled.set(direct.grid.isEnabled())
         self.directGridEnabled.set(direct.grid.isEnabled())
         self.menuBar.addmenuitem('DIRECT', 'checkbutton',
         self.menuBar.addmenuitem('DIRECT', 'checkbutton',
@@ -113,7 +113,7 @@ class DirectSessionPanel(AppShell):
             'Toggle Widget Move/COA Mode',
             'Toggle Widget Move/COA Mode',
             label = 'Toggle Widget Mode',
             label = 'Toggle Widget Mode',
             command = direct.manipulationControl.toggleObjectHandlesMode)
             command = direct.manipulationControl.toggleObjectHandlesMode)
-        
+
         self.directWidgetOnTop = BooleanVar()
         self.directWidgetOnTop = BooleanVar()
         self.directWidgetOnTop.set(0)
         self.directWidgetOnTop.set(0)
         self.menuBar.addmenuitem('DIRECT', 'checkbutton',
         self.menuBar.addmenuitem('DIRECT', 'checkbutton',
@@ -193,10 +193,10 @@ class DirectSessionPanel(AppShell):
         ## Environment page ##
         ## Environment page ##
         # Backgroud color
         # Backgroud color
         bkgrdFrame = Frame(envPage, borderwidth = 2, relief = 'sunken')
         bkgrdFrame = Frame(envPage, borderwidth = 2, relief = 'sunken')
-        
+
         Label(bkgrdFrame, text = 'Background',
         Label(bkgrdFrame, text = 'Background',
               font=('MSSansSerif', 14, 'bold')).pack(expand = 0)
               font=('MSSansSerif', 14, 'bold')).pack(expand = 0)
-        
+
         self.backgroundColor = VectorWidgets.ColorEntry(
         self.backgroundColor = VectorWidgets.ColorEntry(
             bkgrdFrame, text = 'Background Color')
             bkgrdFrame, text = 'Background Color')
         self.backgroundColor['command'] = self.setBackgroundColorVec
         self.backgroundColor['command'] = self.setBackgroundColorVec
@@ -207,7 +207,7 @@ class DirectSessionPanel(AppShell):
         drFrame = Frame(envPage, borderwidth = 2, relief = 'sunken')
         drFrame = Frame(envPage, borderwidth = 2, relief = 'sunken')
         Label(drFrame, text = 'Display Region',
         Label(drFrame, text = 'Display Region',
               font=('MSSansSerif', 14, 'bold')).pack(expand = 0)
               font=('MSSansSerif', 14, 'bold')).pack(expand = 0)
-        
+
         nameList = map(lambda x: 'Display Region ' + `x`,
         nameList = map(lambda x: 'Display Region ' + `x`,
                        range(len(direct.drList)))
                        range(len(direct.drList)))
         self.drMenu = Pmw.ComboBox(
         self.drMenu = Pmw.ComboBox(
@@ -217,7 +217,7 @@ class DirectSessionPanel(AppShell):
             scrolledlist_items = nameList)
             scrolledlist_items = nameList)
         self.drMenu.pack(fill = X, expand = 0)
         self.drMenu.pack(fill = X, expand = 0)
         self.bind(self.drMenu, 'Select display region to configure')
         self.bind(self.drMenu, 'Select display region to configure')
-        
+
         self.nearPlane = Floater.Floater(
         self.nearPlane = Floater.Floater(
             drFrame,
             drFrame,
             text = 'Near Plane',
             text = 'Near Plane',
@@ -225,7 +225,7 @@ class DirectSessionPanel(AppShell):
         self.nearPlane['command'] = self.setNear
         self.nearPlane['command'] = self.setNear
         self.nearPlane.pack(fill = X, expand = 0)
         self.nearPlane.pack(fill = X, expand = 0)
         self.bind(self.nearPlane, 'Set near plane distance')
         self.bind(self.nearPlane, 'Set near plane distance')
-           
+
         self.farPlane = Floater.Floater(
         self.farPlane = Floater.Floater(
             drFrame,
             drFrame,
             text = 'Far Plane',
             text = 'Far Plane',
@@ -243,7 +243,7 @@ class DirectSessionPanel(AppShell):
         self.hFov['command'] = self.setHFov
         self.hFov['command'] = self.setHFov
         self.hFov.pack(fill = X, expand = 0)
         self.hFov.pack(fill = X, expand = 0)
         self.bind(self.hFov, 'Set horizontal field of view')
         self.bind(self.hFov, 'Set horizontal field of view')
-           
+
         self.vFov = Slider.Slider(
         self.vFov = Slider.Slider(
             fovFloaterFrame,
             fovFloaterFrame,
             text = 'Vertical FOV',
             text = 'Vertical FOV',
@@ -270,8 +270,8 @@ class DirectSessionPanel(AppShell):
         self.resetFovButton.pack(fill = X, expand = 0)
         self.resetFovButton.pack(fill = X, expand = 0)
         frame.pack(side = LEFT, fill = X, expand = 0)
         frame.pack(side = LEFT, fill = X, expand = 0)
         fovFrame.pack(fill = X, expand = 1)
         fovFrame.pack(fill = X, expand = 1)
-        
-        
+
+
         drFrame.pack(fill = BOTH, expand = 0)
         drFrame.pack(fill = BOTH, expand = 0)
 
 
         ## Render Style ##
         ## Render Style ##
@@ -283,7 +283,7 @@ class DirectSessionPanel(AppShell):
             text = 'Backface',
             text = 'Backface',
             command = base.toggleBackface)
             command = base.toggleBackface)
         self.toggleBackfaceButton.pack(side = LEFT, fill = X, expand = 1)
         self.toggleBackfaceButton.pack(side = LEFT, fill = X, expand = 1)
-        
+
         self.toggleLightsButton = Button(
         self.toggleLightsButton = Button(
             toggleFrame,
             toggleFrame,
             text = 'Lights',
             text = 'Lights',
@@ -295,7 +295,7 @@ class DirectSessionPanel(AppShell):
             text = 'Texture',
             text = 'Texture',
             command = base.toggleTexture)
             command = base.toggleTexture)
         self.toggleTextureButton.pack(side = LEFT, fill = X, expand = 1)
         self.toggleTextureButton.pack(side = LEFT, fill = X, expand = 1)
-        
+
         self.toggleWireframeButton = Button(
         self.toggleWireframeButton = Button(
             toggleFrame,
             toggleFrame,
             text = 'Wireframe',
             text = 'Wireframe',
@@ -318,10 +318,10 @@ class DirectSessionPanel(AppShell):
                             command = self.addPoint)
                             command = self.addPoint)
         lightsMenu.add_command(label = 'Add Spotlight',
         lightsMenu.add_command(label = 'Add Spotlight',
                             command = self.addSpot)
                             command = self.addSpot)
-            
+
         self.lightsButton.pack(expand = 0)
         self.lightsButton.pack(expand = 0)
         self.lightsButton['menu'] = lightsMenu
         self.lightsButton['menu'] = lightsMenu
-        
+
         # Notebook pages for light specific controls
         # Notebook pages for light specific controls
         self.lightNotebook = Pmw.NoteBook(lightFrame, tabpos = None,
         self.lightNotebook = Pmw.NoteBook(lightFrame, tabpos = None,
                                           borderwidth = 0)
                                           borderwidth = 0)
@@ -344,11 +344,11 @@ class DirectSessionPanel(AppShell):
             command = self.toggleLights)
             command = self.toggleLights)
         self.enableLightsButton.pack(side = LEFT, fill = X, expand = 0)
         self.enableLightsButton.pack(side = LEFT, fill = X, expand = 0)
         mainSwitchFrame.pack(fill = X, expand = 0)
         mainSwitchFrame.pack(fill = X, expand = 0)
-        
+
         # Widget to select a light to configure
         # Widget to select a light to configure
         nameList = direct.lights.getNameList()
         nameList = direct.lights.getNameList()
         lightMenuFrame = Frame(lightFrame)
         lightMenuFrame = Frame(lightFrame)
-        
+
         self.lightMenu = Pmw.ComboBox(
         self.lightMenu = Pmw.ComboBox(
             lightMenuFrame, labelpos = W, label_text = 'Light:',
             lightMenuFrame, labelpos = W, label_text = 'Light:',
             entry_width = 20,
             entry_width = 20,
@@ -356,7 +356,7 @@ class DirectSessionPanel(AppShell):
             scrolledlist_items = nameList)
             scrolledlist_items = nameList)
         self.lightMenu.pack(side = LEFT, fill = X, expand = 0)
         self.lightMenu.pack(side = LEFT, fill = X, expand = 0)
         self.bind(self.lightMenu, 'Select light to configure')
         self.bind(self.lightMenu, 'Select light to configure')
-        
+
         self.lightActive = BooleanVar()
         self.lightActive = BooleanVar()
         self.lightActiveButton = Checkbutton(
         self.lightActiveButton = Checkbutton(
             lightMenuFrame,
             lightMenuFrame,
@@ -398,7 +398,7 @@ class DirectSessionPanel(AppShell):
         self.pConstantAttenuation.pack(fill = X, expand = 0)
         self.pConstantAttenuation.pack(fill = X, expand = 0)
         self.bind(self.pConstantAttenuation,
         self.bind(self.pConstantAttenuation,
                   'Set point light constant attenuation')
                   'Set point light constant attenuation')
-           
+
         self.pLinearAttenuation = Slider.Slider(
         self.pLinearAttenuation = Slider.Slider(
             pointPage,
             pointPage,
             text = 'Linear Attenuation',
             text = 'Linear Attenuation',
@@ -407,7 +407,7 @@ class DirectSessionPanel(AppShell):
         self.pLinearAttenuation.pack(fill = X, expand = 0)
         self.pLinearAttenuation.pack(fill = X, expand = 0)
         self.bind(self.pLinearAttenuation,
         self.bind(self.pLinearAttenuation,
                   'Set point light linear attenuation')
                   'Set point light linear attenuation')
-           
+
         self.pQuadraticAttenuation = Slider.Slider(
         self.pQuadraticAttenuation = Slider.Slider(
             pointPage,
             pointPage,
             text = 'Quadratic Attenuation',
             text = 'Quadratic Attenuation',
@@ -416,7 +416,7 @@ class DirectSessionPanel(AppShell):
         self.pQuadraticAttenuation.pack(fill = X, expand = 0)
         self.pQuadraticAttenuation.pack(fill = X, expand = 0)
         self.bind(self.pQuadraticAttenuation,
         self.bind(self.pQuadraticAttenuation,
                   'Set point light quadratic attenuation')
                   'Set point light quadratic attenuation')
-           
+
         # Spot light controls
         # Spot light controls
         self.sSpecularColor = VectorWidgets.ColorEntry(
         self.sSpecularColor = VectorWidgets.ColorEntry(
             spotPage, text = 'Specular Color')
             spotPage, text = 'Specular Color')
@@ -433,7 +433,7 @@ class DirectSessionPanel(AppShell):
         self.sConstantAttenuation.pack(fill = X, expand = 0)
         self.sConstantAttenuation.pack(fill = X, expand = 0)
         self.bind(self.sConstantAttenuation,
         self.bind(self.sConstantAttenuation,
                   'Set spot light constant attenuation')
                   'Set spot light constant attenuation')
-           
+
         self.sLinearAttenuation = Slider.Slider(
         self.sLinearAttenuation = Slider.Slider(
             spotPage,
             spotPage,
             text = 'Linear Attenuation',
             text = 'Linear Attenuation',
@@ -442,7 +442,7 @@ class DirectSessionPanel(AppShell):
         self.sLinearAttenuation.pack(fill = X, expand = 0)
         self.sLinearAttenuation.pack(fill = X, expand = 0)
         self.bind(self.sLinearAttenuation,
         self.bind(self.sLinearAttenuation,
                   'Set spot light linear attenuation')
                   'Set spot light linear attenuation')
-           
+
         self.sQuadraticAttenuation = Slider.Slider(
         self.sQuadraticAttenuation = Slider.Slider(
             spotPage,
             spotPage,
             text = 'Quadratic Attenuation',
             text = 'Quadratic Attenuation',
@@ -451,7 +451,7 @@ class DirectSessionPanel(AppShell):
         self.sQuadraticAttenuation.pack(fill = X, expand = 0)
         self.sQuadraticAttenuation.pack(fill = X, expand = 0)
         self.bind(self.sQuadraticAttenuation,
         self.bind(self.sQuadraticAttenuation,
                   'Set spot light quadratic attenuation')
                   'Set spot light quadratic attenuation')
-           
+
         self.sExponent = Slider.Slider(
         self.sExponent = Slider.Slider(
             spotPage,
             spotPage,
             text = 'Exponent',
             text = 'Exponent',
@@ -462,10 +462,10 @@ class DirectSessionPanel(AppShell):
                   'Set spot light exponent')
                   'Set spot light exponent')
 
 
         # MRM: Add frustum controls
         # MRM: Add frustum controls
-           
+
         self.lightNotebook.setnaturalsize()
         self.lightNotebook.setnaturalsize()
         self.lightNotebook.pack(expand = 1, fill = BOTH)
         self.lightNotebook.pack(expand = 1, fill = BOTH)
-        
+
         lightFrame.pack(expand = 1, fill = BOTH)
         lightFrame.pack(expand = 1, fill = BOTH)
 
 
         ## GRID PAGE ##
         ## GRID PAGE ##
@@ -505,7 +505,7 @@ class DirectSessionPanel(AppShell):
             value = direct.grid.getGridSpacing())
             value = direct.grid.getGridSpacing())
         self.gridSpacing['command'] = direct.grid.setGridSpacing
         self.gridSpacing['command'] = direct.grid.setGridSpacing
         self.gridSpacing.pack(fill = X, expand = 0)
         self.gridSpacing.pack(fill = X, expand = 0)
-        
+
         self.gridSize = Floater.Floater(
         self.gridSize = Floater.Floater(
             gridPage,
             gridPage,
             text = 'Grid Size',
             text = 'Grid Size',
@@ -551,7 +551,7 @@ class DirectSessionPanel(AppShell):
                                       'HPRXYZ Mode'])
                                       'HPRXYZ Mode'])
             self.jbModeMenu.selectitem('Joe Mode')
             self.jbModeMenu.selectitem('Joe Mode')
             self.jbModeMenu.pack(fill = X, expand = 1)
             self.jbModeMenu.pack(fill = X, expand = 1)
-            
+
             self.jbNodePathMenu = Pmw.ComboBox(
             self.jbNodePathMenu = Pmw.ComboBox(
                 joyboxFrame, labelpos = W, label_text = 'Joybox Node Path:',
                 joyboxFrame, labelpos = W, label_text = 'Joybox Node Path:',
                 label_width = 16, entry_width = 20,
                 label_width = 16, entry_width = 20,
@@ -648,7 +648,7 @@ class DirectSessionPanel(AppShell):
         if (nodePath != None):
         if (nodePath != None):
             # Yes, select it!
             # Yes, select it!
             direct.select(nodePath)
             direct.select(nodePath)
-        
+
     def addNodePath(self, nodePath):
     def addNodePath(self, nodePath):
         self.addNodePathToDict(nodePath, self.nodePathNames,
         self.addNodePathToDict(nodePath, self.nodePathNames,
                                self.nodePathMenu, self.nodePathDict)
                                self.nodePathMenu, self.nodePathDict)
@@ -670,7 +670,7 @@ class DirectSessionPanel(AppShell):
             direct.joybox.demoMode()
             direct.joybox.demoMode()
         elif name == 'HPRXYZ Mode':
         elif name == 'HPRXYZ Mode':
             direct.joybox.hprXyzMode()
             direct.joybox.hprXyzMode()
-        
+
     def selectJBNodePathNamed(self, name):
     def selectJBNodePathNamed(self, name):
         if name == 'selected':
         if name == 'selected':
             nodePath = direct.selected.last
             nodePath = direct.selected.last
@@ -701,7 +701,7 @@ class DirectSessionPanel(AppShell):
                 direct.joybox.setNodePath(None)
                 direct.joybox.setNodePath(None)
             else:
             else:
                 direct.joybox.setNodePath(nodePath)
                 direct.joybox.setNodePath(nodePath)
-        
+
     def addJBNodePath(self, nodePath):
     def addJBNodePath(self, nodePath):
         self.addNodePathToDict(nodePath, self.jbNodePathNames,
         self.addNodePathToDict(nodePath, self.jbNodePathNames,
                                self.jbNodePathMenu, self.jbNodePathDict)
                                self.jbNodePathMenu, self.jbNodePathDict)
@@ -726,7 +726,7 @@ class DirectSessionPanel(AppShell):
         menu.selectitem(dictName)
         menu.selectitem(dictName)
 
 
     ## ENVIRONMENT CONTROLS ##
     ## ENVIRONMENT CONTROLS ##
-    # Background # 
+    # Background #
     def setBackgroundColor(self, r, g, b):
     def setBackgroundColor(self, r, g, b):
         self.setBackgroundColorVec((r, g, b))
         self.setBackgroundColorVec((r, g, b))
     def setBackgroundColorVec(self, color):
     def setBackgroundColorVec(self, color):
@@ -787,7 +787,7 @@ class DirectSessionPanel(AppShell):
             dr.setFov(45.0, 33.75)
             dr.setFov(45.0, 33.75)
             self.hFov.set(45.0, 0)
             self.hFov.set(45.0, 0)
             self.vFov.set(33.75, 0)
             self.vFov.set(33.75, 0)
-            
+
     # Lights #
     # Lights #
     def selectLightNamed(self, name):
     def selectLightNamed(self, name):
         # See if light exists
         # See if light exists
@@ -826,7 +826,7 @@ class DirectSessionPanel(AppShell):
 
 
     def addSpot(self):
     def addSpot(self):
         return direct.lights.create('spot')
         return direct.lights.create('spot')
-        
+
     def addLight(self, light):
     def addLight(self, light):
         # Make list reflect current list of lights
         # Make list reflect current list of lights
         listbox = self.lightMenu.component('scrolledlist')
         listbox = self.lightMenu.component('scrolledlist')
@@ -870,7 +870,7 @@ class DirectSessionPanel(AppShell):
     def setLinearAttenuation(self, value):
     def setLinearAttenuation(self, value):
         if self.activeLight:
         if self.activeLight:
             self.activeLight.getLight().setLinearAttenuation(value)
             self.activeLight.getLight().setLinearAttenuation(value)
-            
+
     def setQuadraticAttenuation(self, value):
     def setQuadraticAttenuation(self, value):
         if self.activeLight:
         if self.activeLight:
             self.activeLight.getLight().setQuadraticAttenuation(value)
             self.activeLight.getLight().setQuadraticAttenuation(value)
@@ -907,7 +907,7 @@ class DirectSessionPanel(AppShell):
             self.updateLightInfo()
             self.updateLightInfo()
         elif page == 'Grid':
         elif page == 'Grid':
             self.updateGridInfo()
             self.updateGridInfo()
-            
+
     def updateEnvironmentInfo(self):
     def updateEnvironmentInfo(self):
         bkgrdColor = base.getBackgroundColor() * 255.0
         bkgrdColor = base.getBackgroundColor() * 255.0
         self.backgroundColor.set([bkgrdColor[0],
         self.backgroundColor.set([bkgrdColor[0],
@@ -927,7 +927,7 @@ class DirectSessionPanel(AppShell):
         # Set main lighting button
         # Set main lighting button
         self.enableLights.set(
         self.enableLights.set(
             render.node().hasAttrib(LightAttrib.getClassType()))
             render.node().hasAttrib(LightAttrib.getClassType()))
-            
+
         # Set light specific info
         # Set light specific info
         if self.activeLight:
         if self.activeLight:
             l = self.activeLight.getLight()
             l = self.activeLight.getLight()
@@ -969,7 +969,7 @@ class DirectSessionPanel(AppShell):
         self.gridSpacing.set(direct.grid.getGridSpacing(), 0)
         self.gridSpacing.set(direct.grid.getGridSpacing(), 0)
         self.gridSize.set(direct.grid.getGridSize(), 0)
         self.gridSize.set(direct.grid.getGridSize(), 0)
         self.gridSnapAngle.set(direct.grid.getSnapAngle(), 0)
         self.gridSnapAngle.set(direct.grid.getSnapAngle(), 0)
-            
+
     # UNDO/REDO
     # UNDO/REDO
     def pushUndo(self, fResetRedo = 1):
     def pushUndo(self, fResetRedo = 1):
         direct.pushUndo([self['nodePath']])
         direct.pushUndo([self['nodePath']])
@@ -987,7 +987,7 @@ class DirectSessionPanel(AppShell):
 
 
     def pushRedo(self):
     def pushRedo(self):
         direct.pushRedo([self['nodePath']])
         direct.pushRedo([self['nodePath']])
-        
+
     def redoHook(self, nodePathList = []):
     def redoHook(self, nodePathList = []):
         pass
         pass
 
 
@@ -998,7 +998,7 @@ class DirectSessionPanel(AppShell):
     def redoListEmptyHook(self):
     def redoListEmptyHook(self):
         # Make sure button is deactivated
         # Make sure button is deactivated
         self.redoButton.configure(state = 'disabled')
         self.redoButton.configure(state = 'disabled')
-        
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         # Remove hooks
         # Remove hooks
         for event, method in self.actionEvents:
         for event, method in self.actionEvents:

+ 26 - 26
direct/src/tkpanels/FSMInspector.py

@@ -61,7 +61,7 @@ class FSMInspector(AppShell):
                                   'Print out ClassicFSM layout',
                                   'Print out ClassicFSM layout',
                                   label = 'Print ClassicFSM layout',
                                   label = 'Print ClassicFSM layout',
                                   command = self.printLayout)
                                   command = self.printLayout)
-        
+
         # States Menu
         # States Menu
         menuBar.addmenu('States', 'State Inspector Operations')
         menuBar.addmenu('States', 'State Inspector Operations')
         menuBar.addcascademenu('States', 'Font Size',
         menuBar.addcascademenu('States', 'Font Size',
@@ -107,7 +107,7 @@ class FSMInspector(AppShell):
 
 
     def canvas(self):
     def canvas(self):
         return self._canvas
         return self._canvas
-    
+
     def setFontSize(self, size):
     def setFontSize(self, size):
         self._canvas.itemconfigure('labels', font = ('MS Sans Serif', size))
         self._canvas.itemconfigure('labels', font = ('MS Sans Serif', size))
 
 
@@ -115,7 +115,7 @@ class FSMInspector(AppShell):
         for key in self.stateInspectorDict.keys():
         for key in self.stateInspectorDict.keys():
             self.stateInspectorDict[key].setRadius(size)
             self.stateInspectorDict[key].setRadius(size)
         self.drawConnections()
         self.drawConnections()
-        
+
     def drawConnections(self, event = None):
     def drawConnections(self, event = None):
         # Get rid of existing arrows
         # Get rid of existing arrows
         self._canvas.delete('arrow')
         self._canvas.delete('arrow')
@@ -136,25 +136,25 @@ class FSMInspector(AppShell):
         fromCenter = fromState.center()
         fromCenter = fromState.center()
         toCenter = toState.center()
         toCenter = toState.center()
         angle = self.findAngle(fromCenter, toCenter)
         angle = self.findAngle(fromCenter, toCenter)
-        
+
         # Compute offset fromState point
         # Compute offset fromState point
         newFromPt = map(operator.__add__,
         newFromPt = map(operator.__add__,
                         fromCenter,
                         fromCenter,
                         self.computePoint(fromState.radius,
                         self.computePoint(fromState.radius,
                                            angle + DELTA))
                                            angle + DELTA))
-        
+
         # Compute offset toState point
         # Compute offset toState point
         newToPt = map(operator.__sub__,
         newToPt = map(operator.__sub__,
                       toCenter,
                       toCenter,
                       self.computePoint(toState.radius,
                       self.computePoint(toState.radius,
                                          angle - DELTA))
                                          angle - DELTA))
         return newFromPt + newToPt
         return newFromPt + newToPt
-        
+
     def computePoint(self, radius, angle):
     def computePoint(self, radius, angle):
         x = radius * math.cos(angle)
         x = radius * math.cos(angle)
         y = radius * math.sin(angle)
         y = radius * math.sin(angle)
         return (x, y)
         return (x, y)
-                         
+
     def findAngle(self, fromPoint, toPoint):
     def findAngle(self, fromPoint, toPoint):
         dx = toPoint[0] - fromPoint[0]
         dx = toPoint[0] - fromPoint[0]
         dy = toPoint[1] - fromPoint[1]
         dy = toPoint[1] - fromPoint[1]
@@ -164,7 +164,7 @@ class FSMInspector(AppShell):
         self._width = 1.0 * self._canvas.winfo_width()
         self._width = 1.0 * self._canvas.winfo_width()
         self._height = 1.0 * self._canvas.winfo_height()
         self._height = 1.0 * self._canvas.winfo_height()
         xview = self._canvas.xview()
         xview = self._canvas.xview()
-        yview = self._canvas.yview()        
+        yview = self._canvas.yview()
         self._left = xview[0]
         self._left = xview[0]
         self._top = yview[0]
         self._top = yview[0]
         self._dxview = xview[1] - xview[0]
         self._dxview = xview[1] - xview[0]
@@ -172,7 +172,7 @@ class FSMInspector(AppShell):
         self._2lx = event.x
         self._2lx = event.x
         self._2ly = event.y
         self._2ly = event.y
 
 
-    def mouse2Motion(self,event):
+    def mouse2Motion(self, event):
         newx = self._left - ((event.x - self._2lx)/self._width) * self._dxview
         newx = self._left - ((event.x - self._2lx)/self._width) * self._dxview
         self._canvas.xview_moveto(newx)
         self._canvas.xview_moveto(newx)
         newy = self._top - ((event.y - self._2ly)/self._height) * self._dyview
         newy = self._top - ((event.y - self._2ly)/self._height) * self._dyview
@@ -219,19 +219,19 @@ class FSMInspector(AppShell):
         return si
         return si
 
 
     def enteredState(self, stateName):
     def enteredState(self, stateName):
-        si = self.stateInspectorDict.get(stateName,None)
+        si = self.stateInspectorDict.get(stateName, None)
         if si:
         if si:
             si.enteredState()
             si.enteredState()
 
 
     def exitedState(self, stateName):
     def exitedState(self, stateName):
-        si = self.stateInspectorDict.get(stateName,None)
+        si = self.stateInspectorDict.get(stateName, None)
         if si:
         if si:
             si.exitedState()
             si.exitedState()
-         
+
     def _setGridSize(self):
     def _setGridSize(self):
         self._gridSize = self['gridSize']
         self._gridSize = self['gridSize']
         self.setGridSize(self._gridSize)
         self.setGridSize(self._gridSize)
-        
+
     def setGridSize(self, size):
     def setGridSize(self, size):
         for key in self.stateInspectorDict.keys():
         for key in self.stateInspectorDict.keys():
             self.stateInspectorDict[key].setGridSize(size)
             self.stateInspectorDict[key].setGridSize(size)
@@ -279,14 +279,14 @@ class FSMInspector(AppShell):
             self.balloon.configure(state = 'balloon')
             self.balloon.configure(state = 'balloon')
         else:
         else:
             self.balloon.configure(state = 'none')
             self.balloon.configure(state = 'none')
-            
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         """ Called on ClassicFSM Panel shutdown """
         """ Called on ClassicFSM Panel shutdown """
         self.fsm.inspecting = 0
         self.fsm.inspecting = 0
         for si in self.stateInspectorDict.values():
         for si in self.stateInspectorDict.values():
             self.ignore(self.name + '_' + si.getName() + '_entered')
             self.ignore(self.name + '_' + si.getName() + '_entered')
             self.ignore(self.name + '_' + si.getName() + '_exited')
             self.ignore(self.name + '_' + si.getName() + '_exited')
-            
+
 class StateInspector(Pmw.MegaArchetype):
 class StateInspector(Pmw.MegaArchetype):
     def __init__(self, inspector, state, **kw):
     def __init__(self, inspector, state, **kw):
 
 
@@ -297,11 +297,11 @@ class StateInspector(Pmw.MegaArchetype):
         # and its corresponding text around together
         # and its corresponding text around together
         self.tag = state.getName()
         self.tag = state.getName()
         self.fsm = inspector.fsm
         self.fsm = inspector.fsm
-        
+
         # Pointers to the inspector's components
         # Pointers to the inspector's components
         self.scrolledCanvas = inspector.component('scrolledCanvas')
         self.scrolledCanvas = inspector.component('scrolledCanvas')
         self._canvas = self.scrolledCanvas.component('canvas')
         self._canvas = self.scrolledCanvas.component('canvas')
-        
+
         #define the megawidget options
         #define the megawidget options
         optiondefs = (
         optiondefs = (
             ('radius', '0.375i', self._setRadius),
             ('radius', '0.375i', self._setRadius),
@@ -343,7 +343,7 @@ class StateInspector(Pmw.MegaArchetype):
             self._popupMenu.add_command(label = 'Inspect ' + state.getName() +
             self._popupMenu.add_command(label = 'Inspect ' + state.getName() +
                                         ' submachine',
                                         ' submachine',
                                         command = self.inspectSubMachine)
                                         command = self.inspectSubMachine)
-                    
+
         self.scrolledCanvas.resizescrollregion()
         self.scrolledCanvas.resizescrollregion()
 
 
         # Add bindings
         # Add bindings
@@ -359,7 +359,7 @@ class StateInspector(Pmw.MegaArchetype):
     # Utility methods
     # Utility methods
     def _setRadius(self):
     def _setRadius(self):
         self.setRadius(self['radius'])
         self.setRadius(self['radius'])
-        
+
     def setRadius(self, size):
     def setRadius(self, size):
         half = self.radius = self._canvas.winfo_fpixels(size)
         half = self.radius = self._canvas.winfo_fpixels(size)
         c = self.center()
         c = self.center()
@@ -372,7 +372,7 @@ class StateInspector(Pmw.MegaArchetype):
 
 
     def _setGridSize(self):
     def _setGridSize(self):
         self.setGridSize(self['gridSize'])
         self.setGridSize(self['gridSize'])
-        
+
     def setGridSize(self, size):
     def setGridSize(self, size):
         self.gridSize = self._canvas.winfo_fpixels(size)
         self.gridSize = self._canvas.winfo_fpixels(size)
         if self.gridSize == 0:
         if self.gridSize == 0:
@@ -382,7 +382,7 @@ class StateInspector(Pmw.MegaArchetype):
 
 
     def setText(self, text = None):
     def setText(self, text = None):
         self._canvas.itemconfigure(self.text, text = text)
         self._canvas.itemconfigure(self.text, text = text)
-        
+
     def setPos(self, x, y, snapToGrid = 0):
     def setPos(self, x, y, snapToGrid = 0):
         if self.fGridSnap:
         if self.fGridSnap:
             self.x = round(x / self.gridSize) * self.gridSize
             self.x = round(x / self.gridSize) * self.gridSize
@@ -404,7 +404,7 @@ class StateInspector(Pmw.MegaArchetype):
     # Event Handlers
     # Event Handlers
     def mouseEnter(self, event):
     def mouseEnter(self, event):
         self._canvas.itemconfig(self.marker, width = 2)
         self._canvas.itemconfig(self.marker, width = 2)
-        
+
     def mouseLeave(self, event):
     def mouseLeave(self, event):
         self._canvas.itemconfig(self.marker, width = 1)
         self._canvas.itemconfig(self.marker, width = 1)
 
 
@@ -413,14 +413,14 @@ class StateInspector(Pmw.MegaArchetype):
         self.startx, self.starty = self.center()
         self.startx, self.starty = self.center()
         self.lastx = self._canvas.canvasx(event.x)
         self.lastx = self._canvas.canvasx(event.x)
         self.lasty = self._canvas.canvasy(event.y)
         self.lasty = self._canvas.canvasy(event.y)
-            
+
     def mouseMotion(self, event):
     def mouseMotion(self, event):
         dx = self._canvas.canvasx(event.x) - self.lastx
         dx = self._canvas.canvasx(event.x) - self.lastx
         dy = self._canvas.canvasy(event.y) - self.lasty
         dy = self._canvas.canvasy(event.y) - self.lasty
-        newx, newy = map(operator.__add__,(self.startx, self.starty), (dx, dy))
+        newx, newy = map(operator.__add__, (self.startx, self.starty), (dx, dy))
         self.setPos(newx, newy)
         self.setPos(newx, newy)
 
 
-    def mouseRelease(self,event):
+    def mouseRelease(self, event):
         self.scrolledCanvas.resizescrollregion()
         self.scrolledCanvas.resizescrollregion()
 
 
     def popupStateMenu(self, event):
     def popupStateMenu(self, event):
@@ -531,7 +531,7 @@ from direct.showbase.ShowBaseGlobal import *
 # At this point everything will lock up and you won't get your prompt back
 # At this point everything will lock up and you won't get your prompt back
 
 
 # Hit a bunch of Control-C's in rapid succession, in most cases
 # Hit a bunch of Control-C's in rapid succession, in most cases
-# this will break you out of whatever badness you were in and 
+# this will break you out of whatever badness you were in and
 # from that point on everything will behave normally
 # from that point on everything will behave normally
 
 
 
 

+ 54 - 54
direct/src/tkpanels/MopathRecorder.py

@@ -48,7 +48,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
         # Call superclass initialization function
         # Call superclass initialization function
         AppShell.__init__(self)
         AppShell.__init__(self)
-        
+
         self.initialiseoptions(MopathRecorder)
         self.initialiseoptions(MopathRecorder)
 
 
         self.selectNodePathNamed('camera')
         self.selectNodePathNamed('camera')
@@ -82,15 +82,15 @@ class MopathRecorder(AppShell, DirectObject):
         self.tangentMarker = loader.loadModel('models/misc/sphere')
         self.tangentMarker = loader.loadModel('models/misc/sphere')
         self.tangentMarker.reparentTo(self.tangentGroup)
         self.tangentMarker.reparentTo(self.tangentGroup)
         self.tangentMarker.setScale(0.5)
         self.tangentMarker.setScale(0.5)
-        self.tangentMarker.setColor(1,0,1,1)
+        self.tangentMarker.setColor(1, 0, 1, 1)
         self.tangentMarker.setName('Tangent Marker')
         self.tangentMarker.setName('Tangent Marker')
         self.tangentMarkerIds = self.getChildIds(
         self.tangentMarkerIds = self.getChildIds(
             self.tangentMarker.getChild(0))
             self.tangentMarker.getChild(0))
         self.tangentLines = LineNodePath(self.tangentGroup)
         self.tangentLines = LineNodePath(self.tangentGroup)
-        self.tangentLines.setColor(VBase4(1,0,1,1))
+        self.tangentLines.setColor(VBase4(1, 0, 1, 1))
         self.tangentLines.setThickness(1)
         self.tangentLines.setThickness(1)
-        self.tangentLines.moveTo(0,0,0)
-        self.tangentLines.drawTo(0,0,0)
+        self.tangentLines.moveTo(0, 0, 0)
+        self.tangentLines.drawTo(0, 0, 0)
         self.tangentLines.create()
         self.tangentLines.create()
         # Active node path dictionary
         # Active node path dictionary
         self.nodePathDict = {}
         self.nodePathDict = {}
@@ -259,7 +259,7 @@ class MopathRecorder(AppShell, DirectObject):
             frame, 'left',
             frame, 'left',
             'Recording', 'New Curve',
             'Recording', 'New Curve',
             ('Next record session records a new path'),
             ('Next record session records a new path'),
-            self.recordingType, 'New Curve',expand = 0)
+            self.recordingType, 'New Curve', expand = 0)
         widget = self.createRadiobutton(
         widget = self.createRadiobutton(
             frame, 'left',
             frame, 'left',
             'Recording', 'Refine',
             'Recording', 'Refine',
@@ -284,9 +284,9 @@ class MopathRecorder(AppShell, DirectObject):
                                    self.addKeyframe,
                                    self.addKeyframe,
                                    side = LEFT, expand = 1)
                                    side = LEFT, expand = 1)
         frame.pack(fill = X, expand = 1)
         frame.pack(fill = X, expand = 1)
-        
+
         mainFrame.pack(expand = 1, fill = X, pady = 3)
         mainFrame.pack(expand = 1, fill = X, pady = 3)
-        
+
         # Playback controls
         # Playback controls
         playbackFrame = Frame(interior, relief = SUNKEN,
         playbackFrame = Frame(interior, relief = SUNKEN,
                               borderwidth = 2)
                               borderwidth = 2)
@@ -348,7 +348,7 @@ class MopathRecorder(AppShell, DirectObject):
             string.atof(s.speedVar.get())))
             string.atof(s.speedVar.get())))
         self.speedEntry.pack(side = LEFT, expand = 0)
         self.speedEntry.pack(side = LEFT, expand = 0)
         frame.pack(fill = X, expand = 1)
         frame.pack(fill = X, expand = 1)
-        
+
         playbackFrame.pack(fill = X, pady = 2)
         playbackFrame.pack(fill = X, pady = 2)
 
 
         # Create notebook pages
         # Create notebook pages
@@ -365,7 +365,7 @@ class MopathRecorder(AppShell, DirectObject):
         label = Label(self.resamplePage, text = 'RESAMPLE CURVE',
         label = Label(self.resamplePage, text = 'RESAMPLE CURVE',
                       font=('MSSansSerif', 12, 'bold'))
                       font=('MSSansSerif', 12, 'bold'))
         label.pack(fill = X)
         label.pack(fill = X)
-        
+
         # Resample
         # Resample
         resampleFrame = Frame(
         resampleFrame = Frame(
             self.resamplePage, relief = SUNKEN, borderwidth = 2)
             self.resamplePage, relief = SUNKEN, borderwidth = 2)
@@ -389,7 +389,7 @@ class MopathRecorder(AppShell, DirectObject):
             self.faceForward, side = LEFT, fill = X, expand = 1)
             self.faceForward, side = LEFT, fill = X, expand = 1)
         frame.pack(fill = X, expand = 0)
         frame.pack(fill = X, expand = 0)
         resampleFrame.pack(fill = X, expand = 0, pady = 2)
         resampleFrame.pack(fill = X, expand = 0, pady = 2)
-        
+
         # Desample
         # Desample
         desampleFrame = Frame(
         desampleFrame = Frame(
             self.resamplePage, relief = SUNKEN, borderwidth = 2)
             self.resamplePage, relief = SUNKEN, borderwidth = 2)
@@ -533,7 +533,7 @@ class MopathRecorder(AppShell, DirectObject):
             sfFrame, 'Style', 'Num Segs',
             sfFrame, 'Style', 'Num Segs',
             'Set number of segments used to approximate each parametric unit',
             'Set number of segments used to approximate each parametric unit',
             min = 1.0, max = 400, resolution = 1.0,
             min = 1.0, max = 400, resolution = 1.0,
-            value = 40, 
+            value = 40,
             command = self.setNumSegs, side = TOP)
             command = self.setNumSegs, side = TOP)
         widget.component('hull')['relief'] = RIDGE
         widget.component('hull')['relief'] = RIDGE
         widget = self.createSlider(
         widget = self.createSlider(
@@ -554,27 +554,27 @@ class MopathRecorder(AppShell, DirectObject):
             sfFrame, 'Style', 'Path Color',
             sfFrame, 'Style', 'Path Color',
             'Color of curve',
             'Color of curve',
             command = self.setPathColor,
             command = self.setPathColor,
-            value = [255.0,255.0,255.0,255.0])
+            value = [255.0, 255.0, 255.0, 255.0])
         self.createColorEntry(
         self.createColorEntry(
             sfFrame, 'Style', 'Knot Color',
             sfFrame, 'Style', 'Knot Color',
             'Color of knots',
             'Color of knots',
             command = self.setKnotColor,
             command = self.setKnotColor,
-            value = [0,0,255.0,255.0])
+            value = [0, 0, 255.0, 255.0])
         self.createColorEntry(
         self.createColorEntry(
             sfFrame, 'Style', 'CV Color',
             sfFrame, 'Style', 'CV Color',
             'Color of CVs',
             'Color of CVs',
             command = self.setCvColor,
             command = self.setCvColor,
-            value = [255.0,0,0,255.0])
+            value = [255.0, 0, 0, 255.0])
         self.createColorEntry(
         self.createColorEntry(
             sfFrame, 'Style', 'Tick Color',
             sfFrame, 'Style', 'Tick Color',
             'Color of Ticks',
             'Color of Ticks',
             command = self.setTickColor,
             command = self.setTickColor,
-            value = [255.0,0,0,255.0])
+            value = [255.0, 0, 0, 255.0])
         self.createColorEntry(
         self.createColorEntry(
             sfFrame, 'Style', 'Hull Color',
             sfFrame, 'Style', 'Hull Color',
             'Color of Hull',
             'Color of Hull',
             command = self.setHullColor,
             command = self.setHullColor,
-            value = [255.0,128.0,128.0,255.0])
+            value = [255.0, 128.0, 128.0, 255.0])
 
 
         #drawFrame.pack(fill = X)
         #drawFrame.pack(fill = X)
 
 
@@ -622,8 +622,8 @@ class MopathRecorder(AppShell, DirectObject):
         # Pack record frame
         # Pack record frame
         optionsFrame.pack(fill = X, pady = 2)
         optionsFrame.pack(fill = X, pady = 2)
 
 
-        self.mainNotebook.setnaturalsize()        
-        
+        self.mainNotebook.setnaturalsize()
+
     def pushUndo(self, fResetRedo = 1):
     def pushUndo(self, fResetRedo = 1):
         direct.pushUndo([self.nodePath])
         direct.pushUndo([self.nodePath])
 
 
@@ -641,7 +641,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
     def pushRedo(self):
     def pushRedo(self):
         direct.pushRedo([self.nodePath])
         direct.pushRedo([self.nodePath])
-        
+
     def redoHook(self, nodePathList = []):
     def redoHook(self, nodePathList = []):
         # Reflect new changes
         # Reflect new changes
         pass
         pass
@@ -653,7 +653,7 @@ class MopathRecorder(AppShell, DirectObject):
     def redoListEmptyHook(self):
     def redoListEmptyHook(self):
         # Make sure button is deactivated
         # Make sure button is deactivated
         self.redoButton.configure(state = 'disabled')
         self.redoButton.configure(state = 'disabled')
-        
+
     def selectedNodePathHook(self, nodePath):
     def selectedNodePathHook(self, nodePath):
         """
         """
         Hook called upon selection of a node path used to select playback
         Hook called upon selection of a node path used to select playback
@@ -692,7 +692,7 @@ class MopathRecorder(AppShell, DirectObject):
             (nodePath.id() == self.tangentMarker.id())):
             (nodePath.id() == self.tangentMarker.id())):
             self.tangentGroup.hide()
             self.tangentGroup.hide()
 
 
-    def curveEditTask(self,state):
+    def curveEditTask(self, state):
         if self.curveCollection != None:
         if self.curveCollection != None:
             # Update curve position
             # Update curve position
             if self.manipulandumId == self.playbackMarker.id():
             if self.manipulandumId == self.playbackMarker.id():
@@ -748,11 +748,11 @@ class MopathRecorder(AppShell, DirectObject):
                 self.manipulandumId = self.playbackMarker.id()
                 self.manipulandumId = self.playbackMarker.id()
             elif direct.selected.last.id() == self.tangentMarker.id():
             elif direct.selected.last.id() == self.tangentMarker.id():
                 self.manipulandumId = self.tangentMarker.id()
                 self.manipulandumId = self.tangentMarker.id()
-              
+
     def manipulateObjectCleanupHook(self, nodePathList = []):
     def manipulateObjectCleanupHook(self, nodePathList = []):
         # Clear flag
         # Clear flag
         self.manipulandumId = None
         self.manipulandumId = None
-            
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         # Remove hooks
         # Remove hooks
         for event, method in self.actionEvents:
         for event, method in self.actionEvents:
@@ -824,7 +824,7 @@ class MopathRecorder(AppShell, DirectObject):
             self.curveNodePath.show()
             self.curveNodePath.show()
         else:
         else:
             self.curveNodePath.hide()
             self.curveNodePath.hide()
-        
+
     def setKnotVis(self):
     def setKnotVis(self):
         self.nurbsCurveDrawer.setShowKnots(
         self.nurbsCurveDrawer.setShowKnots(
             self.getVariable('Style', 'Knots').get())
             self.getVariable('Style', 'Knots').get())
@@ -832,11 +832,11 @@ class MopathRecorder(AppShell, DirectObject):
     def setCvVis(self):
     def setCvVis(self):
         self.nurbsCurveDrawer.setShowCvs(
         self.nurbsCurveDrawer.setShowCvs(
             self.getVariable('Style', 'CVs').get())
             self.getVariable('Style', 'CVs').get())
-        
+
     def setHullVis(self):
     def setHullVis(self):
         self.nurbsCurveDrawer.setShowHull(
         self.nurbsCurveDrawer.setShowHull(
             self.getVariable('Style', 'Hull').get())
             self.getVariable('Style', 'Hull').get())
-        
+
     def setTraceVis(self):
     def setTraceVis(self):
         if self.getVariable('Style', 'Trace').get():
         if self.getVariable('Style', 'Trace').get():
             self.trace.show()
             self.trace.show()
@@ -852,33 +852,33 @@ class MopathRecorder(AppShell, DirectObject):
     def setNumSegs(self, value):
     def setNumSegs(self, value):
         self.numSegs = int(value)
         self.numSegs = int(value)
         self.nurbsCurveDrawer.setNumSegs(self.numSegs)
         self.nurbsCurveDrawer.setNumSegs(self.numSegs)
-        
+
     def setNumTicks(self, value):
     def setNumTicks(self, value):
         self.nurbsCurveDrawer.setNumTicks(float(value))
         self.nurbsCurveDrawer.setNumTicks(float(value))
-        
+
     def setTickScale(self, value):
     def setTickScale(self, value):
         self.nurbsCurveDrawer.setTickScale(float(value))
         self.nurbsCurveDrawer.setTickScale(float(value))
 
 
     def setPathColor(self, color):
     def setPathColor(self, color):
         self.nurbsCurveDrawer.setColor(
         self.nurbsCurveDrawer.setColor(
-            color[0]/255.0,color[1]/255.0,color[2]/255.0)
+            color[0]/255.0, color[1]/255.0, color[2]/255.0)
         self.nurbsCurveDrawer.draw()
         self.nurbsCurveDrawer.draw()
 
 
     def setKnotColor(self, color):
     def setKnotColor(self, color):
         self.nurbsCurveDrawer.setKnotColor(
         self.nurbsCurveDrawer.setKnotColor(
-            color[0]/255.0,color[1]/255.0,color[2]/255.0)
+            color[0]/255.0, color[1]/255.0, color[2]/255.0)
 
 
     def setCvColor(self, color):
     def setCvColor(self, color):
         self.nurbsCurveDrawer.setCvColor(
         self.nurbsCurveDrawer.setCvColor(
-            color[0]/255.0,color[1]/255.0,color[2]/255.0)
+            color[0]/255.0, color[1]/255.0, color[2]/255.0)
 
 
     def setTickColor(self, color):
     def setTickColor(self, color):
         self.nurbsCurveDrawer.setTickColor(
         self.nurbsCurveDrawer.setTickColor(
-            color[0]/255.0,color[1]/255.0,color[2]/255.0)
+            color[0]/255.0, color[1]/255.0, color[2]/255.0)
 
 
     def setHullColor(self, color):
     def setHullColor(self, color):
         self.nurbsCurveDrawer.setHullColor(
         self.nurbsCurveDrawer.setHullColor(
-            color[0]/255.0,color[1]/255.0,color[2]/255.0)
+            color[0]/255.0, color[1]/255.0, color[2]/255.0)
 
 
     def setStartStopHook(self, event = None):
     def setStartStopHook(self, event = None):
         # Clear out old hook
         # Clear out old hook
@@ -904,7 +904,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.curveCollection = None
         self.curveCollection = None
         self.curveFitter.reset()
         self.curveFitter.reset()
         self.nurbsCurveDrawer.hide()
         self.nurbsCurveDrawer.hide()
-        
+
     def setSamplingMode(self, mode):
     def setSamplingMode(self, mode):
         self.samplingMode = mode
         self.samplingMode = mode
 
 
@@ -921,7 +921,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
     def setRefineMode(self):
     def setRefineMode(self):
         self.setRecordingType('Refine')
         self.setRecordingType('Refine')
-        
+
     def setExtendMode(self):
     def setExtendMode(self):
         self.setRecordingType('Extend')
         self.setRecordingType('Extend')
 
 
@@ -972,7 +972,7 @@ class MopathRecorder(AppShell, DirectObject):
                     # Parent record node path to temp
                     # Parent record node path to temp
                     self.nodePath.reparentTo(self.playbackNodePath)
                     self.nodePath.reparentTo(self.playbackNodePath)
                     # Align with temp
                     # Align with temp
-                    self.nodePath.setPosHpr(0,0,0,0,0,0)
+                    self.nodePath.setPosHpr(0, 0, 0, 0, 0, 0)
                     # Set playback start to self.recordStart
                     # Set playback start to self.recordStart
                     self.playbackGoTo(self.recordStart)
                     self.playbackGoTo(self.recordStart)
                     # start flying nodePath along path
                     # start flying nodePath along path
@@ -1009,7 +1009,7 @@ class MopathRecorder(AppShell, DirectObject):
                 self.setNewCurveMode()
                 self.setNewCurveMode()
             # Compute curve
             # Compute curve
             self.computeCurves()
             self.computeCurves()
-            
+
     def recordTask(self, state):
     def recordTask(self, state):
         # Record raw data point
         # Record raw data point
         time = self.recordStart + (
         time = self.recordStart + (
@@ -1201,7 +1201,7 @@ class MopathRecorder(AppShell, DirectObject):
             else:
             else:
                 if name == 'widget':
                 if name == 'widget':
                     # Record relationship between selected nodes and widget
                     # Record relationship between selected nodes and widget
-                    direct.selected.getWrtAll()                    
+                    direct.selected.getWrtAll()
                 if name == 'marker':
                 if name == 'marker':
                     self.playbackMarker.show()
                     self.playbackMarker.show()
                     # Initialize tangent marker position
                     # Initialize tangent marker position
@@ -1287,7 +1287,7 @@ class MopathRecorder(AppShell, DirectObject):
     def setPlaybackSF(self, value):
     def setPlaybackSF(self, value):
         self.playbackSF = pow(10.0, float(value))
         self.playbackSF = pow(10.0, float(value))
         self.speedVar.set('%0.2f' % self.playbackSF)
         self.speedVar.set('%0.2f' % self.playbackSF)
-        
+
     def playbackTask(self, state):
     def playbackTask(self, state):
         time = globalClock.getFrameTime()
         time = globalClock.getFrameTime()
         dTime = self.playbackSF * (time - state.lastTime)
         dTime = self.playbackSF * (time - state.lastTime)
@@ -1346,7 +1346,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
     def setDesampleFrequency(self, frequency):
     def setDesampleFrequency(self, frequency):
         self.desampleFrequency = frequency
         self.desampleFrequency = frequency
-        
+
     def desampleCurve(self):
     def desampleCurve(self):
         if (self.curveFitter.getNumSamples() == 0):
         if (self.curveFitter.getNumSamples() == 0):
             print 'MopathRecorder.desampleCurve: Must define curve first'
             print 'MopathRecorder.desampleCurve: Must define curve first'
@@ -1360,7 +1360,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
     def setNumSamples(self, numSamples):
     def setNumSamples(self, numSamples):
         self.numSamples = int(numSamples)
         self.numSamples = int(numSamples)
-        
+
     def sampleCurve(self, fCompute = 1):
     def sampleCurve(self, fCompute = 1):
         if self.curveCollection == None:
         if self.curveCollection == None:
             print 'MopathRecorder.sampleCurve: Must define curve first'
             print 'MopathRecorder.sampleCurve: Must define curve first'
@@ -1390,7 +1390,7 @@ class MopathRecorder(AppShell, DirectObject):
     def setPathDuration(self, event):
     def setPathDuration(self, event):
         newMaxT = float(self.getWidget('Resample', 'Path Duration').get())
         newMaxT = float(self.getWidget('Resample', 'Path Duration').get())
         self.setPathDurationTo(newMaxT)
         self.setPathDurationTo(newMaxT)
-        
+
     def setPathDurationTo(self, newMaxT):
     def setPathDurationTo(self, newMaxT):
         # Compute scale factor
         # Compute scale factor
         sf = newMaxT/self.maxT
         sf = newMaxT/self.maxT
@@ -1415,7 +1415,7 @@ class MopathRecorder(AppShell, DirectObject):
         # Compute curve
         # Compute curve
         #self.computeCurves()
         #self.computeCurves()
 
 
-    def setRecordStart(self,value):
+    def setRecordStart(self, value):
         self.recordStart = value
         self.recordStart = value
         # Someone else is adjusting values, let them take care of it
         # Someone else is adjusting values, let them take care of it
         if self.fAdjustingValues:
         if self.fAdjustingValues:
@@ -1550,7 +1550,7 @@ class MopathRecorder(AppShell, DirectObject):
             # Add it to the curve fitters
             # Add it to the curve fitters
             self.curveFitter.addXyzHpr(adjustedTime, pos, hpr)
             self.curveFitter.addXyzHpr(adjustedTime, pos, hpr)
 
 
-    def setCropFrom(self,value):
+    def setCropFrom(self, value):
         self.cropFrom = value
         self.cropFrom = value
         # Someone else is adjusting values, let them take care of it
         # Someone else is adjusting values, let them take care of it
         if self.fAdjustingValues:
         if self.fAdjustingValues:
@@ -1563,7 +1563,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.getWidget('Playback', 'Time').set(value)
         self.getWidget('Playback', 'Time').set(value)
         self.fAdjustingValues = 0
         self.fAdjustingValues = 0
 
 
-    def setCropTo(self,value):
+    def setCropTo(self, value):
         self.cropTo = value
         self.cropTo = value
         # Someone else is adjusting values, let them take care of it
         # Someone else is adjusting values, let them take care of it
         if self.fAdjustingValues:
         if self.fAdjustingValues:
@@ -1685,7 +1685,7 @@ class MopathRecorder(AppShell, DirectObject):
     ## WIDGET UTILITY FUNCTIONS ##
     ## WIDGET UTILITY FUNCTIONS ##
     def addWidget(self, widget, category, text):
     def addWidget(self, widget, category, text):
         self.widgetDict[category + '-' + text] = widget
         self.widgetDict[category + '-' + text] = widget
-        
+
     def getWidget(self, category, text):
     def getWidget(self, category, text):
         return self.widgetDict[category + '-' + text]
         return self.widgetDict[category + '-' + text]
 
 
@@ -1723,7 +1723,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.bind(widget, balloonHelp)
         self.bind(widget, balloonHelp)
         self.widgetDict[category + '-' + text] = widget
         self.widgetDict[category + '-' + text] = widget
         return widget
         return widget
-        
+
     def createCheckbutton(self, parent, category, text,
     def createCheckbutton(self, parent, category, text,
                           balloonHelp, command, initialState,
                           balloonHelp, command, initialState,
                           side = 'top', fill = X, expand = 0):
                           side = 'top', fill = X, expand = 0):
@@ -1738,7 +1738,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.widgetDict[category + '-' + text] = widget
         self.widgetDict[category + '-' + text] = widget
         self.variableDict[category + '-' + text] = bool
         self.variableDict[category + '-' + text] = bool
         return widget
         return widget
-        
+
     def createRadiobutton(self, parent, side, category, text,
     def createRadiobutton(self, parent, side, category, text,
                           balloonHelp, variable, value,
                           balloonHelp, variable, value,
                           command = None, fill = X, expand = 0):
                           command = None, fill = X, expand = 0):
@@ -1750,7 +1750,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.bind(widget, balloonHelp)
         self.bind(widget, balloonHelp)
         self.widgetDict[category + '-' + text] = widget
         self.widgetDict[category + '-' + text] = widget
         return widget
         return widget
-        
+
     def createFloater(self, parent, category, text, balloonHelp,
     def createFloater(self, parent, category, text, balloonHelp,
                       command = None, min = 0.0, resolution = None,
                       command = None, min = 0.0, resolution = None,
                       maxVelocity = 10.0, **kw):
                       maxVelocity = 10.0, **kw):
@@ -1769,7 +1769,7 @@ class MopathRecorder(AppShell, DirectObject):
     def createAngleDial(self, parent, category, text, balloonHelp,
     def createAngleDial(self, parent, category, text, balloonHelp,
                         command = None, **kw):
                         command = None, **kw):
         kw['text'] = text
         kw['text'] = text
-        widget = apply(Dial.AngleDial,(parent,), kw)
+        widget = apply(Dial.AngleDial, (parent,), kw)
         # Do this after the widget so command isn't called on creation
         # Do this after the widget so command isn't called on creation
         widget['command'] = command
         widget['command'] = command
         widget.pack(fill = X)
         widget.pack(fill = X)
@@ -1839,7 +1839,7 @@ class MopathRecorder(AppShell, DirectObject):
                          command = None, **kw):
                          command = None, **kw):
         # Set label's text
         # Set label's text
         kw['text'] = text
         kw['text'] = text
-        widget = apply(VectorWidgets.ColorEntry, (parent,),kw)
+        widget = apply(VectorWidgets.ColorEntry, (parent,), kw)
         # Do this after the widget so command isn't called on creation
         # Do this after the widget so command isn't called on creation
         widget['command'] = command
         widget['command'] = command
         widget.pack(fill = X)
         widget.pack(fill = X)
@@ -1903,12 +1903,12 @@ class MopathRecorder(AppShell, DirectObject):
         self.cCamera = render.attachNewNode('cCamera')
         self.cCamera = render.attachNewNode('cCamera')
         self.cCamNode = Camera('cCam')
         self.cCamNode = Camera('cCam')
         self.cLens = PerspectiveLens()
         self.cLens = PerspectiveLens()
-        self.cLens.setFov(40,40)
+        self.cLens.setFov(40, 40)
         self.cLens.setNear(0.1)
         self.cLens.setNear(0.1)
         self.cLens.setFar(100.0)
         self.cLens.setFar(100.0)
         self.cCamNode.setLens(self.cLens)
         self.cCamNode.setLens(self.cLens)
         self.cCamNode.setScene(render)
         self.cCamNode.setScene(render)
         self.cCam = self.cCamera.attachNewNode(self.cCamNode)
         self.cCam = self.cCamera.attachNewNode(self.cCamNode)
-        
+
         self.cDr.setCamera(self.cCam)
         self.cDr.setCamera(self.cCam)
 
 

+ 101 - 101
direct/src/tkpanels/ParticlePanel.py

@@ -15,7 +15,7 @@ from direct.particles import ForceGroup
 from direct.particles import Particles
 from direct.particles import Particles
 from direct.particles import ParticleEffect
 from direct.particles import ParticleEffect
 
 
-from pandac.PandaModules import ColorBlendAttrib,getModelPath
+from pandac.PandaModules import ColorBlendAttrib, getModelPath
 
 
 class ParticlePanel(AppShell):
 class ParticlePanel(AppShell):
     # Override class variables
     # Override class variables
@@ -514,7 +514,7 @@ class ParticlePanel(AppShell):
 
 
         self.rendererNotebook = Pmw.NoteBook(rendererPage, tabpos = None)
         self.rendererNotebook = Pmw.NoteBook(rendererPage, tabpos = None)
         self.rendererNotebook.pack(fill = BOTH, expand = 1)
         self.rendererNotebook.pack(fill = BOTH, expand = 1)
-               
+
         # Line page #
         # Line page #
         linePage = self.rendererNotebook.add('LineParticleRenderer')
         linePage = self.rendererNotebook.add('LineParticleRenderer')
         self.createColorEntry(linePage, 'Line Renderer', 'Head Color',
         self.createColorEntry(linePage, 'Line Renderer', 'Head Color',
@@ -591,16 +591,16 @@ class ParticlePanel(AppShell):
         segmentMenu.add_command(label = 'Add Sinusoid segment',
         segmentMenu.add_command(label = 'Add Sinusoid segment',
                                 command = self.addSinusoidInterpolationSegment)
                                 command = self.addSinusoidInterpolationSegment)
         addSegmentButton.pack(expand = 0)
         addSegmentButton.pack(expand = 0)
-        
+
         sf = Pmw.ScrolledFrame(p, horizflex = 'elastic')
         sf = Pmw.ScrolledFrame(p, horizflex = 'elastic')
         sf.pack(fill = BOTH, expand = 1)
         sf.pack(fill = BOTH, expand = 1)
-        
+
         self.rendererGeomSegmentFrame = sf.interior()
         self.rendererGeomSegmentFrame = sf.interior()
         self.rendererGeomSegmentFrame.pack(fill = BOTH, expand = 1)
         self.rendererGeomSegmentFrame.pack(fill = BOTH, expand = 1)
         self.rendererGeomSegmentWidgetList = []
         self.rendererGeomSegmentWidgetList = []
 
 
 
 
-        
+
         rendererGeomNotebook.setnaturalsize()
         rendererGeomNotebook.setnaturalsize()
 
 
         # Point #
         # Point #
@@ -658,7 +658,7 @@ class ParticlePanel(AppShell):
 
 
         rendererSpriteNotebook = Pmw.NoteBook(f)
         rendererSpriteNotebook = Pmw.NoteBook(f)
         rendererSpriteNotebook.pack(fill = BOTH, expand = 1)
         rendererSpriteNotebook.pack(fill = BOTH, expand = 1)
-        
+
         rendererSpriteTexturePage = rendererSpriteNotebook.add('Texture')
         rendererSpriteTexturePage = rendererSpriteNotebook.add('Texture')
         rendererSpriteScalePage = rendererSpriteNotebook.add('Scale')
         rendererSpriteScalePage = rendererSpriteNotebook.add('Scale')
         rendererSpriteBlendPage = rendererSpriteNotebook.add('Blend')
         rendererSpriteBlendPage = rendererSpriteNotebook.add('Blend')
@@ -680,14 +680,14 @@ class ParticlePanel(AppShell):
             self.setRendererSpriteAnimationEnable, 0, side = LEFT)
             self.setRendererSpriteAnimationEnable, 0, side = LEFT)
         self.createFloater(bbp, 'Sprite Renderer', 'Frame Rate', 'Animation frame rate',
         self.createFloater(bbp, 'Sprite Renderer', 'Frame Rate', 'Animation frame rate',
                            command = self.setRendererSpriteAnimationFrameRate).pack(side = LEFT)
                            command = self.setRendererSpriteAnimationFrameRate).pack(side = LEFT)
-        
+
         bbp = Frame(bp)
         bbp = Frame(bp)
         bbp.pack(pady=3)
         bbp.pack(pady=3)
         Button(bbp, text = 'Add Texture',
         Button(bbp, text = 'Add Texture',
                command = self.addRendererSpriteAnimationTexture).pack(pady = 3, padx = 15, side = LEFT)
                command = self.addRendererSpriteAnimationTexture).pack(pady = 3, padx = 15, side = LEFT)
         Button(bbp, text = 'Add Animation',
         Button(bbp, text = 'Add Animation',
                command = self.addRendererSpriteAnimationFromNode).pack(pady = 3, padx = 15, side = LEFT)
                command = self.addRendererSpriteAnimationFromNode).pack(pady = 3, padx = 15, side = LEFT)
-        
+
         pp = Frame(p)
         pp = Frame(p)
         pp.pack(fill = BOTH, expand = 1, pady = 3)
         pp.pack(fill = BOTH, expand = 1, pady = 3)
         sf = Pmw.ScrolledFrame(pp, horizflex = 'elastic')
         sf = Pmw.ScrolledFrame(pp, horizflex = 'elastic')
@@ -801,7 +801,7 @@ class ParticlePanel(AppShell):
         pp.pack(fill = BOTH, expand = 1, pady = 3)
         pp.pack(fill = BOTH, expand = 1, pady = 3)
         sf = Pmw.ScrolledFrame(pp, horizflex = 'elastic')
         sf = Pmw.ScrolledFrame(pp, horizflex = 'elastic')
         sf.pack(fill = BOTH, expand = 1)
         sf.pack(fill = BOTH, expand = 1)
-        
+
         self.rendererSpriteSegmentFrame = sf.interior()
         self.rendererSpriteSegmentFrame = sf.interior()
         self.rendererSpriteSegmentFrame.pack(fill = BOTH, expand = 1)
         self.rendererSpriteSegmentFrame.pack(fill = BOTH, expand = 1)
         self.rendererSpriteSegmentWidgetList = []
         self.rendererSpriteSegmentWidgetList = []
@@ -919,7 +919,7 @@ class ParticlePanel(AppShell):
                         command = None, **kw):
                         command = None, **kw):
         kw['text'] = text
         kw['text'] = text
         kw['style'] = 'mini'
         kw['style'] = 'mini'
-        widget = apply(Dial.AngleDial,(parent,), kw)
+        widget = apply(Dial.AngleDial, (parent,), kw)
         # Do this after the widget so command isn't called on creation
         # Do this after the widget so command isn't called on creation
         widget['command'] = command
         widget['command'] = command
         widget.pack(fill = X)
         widget.pack(fill = X)
@@ -970,7 +970,7 @@ class ParticlePanel(AppShell):
                          command = None, **kw):
                          command = None, **kw):
         # Set label's text
         # Set label's text
         kw['text'] = text
         kw['text'] = text
-        widget = apply(VectorWidgets.ColorEntry, (parent,),kw)
+        widget = apply(VectorWidgets.ColorEntry, (parent,), kw)
         # Do this after the widget so command isn't called on creation
         # Do this after the widget so command isn't called on creation
         widget['command'] = command
         widget['command'] = command
         widget.pack(fill = X)
         widget.pack(fill = X)
@@ -1186,7 +1186,7 @@ class ParticlePanel(AppShell):
             path = '.'
             path = '.'
         particleFilename = askopenfilename(
         particleFilename = askopenfilename(
             defaultextension = '.ptf',
             defaultextension = '.ptf',
-            filetypes = (('Particle Files', '*.ptf'),('All files', '*')),
+            filetypes = (('Particle Files', '*.ptf'), ('All files', '*')),
             initialdir = path,
             initialdir = path,
             title = 'Load Particle Effect',
             title = 'Load Particle Effect',
             parent = self.parent)
             parent = self.parent)
@@ -1214,7 +1214,7 @@ class ParticlePanel(AppShell):
             path = '.'
             path = '.'
         particleFilename = asksaveasfilename(
         particleFilename = asksaveasfilename(
             defaultextension = '.ptf',
             defaultextension = '.ptf',
-            filetypes = (('Particle Files', '*.ptf'),('All files', '*')),
+            filetypes = (('Particle Files', '*.ptf'), ('All files', '*')),
             initialdir = path,
             initialdir = path,
             title = 'Save Particle Effect as',
             title = 'Save Particle Effect as',
             parent = self.parent)
             parent = self.parent)
@@ -1415,7 +1415,7 @@ class ParticlePanel(AppShell):
             radius = emitter.getRadius()
             radius = emitter.getRadius()
             self.getWidget('Ring Emitter', 'Radius').set(radius, 0)
             self.getWidget('Ring Emitter', 'Radius').set(radius, 0)
             radiusSpread = emitter.getRadiusSpread()
             radiusSpread = emitter.getRadiusSpread()
-            self.getWidget('Ring Emitter', 'Radius Spread').set(radiusSpread,0)
+            self.getWidget('Ring Emitter', 'Radius Spread').set(radiusSpread, 0)
             angle = emitter.getAngle()
             angle = emitter.getAngle()
             self.getWidget('Ring Emitter', 'Angle').set(angle, 0)
             self.getWidget('Ring Emitter', 'Angle').set(angle, 0)
         elif isinstance(emitter, SphereVolumeEmitter):
         elif isinstance(emitter, SphereVolumeEmitter):
@@ -1429,7 +1429,7 @@ class ParticlePanel(AppShell):
             self.getWidget('Tangent Ring Emitter', 'Radius').set(radius, 0)
             self.getWidget('Tangent Ring Emitter', 'Radius').set(radius, 0)
             radiusSpread = emitter.getRadiusSpread()
             radiusSpread = emitter.getRadiusSpread()
             self.getWidget('Tangent Ring Emitter', 'Radius Spread').set(
             self.getWidget('Tangent Ring Emitter', 'Radius Spread').set(
-                radiusSpread,0)
+                radiusSpread, 0)
     # All #
     # All #
     def setEmissionType(self, newType = None):
     def setEmissionType(self, newType = None):
         if newType:
         if newType:
@@ -1633,7 +1633,7 @@ class ParticlePanel(AppShell):
                 lScale = "SP_SCALE"
                 lScale = "SP_SCALE"
             self.getVariable('Sparkle Renderer', 'Life Scale').set(lScale)
             self.getVariable('Sparkle Renderer', 'Life Scale').set(lScale)
         elif isinstance(renderer, SpriteParticleRenderer):
         elif isinstance(renderer, SpriteParticleRenderer):
-            self.getWidget('Sprite Renderer','Frame Rate').set(renderer.getAnimateFramesRate(),0)
+            self.getWidget('Sprite Renderer','Frame Rate').set(renderer.getAnimateFramesRate(), 0)
             self.getVariable('Sprite Renderer','Enable Animation').set(
             self.getVariable('Sprite Renderer','Enable Animation').set(
                 renderer.getAnimateFramesEnable())
                 renderer.getAnimateFramesEnable())
             self.readSpriteRendererAnimations() # Updates widgets with renderer data.
             self.readSpriteRendererAnimations() # Updates widgets with renderer data.
@@ -1793,15 +1793,15 @@ class ParticlePanel(AppShell):
             parent = self.rendererSpriteSegmentFrame
             parent = self.rendererSpriteSegmentFrame
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Constant'
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Constant'
             self.rendererSpriteSegmentWidgetList.append(
             self.rendererSpriteSegmentWidgetList.append(
-                self.createConstantInterpolationSegmentWidget(parent,segName,seg))
+                self.createConstantInterpolationSegmentWidget(parent, segName, seg))
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
             parent = self.rendererGeomSegmentFrame
             parent = self.rendererGeomSegmentFrame
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Constant'
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Constant'
             self.rendererGeomSegmentWidgetList.append(
             self.rendererGeomSegmentWidgetList.append(
-                self.createConstantInterpolationSegmentWidget(parent,segName,seg))
+                self.createConstantInterpolationSegmentWidget(parent, segName, seg))
         parent.pack(fill=BOTH, expand=1)
         parent.pack(fill=BOTH, expand=1)
 
 
-    def setRendererSpriteAnimationFrameRate(self,rate):
+    def setRendererSpriteAnimationFrameRate(self, rate):
         self.particles.renderer.setAnimateFramesRate(rate)
         self.particles.renderer.setAnimateFramesRate(rate)
     def setRendererSpriteAnimationEnable(self):
     def setRendererSpriteAnimationEnable(self):
         self.particles.renderer.setAnimateFramesEnable(
         self.particles.renderer.setAnimateFramesEnable(
@@ -1815,17 +1815,17 @@ class ParticlePanel(AppShell):
             anim = ren.getAnim(animId)
             anim = ren.getAnim(animId)
 
 
             frameNum = len([x for x in self.rendererSpriteAnimationWidgetList if x])
             frameNum = len([x for x in self.rendererSpriteAnimationWidgetList if x])
-            
+
             self.rendererSpriteAnimationWidgetList.append(
             self.rendererSpriteAnimationWidgetList.append(
-                self.createSpriteAnimationTextureWidget(parent,anim,`frameNum`))
+                self.createSpriteAnimationTextureWidget(parent, anim, `frameNum`))
         else:
         else:
             animId = len([x for x in self.rendererSpriteAnimationWidgetList if x and x.valid])
             animId = len([x for x in self.rendererSpriteAnimationWidgetList if x and x.valid])
             anim = SpriteAnim.STTexture
             anim = SpriteAnim.STTexture
 
 
             frameNum = len([x for x in self.rendererSpriteAnimationWidgetList if x])
             frameNum = len([x for x in self.rendererSpriteAnimationWidgetList if x])
-            
+
             self.rendererSpriteAnimationWidgetList.append(
             self.rendererSpriteAnimationWidgetList.append(
-                self.createSpriteAnimationTextureWidget(parent,anim,`frameNum`))
+                self.createSpriteAnimationTextureWidget(parent, anim, `frameNum`))
         parent.pack(fill=BOTH, expand=1)
         parent.pack(fill=BOTH, expand=1)
     def addRendererSpriteAnimationFromNode(self):
     def addRendererSpriteAnimationFromNode(self):
         ren = self.particles.getRenderer()
         ren = self.particles.getRenderer()
@@ -1836,19 +1836,19 @@ class ParticlePanel(AppShell):
             anim = ren.getAnim(animId)
             anim = ren.getAnim(animId)
 
 
             frameNum = len([x for x in self.rendererSpriteAnimationWidgetList if x])
             frameNum = len([x for x in self.rendererSpriteAnimationWidgetList if x])
-            
+
             self.rendererSpriteAnimationWidgetList.append(
             self.rendererSpriteAnimationWidgetList.append(
-                self.createSpriteAnimationNodeWidget(parent,anim,`frameNum`))
+                self.createSpriteAnimationNodeWidget(parent, anim, `frameNum`))
         else:
         else:
             animId = len([x for x in self.rendererSpriteAnimationWidgetList if x and x.valid])
             animId = len([x for x in self.rendererSpriteAnimationWidgetList if x and x.valid])
             anim = SpriteAnim.STFromNode
             anim = SpriteAnim.STFromNode
 
 
             frameNum = len([x for x in self.rendererSpriteAnimationWidgetList if x])
             frameNum = len([x for x in self.rendererSpriteAnimationWidgetList if x])
-            
+
             self.rendererSpriteAnimationWidgetList.append(
             self.rendererSpriteAnimationWidgetList.append(
-                self.createSpriteAnimationNodeWidget(parent,anim,`frameNum`))
+                self.createSpriteAnimationNodeWidget(parent, anim, `frameNum`))
         parent.pack(fill=BOTH, expand=1)
         parent.pack(fill=BOTH, expand=1)
-        
+
     def toggleRendererSpriteXScale(self):
     def toggleRendererSpriteXScale(self):
         self.particles.renderer.setXScaleFlag(
         self.particles.renderer.setXScaleFlag(
             self.getVariable('Sprite Renderer', 'X Scale').get())
             self.getVariable('Sprite Renderer', 'X Scale').get())
@@ -1885,7 +1885,7 @@ class ParticlePanel(AppShell):
     def toggleRendererSpriteAlphaDisable(self):
     def toggleRendererSpriteAlphaDisable(self):
         self.particles.renderer.setAlphaDisable(
         self.particles.renderer.setAlphaDisable(
             self.getVariable('Sprite Renderer', 'Alpha Disable').get())
             self.getVariable('Sprite Renderer', 'Alpha Disable').get())
-    def setRendererColorBlendAttrib(self,rendererName,blendMethodStr,incomingOperandStr,fbufferOperandStr):
+    def setRendererColorBlendAttrib(self, rendererName, blendMethodStr, incomingOperandStr, fbufferOperandStr):
         self.particles.getRenderer().setColorBlendMode(eval('ColorBlendAttrib.'+blendMethodStr),
         self.particles.getRenderer().setColorBlendMode(eval('ColorBlendAttrib.'+blendMethodStr),
                                                        eval('ColorBlendAttrib.'+incomingOperandStr),
                                                        eval('ColorBlendAttrib.'+incomingOperandStr),
                                                        eval('ColorBlendAttrib.'+fbufferOperandStr))
                                                        eval('ColorBlendAttrib.'+fbufferOperandStr))
@@ -1903,36 +1903,36 @@ class ParticlePanel(AppShell):
         incomingOperandStr = self.getVariable('Sprite Renderer','Incoming Op.').get()
         incomingOperandStr = self.getVariable('Sprite Renderer','Incoming Op.').get()
         fbufferOperandStr = self.getVariable('Sprite Renderer','Fbuffer Op.').get()
         fbufferOperandStr = self.getVariable('Sprite Renderer','Fbuffer Op.').get()
 
 
-        self.setRendererColorBlendAttrib('Sprite Renderer',blendMethodStr,incomingOperandStr,fbufferOperandStr)
+        self.setRendererColorBlendAttrib('Sprite Renderer', blendMethodStr, incomingOperandStr, fbufferOperandStr)
     def setRendererSpriteColorBlendIncomingOperand(self, operand):
     def setRendererSpriteColorBlendIncomingOperand(self, operand):
         blendMethodStr = self.getVariable('Sprite Renderer','Color Blend').get()
         blendMethodStr = self.getVariable('Sprite Renderer','Color Blend').get()
         incomingOperandStr = operand
         incomingOperandStr = operand
         fbufferOperandStr = self.getVariable('Sprite Renderer','Fbuffer Op.').get()
         fbufferOperandStr = self.getVariable('Sprite Renderer','Fbuffer Op.').get()
 
 
-        self.setRendererColorBlendAttrib('Sprite Renderer',blendMethodStr,incomingOperandStr,fbufferOperandStr)
+        self.setRendererColorBlendAttrib('Sprite Renderer', blendMethodStr, incomingOperandStr, fbufferOperandStr)
     def setRendererSpriteColorBlendFbufferOperand(self, operand):
     def setRendererSpriteColorBlendFbufferOperand(self, operand):
         blendMethodStr = self.getVariable('Sprite Renderer','Color Blend').get()
         blendMethodStr = self.getVariable('Sprite Renderer','Color Blend').get()
         incomingOperandStr = self.getVariable('Sprite Renderer','Incoming Op.').get()
         incomingOperandStr = self.getVariable('Sprite Renderer','Incoming Op.').get()
         fbufferOperandStr = operand
         fbufferOperandStr = operand
 
 
-        self.setRendererColorBlendAttrib('Sprite Renderer',blendMethodStr,incomingOperandStr,fbufferOperandStr)
+        self.setRendererColorBlendAttrib('Sprite Renderer', blendMethodStr, incomingOperandStr, fbufferOperandStr)
     def setRendererGeomColorBlendMethod(self, blendMethod):
     def setRendererGeomColorBlendMethod(self, blendMethod):
         blendMethodStr = blendMethod
         blendMethodStr = blendMethod
         incomingOperandStr = self.getVariable('Geom Renderer','Incoming Op.').get()
         incomingOperandStr = self.getVariable('Geom Renderer','Incoming Op.').get()
         fbufferOperandStr = self.getVariable('Geom Renderer','Fbuffer Op.').get()
         fbufferOperandStr = self.getVariable('Geom Renderer','Fbuffer Op.').get()
 
 
-        self.setRendererColorBlendAttrib('Geom Renderer',blendMethodStr,incomingOperandStr,fbufferOperandStr)
+        self.setRendererColorBlendAttrib('Geom Renderer', blendMethodStr, incomingOperandStr, fbufferOperandStr)
     def setRendererGeomColorBlendIncomingOperand(self, operand):
     def setRendererGeomColorBlendIncomingOperand(self, operand):
         blendMethodStr = self.getVariable('Geom Renderer','Color Blend').get()
         blendMethodStr = self.getVariable('Geom Renderer','Color Blend').get()
         incomingOperandStr = operand
         incomingOperandStr = operand
         fbufferOperandStr = self.getVariable('Geom Renderer','Fbuffer Op.').get()
         fbufferOperandStr = self.getVariable('Geom Renderer','Fbuffer Op.').get()
 
 
-        self.setRendererColorBlendAttrib('Geom Renderer',blendMethodStr,incomingOperandStr,fbufferOperandStr)
+        self.setRendererColorBlendAttrib('Geom Renderer', blendMethodStr, incomingOperandStr, fbufferOperandStr)
     def setRendererGeomColorBlendFbufferOperand(self, operand):
     def setRendererGeomColorBlendFbufferOperand(self, operand):
         blendMethodStr = self.getVariable('Geom Renderer','Color Blend').get()
         blendMethodStr = self.getVariable('Geom Renderer','Color Blend').get()
         incomingOperandStr = self.getVariable('Geom Renderer','Incoming Op.').get()
         incomingOperandStr = self.getVariable('Geom Renderer','Incoming Op.').get()
         fbufferOperandStr = operand
         fbufferOperandStr = operand
-        self.setRendererColorBlendAttrib('Geom Renderer',blendMethodStr,incomingOperandStr,fbufferOperandStr)
+        self.setRendererColorBlendAttrib('Geom Renderer', blendMethodStr, incomingOperandStr, fbufferOperandStr)
 
 
     def addConstantInterpolationSegment(self):
     def addConstantInterpolationSegment(self):
         ren = self.particles.getRenderer()
         ren = self.particles.getRenderer()
@@ -1943,12 +1943,12 @@ class ParticlePanel(AppShell):
             parent = self.rendererSpriteSegmentFrame
             parent = self.rendererSpriteSegmentFrame
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Constant'
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Constant'
             self.rendererSpriteSegmentWidgetList.append(
             self.rendererSpriteSegmentWidgetList.append(
-                self.createConstantInterpolationSegmentWidget(parent,segName,seg))
+                self.createConstantInterpolationSegmentWidget(parent, segName, seg))
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
             parent = self.rendererGeomSegmentFrame
             parent = self.rendererGeomSegmentFrame
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Constant'
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Constant'
             self.rendererGeomSegmentWidgetList.append(
             self.rendererGeomSegmentWidgetList.append(
-                self.createConstantInterpolationSegmentWidget(parent,segName,seg))
+                self.createConstantInterpolationSegmentWidget(parent, segName, seg))
         parent.pack(fill=BOTH, expand=1)
         parent.pack(fill=BOTH, expand=1)
 
 
     def addLinearInterpolationSegment(self):
     def addLinearInterpolationSegment(self):
@@ -1960,12 +1960,12 @@ class ParticlePanel(AppShell):
             parent = self.rendererSpriteSegmentFrame
             parent = self.rendererSpriteSegmentFrame
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Linear'
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Linear'
             self.rendererSpriteSegmentWidgetList.append(
             self.rendererSpriteSegmentWidgetList.append(
-                self.createLinearInterpolationSegmentWidget(parent,segName,seg))
+                self.createLinearInterpolationSegmentWidget(parent, segName, seg))
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
             parent = self.rendererGeomSegmentFrame
             parent = self.rendererGeomSegmentFrame
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Linear'
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Linear'
             self.rendererGeomSegmentWidgetList.append(
             self.rendererGeomSegmentWidgetList.append(
-                self.createLinearInterpolationSegmentWidget(parent,segName,seg))
+                self.createLinearInterpolationSegmentWidget(parent, segName, seg))
         parent.pack(fill=BOTH, expand=1)
         parent.pack(fill=BOTH, expand=1)
 
 
     def addStepwaveInterpolationSegment(self):
     def addStepwaveInterpolationSegment(self):
@@ -1977,12 +1977,12 @@ class ParticlePanel(AppShell):
             parent = self.rendererSpriteSegmentFrame
             parent = self.rendererSpriteSegmentFrame
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Stepwave'
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Stepwave'
             self.rendererSpriteSegmentWidgetList.append(
             self.rendererSpriteSegmentWidgetList.append(
-                self.createStepwaveInterpolationSegmentWidget(parent,segName,seg))
+                self.createStepwaveInterpolationSegmentWidget(parent, segName, seg))
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
             parent = self.rendererGeomSegmentFrame
             parent = self.rendererGeomSegmentFrame
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Stepwave'
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Stepwave'
             self.rendererGeomSegmentWidgetList.append(
             self.rendererGeomSegmentWidgetList.append(
-                self.createStepwaveInterpolationSegmentWidget(parent,segName,seg))
+                self.createStepwaveInterpolationSegmentWidget(parent, segName, seg))
         parent.pack(fill=BOTH, expand=1)
         parent.pack(fill=BOTH, expand=1)
 
 
     def addSinusoidInterpolationSegment(self):
     def addSinusoidInterpolationSegment(self):
@@ -1994,12 +1994,12 @@ class ParticlePanel(AppShell):
             parent = self.rendererSpriteSegmentFrame
             parent = self.rendererSpriteSegmentFrame
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Sinusoid'
             segName = `len(self.rendererSpriteSegmentWidgetList)`+':Sinusoid'
             self.rendererSpriteSegmentWidgetList.append(
             self.rendererSpriteSegmentWidgetList.append(
-                self.createSinusoidInterpolationSegmentWidget(parent,segName,seg))
+                self.createSinusoidInterpolationSegmentWidget(parent, segName, seg))
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
         elif(ren.__class__.__name__ == 'GeomParticleRenderer'):
             parent = self.rendererGeomSegmentFrame
             parent = self.rendererGeomSegmentFrame
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Sinusoid'
             segName = `len(self.rendererGeomSegmentWidgetList)`+':Sinusoid'
             self.rendererGeomSegmentWidgetList.append(
             self.rendererGeomSegmentWidgetList.append(
-                self.createSinusoidInterpolationSegmentWidget(parent,segName,seg))
+                self.createSinusoidInterpolationSegmentWidget(parent, segName, seg))
         parent.pack(fill=BOTH, expand=1)
         parent.pack(fill=BOTH, expand=1)
 
 
     def createInterpolationSegmentFrame(self, parent, segName, seg):
     def createInterpolationSegmentFrame(self, parent, segName, seg):
@@ -2008,7 +2008,7 @@ class ParticlePanel(AppShell):
         def removeInterpolationSegmentFrame(s = self, seg = seg, fr = frame):
         def removeInterpolationSegmentFrame(s = self, seg = seg, fr = frame):
             s.particles.getRenderer().getColorInterpolationManager().clearSegment(seg.getId())
             s.particles.getRenderer().getColorInterpolationManager().clearSegment(seg.getId())
             fr.pack_forget()
             fr.pack_forget()
-        def setSegEnabled(s=self,n=segName):
+        def setSegEnabled(s=self, n=segName):
             enabled = s.getVariable('Sprite Renderer', n+' Enabled')
             enabled = s.getVariable('Sprite Renderer', n+' Enabled')
             seg.setEnabled(enabled.get())
             seg.setEnabled(enabled.get())
         def setSegBegin(time):
         def setSegBegin(time):
@@ -2033,31 +2033,31 @@ class ParticlePanel(AppShell):
 
 
         f = Frame(frame)
         f = Frame(frame)
         self.createSlider(f,
         self.createSlider(f,
-                          'Sprite Renderer',segName + ' Begin',
+                          'Sprite Renderer', segName + ' Begin',
                           '',
                           '',
                           command = setSegBegin,
                           command = setSegBegin,
                           value = seg.getTimeBegin())
                           value = seg.getTimeBegin())
-        self.createSlider(f,'Sprite Renderer',segName + ' End',
+        self.createSlider(f,'Sprite Renderer', segName + ' End',
                           '',
                           '',
                           command = setSegEnd,
                           command = setSegEnd,
                           value = seg.getTimeEnd())
                           value = seg.getTimeEnd())
         f.pack(fill = X, expand = 0)
         f.pack(fill = X, expand = 0)
         frame.pack(pady = 3, fill = X, expand = 0)
         frame.pack(pady = 3, fill = X, expand = 0)
         return frame
         return frame
-    
+
     def createConstantInterpolationSegmentWidget(self, parent, segName, segment):
     def createConstantInterpolationSegmentWidget(self, parent, segName, segment):
         fun = segment.getFunction()
         fun = segment.getFunction()
         def setSegColorA(color):
         def setSegColorA(color):
             fun.setColorA(
             fun.setColorA(
-                Vec4(color[0]/255.0,color[1]/255.0,
-                     color[2]/255.0,color[3]/255.0))
-            
+                Vec4(color[0]/255.0, color[1]/255.0,
+                     color[2]/255.0, color[3]/255.0))
+
         frame = self.createInterpolationSegmentFrame(parent, segName, segment)
         frame = self.createInterpolationSegmentFrame(parent, segName, segment)
         f = Frame(frame)
         f = Frame(frame)
 
 
         c = fun.getColorA()
         c = fun.getColorA()
-        c = [c[0]*255.0,c[1]*255.0,c[2]*255.0,c[3]*255.0]
-        self.createColorEntry(f,'Sprite Renderer',segName + ' Color A',
+        c = [c[0]*255.0, c[1]*255.0, c[2]*255.0, c[3]*255.0]
+        self.createColorEntry(f,'Sprite Renderer', segName + ' Color A',
                               '',
                               '',
                               command = setSegColorA,
                               command = setSegColorA,
                               value = c)
                               value = c)
@@ -2068,25 +2068,25 @@ class ParticlePanel(AppShell):
         fun = segment.getFunction()
         fun = segment.getFunction()
         def setSegColorA(color):
         def setSegColorA(color):
             fun.setColorA(
             fun.setColorA(
-                Vec4(color[0]/255.0,color[1]/255.0,
-                     color[2]/255.0,color[3]/255.0))
+                Vec4(color[0]/255.0, color[1]/255.0,
+                     color[2]/255.0, color[3]/255.0))
         def setSegColorB(color):
         def setSegColorB(color):
             fun.setColorB(
             fun.setColorB(
-                Vec4(color[0]/255.0,color[1]/255.0,
-                     color[2]/255.0,color[3]/255.0))
+                Vec4(color[0]/255.0, color[1]/255.0,
+                     color[2]/255.0, color[3]/255.0))
 
 
         frame = self.createInterpolationSegmentFrame(parent, segName, segment)
         frame = self.createInterpolationSegmentFrame(parent, segName, segment)
         f = Frame(frame)
         f = Frame(frame)
 
 
         c = fun.getColorA()
         c = fun.getColorA()
-        c = [c[0]*255.0,c[1]*255.0,c[2]*255.0,c[3]*255.0]
-        self.createColorEntry(f,'Sprite Renderer',segName + ' Color A',
+        c = [c[0]*255.0, c[1]*255.0, c[2]*255.0, c[3]*255.0]
+        self.createColorEntry(f,'Sprite Renderer', segName + ' Color A',
                               '',
                               '',
                               command = setSegColorA,
                               command = setSegColorA,
                               value = c)
                               value = c)
         c = fun.getColorB()
         c = fun.getColorB()
-        c = [c[0]*255.0,c[1]*255.0,c[2]*255.0,c[3]*255.0]
-        self.createColorEntry(f,'Sprite Renderer',segName + ' Color B',
+        c = [c[0]*255.0, c[1]*255.0, c[2]*255.0, c[3]*255.0]
+        self.createColorEntry(f,'Sprite Renderer', segName + ' Color B',
                               '',
                               '',
                               command = setSegColorB,
                               command = setSegColorB,
                               value = c)
                               value = c)
@@ -2094,32 +2094,32 @@ class ParticlePanel(AppShell):
         return frame
         return frame
 
 
     def createStepwaveInterpolationSegmentWidget(self, parent, segName, segment):
     def createStepwaveInterpolationSegmentWidget(self, parent, segName, segment):
-        fun = segment.getFunction()     
+        fun = segment.getFunction()
         def setColorA(color):
         def setColorA(color):
             fun.setColorA(
             fun.setColorA(
-                Vec4(color[0]/255.0,color[1]/255.0,
-                     color[2]/255.0,color[3]/255.0))
+                Vec4(color[0]/255.0, color[1]/255.0,
+                     color[2]/255.0, color[3]/255.0))
         def setColorB(color):
         def setColorB(color):
             fun.setColorB(
             fun.setColorB(
-                Vec4(color[0]/255.0,color[1]/255.0,
-                     color[2]/255.0,color[3]/255.0))
+                Vec4(color[0]/255.0, color[1]/255.0,
+                     color[2]/255.0, color[3]/255.0))
         def setWidthA(width):
         def setWidthA(width):
             fun.setWidthA(width)
             fun.setWidthA(width)
         def setWidthB(width):
         def setWidthB(width):
             fun.setWidthB(width)
             fun.setWidthB(width)
-            
+
         frame = self.createInterpolationSegmentFrame(parent, segName, segment)
         frame = self.createInterpolationSegmentFrame(parent, segName, segment)
         f = Frame(frame)
         f = Frame(frame)
 
 
         c = fun.getColorA()
         c = fun.getColorA()
-        c = [c[0]*255.0,c[1]*255.0,c[2]*255.0,c[3]*255.0]
-        self.createColorEntry(f,'Sprite Renderer',segName + ' Color A',
+        c = [c[0]*255.0, c[1]*255.0, c[2]*255.0, c[3]*255.0]
+        self.createColorEntry(f,'Sprite Renderer', segName + ' Color A',
                               '',
                               '',
                               command = setColorA,
                               command = setColorA,
                               value = c)
                               value = c)
         c = fun.getColorB()
         c = fun.getColorB()
-        c = [c[0]*255.0,c[1]*255.0,c[2]*255.0,c[3]*255.0]
-        self.createColorEntry(f,'Sprite Renderer',segName + ' Color B',
+        c = [c[0]*255.0, c[1]*255.0, c[2]*255.0, c[3]*255.0]
+        self.createColorEntry(f,'Sprite Renderer', segName + ' Color B',
                               '',
                               '',
                               command = setColorB,
                               command = setColorB,
                               value = c)
                               value = c)
@@ -2135,32 +2135,32 @@ class ParticlePanel(AppShell):
                           value = w)
                           value = w)
         f.pack(fill = X)
         f.pack(fill = X)
         return frame
         return frame
-    
+
     def createSinusoidInterpolationSegmentWidget(self, parent, segName, segment):
     def createSinusoidInterpolationSegmentWidget(self, parent, segName, segment):
-        fun = segment.getFunction()   
+        fun = segment.getFunction()
         def setColorA(color):
         def setColorA(color):
             fun.setColorA(
             fun.setColorA(
-                Vec4(color[0]/255.0,color[1]/255.0,
-                     color[2]/255.0,color[3]/255.0))
+                Vec4(color[0]/255.0, color[1]/255.0,
+                     color[2]/255.0, color[3]/255.0))
         def setColorB(color):
         def setColorB(color):
             fun.setColorB(
             fun.setColorB(
-                Vec4(color[0]/255.0,color[1]/255.0,
-                     color[2]/255.0,color[3]/255.0))
+                Vec4(color[0]/255.0, color[1]/255.0,
+                     color[2]/255.0, color[3]/255.0))
         def setPeriod(period):
         def setPeriod(period):
             fun.setPeriod(period)
             fun.setPeriod(period)
-            
+
         frame = self.createInterpolationSegmentFrame(parent, segName, segment)
         frame = self.createInterpolationSegmentFrame(parent, segName, segment)
         f = Frame(frame)
         f = Frame(frame)
 
 
         c = fun.getColorA()
         c = fun.getColorA()
-        c = [c[0]*255.0,c[1]*255.0,c[2]*255.0,c[3]*255.0]
-        self.createColorEntry(f,'Sprite Renderer',segName + ' Color A',
+        c = [c[0]*255.0, c[1]*255.0, c[2]*255.0, c[3]*255.0]
+        self.createColorEntry(f,'Sprite Renderer', segName + ' Color A',
                               '',
                               '',
                               command = setColorA,
                               command = setColorA,
                               value = c)
                               value = c)
         c = fun.getColorB()
         c = fun.getColorB()
-        c = [c[0]*255.0,c[1]*255.0,c[2]*255.0,c[3]*255.0]
-        self.createColorEntry(f,'Sprite Renderer',segName + ' Color B',
+        c = [c[0]*255.0, c[1]*255.0, c[2]*255.0, c[3]*255.0]
+        self.createColorEntry(f,'Sprite Renderer', segName + ' Color B',
                               '',
                               '',
                               command = setColorB,
                               command = setColorB,
                               value = c)
                               value = c)
@@ -2202,7 +2202,7 @@ class ParticlePanel(AppShell):
                 type = 'From Node'
                 type = 'From Node'
         else:
         else:
             frame.valid = True
             frame.valid = True
-            
+
             if(anim.getSourceType()==SpriteAnim.STTexture):
             if(anim.getSourceType()==SpriteAnim.STTexture):
                 frame.animSourceType = SpriteAnim.STTexture
                 frame.animSourceType = SpriteAnim.STTexture
                 type = 'Texture'
                 type = 'Texture'
@@ -2216,16 +2216,16 @@ class ParticlePanel(AppShell):
               ).pack(fill = X, expand = 1)
               ).pack(fill = X, expand = 1)
 
 
         return frame
         return frame
-    
+
     def createSpriteAnimationTextureWidget(self, parent, anim, animName):
     def createSpriteAnimationTextureWidget(self, parent, anim, animName):
         ren = self.particles.getRenderer()
         ren = self.particles.getRenderer()
-        frame = self.createSpriteAnimationFrame(parent,anim,animName)
+        frame = self.createSpriteAnimationFrame(parent, anim, animName)
         f = Frame(frame)
         f = Frame(frame)
         f.pack(fill=X)
         f.pack(fill=X)
 
 
-        Label(f, text = 'Texture: ', font = ('MSSansSerif',12), width=7).pack(side = LEFT)
+        Label(f, text = 'Texture: ', font = ('MSSansSerif', 12), width=7).pack(side = LEFT)
         strVar = StringVar()
         strVar = StringVar()
-        entry = Entry(f,textvariable = strVar).pack(padx=3, pady=3,side=LEFT,fill=X,expand=1)
+        entry = Entry(f, textvariable = strVar).pack(padx=3, pady=3, side=LEFT, fill=X, expand=1)
         if frame.valid:
         if frame.valid:
             strVar.set(anim.getTexSource())
             strVar.set(anim.getTexSource())
         else:
         else:
@@ -2248,40 +2248,40 @@ class ParticlePanel(AppShell):
 
 
     def createSpriteAnimationNodeWidget(self, parent, anim, animName):
     def createSpriteAnimationNodeWidget(self, parent, anim, animName):
         ren = self.particles.getRenderer()
         ren = self.particles.getRenderer()
-        frame = self.createSpriteAnimationFrame(parent,anim, animName)
+        frame = self.createSpriteAnimationFrame(parent, anim, animName)
         f = Frame(frame)
         f = Frame(frame)
         f.pack(fill=X)
         f.pack(fill=X)
 
 
         lf = Frame(f)
         lf = Frame(f)
         lf.pack(fill=X, expand=1)
         lf.pack(fill=X, expand=1)
-        Label(lf, text = 'Model: ', font = ('MSSansSerif',12), width=7).pack(side = LEFT)
+        Label(lf, text = 'Model: ', font = ('MSSansSerif', 12), width=7).pack(side = LEFT)
         mStrVar = StringVar()
         mStrVar = StringVar()
-        entry = Entry(lf,textvariable = mStrVar).pack(padx=3, pady=3,side=LEFT,fill=X,expand=1)
+        entry = Entry(lf, textvariable = mStrVar).pack(padx=3, pady=3, side=LEFT, fill=X, expand=1)
         if frame.valid:
         if frame.valid:
             mStrVar.set(anim.getModelSource())
             mStrVar.set(anim.getModelSource())
         else:
         else:
             mStrVar.set('Base model path: ' + `getModelPath().getValue()`)
             mStrVar.set('Base model path: ' + `getModelPath().getValue()`)
 
 
         mlf = lf
         mlf = lf
-        
+
         self.variableDict['Sprite Renderer-'+animName+' Anim Model'] = mStrVar
         self.variableDict['Sprite Renderer-'+animName+' Anim Model'] = mStrVar
         self.widgetDict['Sprite Renderer-'+animName+' Anim Model'] = entry
         self.widgetDict['Sprite Renderer-'+animName+' Anim Model'] = entry
 
 
         lf = Frame(f)
         lf = Frame(f)
         lf.pack(fill=X, expand=1)
         lf.pack(fill=X, expand=1)
-        Label(lf, text = 'Node: ', font = ('MSSansSerif',12), width=7).pack(side = LEFT)
+        Label(lf, text = 'Node: ', font = ('MSSansSerif', 12), width=7).pack(side = LEFT)
         nStrVar = StringVar()
         nStrVar = StringVar()
-        entry = Entry(lf,textvariable = nStrVar).pack(padx=3, pady=3,side=LEFT,fill=X,expand=1)
+        entry = Entry(lf, textvariable = nStrVar).pack(padx=3, pady=3, side=LEFT, fill=X, expand=1)
         if frame.valid:
         if frame.valid:
             nStrVar.set(anim.getNodeSource())
             nStrVar.set(anim.getNodeSource())
         else:
         else:
             nStrVar.set('**/*')
             nStrVar.set('**/*')
         nlf = lf
         nlf = lf
-        
+
         self.variableDict['Sprite Renderer-'+animName+' Anim Node'] = nStrVar
         self.variableDict['Sprite Renderer-'+animName+' Anim Node'] = nStrVar
         self.widgetDict['Sprite Renderer-'+animName+' Anim Node'] = entry
         self.widgetDict['Sprite Renderer-'+animName+' Anim Node'] = entry
 
 
-        def checkForNode(modelStrVar=mStrVar,nodeStrVar=nStrVar):
+        def checkForNode(modelStrVar=mStrVar, nodeStrVar=nStrVar):
             mod = loader.loadModelCopy(modelStrVar.get())
             mod = loader.loadModelCopy(modelStrVar.get())
             if mod:
             if mod:
                 node = mod.find(nodeStrVar.get())
                 node = mod.find(nodeStrVar.get())
@@ -2291,7 +2291,7 @@ class ParticlePanel(AppShell):
                     frame.valid = False
                     frame.valid = False
             else:
             else:
                 frame.valid = False
                 frame.valid = False
-                
+
             self.writeSpriteRendererAnimations()
             self.writeSpriteRendererAnimations()
 
 
         Button(mlf, text = 'Update',
         Button(mlf, text = 'Update',
@@ -2314,11 +2314,11 @@ class ParticlePanel(AppShell):
 
 
         for anim in [ren.getAnim(x) for x in range(ren.getNumAnims())]:
         for anim in [ren.getAnim(x) for x in range(ren.getNumAnims())]:
             if(anim.getSourceType() == SpriteAnim.STTexture):
             if(anim.getSourceType() == SpriteAnim.STTexture):
-                w = self.createSpriteAnimationTextureWidget(self.rendererSpriteAnimationFrame,anim,`len(self.rendererSpriteAnimationWidgetList)`)
+                w = self.createSpriteAnimationTextureWidget(self.rendererSpriteAnimationFrame, anim, `len(self.rendererSpriteAnimationWidgetList)`)
             else:
             else:
-                w = self.createSpriteAnimationNodeWidget(self.rendererSpriteAnimationFrame,anim,`len(self.rendererSpriteAnimationWidgetList)`)
+                w = self.createSpriteAnimationNodeWidget(self.rendererSpriteAnimationFrame, anim, `len(self.rendererSpriteAnimationWidgetList)`)
             self.rendererSpriteAnimationWidgetList.append(w)
             self.rendererSpriteAnimationWidgetList.append(w)
-            
+
     # set animation info from panel into renderer
     # set animation info from panel into renderer
     def writeSpriteRendererAnimations(self):
     def writeSpriteRendererAnimations(self):
         ren = self.particles.getRenderer()
         ren = self.particles.getRenderer()
@@ -2335,8 +2335,8 @@ class ParticlePanel(AppShell):
                 else:
                 else:
                     modelSource = self.getVariable('Sprite Renderer', `x` + ' Anim Model').get()
                     modelSource = self.getVariable('Sprite Renderer', `x` + ' Anim Model').get()
                     nodeSource = self.getVariable('Sprite Renderer', `x` + ' Anim Node').get()
                     nodeSource = self.getVariable('Sprite Renderer', `x` + ' Anim Node').get()
-                    ren.addTextureFromNode(modelSource,nodeSource)
-    
+                    ren.addTextureFromNode(modelSource, nodeSource)
+
     ## FORCEGROUP COMMANDS ##
     ## FORCEGROUP COMMANDS ##
     def updateForceWidgets(self):
     def updateForceWidgets(self):
         # Select appropriate notebook page
         # Select appropriate notebook page
@@ -2375,7 +2375,7 @@ class ParticlePanel(AppShell):
         if self.forceGroup == None:
         if self.forceGroup == None:
             self.createNewForceGroup()
             self.createNewForceGroup()
         self.forceGroup.addForce(f)
         self.forceGroup.addForce(f)
-        self.addForceWidget(self.forceGroup,f)
+        self.addForceWidget(self.forceGroup, f)
 
 
     ## SYSTEM COMMANDS ##
     ## SYSTEM COMMANDS ##
     def createNewEffect(self):
     def createNewEffect(self):

+ 36 - 36
direct/src/tkwidgets/AppShell.py

@@ -46,7 +46,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
     contactname     = 'Mark R. Mine'
     contactname     = 'Mark R. Mine'
     contactphone    = '(818) 544-2921'
     contactphone    = '(818) 544-2921'
     contactemail    = '[email protected]'
     contactemail    = '[email protected]'
-          
+
     frameWidth      = 450
     frameWidth      = 450
     frameHeight     = 320
     frameHeight     = 320
     padx            = 5
     padx            = 5
@@ -55,7 +55,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
     usestatusarea   = 0
     usestatusarea   = 0
     balloonState    = 'none'
     balloonState    = 'none'
     panelCount      = 0
     panelCount      = 0
-    
+
     def __init__(self, parent = None, **kw):
     def __init__(self, parent = None, **kw):
         optiondefs = (
         optiondefs = (
             ('title',          self.appname,        None),
             ('title',          self.appname,        None),
@@ -96,7 +96,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         self.initialiseoptions(AppShell)
         self.initialiseoptions(AppShell)
 
 
         self.pack(fill = BOTH, expand = 1)
         self.pack(fill = BOTH, expand = 1)
-        
+
     def __createInterface(self):
     def __createInterface(self):
         self.__createBalloon()
         self.__createBalloon()
         self.__createMenuBar()
         self.__createMenuBar()
@@ -138,13 +138,13 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         spacer.pack(side = LEFT, expand = 0)
         spacer.pack(side = LEFT, expand = 0)
 
 
         self.menuFrame.pack(fill = X)
         self.menuFrame.pack(fill = X)
-                            
+
     def __createDataArea(self):
     def __createDataArea(self):
         # Create data area where data entry widgets are placed.
         # Create data area where data entry widgets are placed.
         self.dataArea = self.createcomponent('dataarea',
         self.dataArea = self.createcomponent('dataarea',
                                              (), None,
                                              (), None,
-                                             Frame, (self._hull,), 
-                                             relief=GROOVE, 
+                                             Frame, (self._hull,),
+                                             relief=GROOVE,
                                              bd=1)
                                              bd=1)
         self.dataArea.pack(side=TOP, fill=BOTH, expand=YES,
         self.dataArea.pack(side=TOP, fill=BOTH, expand=YES,
                            padx=self['padx'], pady=self['pady'])
                            padx=self['padx'], pady=self['pady'])
@@ -162,8 +162,8 @@ class AppShell(Pmw.MegaWidget, DirectObject):
                                                 padx=0, pady=0)
                                                 padx=0, pady=0)
         self.__buttonBox.pack(side=TOP, expand=NO, fill=X)
         self.__buttonBox.pack(side=TOP, expand=NO, fill=X)
         if self['usecommandarea']:
         if self['usecommandarea']:
-            self.__commandFrame.pack(side=TOP, 
-                                     expand=NO, 
+            self.__commandFrame.pack(side=TOP,
+                                     expand=NO,
                                      fill=X,
                                      fill=X,
                                      padx=self['padx'],
                                      padx=self['padx'],
                                      pady=self['pady'])
                                      pady=self['pady'])
@@ -172,10 +172,10 @@ class AppShell(Pmw.MegaWidget, DirectObject):
     def __createMessageBar(self):
     def __createMessageBar(self):
         # Create the message bar area for help and status messages.
         # Create the message bar area for help and status messages.
         frame = self.createcomponent('bottomtray', (), None,
         frame = self.createcomponent('bottomtray', (), None,
-                                     Frame,(self._hull,), relief=SUNKEN)
+                                     Frame, (self._hull,), relief=SUNKEN)
         self.__messageBar = self.createcomponent('messagebar',
         self.__messageBar = self.createcomponent('messagebar',
                                                   (), None,
                                                   (), None,
-                                                 Pmw.MessageBar, 
+                                                 Pmw.MessageBar,
                                                  (frame,),
                                                  (frame,),
                                                  #entry_width = 40,
                                                  #entry_width = 40,
                                                  entry_relief=SUNKEN,
                                                  entry_relief=SUNKEN,
@@ -193,7 +193,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         self.updateProgress(0)
         self.updateProgress(0)
         if self['usestatusarea']:
         if self['usestatusarea']:
             frame.pack(side=BOTTOM, expand=NO, fill=X)
             frame.pack(side=BOTTOM, expand=NO, fill=X)
-                   
+
         self.__balloon.configure(statuscommand = \
         self.__balloon.configure(statuscommand = \
                                  self.__messageBar.helpmessage)
                                  self.__messageBar.helpmessage)
 
 
@@ -202,12 +202,12 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         Pmw.aboutcopyright(self.copyright)
         Pmw.aboutcopyright(self.copyright)
         Pmw.aboutcontact(
         Pmw.aboutcontact(
           'For more information, contact:\n %s\n Phone: %s\n Email: %s' %\
           'For more information, contact:\n %s\n Phone: %s\n Email: %s' %\
-                      (self.contactname, self.contactphone, 
+                      (self.contactname, self.contactphone,
                        self.contactemail))
                        self.contactemail))
-        self.about = Pmw.AboutDialog(self._hull, 
+        self.about = Pmw.AboutDialog(self._hull,
                                      applicationname=self.appname)
                                      applicationname=self.appname)
         self.about.withdraw()
         self.about.withdraw()
-       
+
     def toggleBalloon(self):
     def toggleBalloon(self):
         if self.toggleBalloonVar.get():
         if self.toggleBalloonVar.get():
             self.__balloon.configure(state = 'both')
             self.__balloon.configure(state = 'both')
@@ -218,7 +218,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         # Create the dialog to display about and contact information.
         # Create the dialog to display about and contact information.
         self.about.show()
         self.about.show()
         self.about.focus_set()
         self.about.focus_set()
-       
+
     def quit(self):
     def quit(self):
         self.parent.destroy()
         self.parent.destroy()
 
 
@@ -227,7 +227,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
     def appInit(self):
     def appInit(self):
         # Called before interface is created (should be overridden).
         # Called before interface is created (should be overridden).
         pass
         pass
-        
+
     def createInterface(self):
     def createInterface(self):
         # Override this method to create the interface for the app.
         # Override this method to create the interface for the app.
         pass
         pass
@@ -240,7 +240,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         # Creates default menus.  Can be overridden or simply augmented
         # Creates default menus.  Can be overridden or simply augmented
         # Using button Add below
         # Using button Add below
         self.menuBar.addmenuitem('Help', 'command',
         self.menuBar.addmenuitem('Help', 'command',
-                                 'Get information on application', 
+                                 'Get information on application',
                                  label='About...', command=self.showAbout)
                                  label='About...', command=self.showAbout)
         self.toggleBalloonVar = IntVar()
         self.toggleBalloonVar = IntVar()
         if self.balloonState == 'none':
         if self.balloonState == 'none':
@@ -256,7 +256,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         self.menuBar.addmenuitem('File', 'command', 'Quit this application',
         self.menuBar.addmenuitem('File', 'command', 'Quit this application',
                                 label='Quit',
                                 label='Quit',
                                 command=self.quit)
                                 command=self.quit)
-                                        
+
     # Getters
     # Getters
     def interior(self):
     def interior(self):
         # Retrieve the interior site where widgets should go.
         # Retrieve the interior site where widgets should go.
@@ -299,13 +299,13 @@ class AppShell(Pmw.MegaWidget, DirectObject):
     ## WIDGET UTILITY FUNCTIONS ##
     ## WIDGET UTILITY FUNCTIONS ##
     def addWidget(self, category, text, widget):
     def addWidget(self, category, text, widget):
         self.widgetDict[category + '-' + text] = widget
         self.widgetDict[category + '-' + text] = widget
-        
+
     def getWidget(self, category, text):
     def getWidget(self, category, text):
         return self.widgetDict.get(category + '-' + text, None)
         return self.widgetDict.get(category + '-' + text, None)
 
 
     def addVariable(self, category, text, variable):
     def addVariable(self, category, text, variable):
         self.variableDict[category + '-' + text] = variable
         self.variableDict[category + '-' + text] = variable
-        
+
     def getVariable(self, category, text):
     def getVariable(self, category, text):
         return self.variableDict.get(category + '-' + text, None)
         return self.variableDict.get(category + '-' + text, None)
 
 
@@ -325,7 +325,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         self.addWidget(category, text, widget)
         self.addWidget(category, text, widget)
         return widget
         return widget
 
 
-    def newCreateLabeledEntry(self, parent, category, text, help = '', 
+    def newCreateLabeledEntry(self, parent, category, text, help = '',
                               command = None, value = '',
                               command = None, value = '',
                               width = 12, relief = SUNKEN,
                               width = 12, relief = SUNKEN,
                               side = LEFT, fill = X, expand = 0):
                               side = LEFT, fill = X, expand = 0):
@@ -359,7 +359,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         widget = self.createWidget(parent, category, text, Button,
         widget = self.createWidget(parent, category, text, Button,
                                    help, command, side, fill, expand, kw)
                                    help, command, side, fill, expand, kw)
         return widget
         return widget
-        
+
     def newCreateCheckbutton(self, parent, category, text,
     def newCreateCheckbutton(self, parent, category, text,
                              help = '', command = None,
                              help = '', command = None,
                              initialState = 0, anchor = W,
                              initialState = 0, anchor = W,
@@ -375,9 +375,9 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         self.addVariable(category, text, variable)
         self.addVariable(category, text, variable)
         widget['variable'] = variable
         widget['variable'] = variable
         return widget
         return widget
-        
-    def newCreateRadiobutton(self, parent, category, text, variable, value, 
-                             command = None, help = '', anchor = W, 
+
+    def newCreateRadiobutton(self, parent, category, text, variable, value,
+                             command = None, help = '', anchor = W,
                              side = LEFT, fill = X, expand = 0, **kw):
                              side = LEFT, fill = X, expand = 0, **kw):
         """
         """
         createRadiobutton(parent, category, text, variable, value, [options])
         createRadiobutton(parent, category, text, variable, value, [options])
@@ -390,9 +390,9 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         widget['value'] = value
         widget['value'] = value
         widget['variable'] = variable
         widget['variable'] = variable
         return widget
         return widget
-        
-    def newCreateFloater(self, parent, category, text, 
-                         help = '', command = None, 
+
+    def newCreateFloater(self, parent, category, text,
+                         help = '', command = None,
                          side = LEFT, fill = X, expand = 0, **kw):
                          side = LEFT, fill = X, expand = 0, **kw):
         # Create the widget
         # Create the widget
         widget = self.createWidget(parent, category, text,
         widget = self.createWidget(parent, category, text,
@@ -428,7 +428,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         return widget
         return widget
 
 
     def newCreateVector2Entry(self, parent, category, text,
     def newCreateVector2Entry(self, parent, category, text,
-                              help = '', command = None, 
+                              help = '', command = None,
                               side = LEFT, fill = X, expand = 0, **kw):
                               side = LEFT, fill = X, expand = 0, **kw):
         # Create the widget
         # Create the widget
         widget = self.createWidget(parent, category, text,
         widget = self.createWidget(parent, category, text,
@@ -436,7 +436,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
                                    help, command, side, fill, expand, kw)
                                    help, command, side, fill, expand, kw)
 
 
     def newCreateVector3Entry(self, parent, category, text,
     def newCreateVector3Entry(self, parent, category, text,
-                              help = '', command = None, 
+                              help = '', command = None,
                               side = LEFT, fill = X, expand = 0, **kw):
                               side = LEFT, fill = X, expand = 0, **kw):
         # Create the widget
         # Create the widget
         widget = self.createWidget(parent, category, text,
         widget = self.createWidget(parent, category, text,
@@ -445,7 +445,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
         return widget
         return widget
 
 
     def newCreateColorEntry(self, parent, category, text,
     def newCreateColorEntry(self, parent, category, text,
-                            help = '', command = None, 
+                            help = '', command = None,
                             side = LEFT, fill = X, expand = 0, **kw):
                             side = LEFT, fill = X, expand = 0, **kw):
         # Create the widget
         # Create the widget
         widget = self.createWidget(parent, category, text,
         widget = self.createWidget(parent, category, text,
@@ -486,7 +486,7 @@ class AppShell(Pmw.MegaWidget, DirectObject):
     def newCreateComboBox(self, parent, category, text,
     def newCreateComboBox(self, parent, category, text,
                           help = '', command = None,
                           help = '', command = None,
                           items = [], state = DISABLED, history = 0,
                           items = [], state = DISABLED, history = 0,
-                          labelpos = W, label_anchor = W, 
+                          labelpos = W, label_anchor = W,
                           label_width = 16, entry_width = 16,
                           label_width = 16, entry_width = 16,
                           side = LEFT, fill = X, expand = 0, **kw):
                           side = LEFT, fill = X, expand = 0, **kw):
         # Update kw to reflect user inputs
         # Update kw to reflect user inputs
@@ -532,13 +532,13 @@ class TestAppShell(AppShell):
         # Call superclass initialization function
         # Call superclass initialization function
         AppShell.__init__(self)
         AppShell.__init__(self)
         self.initialiseoptions(TestAppShell)
         self.initialiseoptions(TestAppShell)
-        
+
     def createButtons(self):
     def createButtons(self):
         self.buttonAdd('Ok',
         self.buttonAdd('Ok',
                        helpMessage='Exit',
                        helpMessage='Exit',
                        statusMessage='Exit',
                        statusMessage='Exit',
                        command=self.quit)
                        command=self.quit)
-        
+
     def createMain(self):
     def createMain(self):
         self.label = self.createcomponent('label', (), None,
         self.label = self.createcomponent('label', (), None,
                                           Label,
                                           Label,
@@ -546,11 +546,11 @@ class TestAppShell(AppShell):
                                           text='Data Area')
                                           text='Data Area')
         self.label.pack()
         self.label.pack()
         self.bind(self.label, 'Space taker')
         self.bind(self.label, 'Space taker')
-                
+
     def createInterface(self):
     def createInterface(self):
         self.createButtons()
         self.createButtons()
         self.createMain()
         self.createMain()
-        
+
 if __name__ == '__main__':
 if __name__ == '__main__':
     test = TestAppShell(balloon_state='none')
     test = TestAppShell(balloon_state='none')
 
 

+ 28 - 28
direct/src/tkwidgets/Dial.py

@@ -58,9 +58,9 @@ class Dial(Valuator):
             self.interior().columnconfigure(2, weight = 1)
             self.interior().columnconfigure(2, weight = 1)
         else:
         else:
             if self._label:
             if self._label:
-                self._label.grid(row=0,column=0, sticky = EW)
-            self._entry.grid(row=0,column=1, sticky = EW)
-            self._valuator.grid(row=0,column=2, padx = 2, pady = 2)
+                self._label.grid(row=0, column=0, sticky = EW)
+            self._entry.grid(row=0, column=1, sticky = EW)
+            self._valuator.grid(row=0, column=2, padx = 2, pady = 2)
             self.interior().columnconfigure(0, weight = 1)
             self.interior().columnconfigure(0, weight = 1)
 
 
     def addValuatorPropertiesToDialog(self):
     def addValuatorPropertiesToDialog(self):
@@ -79,7 +79,7 @@ class Dial(Valuator):
             { 'widget': self._valuator,
             { 'widget': self._valuator,
               'type': 'integer',
               'type': 'integer',
               'help': 'Number of segments to divide dial into.'})
               'help': 'Number of segments to divide dial into.'})
-            
+
     def addValuatorMenuEntries(self):
     def addValuatorMenuEntries(self):
         # The popup menu
         # The popup menu
         self._fSnap = IntVar()
         self._fSnap = IntVar()
@@ -93,15 +93,15 @@ class Dial(Valuator):
             self._popupMenu.add_checkbutton(label = 'Rollover',
             self._popupMenu.add_checkbutton(label = 'Rollover',
                                             variable = self._fRollover,
                                             variable = self._fRollover,
                                             command = self._setRollover)
                                             command = self._setRollover)
-            
+
     def setBase(self):
     def setBase(self):
         """ Set Dial base value: value = base + delta * numRevs """
         """ Set Dial base value: value = base + delta * numRevs """
         self._valuator['base'] = self['base']
         self._valuator['base'] = self['base']
-        
+
     def setDelta(self):
     def setDelta(self):
         """ Set Dial delta value: value = base + delta * numRevs """
         """ Set Dial delta value: value = base + delta * numRevs """
         self._valuator['delta'] = self['delta']
         self._valuator['delta'] = self['delta']
-        
+
     def _setSnap(self):
     def _setSnap(self):
         """ Menu command to turn Dial angle snap on/off """
         """ Menu command to turn Dial angle snap on/off """
         self._valuator['fSnap'] = self._fSnap.get()
         self._valuator['fSnap'] = self._fSnap.get()
@@ -177,11 +177,11 @@ class DialWidget(Pmw.MegaWidget):
             ('callbackData',    [],             None),
             ('callbackData',    [],             None),
             )
             )
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
-        
+
         # Initialize the superclass
         # Initialize the superclass
         Pmw.MegaWidget.__init__(self, parent)
         Pmw.MegaWidget.__init__(self, parent)
 
 
-        # Set up some local and instance variables        
+        # Set up some local and instance variables
         # Create the components
         # Create the components
         interior = self.interior()
         interior = self.interior()
 
 
@@ -191,7 +191,7 @@ class DialWidget(Pmw.MegaWidget):
         # Running total which increments/decrements every time around dial
         # Running total which increments/decrements every time around dial
         self.rollCount = 0
         self.rollCount = 0
 
 
-        # Base dial size on style, if size not specified, 
+        # Base dial size on style, if size not specified,
         if not self['size']:
         if not self['size']:
             if self['style'] == VALUATOR_FULL:
             if self['style'] == VALUATOR_FULL:
                 size = DIAL_FULL_SIZE
                 size = DIAL_FULL_SIZE
@@ -199,19 +199,19 @@ class DialWidget(Pmw.MegaWidget):
                 size = DIAL_MINI_SIZE
                 size = DIAL_MINI_SIZE
         else:
         else:
             size = self['size']
             size = self['size']
-        
+
         # Radius of the dial
         # Radius of the dial
         radius = self.radius = int(size/2.0)
         radius = self.radius = int(size/2.0)
         # Radius of the inner knob
         # Radius of the inner knob
-        inner_radius = max(3,radius * INNER_SF)
+        inner_radius = max(3, radius * INNER_SF)
 
 
-        # The canvas 
+        # The canvas
         self._widget = self.createcomponent('canvas', (), None,
         self._widget = self.createcomponent('canvas', (), None,
                                             Canvas, (interior,),
                                             Canvas, (interior,),
                                             width = size, height = size,
                                             width = size, height = size,
                                             background = self['background'],
                                             background = self['background'],
                                             highlightthickness = 0,
                                             highlightthickness = 0,
-                                            scrollregion = (-radius,-radius,
+                                            scrollregion = (-radius, -radius,
                                                             radius, radius))
                                                             radius, radius))
         self._widget.pack(expand = 1, fill = BOTH)
         self._widget.pack(expand = 1, fill = BOTH)
 
 
@@ -242,7 +242,7 @@ class DialWidget(Pmw.MegaWidget):
         self._widget.tag_bind('knob', '<Enter>', self.highlightKnob)
         self._widget.tag_bind('knob', '<Enter>', self.highlightKnob)
         self._widget.tag_bind('knob', '<Leave>', self.restoreKnob)
         self._widget.tag_bind('knob', '<Leave>', self.restoreKnob)
 
 
-        # Make sure input variables processed 
+        # Make sure input variables processed
         self.initialiseoptions(DialWidget)
         self.initialiseoptions(DialWidget)
 
 
     def set(self, value, fCommand = 1):
     def set(self, value, fCommand = 1):
@@ -260,7 +260,7 @@ class DialWidget(Pmw.MegaWidget):
             apply(self['command'], [value] + self['commandData'])
             apply(self['command'], [value] + self['commandData'])
         # Record value
         # Record value
         self.value = value
         self.value = value
-        
+
     def get(self):
     def get(self):
         """
         """
         self.get()
         self.get()
@@ -270,25 +270,25 @@ class DialWidget(Pmw.MegaWidget):
 
 
     ## Canvas callback functions
     ## Canvas callback functions
     # Dial
     # Dial
-    def mouseDown(self,event):
+    def mouseDown(self, event):
         self._onButtonPress()
         self._onButtonPress()
         self.lastAngle = dialAngle = self.computeDialAngle(event)
         self.lastAngle = dialAngle = self.computeDialAngle(event)
         self.computeValueFromAngle(dialAngle)
         self.computeValueFromAngle(dialAngle)
 
 
-    def mouseUp(self,event):
+    def mouseUp(self, event):
         self._onButtonRelease()
         self._onButtonRelease()
 
 
-    def shiftMouseMotion(self,event):
+    def shiftMouseMotion(self, event):
         self.mouseMotion(event, 1)
         self.mouseMotion(event, 1)
 
 
     def mouseMotion(self, event, fShift = 0):
     def mouseMotion(self, event, fShift = 0):
         dialAngle = self.computeDialAngle(event, fShift)
         dialAngle = self.computeDialAngle(event, fShift)
         self.computeValueFromAngle(dialAngle)
         self.computeValueFromAngle(dialAngle)
-        
-    def computeDialAngle(self,event, fShift = 0):
+
+    def computeDialAngle(self, event, fShift = 0):
         x = self._widget.canvasx(event.x)
         x = self._widget.canvasx(event.x)
         y = self._widget.canvasy(event.y)
         y = self._widget.canvasy(event.y)
-        rawAngle = math.atan2(y,x)
+        rawAngle = math.atan2(y, x)
         # Snap to grid
         # Snap to grid
         # Convert to dial coords to do snapping
         # Convert to dial coords to do snapping
         dialAngle = rawAngle + POINTFIVE_PI
         dialAngle = rawAngle + POINTFIVE_PI
@@ -318,8 +318,8 @@ class DialWidget(Pmw.MegaWidget):
 
 
     def updateIndicatorDegrees(self, degAngle):
     def updateIndicatorDegrees(self, degAngle):
         self.updateIndicatorRadians(degAngle * (math.pi/180.0))
         self.updateIndicatorRadians(degAngle * (math.pi/180.0))
-        
-    def updateIndicatorRadians(self,dialAngle):
+
+    def updateIndicatorRadians(self, dialAngle):
         rawAngle = dialAngle - POINTFIVE_PI
         rawAngle = dialAngle - POINTFIVE_PI
         # Compute end points
         # Compute end points
         endx = math.cos(rawAngle) * self.radius
         endx = math.cos(rawAngle) * self.radius
@@ -329,7 +329,7 @@ class DialWidget(Pmw.MegaWidget):
                             endx, endy)
                             endx, endy)
 
 
     # Knob velocity controller
     # Knob velocity controller
-    def knobMouseDown(self,event):
+    def knobMouseDown(self, event):
         self._onButtonPress()
         self._onButtonPress()
         self.knobSF = 0.0
         self.knobSF = 0.0
         self.updateTask = taskMgr.add(self.updateDialTask, 'updateDial')
         self.updateTask = taskMgr.add(self.updateDialTask, 'updateDial')
@@ -364,9 +364,9 @@ class DialWidget(Pmw.MegaWidget):
     def setNumDigits(self):
     def setNumDigits(self):
         # Set minimum exponent to use in velocity task
         # Set minimum exponent to use in velocity task
         self.minExp = math.floor(-self['numDigits']/
         self.minExp = math.floor(-self['numDigits']/
-                                 math.log10(Valuator.sfBase))        
+                                 math.log10(Valuator.sfBase))
 
 
-    # Methods to modify dial characteristics    
+    # Methods to modify dial characteristics
     def setRelief(self):
     def setRelief(self):
         self.interior()['relief'] = self['relief']
         self.interior()['relief'] = self['relief']
 
 
@@ -417,7 +417,7 @@ class DialWidget(Pmw.MegaWidget):
         if self['postCallback']:
         if self['postCallback']:
             apply(self['postCallback'], self['callbackData'])
             apply(self['postCallback'], self['callbackData'])
 
 
-  
+
 if __name__ == '__main__':
 if __name__ == '__main__':
     tl = Toplevel()
     tl = Toplevel()
     d = Dial(tl)
     d = Dial(tl)

+ 27 - 27
direct/src/tkwidgets/EntryScale.py

@@ -13,7 +13,7 @@ Change Min/Max buttons to labels, add highlight binding
 
 
 class EntryScale(Pmw.MegaWidget):
 class EntryScale(Pmw.MegaWidget):
     "Scale with linked and validated entry"
     "Scale with linked and validated entry"
- 
+
     def __init__(self, parent = None, **kw):
     def __init__(self, parent = None, **kw):
 
 
         # Define the megawidget options.
         # Define the megawidget options.
@@ -31,7 +31,7 @@ class EntryScale(Pmw.MegaWidget):
             ('numDigits',   2,             self._setSigDigits),
             ('numDigits',   2,             self._setSigDigits),
             )
             )
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
- 
+
         # Initialise superclass
         # Initialise superclass
         Pmw.MegaWidget.__init__(self, parent)
         Pmw.MegaWidget.__init__(self, parent)
 
 
@@ -66,8 +66,8 @@ class EntryScale(Pmw.MegaWidget):
                                           entry_justify = 'right',
                                           entry_justify = 'right',
                                           entry_textvar = self.entryValue,
                                           entry_textvar = self.entryValue,
                                           command = self._entryCommand)
                                           command = self._entryCommand)
-        self.entry.pack(side='left',padx = 4)
-                                          
+        self.entry.pack(side='left', padx = 4)
+
         # Create the EntryScale's label
         # Create the EntryScale's label
         self.label = self.createcomponent('label', (), None,
         self.label = self.createcomponent('label', (), None,
                                           Label, self.labelFrame,
                                           Label, self.labelFrame,
@@ -122,7 +122,7 @@ class EntryScale(Pmw.MegaWidget):
         self.maxLabel.bind('<Button-3>', self.askForMax)
         self.maxLabel.bind('<Button-3>', self.askForMax)
         self.maxLabel.pack(side='left', fill = 'x')
         self.maxLabel.pack(side='left', fill = 'x')
         self.minMaxFrame.pack(expand = 1, fill = 'both')
         self.minMaxFrame.pack(expand = 1, fill = 'both')
-         
+
         # Check keywords and initialise options based on input values.
         # Check keywords and initialise options based on input values.
         self.initialiseoptions(EntryScale)
         self.initialiseoptions(EntryScale)
 
 
@@ -140,7 +140,7 @@ class EntryScale(Pmw.MegaWidget):
                              parent = self.interior())
                              parent = self.interior())
         if newLabel:
         if newLabel:
             self['text'] = newLabel
             self['text'] = newLabel
-            
+
     def askForMin(self, event = None):
     def askForMin(self, event = None):
         newMin = askfloat(title = self['text'],
         newMin = askfloat(title = self['text'],
                           prompt = 'New min val:',
                           prompt = 'New min val:',
@@ -148,13 +148,13 @@ class EntryScale(Pmw.MegaWidget):
                           parent = self.interior())
                           parent = self.interior())
         if newMin:
         if newMin:
             self.setMin(newMin)
             self.setMin(newMin)
-            
+
     def setMin(self, newMin):
     def setMin(self, newMin):
         self['min'] = newMin
         self['min'] = newMin
         self.scale['from_'] = newMin
         self.scale['from_'] = newMin
         self.minLabel['text'] = newMin
         self.minLabel['text'] = newMin
         self.entry.checkentry()
         self.entry.checkentry()
-    
+
     def askForMax(self, event = None):
     def askForMax(self, event = None):
         newMax = askfloat(title = self['text'],
         newMax = askfloat(title = self['text'],
                           parent = self.interior(),
                           parent = self.interior(),
@@ -168,7 +168,7 @@ class EntryScale(Pmw.MegaWidget):
         self.scale['to'] = newMax
         self.scale['to'] = newMax
         self.maxLabel['text'] = newMax
         self.maxLabel['text'] = newMax
         self.entry.checkentry()
         self.entry.checkentry()
-    
+
     def askForResolution(self, event = None):
     def askForResolution(self, event = None):
         newResolution = askfloat(title = self['text'],
         newResolution = askfloat(title = self['text'],
                                  parent = self.interior(),
                                  parent = self.interior(),
@@ -181,7 +181,7 @@ class EntryScale(Pmw.MegaWidget):
         self['resolution'] = newResolution
         self['resolution'] = newResolution
         self.scale['resolution'] = newResolution
         self.scale['resolution'] = newResolution
         self.entry.checkentry()
         self.entry.checkentry()
-    
+
     def _updateLabelText(self):
     def _updateLabelText(self):
         self.label['text'] = self['text']
         self.label['text'] = self['text']
 
 
@@ -213,9 +213,9 @@ class EntryScale(Pmw.MegaWidget):
     def _entryCommand(self, event = None):
     def _entryCommand(self, event = None):
         try:
         try:
             val = string.atof(self.entryValue.get())
             val = string.atof(self.entryValue.get())
-            apply(self.onReturn,self['callbackData'])
+            apply(self.onReturn, self['callbackData'])
             self.set(val)
             self.set(val)
-            apply(self.onReturnRelease,self['callbackData'])
+            apply(self.onReturnRelease, self['callbackData'])
         except ValueError:
         except ValueError:
             pass
             pass
 
 
@@ -227,7 +227,7 @@ class EntryScale(Pmw.MegaWidget):
 
 
     def get(self):
     def get(self):
         return self.value
         return self.value
-    
+
     def set(self, newVal, fCommand = 1):
     def set(self, newVal, fCommand = 1):
         # Clamp value
         # Clamp value
         if self['min'] is not None:
         if self['min'] is not None:
@@ -247,7 +247,7 @@ class EntryScale(Pmw.MegaWidget):
         # Update entry to reflect formatted value
         # Update entry to reflect formatted value
         self.entryValue.set(self.entryFormat % self.value)
         self.entryValue.set(self.entryFormat % self.value)
         self.entry.checkentry()
         self.entry.checkentry()
-        
+
         # execute command
         # execute command
         if fCommand and (self['command'] is not None):
         if fCommand and (self['command'] is not None):
             self['command'](newVal)
             self['command'](newVal)
@@ -313,7 +313,7 @@ class EntryScaleGroup(Pmw.MegaToplevel):
 
 
         # Initialize the toplevel widget
         # Initialize the toplevel widget
         Pmw.MegaToplevel.__init__(self, parent)
         Pmw.MegaToplevel.__init__(self, parent)
-        
+
         # Create the components
         # Create the components
         interior = self.interior()
         interior = self.interior()
         # Get a copy of the initial value (making sure its a list)
         # Get a copy of the initial value (making sure its a list)
@@ -321,11 +321,11 @@ class EntryScaleGroup(Pmw.MegaToplevel):
 
 
         # The Menu Bar
         # The Menu Bar
         self.balloon = Pmw.Balloon()
         self.balloon = Pmw.Balloon()
-        menubar = self.createcomponent('menubar',(), None,
+        menubar = self.createcomponent('menubar', (), None,
                                        Pmw.MenuBar, (interior,),
                                        Pmw.MenuBar, (interior,),
                                        balloon = self.balloon)
                                        balloon = self.balloon)
         menubar.pack(fill=X)
         menubar.pack(fill=X)
-        
+
         # EntryScaleGroup Menu
         # EntryScaleGroup Menu
         menubar.addmenu('EntryScale Group', 'EntryScale Group Operations')
         menubar.addmenu('EntryScale Group', 'EntryScale Group Operations')
         menubar.addmenuitem(
         menubar.addmenuitem(
@@ -339,7 +339,7 @@ class EntryScaleGroup(Pmw.MegaToplevel):
         menubar.addmenuitem(
         menubar.addmenuitem(
             'EntryScale Group', 'command', 'Dismiss EntryScale Group panel',
             'EntryScale Group', 'command', 'Dismiss EntryScale Group panel',
             label = 'Dismiss', command = dismissCommand)
             label = 'Dismiss', command = dismissCommand)
-        
+
         menubar.addmenu('Help', 'EntryScale Group Help Operations')
         menubar.addmenu('Help', 'EntryScale Group Help Operations')
         self.toggleBalloonVar = IntVar()
         self.toggleBalloonVar = IntVar()
         self.toggleBalloonVar.set(0)
         self.toggleBalloonVar.set(0)
@@ -370,8 +370,8 @@ class EntryScaleGroup(Pmw.MegaToplevel):
 
 
         # Make sure entryScales are initialized
         # Make sure entryScales are initialized
         self.set(self['value'])
         self.set(self['value'])
-        
-        # Make sure input variables processed 
+
+        # Make sure input variables processed
         self.initialiseoptions(EntryScaleGroup)
         self.initialiseoptions(EntryScaleGroup)
 
 
     def _updateLabels(self):
     def _updateLabels(self):
@@ -388,7 +388,7 @@ class EntryScaleGroup(Pmw.MegaToplevel):
     def get(self):
     def get(self):
         return self._value
         return self._value
 
 
-    def getAt(self,index):
+    def getAt(self, index):
         return self._value[index]
         return self._value[index]
 
 
     # This is the command is used to set the groups value
     # This is the command is used to set the groups value
@@ -503,10 +503,10 @@ def rgbPanel(nodePath, callback = None):
         print "Vec4(%.3f, %.3f, %.3f, %.3f)"%(c[0], c[1], c[2], c[3])
         print "Vec4(%.3f, %.3f, %.3f, %.3f)"%(c[0], c[1], c[2], c[3])
     menu.insert_command(index = 5, label = 'Print to log',
     menu.insert_command(index = 5, label = 'Print to log',
                         command = printToLog)
                         command = printToLog)
-    
+
     # Set callback
     # Set callback
-    def onRelease(r,g,b,a, nodePath = nodePath):
-        messenger.send('RGBPanel_setColor', [nodePath, r,g,b,a])
+    def onRelease(r, g, b, a, nodePath = nodePath):
+        messenger.send('RGBPanel_setColor', [nodePath, r, g, b, a])
     esg['postCallback'] = onRelease
     esg['postCallback'] = onRelease
     return esg
     return esg
 
 
@@ -519,14 +519,14 @@ if __name__ == '__main__':
     # Dummy command
     # Dummy command
     def printVal(val):
     def printVal(val):
         print val
         print val
-    
+
     # Create and pack a EntryScale megawidget.
     # Create and pack a EntryScale megawidget.
     mega1 = EntryScale(root, command = printVal)
     mega1 = EntryScale(root, command = printVal)
     mega1.pack(side = 'left', expand = 1, fill = 'x')
     mega1.pack(side = 'left', expand = 1, fill = 'x')
 
 
     """
     """
     # These are things you can set/configure
     # These are things you can set/configure
-    # Starting value for entryScale    
+    # Starting value for entryScale
     mega1['value'] = 123.456
     mega1['value'] = 123.456
     mega1['text'] = 'Drive delta X'
     mega1['text'] = 'Drive delta X'
     mega1['min'] = 0.0
     mega1['min'] = 0.0
@@ -549,6 +549,6 @@ if __name__ == '__main__':
                           Valuator_max = 255.0,
                           Valuator_max = 255.0,
                           Valuator_resolution = 1.0,
                           Valuator_resolution = 1.0,
                           command = printVal)
                           command = printVal)
-    
+
     # Uncomment this if you aren't running in IDLE
     # Uncomment this if you aren't running in IDLE
     #root.mainloop()
     #root.mainloop()

+ 22 - 22
direct/src/tkwidgets/Floater.py

@@ -5,7 +5,7 @@ Floater Class: Velocity style controller for floating point values with
 from direct.showbase.TkGlobal import *
 from direct.showbase.TkGlobal import *
 from Valuator import *
 from Valuator import *
 from direct.task import Task
 from direct.task import Task
-import math,sys,string
+import math, sys, string
 
 
 FLOATER_WIDTH = 22
 FLOATER_WIDTH = 22
 FLOATER_HEIGHT = 18
 FLOATER_HEIGHT = 18
@@ -20,7 +20,7 @@ class Floater(Valuator):
         # Initialize the superclass
         # Initialize the superclass
         Valuator.__init__(self, parent)
         Valuator.__init__(self, parent)
         self.initialiseoptions(Floater)
         self.initialiseoptions(Floater)
-        
+
     def createValuator(self):
     def createValuator(self):
         self._valuator = self.createcomponent('valuator',
         self._valuator = self.createcomponent('valuator',
                                               (('floater', 'valuator'),),
                                               (('floater', 'valuator'),),
@@ -34,9 +34,9 @@ class Floater(Valuator):
     def packValuator(self):
     def packValuator(self):
         # Position components
         # Position components
         if self._label:
         if self._label:
-            self._label.grid(row=0,column=0, sticky = EW)
-        self._entry.grid(row=0,column=1, sticky = EW)
-        self._valuator.grid(row=0,column=2, padx = 2, pady = 2)
+            self._label.grid(row=0, column=0, sticky = EW)
+        self._entry.grid(row=0, column=1, sticky = EW)
+        self._valuator.grid(row=0, column=2, padx = 2, pady = 2)
         self.interior().columnconfigure(0, weight = 1)
         self.interior().columnconfigure(0, weight = 1)
 
 
 
 
@@ -70,7 +70,7 @@ class FloaterWidget(Pmw.MegaWidget):
         # Initialize the superclass
         # Initialize the superclass
         Pmw.MegaWidget.__init__(self, parent)
         Pmw.MegaWidget.__init__(self, parent)
 
 
-        # Set up some local and instance variables        
+        # Set up some local and instance variables
         # Create the components
         # Create the components
         interior = self.interior()
         interior = self.interior()
 
 
@@ -109,7 +109,7 @@ class FloaterWidget(Pmw.MegaWidget):
         self._widget.bind('<Enter>', self.highlightWidget)
         self._widget.bind('<Enter>', self.highlightWidget)
         self._widget.bind('<Leave>', self.restoreWidget)
         self._widget.bind('<Leave>', self.restoreWidget)
 
 
-        # Make sure input variables processed 
+        # Make sure input variables processed
         self.initialiseoptions(FloaterWidget)
         self.initialiseoptions(FloaterWidget)
 
 
     def set(self, value, fCommand = 1):
     def set(self, value, fCommand = 1):
@@ -126,7 +126,7 @@ class FloaterWidget(Pmw.MegaWidget):
     def updateIndicator(self, value):
     def updateIndicator(self, value):
         # Nothing visible to update on this type of widget
         # Nothing visible to update on this type of widget
         pass
         pass
-    
+
     def get(self):
     def get(self):
         """
         """
         self.get()
         self.get()
@@ -136,7 +136,7 @@ class FloaterWidget(Pmw.MegaWidget):
 
 
     ## Canvas callback functions
     ## Canvas callback functions
     # Floater velocity controller
     # Floater velocity controller
-    def mouseDown(self,event):
+    def mouseDown(self, event):
         """ Begin mouse interaction """
         """ Begin mouse interaction """
         # Exectute user redefinable callback function (if any)
         # Exectute user redefinable callback function (if any)
         self['relief'] = SUNKEN
         self['relief'] = SUNKEN
@@ -188,9 +188,9 @@ class FloaterWidget(Pmw.MegaWidget):
         upon the number of digits to be displayed in the result
         upon the number of digits to be displayed in the result
         """
         """
         self.minExp = math.floor(-self['numDigits']/
         self.minExp = math.floor(-self['numDigits']/
-                                 math.log10(Valuator.sfBase))        
+                                 math.log10(Valuator.sfBase))
 
 
-    # Methods to modify floater characteristics    
+    # Methods to modify floater characteristics
     def setRelief(self):
     def setRelief(self):
         self.interior()['relief'] = self['relief']
         self.interior()['relief'] = self['relief']
 
 
@@ -234,7 +234,7 @@ class FloaterGroup(Pmw.MegaToplevel):
 
 
         # Initialize the toplevel widget
         # Initialize the toplevel widget
         Pmw.MegaToplevel.__init__(self, parent)
         Pmw.MegaToplevel.__init__(self, parent)
-        
+
         # Create the components
         # Create the components
         interior = self.interior()
         interior = self.interior()
         # Get a copy of the initial value (making sure its a list)
         # Get a copy of the initial value (making sure its a list)
@@ -242,11 +242,11 @@ class FloaterGroup(Pmw.MegaToplevel):
 
 
         # The Menu Bar
         # The Menu Bar
         self.balloon = Pmw.Balloon()
         self.balloon = Pmw.Balloon()
-        menubar = self.createcomponent('menubar',(), None,
+        menubar = self.createcomponent('menubar', (), None,
                                        Pmw.MenuBar, (interior,),
                                        Pmw.MenuBar, (interior,),
                                        balloon = self.balloon)
                                        balloon = self.balloon)
         menubar.pack(fill=X)
         menubar.pack(fill=X)
-        
+
         # FloaterGroup Menu
         # FloaterGroup Menu
         menubar.addmenu('Floater Group', 'Floater Group Operations')
         menubar.addmenu('Floater Group', 'Floater Group Operations')
         menubar.addmenuitem(
         menubar.addmenuitem(
@@ -256,7 +256,7 @@ class FloaterGroup(Pmw.MegaToplevel):
         menubar.addmenuitem(
         menubar.addmenuitem(
             'Floater Group', 'command', 'Dismiss Floater Group panel',
             'Floater Group', 'command', 'Dismiss Floater Group panel',
             label = 'Dismiss', command = self.withdraw)
             label = 'Dismiss', command = self.withdraw)
-        
+
         menubar.addmenu('Help', 'Floater Group Help Operations')
         menubar.addmenu('Help', 'Floater Group Help Operations')
         self.toggleBalloonVar = IntVar()
         self.toggleBalloonVar = IntVar()
         self.toggleBalloonVar.set(0)
         self.toggleBalloonVar.set(0)
@@ -281,8 +281,8 @@ class FloaterGroup(Pmw.MegaToplevel):
 
 
         # Make sure floaters are initialized
         # Make sure floaters are initialized
         self.set(self['value'])
         self.set(self['value'])
-        
-        # Make sure input variables processed 
+
+        # Make sure input variables processed
         self.initialiseoptions(FloaterGroup)
         self.initialiseoptions(FloaterGroup)
 
 
     def _updateLabels(self):
     def _updateLabels(self):
@@ -299,7 +299,7 @@ class FloaterGroup(Pmw.MegaToplevel):
     def get(self):
     def get(self):
         return self._value
         return self._value
 
 
-    def getAt(self,index):
+    def getAt(self, index):
         return self._value[index]
         return self._value[index]
 
 
     # This is the command is used to set the groups value
     # This is the command is used to set the groups value
@@ -324,7 +324,7 @@ class FloaterGroup(Pmw.MegaToplevel):
     def reset(self):
     def reset(self):
         self.set(self['value'])
         self.set(self['value'])
 
 
-  
+
 ## SAMPLE CODE
 ## SAMPLE CODE
 if __name__ == '__main__':
 if __name__ == '__main__':
     # Initialise Tkinter and Pmw.
     # Initialise Tkinter and Pmw.
@@ -334,14 +334,14 @@ if __name__ == '__main__':
     # Dummy command
     # Dummy command
     def printVal(val):
     def printVal(val):
         print val
         print val
-    
+
     # Create and pack a Floater megawidget.
     # Create and pack a Floater megawidget.
     mega1 = Floater(root, command = printVal)
     mega1 = Floater(root, command = printVal)
     mega1.pack(side = 'left', expand = 1, fill = 'x')
     mega1.pack(side = 'left', expand = 1, fill = 'x')
 
 
     """
     """
     # These are things you can set/configure
     # These are things you can set/configure
-    # Starting value for floater    
+    # Starting value for floater
     mega1['value'] = 123.456
     mega1['value'] = 123.456
     mega1['text'] = 'Drive delta X'
     mega1['text'] = 'Drive delta X'
     # To change the color of the label:
     # To change the color of the label:
@@ -361,6 +361,6 @@ if __name__ == '__main__':
                           Valuator_max = 255.0,
                           Valuator_max = 255.0,
                           Valuator_resolution = 1.0,
                           Valuator_resolution = 1.0,
                           command = printVal)
                           command = printVal)
-    
+
     # Uncomment this if you aren't running in IDLE
     # Uncomment this if you aren't running in IDLE
     #root.mainloop()
     #root.mainloop()

+ 9 - 9
direct/src/tkwidgets/SceneGraphExplorer.py

@@ -6,7 +6,7 @@ from Tree import *
 DEFAULT_MENU_ITEMS = [
 DEFAULT_MENU_ITEMS = [
     'Update Explorer',
     'Update Explorer',
     'Separator',
     'Separator',
-    'Select', 'Deselect', 
+    'Select', 'Deselect',
     'Separator',
     'Separator',
     'Delete',
     'Delete',
     'Separator',
     'Separator',
@@ -25,19 +25,19 @@ class SceneGraphExplorer(Pmw.MegaWidget, DirectObject):
             ('menuItems',   [],   Pmw.INITOPT),
             ('menuItems',   [],   Pmw.INITOPT),
             )
             )
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
- 
+
         # Initialise superclass
         # Initialise superclass
         Pmw.MegaWidget.__init__(self, parent)
         Pmw.MegaWidget.__init__(self, parent)
-        
+
         # Initialize some class variables
         # Initialize some class variables
         self.nodePath = nodePath
         self.nodePath = nodePath
 
 
         # Create the components.
         # Create the components.
-        
+
         # Setup up container
         # Setup up container
         interior = self.interior()
         interior = self.interior()
         interior.configure(relief = GROOVE, borderwidth = 2)
         interior.configure(relief = GROOVE, borderwidth = 2)
-        
+
         # Create a label and an entry
         # Create a label and an entry
         self._scrolledCanvas = self.createcomponent(
         self._scrolledCanvas = self.createcomponent(
             'scrolledCanvas',
             'scrolledCanvas',
@@ -49,14 +49,14 @@ class SceneGraphExplorer(Pmw.MegaWidget, DirectObject):
         self._canvas['scrollregion'] = ('0i', '0i', '2i', '4i')
         self._canvas['scrollregion'] = ('0i', '0i', '2i', '4i')
         self._scrolledCanvas.resizescrollregion()
         self._scrolledCanvas.resizescrollregion()
         self._scrolledCanvas.pack(padx = 3, pady = 3, expand=1, fill = BOTH)
         self._scrolledCanvas.pack(padx = 3, pady = 3, expand=1, fill = BOTH)
-        
+
         self._canvas.bind('<ButtonPress-2>', self.mouse2Down)
         self._canvas.bind('<ButtonPress-2>', self.mouse2Down)
         self._canvas.bind('<B2-Motion>', self.mouse2Motion)
         self._canvas.bind('<B2-Motion>', self.mouse2Motion)
         self._canvas.bind('<Configure>',
         self._canvas.bind('<Configure>',
                           lambda e, sc = self._scrolledCanvas:
                           lambda e, sc = self._scrolledCanvas:
                           sc.resizescrollregion())
                           sc.resizescrollregion())
         self.interior().bind('<Destroy>', self.onDestroy)
         self.interior().bind('<Destroy>', self.onDestroy)
-        
+
         # Create the contents
         # Create the contents
         self._treeItem = SceneGraphExplorerItem(self.nodePath)
         self._treeItem = SceneGraphExplorerItem(self.nodePath)
 
 
@@ -93,7 +93,7 @@ class SceneGraphExplorer(Pmw.MegaWidget, DirectObject):
         self._width = 1.0 * self._canvas.winfo_width()
         self._width = 1.0 * self._canvas.winfo_width()
         self._height = 1.0 * self._canvas.winfo_height()
         self._height = 1.0 * self._canvas.winfo_height()
         xview = self._canvas.xview()
         xview = self._canvas.xview()
-        yview = self._canvas.yview()        
+        yview = self._canvas.yview()
         self._left = xview[0]
         self._left = xview[0]
         self._top = yview[0]
         self._top = yview[0]
         self._dxview = xview[1] - xview[0]
         self._dxview = xview[1] - xview[0]
@@ -101,7 +101,7 @@ class SceneGraphExplorer(Pmw.MegaWidget, DirectObject):
         self._2lx = event.x
         self._2lx = event.x
         self._2ly = event.y
         self._2ly = event.y
 
 
-    def mouse2Motion(self,event):
+    def mouse2Motion(self, event):
         newx = self._left - ((event.x - self._2lx)/self._width) * self._dxview
         newx = self._left - ((event.x - self._2lx)/self._width) * self._dxview
         self._canvas.xview_moveto(newx)
         self._canvas.xview_moveto(newx)
         newy = self._top - ((event.y - self._2ly)/self._height) * self._dyview
         newy = self._top - ((event.y - self._2ly)/self._height) * self._dyview

+ 15 - 15
direct/src/tkwidgets/Slider.py

@@ -5,7 +5,7 @@ Slider Class: Velocity style controller for floating point values with
 from direct.showbase.TkGlobal import *
 from direct.showbase.TkGlobal import *
 from Valuator import *
 from Valuator import *
 from direct.task import Task
 from direct.task import Task
-import math,sys,string
+import math, sys, string
 import operator
 import operator
 from pandac.PandaModules import ClockObject
 from pandac.PandaModules import ClockObject
 
 
@@ -63,9 +63,9 @@ class Slider(Valuator):
             self.interior().columnconfigure(0, weight = 1)
             self.interior().columnconfigure(0, weight = 1)
         else:
         else:
             if self._label:
             if self._label:
-                self._label.grid(row=0,column=0, sticky = EW)
-            self._entry.grid(row=0,column=1, sticky = EW)
-            self._valuator.grid(row=0,column=2, padx = 2, pady = 2)
+                self._label.grid(row=0, column=0, sticky = EW)
+            self._entry.grid(row=0, column=1, sticky = EW)
+            self._valuator.grid(row=0, column=2, padx = 2, pady = 2)
             self.interior().columnconfigure(0, weight = 1)
             self.interior().columnconfigure(0, weight = 1)
 
 
     def setMin(self):
     def setMin(self):
@@ -207,7 +207,7 @@ class SliderWidget(Pmw.MegaWidget):
                 (), None,
                 (), None,
                 Canvas, (interior,), borderwidth = 0,
                 Canvas, (interior,), borderwidth = 0,
                 relief = FLAT, width = 14, height = 14,
                 relief = FLAT, width = 14, height = 14,
-                scrollregion = (-7,-7,7,7))
+                scrollregion = (-7, -7, 7, 7))
             self._arrowBtn.pack(expand = 1, fill = BOTH)
             self._arrowBtn.pack(expand = 1, fill = BOTH)
             self._arrowBtn.create_polygon(-5, -5, 5, -5, 0, 5,
             self._arrowBtn.create_polygon(-5, -5, 5, -5, 0, 5,
                                           fill = 'grey50',
                                           fill = 'grey50',
@@ -231,17 +231,17 @@ class SliderWidget(Pmw.MegaWidget):
             self._arrowBtn.bind('<1>', self._postSlider)
             self._arrowBtn.bind('<1>', self._postSlider)
             self._arrowBtn.bind('<Enter>', self.highlightWidget)
             self._arrowBtn.bind('<Enter>', self.highlightWidget)
             self._arrowBtn.bind('<Leave>', self.restoreWidget)
             self._arrowBtn.bind('<Leave>', self.restoreWidget)
-            # Need to unpost the popup if the arrow Button is unmapped (eg: 
+            # Need to unpost the popup if the arrow Button is unmapped (eg:
             # its toplevel window is withdrawn) while the popup slider is
             # its toplevel window is withdrawn) while the popup slider is
             # displayed.
             # displayed.
             self._arrowBtn.bind('<Unmap>', self._unpostSlider)
             self._arrowBtn.bind('<Unmap>', self._unpostSlider)
-            
+
             # Bind events to the dropdown window.
             # Bind events to the dropdown window.
             self._popup.bind('<Escape>', self._unpostSlider)
             self._popup.bind('<Escape>', self._unpostSlider)
             self._popup.bind('<ButtonRelease-1>', self._widgetBtnRelease)
             self._popup.bind('<ButtonRelease-1>', self._widgetBtnRelease)
             self._popup.bind('<ButtonPress-1>', self._widgetBtnPress)
             self._popup.bind('<ButtonPress-1>', self._widgetBtnPress)
             self._popup.bind('<Motion>', self._widgetMove)
             self._popup.bind('<Motion>', self._widgetMove)
-            
+
             self._widget.bind('<Left>', self._decrementValue)
             self._widget.bind('<Left>', self._decrementValue)
             self._widget.bind('<Right>', self._incrementValue)
             self._widget.bind('<Right>', self._incrementValue)
             self._widget.bind('<Shift-Left>', self._bigDecrementValue)
             self._widget.bind('<Shift-Left>', self._bigDecrementValue)
@@ -253,7 +253,7 @@ class SliderWidget(Pmw.MegaWidget):
             self._widget['command'] = self._firstScaleCommand
             self._widget['command'] = self._firstScaleCommand
             self._widget.bind('<ButtonRelease-1>', self._scaleBtnRelease)
             self._widget.bind('<ButtonRelease-1>', self._scaleBtnRelease)
             self._widget.bind('<ButtonPress-1>', self._scaleBtnPress)
             self._widget.bind('<ButtonPress-1>', self._scaleBtnPress)
-            
+
         # Check keywords and initialise options.
         # Check keywords and initialise options.
         self.initialiseoptions(SliderWidget)
         self.initialiseoptions(SliderWidget)
 
 
@@ -303,7 +303,7 @@ class SliderWidget(Pmw.MegaWidget):
             # Update scale's variable, which update scale without
             # Update scale's variable, which update scale without
             # Calling scale's command
             # Calling scale's command
             self._widgetVar.set(value)
             self._widgetVar.set(value)
-    
+
     #======================================================================
     #======================================================================
 
 
     # Private methods for slider.
     # Private methods for slider.
@@ -324,7 +324,7 @@ class SliderWidget(Pmw.MegaWidget):
         y = self._arrowBtn.winfo_rooty() + self._arrowBtn.winfo_height()
         y = self._arrowBtn.winfo_rooty() + self._arrowBtn.winfo_height()
         # Popup border width
         # Popup border width
         bd = self._popup['bd']
         bd = self._popup['bd']
-#        bd = string.atoi(self._popup['bd'])        
+#        bd = string.atoi(self._popup['bd'])
         # Get width of label
         # Get width of label
         minW = self._minLabel.winfo_width()
         minW = self._minLabel.winfo_width()
         # Width of canvas to adjust for
         # Width of canvas to adjust for
@@ -352,7 +352,7 @@ class SliderWidget(Pmw.MegaWidget):
         self._firstPress = 1
         self._firstPress = 1
         self._fPressInsde = 0
         self._fPressInsde = 0
 
 
-    def _updateValue(self,event):
+    def _updateValue(self, event):
         mouseX = self._widget.canvasx(
         mouseX = self._widget.canvasx(
             event.x_root - self._widget.winfo_rootx())
             event.x_root - self._widget.winfo_rootx())
         if mouseX < self.left:
         if mouseX < self.left:
@@ -381,7 +381,7 @@ class SliderWidget(Pmw.MegaWidget):
         else:
         else:
             self._fPressInside = 0
             self._fPressInside = 0
             self._fUpdate = 0
             self._fUpdate = 0
-            
+
     def _widgetMove(self, event):
     def _widgetMove(self, event):
         if self._firstPress and not self._fUpdate:
         if self._firstPress and not self._fUpdate:
             canvasY = self._widget.canvasy(
             canvasY = self._widget.canvasy(
@@ -397,7 +397,7 @@ class SliderWidget(Pmw.MegaWidget):
     def _scaleBtnPress(self, event):
     def _scaleBtnPress(self, event):
         if self['preCallback']:
         if self['preCallback']:
             apply(self['preCallback'], self['callbackData'])
             apply(self['preCallback'], self['callbackData'])
-            
+
     def _scaleBtnRelease(self, event):
     def _scaleBtnRelease(self, event):
         # Do post callback if any
         # Do post callback if any
         if self['postCallback']:
         if self['postCallback']:
@@ -460,7 +460,7 @@ class SliderWidget(Pmw.MegaWidget):
     def _scaleCommand(self, val):
     def _scaleCommand(self, val):
         self.set(string.atof(val))
         self.set(string.atof(val))
 
 
-    # Methods to modify floater characteristics    
+    # Methods to modify floater characteristics
     def setMin(self):
     def setMin(self):
         self._minLabel['text'] = self.formatString % self['min']
         self._minLabel['text'] = self.formatString % self['min']
         if self['style'] == VALUATOR_FULL:
         if self['style'] == VALUATOR_FULL:

+ 34 - 34
direct/src/tkwidgets/Valuator.py

@@ -43,7 +43,7 @@ class Valuator(Pmw.MegaWidget):
             ('callbackData',      [],             None),
             ('callbackData',      [],             None),
             )
             )
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
-        
+
         # Initialize the superclass
         # Initialize the superclass
         Pmw.MegaWidget.__init__(self, parent)
         Pmw.MegaWidget.__init__(self, parent)
 
 
@@ -53,7 +53,7 @@ class Valuator(Pmw.MegaWidget):
         # Create the components
         # Create the components
         interior = self.interior()
         interior = self.interior()
         interior.configure(relief = self['relief'], bd = self['borderwidth'])
         interior.configure(relief = self['relief'], bd = self['borderwidth'])
-        
+
         # The Valuator
         # The Valuator
         self.createValuator()
         self.createValuator()
         # Set valuator callbacks for mouse start/stop
         # Set valuator callbacks for mouse start/stop
@@ -65,7 +65,7 @@ class Valuator(Pmw.MegaWidget):
             self._label = self.createcomponent('label', (), None,
             self._label = self.createcomponent('label', (), None,
                                                Label, (interior,),
                                                Label, (interior,),
                                                text = self['text'],
                                                text = self['text'],
-                                               font = ('MS Sans Serif',12),
+                                               font = ('MS Sans Serif', 12),
                                                anchor = CENTER)
                                                anchor = CENTER)
         else:
         else:
             self._label = None
             self._label = None
@@ -114,13 +114,13 @@ class Valuator(Pmw.MegaWidget):
                  'type': 'string',
                  'type': 'string',
                  'help': 'Enter state: normal or disabled.'
                  'help': 'Enter state: normal or disabled.'
                  },
                  },
-                
+
                 'text':
                 'text':
                 {'widget': self,
                 {'widget': self,
                  'type': 'string',
                  'type': 'string',
                  'help': 'Enter label text.'
                  'help': 'Enter label text.'
                  },
                  },
-                
+
                 'min':
                 'min':
                 { 'widget': self,
                 { 'widget': self,
                   'type': 'real',
                   'type': 'real',
@@ -136,14 +136,14 @@ class Valuator(Pmw.MegaWidget):
                  'type': 'integer',
                  'type': 'integer',
                  'help': 'Number of digits after decimal point.'
                  'help': 'Number of digits after decimal point.'
                  },
                  },
-                
+
                 'resolution':
                 'resolution':
                 {'widget': self,
                 {'widget': self,
                  'type': 'real',
                  'type': 'real',
                  'fNone': 1,
                  'fNone': 1,
                  'help':'Widget resolution. Enter None for no resolution .'
                  'help':'Widget resolution. Enter None for no resolution .'
                  },
                  },
-                
+
                 'resetValue':
                 'resetValue':
                 { 'widget': self,
                 { 'widget': self,
                   'type': 'real',
                   'type': 'real',
@@ -155,7 +155,7 @@ class Valuator(Pmw.MegaWidget):
                 'resolution', 'resetValue']
                 'resolution', 'resetValue']
             # Add any valuator specific properties
             # Add any valuator specific properties
             self.addValuatorPropertiesToDialog()
             self.addValuatorPropertiesToDialog()
-            
+
         # Make sure input variables processed
         # Make sure input variables processed
         self.fInit = self['fCommandOnInit']
         self.fInit = self['fCommandOnInit']
         self.initialiseoptions(Valuator)
         self.initialiseoptions(Valuator)
@@ -173,7 +173,7 @@ class Valuator(Pmw.MegaWidget):
         # will result in command being executed, otherwise a set with
         # will result in command being executed, otherwise a set with
         # commandData == 0 will stick and commands will not be executed
         # commandData == 0 will stick and commands will not be executed
         self._valuator['commandData'] = [1]
         self._valuator['commandData'] = [1]
-        
+
     def get(self):
     def get(self):
         """ Return current widget value """
         """ Return current widget value """
         return self.adjustedValue
         return self.adjustedValue
@@ -242,7 +242,7 @@ class Valuator(Pmw.MegaWidget):
         """ Function to execute at start of mouse interaction """
         """ Function to execute at start of mouse interaction """
         # Execute pre interaction callback
         # Execute pre interaction callback
         self._preCallback()
         self._preCallback()
-        
+
     def _mouseUp(self):
     def _mouseUp(self):
         """ Function to execute at end of mouse interaction """
         """ Function to execute at end of mouse interaction """
         # Execute post interaction callback
         # Execute post interaction callback
@@ -291,16 +291,16 @@ class Valuator(Pmw.MegaWidget):
         """
         """
         self.set(self['resetValue'])
         self.set(self['resetValue'])
 
 
-    def mouseReset(self,event):
+    def mouseReset(self, event):
         """
         """
         Reset valuator to resetValue
         Reset valuator to resetValue
         """
         """
         # If not over any canvas item
         # If not over any canvas item
         #if not self._widget.find_withtag(CURRENT):
         #if not self._widget.find_withtag(CURRENT):
         self.reset()
         self.reset()
-        
+
     # Popup dialog to adjust widget properties
     # Popup dialog to adjust widget properties
-    def _popupValuatorMenu(self,event):
+    def _popupValuatorMenu(self, event):
         self._popupMenu.post(event.widget.winfo_pointerx(),
         self._popupMenu.post(event.widget.winfo_pointerx(),
                              event.widget.winfo_pointery())
                              event.widget.winfo_pointery())
 
 
@@ -315,7 +315,7 @@ class Valuator(Pmw.MegaWidget):
     def addPropertyToDialog(self, property, pDict):
     def addPropertyToDialog(self, property, pDict):
         self.propertyDict[property] = pDict
         self.propertyDict[property] = pDict
         self.propertyList.append(property)
         self.propertyList.append(property)
-            
+
     # Virtual functions to be redefined by subclass
     # Virtual functions to be redefined by subclass
     def createValuator(self):
     def createValuator(self):
         """ Function used by subclass to create valuator geometry """
         """ Function used by subclass to create valuator geometry """
@@ -375,7 +375,7 @@ class ValuatorGroup(Pmw.MegaWidget):
 
 
         # Initialize the toplevel widget
         # Initialize the toplevel widget
         Pmw.MegaWidget.__init__(self, parent)
         Pmw.MegaWidget.__init__(self, parent)
-        
+
         # Create the components
         # Create the components
         interior = self.interior()
         interior = self.interior()
         # Get a copy of the initial value (making sure its a list)
         # Get a copy of the initial value (making sure its a list)
@@ -414,8 +414,8 @@ class ValuatorGroup(Pmw.MegaWidget):
 
 
         # Make sure valuators are initialized
         # Make sure valuators are initialized
         self.set(self['value'], fCommand = 0)
         self.set(self['value'], fCommand = 0)
-        
-        # Make sure input variables processed 
+
+        # Make sure input variables processed
         self.initialiseoptions(ValuatorGroup)
         self.initialiseoptions(ValuatorGroup)
 
 
     # This is the command is used to set the groups value
     # This is the command is used to set the groups value
@@ -440,7 +440,7 @@ class ValuatorGroup(Pmw.MegaWidget):
     def get(self):
     def get(self):
         return self._value
         return self._value
 
 
-    def getAt(self,index):
+    def getAt(self, index):
         return self._value[index]
         return self._value[index]
 
 
     def _setNumDigits(self):
     def _setNumDigits(self):
@@ -456,7 +456,7 @@ class ValuatorGroup(Pmw.MegaWidget):
         # Execute pre callback
         # Execute pre callback
         if self['preCallback']:
         if self['preCallback']:
             apply(self['preCallback'], valGroup.get())
             apply(self['preCallback'], valGroup.get())
-        
+
     def _postCallback(self, valGroup):
     def _postCallback(self, valGroup):
         # Execute post callback
         # Execute post callback
         if self['postCallback']:
         if self['postCallback']:
@@ -464,14 +464,14 @@ class ValuatorGroup(Pmw.MegaWidget):
 
 
     def __len__(self):
     def __len__(self):
         return self['dim']
         return self['dim']
-    
+
     def __repr__(self):
     def __repr__(self):
         str = '[' + self.formatString % self._value[0]
         str = '[' + self.formatString % self._value[0]
         for val in self._value[1:]:
         for val in self._value[1:]:
             str += ', ' + self.formatString % val
             str += ', ' + self.formatString % val
         str += ']'
         str += ']'
         return str
         return str
-                
+
 
 
 
 
 class ValuatorGroupPanel(Pmw.MegaToplevel):
 class ValuatorGroupPanel(Pmw.MegaToplevel):
@@ -513,17 +513,17 @@ class ValuatorGroupPanel(Pmw.MegaToplevel):
 
 
         # Initialize the toplevel widget
         # Initialize the toplevel widget
         Pmw.MegaToplevel.__init__(self, parent)
         Pmw.MegaToplevel.__init__(self, parent)
-        
+
         # Create the components
         # Create the components
         interior = self.interior()
         interior = self.interior()
 
 
         # The Menu Bar
         # The Menu Bar
         self.balloon = Pmw.Balloon()
         self.balloon = Pmw.Balloon()
-        menubar = self.createcomponent('menubar',(), None,
+        menubar = self.createcomponent('menubar', (), None,
                                        Pmw.MenuBar, (interior,),
                                        Pmw.MenuBar, (interior,),
                                        balloon = self.balloon)
                                        balloon = self.balloon)
         menubar.pack(fill=X)
         menubar.pack(fill=X)
-        
+
         # ValuatorGroup Menu
         # ValuatorGroup Menu
         menubar.addmenu('Valuator Group', 'Valuator Group Operations')
         menubar.addmenu('Valuator Group', 'Valuator Group Operations')
         menubar.addmenuitem(
         menubar.addmenuitem(
@@ -539,7 +539,7 @@ class ValuatorGroupPanel(Pmw.MegaToplevel):
         menubar.addmenuitem(
         menubar.addmenuitem(
             'Valuator Group', 'command', 'Dismiss Valuator Group panel',
             'Valuator Group', 'command', 'Dismiss Valuator Group panel',
             label = 'Dismiss', command = dismissCommand)
             label = 'Dismiss', command = dismissCommand)
-        
+
         menubar.addmenu('Help', 'Valuator Group Help Operations')
         menubar.addmenu('Help', 'Valuator Group Help Operations')
         self.toggleBalloonVar = IntVar()
         self.toggleBalloonVar = IntVar()
         self.toggleBalloonVar.set(0)
         self.toggleBalloonVar.set(0)
@@ -564,8 +564,8 @@ class ValuatorGroupPanel(Pmw.MegaToplevel):
             labels = self['labels'],
             labels = self['labels'],
             command = self['command'])
             command = self['command'])
         self.valuatorGroup.pack(expand = 1, fill = X)
         self.valuatorGroup.pack(expand = 1, fill = X)
-        
-        # Make sure input variables processed 
+
+        # Make sure input variables processed
         self.initialiseoptions(ValuatorGroupPanel)
         self.initialiseoptions(ValuatorGroupPanel)
 
 
     def toggleBalloon(self):
     def toggleBalloon(self):
@@ -579,7 +579,7 @@ class ValuatorGroupPanel(Pmw.MegaToplevel):
 
 
     def _setNumDigits(self):
     def _setNumDigits(self):
         self.valuatorGroup['numDigits'] = self['numDigits']
         self.valuatorGroup['numDigits'] = self['numDigits']
-        
+
     def _setCommand(self):
     def _setCommand(self):
         self.valuatorGroup['command'] = self['command']
         self.valuatorGroup['command'] = self['command']
 
 
@@ -599,8 +599,8 @@ Pmw.forwardmethods(ValuatorGroupPanel, ValuatorGroup, 'valuatorGroup')
 
 
 
 
 def rgbPanel(nodePath, callback = None, style = 'mini'):
 def rgbPanel(nodePath, callback = None, style = 'mini'):
-    def onRelease(r,g,b,a, nodePath = nodePath):
-        messenger.send('RGBPanel_setColor', [nodePath, r,g,b,a])
+    def onRelease(r, g, b, a, nodePath = nodePath):
+        messenger.send('RGBPanel_setColor', [nodePath, r, g, b, a])
 
 
     def popupColorPicker():
     def popupColorPicker():
         # Can pass in current color with: color = (255, 0, 0)
         # Can pass in current color with: color = (255, 0, 0)
@@ -641,13 +641,13 @@ def rgbPanel(nodePath, callback = None, style = 'mini'):
 
 
     # Set callback
     # Set callback
     vgp['postCallback'] = onRelease
     vgp['postCallback'] = onRelease
-    
+
     # Add a print button which will also serve as a color tile
     # Add a print button which will also serve as a color tile
     pButton = Button(vgp.interior(), text = 'Print to Log',
     pButton = Button(vgp.interior(), text = 'Print to Log',
                      bg = getTkColorString(initColor),
                      bg = getTkColorString(initColor),
                      command = printToLog)
                      command = printToLog)
     pButton.pack(expand = 1, fill = BOTH)
     pButton.pack(expand = 1, fill = BOTH)
-    
+
     # Update menu
     # Update menu
     menu = vgp.component('menubar').component('Valuator Group-menu')
     menu = vgp.component('menubar').component('Valuator Group-menu')
     # Some helper functions
     # Some helper functions
@@ -678,7 +678,7 @@ def rgbPanel(nodePath, callback = None, style = 'mini'):
         if callback:
         if callback:
             callback(color)
             callback(color)
     vgp['command'] = setNodePathColor
     vgp['command'] = setNodePathColor
-    
+
     return vgp
     return vgp
 
 
 
 
@@ -696,7 +696,7 @@ def lightRGBPanel(light, style = 'mini'):
         n = light.getName()
         n = light.getName()
         c=light.getColor()
         c=light.getColor()
         print n + (".setColor(Vec4(%.3f, %.3f, %.3f, %.3f))" %
         print n + (".setColor(Vec4(%.3f, %.3f, %.3f, %.3f))" %
-                   (c[0],c[1],c[2],c[3]))
+                   (c[0], c[1], c[2], c[3]))
     # Check init color
     # Check init color
     initColor = light.getColor() * 255.0
     initColor = light.getColor() * 255.0
     # Create entry scale group
     # Create entry scale group

+ 16 - 16
direct/src/tkwidgets/VectorWidgets.py

@@ -47,7 +47,7 @@ class VectorEntry(Pmw.MegaWidget):
         self._floaters = None
         self._floaters = None
         self.entryFormat = '%.2f'
         self.entryFormat = '%.2f'
 
 
-        # Get a handle on the parent container        
+        # Get a handle on the parent container
         interior = self.interior()
         interior = self.interior()
 
 
         # This does double duty as a menu button
         # This does double duty as a menu button
@@ -103,15 +103,15 @@ class VectorEntry(Pmw.MegaWidget):
         # if the user kills the floaterGroup and then tries to pop it open again
         # if the user kills the floaterGroup and then tries to pop it open again
         self._floaters.userdeletefunc(self._floaters.withdraw)
         self._floaters.userdeletefunc(self._floaters.withdraw)
         self._floaters.withdraw()
         self._floaters.withdraw()
-                                             
+
 
 
         # Make sure entries are updated
         # Make sure entries are updated
         self.set(self['value'])
         self.set(self['value'])
 
 
         # Record entry color
         # Record entry color
         self.entryBackground = self.cget('Entry_entry_background')
         self.entryBackground = self.cget('Entry_entry_background')
-        
-        # Make sure input variables processed 
+
+        # Make sure input variables processed
         self.initialiseoptions(VectorEntry)
         self.initialiseoptions(VectorEntry)
 
 
     def menu(self):
     def menu(self):
@@ -131,7 +131,7 @@ class VectorEntry(Pmw.MegaWidget):
 
 
     def _clearFloaters(self):
     def _clearFloaters(self):
         self._floaters.withdraw()
         self._floaters.withdraw()
-        
+
     def _updateText(self):
     def _updateText(self):
         self._label['text'] = self['text']
         self._label['text'] = self['text']
 
 
@@ -139,7 +139,7 @@ class VectorEntry(Pmw.MegaWidget):
         self.interior()['relief'] = self['relief']
         self.interior()['relief'] = self['relief']
 
 
     def _updateBorderWidth(self):
     def _updateBorderWidth(self):
-        self.interior()['bd'] = self['bd']        
+        self.interior()['bd'] = self['bd']
 
 
     def _updateEntryWidth(self):
     def _updateEntryWidth(self):
         self['Entry_entry_width'] = self['entryWidth']
         self['Entry_entry_width'] = self['entryWidth']
@@ -162,14 +162,14 @@ class VectorEntry(Pmw.MegaWidget):
             'maxstrict': 0})
             'maxstrict': 0})
         # Reflect changes in floaters
         # Reflect changes in floaters
         self.configure(valuator_min = self['min'],
         self.configure(valuator_min = self['min'],
-                       valuator_max = self['max'])            
+                       valuator_max = self['max'])
 
 
     def get(self):
     def get(self):
         return self._value
         return self._value
 
 
-    def getAt(self,index):
+    def getAt(self, index):
         return self._value[index]
         return self._value[index]
-                                                                                      
+
     def set(self, value, fCommand = 1):
     def set(self, value, fCommand = 1):
         if type(value) in (types.FloatType, types.IntType, types.LongType):
         if type(value) in (types.FloatType, types.IntType, types.LongType):
             value = [value] * self['dim']
             value = [value] * self['dim']
@@ -182,15 +182,15 @@ class VectorEntry(Pmw.MegaWidget):
         self.variableList[index].set(self.entryFormat % value)
         self.variableList[index].set(self.entryFormat % value)
         self._value[index] = value
         self._value[index] = value
         self.action(fCommand)
         self.action(fCommand)
-        
+
     def _entryUpdateAt(self, index):
     def _entryUpdateAt(self, index):
         entryVar = self.variableList[index]
         entryVar = self.variableList[index]
         # Did we get a valid float?
         # Did we get a valid float?
-        try: 
+        try:
             newVal = string.atof(entryVar.get())
             newVal = string.atof(entryVar.get())
         except ValueError:
         except ValueError:
             return
             return
-        
+
         # Clamp value
         # Clamp value
         if self['min'] is not None:
         if self['min'] is not None:
             if newVal < self['min']:
             if newVal < self['min']:
@@ -208,19 +208,19 @@ class VectorEntry(Pmw.MegaWidget):
         # Update the floaters and call the command
         # Update the floaters and call the command
         self.action()
         self.action()
 
 
-    def _refreshEntry(self,index):
+    def _refreshEntry(self, index):
         self.variableList[index].set(self.entryFormat % self._value[index])
         self.variableList[index].set(self.entryFormat % self._value[index])
         self.entryList[index].checkentry()
         self.entryList[index].checkentry()
 
 
     def _refreshFloaters(self):
     def _refreshFloaters(self):
         if self._floaters:
         if self._floaters:
             self._floaters.set(self._value, 0)
             self._floaters.set(self._value, 0)
-        
+
     def action(self, fCommand = 1):
     def action(self, fCommand = 1):
         self._refreshFloaters()
         self._refreshFloaters()
         if fCommand and (self['command'] != None):
         if fCommand and (self['command'] != None):
-            self['command'](self._value)        
-        
+            self['command'](self._value)
+
     def reset(self):
     def reset(self):
         self.set(self['resetValue'])
         self.set(self['resetValue'])
 
 

+ 9 - 9
direct/src/tkwidgets/WidgetPropertiesDialog.py

@@ -53,7 +53,7 @@ class WidgetPropertiesDialog(Toplevel):
                                   parent.winfo_rooty()+50))
                                   parent.winfo_rooty()+50))
         self.initial_focus.focus_set()
         self.initial_focus.focus_set()
         self.wait_window(self)
         self.wait_window(self)
-        
+
     def destroy(self):
     def destroy(self):
         """Destroy the window"""
         """Destroy the window"""
         self.propertyDict = {}
         self.propertyDict = {}
@@ -62,12 +62,12 @@ class WidgetPropertiesDialog(Toplevel):
         for balloon in self.balloonList:
         for balloon in self.balloonList:
             balloon.withdraw()
             balloon.withdraw()
         Toplevel.destroy(self)
         Toplevel.destroy(self)
-        
+
     #
     #
     # construction hooks
     # construction hooks
     def body(self, master):
     def body(self, master):
         """create dialog body.
         """create dialog body.
-        return entry that should have initial focus. 
+        return entry that should have initial focus.
         This method should be overridden, and is called
         This method should be overridden, and is called
         by the __init__ method.
         by the __init__ method.
         """
         """
@@ -132,8 +132,8 @@ class WidgetPropertiesDialog(Toplevel):
             balloon.bind(entry, helpString)
             balloon.bind(entry, helpString)
             # Create callback to execute whenever a value is changed
             # Create callback to execute whenever a value is changed
             modifiedCallback = (lambda f=self.modified, w=widget, e=entry,
             modifiedCallback = (lambda f=self.modified, w=widget, e=entry,
-                                p=property, t=entryType,fn=fAllowNone:
-                                f(w,e,p,t, fn))
+                                p=property, t=entryType, fn=fAllowNone:
+                                f(w, e, p, t, fn))
             entry['modifiedcommand'] = modifiedCallback
             entry['modifiedcommand'] = modifiedCallback
             # Keep track of the entrys
             # Keep track of the entrys
             entryList.append(entry)
             entryList.append(entry)
@@ -149,10 +149,10 @@ class WidgetPropertiesDialog(Toplevel):
             return self
             return self
 
 
     def modified(self, widget, entry, property, type, fNone):
     def modified(self, widget, entry, property, type, fNone):
-        self.modifiedDict[property] = (widget,entry,type,fNone)
-        
+        self.modifiedDict[property] = (widget, entry, type, fNone)
+
     def buttonbox(self):
     def buttonbox(self):
-        """add standard button box buttons. 
+        """add standard button box buttons.
         """
         """
         box = Frame(self)
         box = Frame(self)
         # Create buttons
         # Create buttons
@@ -193,7 +193,7 @@ class WidgetPropertiesDialog(Toplevel):
         self.validateChanges()
         self.validateChanges()
         self.apply()
         self.apply()
         self.cancel()
         self.cancel()
-        
+
     def cancel(self, event=None):
     def cancel(self, event=None):
         # put focus back to the parent window
         # put focus back to the parent window
         self.parent.focus_set()
         self.parent.focus_set()

Some files were not shown because too many files changed in this diff