瀏覽代碼

formatting

Dave Schuyler 21 年之前
父節點
當前提交
6fe83b0c15

+ 70 - 49
direct/src/actor/Actor.py

@@ -315,7 +315,7 @@ class Actor(PandaObject, NodePath):
 
 
         
         
     def getLODNames(self):
     def getLODNames(self):
-        """getLODNames(self):
+        """
         Return list of Actor LOD names. If not an LOD actor,
         Return list of Actor LOD names. If not an LOD actor,
         returns 'lodRoot'
         returns 'lodRoot'
         Sorts them from highest lod to lowest.
         Sorts them from highest lod to lowest.
@@ -326,9 +326,10 @@ class Actor(PandaObject, NodePath):
         return lodNames
         return lodNames
     
     
     def getPartNames(self):
     def getPartNames(self):
-        """getPartNames(self):
+        """
         Return list of Actor part names. If not an multipart actor,
         Return list of Actor part names. If not an multipart actor,
-        returns 'modelRoot' NOTE: returns parts of arbitrary LOD"""
+        returns 'modelRoot' NOTE: returns parts of arbitrary LOD
+        """
         return self.__partBundleDict.values()[0].keys()
         return self.__partBundleDict.values()[0].keys()
     
     
     def getGeomNode(self):
     def getGeomNode(self):
@@ -351,7 +352,8 @@ class Actor(PandaObject, NodePath):
     def setLODNode(self, node=None):
     def setLODNode(self, node=None):
         """
         """
         Set the node that switches actor geometry in and out.
         Set the node that switches actor geometry in and out.
-        If one is not supplied as an argument, make one"""
+        If one is not supplied as an argument, make one
+        """
         if (node == None):
         if (node == None):
             lod = LODNode.LODNode("lod")
             lod = LODNode.LODNode("lod")
             self.__LODNode = self.__geomNode.attachNewNode(lod)
             self.__LODNode = self.__geomNode.attachNewNode(lod)
@@ -361,8 +363,9 @@ class Actor(PandaObject, NodePath):
         self.switches = {}
         self.switches = {}
 
 
     def useLOD(self, lodName):
     def useLOD(self, lodName):
-        """useLOD(self, string)
-        Make the Actor ONLY display the given LOD"""
+        """
+        Make the Actor ONLY display the given LOD
+        """
         # make sure we don't call this twice in a row
         # make sure we don't call this twice in a row
         # and pollute the the switches dictionary
         # and pollute the the switches dictionary
         self.resetLOD()
         self.resetLOD()
@@ -405,7 +408,8 @@ class Actor(PandaObject, NodePath):
     def addLOD(self, lodName, inDist=0, outDist=0):
     def addLOD(self, lodName, inDist=0, outDist=0):
         """addLOD(self, string) 
         """addLOD(self, string) 
         Add a named node under the LODNode to parent all geometry
         Add a named node under the LODNode to parent all geometry
-        of a specific LOD under."""
+        of a specific LOD under.
+        """
         self.__LODNode.attachNewNode(str(lodName))
         self.__LODNode.attachNewNode(str(lodName))
         # save the switch distance info
         # save the switch distance info
         self.switches[lodName] = [inDist, outDist]
         self.switches[lodName] = [inDist, outDist]
@@ -414,7 +418,8 @@ class Actor(PandaObject, NodePath):
 
 
     def setLOD(self, lodName, inDist=0, outDist=0):
     def setLOD(self, lodName, inDist=0, outDist=0):
         """setLOD(self, string)
         """setLOD(self, string)
-        Set the switch distance for given LOD"""
+        Set the switch distance for given LOD
+        """
         # save the switch distance info
         # save the switch distance info
         self.switches[lodName] = [inDist, outDist]
         self.switches[lodName] = [inDist, outDist]
         # add the switch distance info
         # add the switch distance info
@@ -426,7 +431,8 @@ class Actor(PandaObject, NodePath):
     def getLOD(self, lodName):
     def getLOD(self, lodName):
         """getLOD(self, string)
         """getLOD(self, string)
         Get the named node under the LOD to which we parent all LOD
         Get the named node under the LOD to which we parent all LOD
-        specific geometry to. Returns 'None' if not found"""
+        specific geometry to. Returns 'None' if not found
+        """
         lod = self.__LODNode.find("**/" + str(lodName))
         lod = self.__LODNode.find("**/" + str(lodName))
         if lod.isEmpty():
         if lod.isEmpty():
             return None
             return None
@@ -434,13 +440,12 @@ class Actor(PandaObject, NodePath):
             return lod
             return lod
         
         
     def hasLOD(self):
     def hasLOD(self):
-        """hasLOD(self)
-        Return 1 if the actor has LODs, 0 otherwise"""
+        """
+        Return 1 if the actor has LODs, 0 otherwise
+        """
         return self.__hasLOD
         return self.__hasLOD
 
 
     def update(self, lod=0):
     def update(self, lod=0):
-        """ update(lod)
-        """
         lodnames = self.getLODNames()
         lodnames = self.getLODNames()
         if (lod < len(lodnames)):
         if (lod < len(lodnames)):
             partBundles = self.__partBundleDict[lodnames[lod]].values()
             partBundles = self.__partBundleDict[lodnames[lod]].values()
@@ -455,7 +460,8 @@ class Actor(PandaObject, NodePath):
         Return actual frame rate of given anim name and given part.
         Return actual frame rate of given anim name and given part.
         If no anim specified, use the currently playing anim.
         If no anim specified, use the currently playing anim.
         If no part specified, return anim durations of first part.
         If no part specified, return anim durations of first part.
-        NOTE: returns info only for an arbitrary LOD"""
+        NOTE: returns info only for an arbitrary LOD
+        """
         lodName = self.__animControlDict.keys()[0]
         lodName = self.__animControlDict.keys()[0]
         controls = self.getAnimControls(animName, partName)
         controls = self.getAnimControls(animName, partName)
         if len(controls) == 0:
         if len(controls) == 0:
@@ -476,11 +482,12 @@ class Actor(PandaObject, NodePath):
         return controls[0].getAnim().getBaseFrameRate()
         return controls[0].getAnim().getBaseFrameRate()
 
 
     def getPlayRate(self, animName=None, partName=None):
     def getPlayRate(self, animName=None, partName=None):
-        """getPlayRate(self, string=None, string=None)
+        """
         Return the play rate of given anim for a given part.
         Return the play rate of given anim for a given part.
         If no part is given, assume first part in dictionary.
         If no part is given, assume first part in dictionary.
         If no anim is given, find the current anim for the part.
         If no anim is given, find the current anim for the part.
-        NOTE: Returns info only for an arbitrary LOD"""
+        NOTE: Returns info only for an arbitrary LOD
+        """
         # use the first lod
         # use the first lod
         lodName = self.__animControlDict.keys()[0]
         lodName = self.__animControlDict.keys()[0]
         controls = self.getAnimControls(animName, partName)
         controls = self.getAnimControls(animName, partName)
@@ -504,11 +511,12 @@ class Actor(PandaObject, NodePath):
             control.setPlayRate(rate)
             control.setPlayRate(rate)
 
 
     def getDuration(self, animName=None, partName=None):
     def getDuration(self, animName=None, partName=None):
-        """getDuration(self, string, string=None)
+        """
         Return duration of given anim name and given part.
         Return duration of given anim name and given part.
         If no anim specified, use the currently playing anim.
         If no anim specified, use the currently playing anim.
         If no part specified, return anim duration of first part.
         If no part specified, return anim duration of first part.
-        NOTE: returns info for arbitrary LOD"""
+        NOTE: returns info for arbitrary LOD
+        """
         lodName = self.__animControlDict.keys()[0]
         lodName = self.__animControlDict.keys()[0]
         controls = self.getAnimControls(animName, partName)
         controls = self.getAnimControls(animName, partName)
         if len(controls) == 0:
         if len(controls) == 0:
@@ -525,10 +533,11 @@ class Actor(PandaObject, NodePath):
         return controls[0].getNumFrames()
         return controls[0].getNumFrames()
         
         
     def getCurrentAnim(self, partName=None):
     def getCurrentAnim(self, partName=None):
-        """getCurrentAnim(self, string=None)
+        """
         Return the anim currently playing on the actor. If part not
         Return the anim currently playing on the actor. If part not
         specified return current anim of an arbitrary part in dictionary.
         specified return current anim of an arbitrary part in dictionary.
-        NOTE: only returns info for an arbitrary LOD"""
+        NOTE: only returns info for an arbitrary LOD
+        """
         lodName, animControlDict = self.__animControlDict.items()[0]
         lodName, animControlDict = self.__animControlDict.items()[0]
         if partName == None:
         if partName == None:
             partName, animDict = animControlDict.items()[0]
             partName, animDict = animControlDict.items()[0]
@@ -548,11 +557,12 @@ class Actor(PandaObject, NodePath):
         return None
         return None
 
 
     def getCurrentFrame(self, animName=None, partName=None):
     def getCurrentFrame(self, animName=None, partName=None):
-        """getCurrentAnim(self, string=None)
+        """
         Return the current frame number of the anim current playing on
         Return the current frame number of the anim current playing on
         the actor. If part not specified return current anim of first
         the actor. If part not specified return current anim of first
         part in dictionary.
         part in dictionary.
-        NOTE: only returns info for an arbitrary LOD"""
+        NOTE: only returns info for an arbitrary LOD
+        """
         lodName, animControlDict = self.__animControlDict.items()[0]
         lodName, animControlDict = self.__animControlDict.items()[0]
         if partName == None:
         if partName == None:
             partName, animDict = animControlDict.items()[0]
             partName, animDict = animControlDict.items()[0]
@@ -575,9 +585,10 @@ class Actor(PandaObject, NodePath):
     # arranging
     # arranging
 
 
     def getPart(self, partName, lodName="lodRoot"):
     def getPart(self, partName, lodName="lodRoot"):
-        """getPart(self, string, key="lodRoot")
+        """
         Find the named part in the optional named lod and return it, or
         Find the named part in the optional named lod and return it, or
-        return None if not present"""
+        return None if not present
+        """
         partBundleDict = self.__partBundleDict.get(lodName)
         partBundleDict = self.__partBundleDict.get(lodName)
         if not partBundleDict:
         if not partBundleDict:
             Actor.notify.warning("no lod named: %s" % (lodName))
             Actor.notify.warning("no lod named: %s" % (lodName))
@@ -585,10 +596,11 @@ class Actor(PandaObject, NodePath):
         return partBundleDict.get(partName)
         return partBundleDict.get(partName)
 
 
     def removePart(self, partName, lodName="lodRoot"):
     def removePart(self, partName, lodName="lodRoot"):
-        """removePart(self, string, key="lodRoot")
+        """
         Remove the geometry and animations of the named part of the
         Remove the geometry and animations of the named part of the
         optional named lod if present.
         optional named lod if present.
-        NOTE: this will remove child geometry also!"""
+        NOTE: this will remove child geometry also!
+        """
         # find the corresponding part bundle dict
         # find the corresponding part bundle dict
         partBundleDict = self.__partBundleDict.get(lodName)
         partBundleDict = self.__partBundleDict.get(lodName)
         if not partBundleDict:
         if not partBundleDict:
@@ -611,10 +623,11 @@ class Actor(PandaObject, NodePath):
             del(animControlDict[partName])
             del(animControlDict[partName])
             
             
     def hidePart(self, partName, lodName="lodRoot"):
     def hidePart(self, partName, lodName="lodRoot"):
-        """hidePart(self, string, key="lodName")
+        """
         Make the given part of the optionally given lod not render,
         Make the given part of the optionally given lod not render,
         even though still in the tree.
         even though still in the tree.
-        NOTE: this will affect child geometry"""
+        NOTE: this will affect child geometry
+        """
         partBundleDict = self.__partBundleDict.get(lodName)
         partBundleDict = self.__partBundleDict.get(lodName)
         if not partBundleDict:
         if not partBundleDict:
             Actor.notify.warning("no lod named: %s" % (lodName))
             Actor.notify.warning("no lod named: %s" % (lodName))
@@ -626,9 +639,10 @@ class Actor(PandaObject, NodePath):
             Actor.notify.warning("no part named %s!" % (partName))
             Actor.notify.warning("no part named %s!" % (partName))
 
 
     def showPart(self, partName, lodName="lodRoot"):
     def showPart(self, partName, lodName="lodRoot"):
-        """showPart(self, string, key="lodRoot")
+        """
         Make the given part render while in the tree.
         Make the given part render while in the tree.
-        NOTE: this will affect child geometry"""
+        NOTE: this will affect child geometry
+        """
         partBundleDict = self.__partBundleDict.get(lodName)
         partBundleDict = self.__partBundleDict.get(lodName)
         if not partBundleDict:
         if not partBundleDict:
             Actor.notify.warning("no lod named: %s" % (lodName))
             Actor.notify.warning("no lod named: %s" % (lodName))
@@ -640,9 +654,10 @@ class Actor(PandaObject, NodePath):
             Actor.notify.warning("no part named %s!" % (partName))
             Actor.notify.warning("no part named %s!" % (partName))
 
 
     def showAllParts(self, partName, lodName="lodRoot"):
     def showAllParts(self, partName, lodName="lodRoot"):
-        """showAllParts(self, string, key="lodRoot")
+        """
         Make the given part and all its children render while in the tree.
         Make the given part and all its children render while in the tree.
-        NOTE: this will affect child geometry"""
+        NOTE: this will affect child geometry
+        """
         partBundleDict = self.__partBundleDict.get(lodName)
         partBundleDict = self.__partBundleDict.get(lodName)
         if not partBundleDict:
         if not partBundleDict:
             Actor.notify.warning("no lod named: %s" % (lodName))
             Actor.notify.warning("no lod named: %s" % (lodName))
@@ -822,8 +837,8 @@ class Actor(PandaObject, NodePath):
         Takes an optional argument root as the start of the search for the
         Takes an optional argument root as the start of the search for the
         given parts. Also takes optional lod name to refine search for the
         given parts. Also takes optional lod name to refine search for the
         named parts. If root and lod are defined, we search for the given
         named parts. If root and lod are defined, we search for the given
-        root under the given lod."""
-
+        root under the given lod.
+        """
         # check to see if we are working within an lod
         # check to see if we are working within an lod
         if (lodName != None):
         if (lodName != None):
             # find the named lod node
             # find the named lod node
@@ -877,8 +892,8 @@ class Actor(PandaObject, NodePath):
         """fixBounds(self, nodePath=None)
         """fixBounds(self, nodePath=None)
         Force recomputation of bounding spheres for all geoms
         Force recomputation of bounding spheres for all geoms
         in a given part. If no part specified, fix all geoms
         in a given part. If no part specified, fix all geoms
-        in this actor"""
-        
+        in this actor
+        """
         # if no part name specified fix all parts
         # if no part name specified fix all parts
         if (part==None):
         if (part==None):
             part = self
             part = self
@@ -904,8 +919,9 @@ class Actor(PandaObject, NodePath):
             thisGeomNode.node().markBoundStale()
             thisGeomNode.node().markBoundStale()
 
 
     def showAllBounds(self):
     def showAllBounds(self):
-        """showAllBounds(self)
-        Show the bounds of all actor geoms"""
+        """
+        Show the bounds of all actor geoms
+        """
         geomNodes = self.__geomNode.findAllMatches("**/+GeomNode")
         geomNodes = self.__geomNode.findAllMatches("**/+GeomNode")
         numGeomNodes = geomNodes.getNumPaths()
         numGeomNodes = geomNodes.getNumPaths()
 
 
@@ -913,8 +929,9 @@ class Actor(PandaObject, NodePath):
             geomNodes.getPath(nodeNum).showBounds()
             geomNodes.getPath(nodeNum).showBounds()
 
 
     def hideAllBounds(self):
     def hideAllBounds(self):
-        """hideAllBounds(self)
-        Hide the bounds of all actor geoms"""
+        """
+        Hide the bounds of all actor geoms
+        """
         geomNodes = self.__geomNode.findAllMatches("**/+GeomNode")
         geomNodes = self.__geomNode.findAllMatches("**/+GeomNode")
         numGeomNodes = geomNodes.getNumPaths()
         numGeomNodes = geomNodes.getNumPaths()
 
 
@@ -957,7 +974,8 @@ class Actor(PandaObject, NodePath):
         Loop the given animation on the given part of the actor,
         Loop the given animation on the given part of the actor,
         restarting at zero frame if requested. If no part name
         restarting at zero frame if requested. If no part name
         is given then try to loop on all parts. NOTE: loops on
         is given then try to loop on all parts. NOTE: loops on
-        all LOD's"""
+        all LOD's
+        """
         if fromFrame == None:
         if fromFrame == None:
             for control in self.getAnimControls(animName, partName):
             for control in self.getAnimControls(animName, partName):
                 control.loop(restart)
                 control.loop(restart)
@@ -1010,7 +1028,8 @@ class Actor(PandaObject, NodePath):
                     Actor.notify.warning("Couldn't find part: %s" % (partName))
                     Actor.notify.warning("Couldn't find part: %s" % (partName))
 
 
     def disableBlend(self, partName = None):
     def disableBlend(self, partName = None):
-        """ Restores normal one-animation-at-a-time operation after a
+        """
+        Restores normal one-animation-at-a-time operation after a
         previous call to enableBlend().
         previous call to enableBlend().
         """
         """
         self.enableBlend(PartBundle.BTSingle, partName)
         self.enableBlend(PartBundle.BTSingle, partName)
@@ -1225,8 +1244,8 @@ class Actor(PandaObject, NodePath):
         Actor anim loader. Takes an optional partName (defaults to
         Actor anim loader. Takes an optional partName (defaults to
         'modelRoot' for non-multipart actors) and lodName (defaults
         'modelRoot' for non-multipart actors) and lodName (defaults
         to 'lodRoot' for non-LOD actors) and dict of corresponding
         to 'lodRoot' for non-LOD actors) and dict of corresponding
-        anims in the form animName:animPath{}"""
-        
+        anims in the form animName:animPath{}
+        """
         Actor.notify.debug("in loadAnims: %s, part: %s, lod: %s" %
         Actor.notify.debug("in loadAnims: %s, part: %s, lod: %s" %
                            (anims, partName, lodName))
                            (anims, partName, lodName))
 
 
@@ -1246,8 +1265,8 @@ class Actor(PandaObject, NodePath):
         'modelRoot' for non-multipart actors) and lodName (defaults
         'modelRoot' for non-multipart actors) and lodName (defaults
         to 'lodRoot' for non-LOD actors) and dict of corresponding
         to 'lodRoot' for non-LOD actors) and dict of corresponding
         anims in the form animName:animPath{}. Deletes the anim control
         anims in the form animName:animPath{}. Deletes the anim control
-        for the given animation and parts/lods."""
-        
+        for the given animation and parts/lods.
+        """
         Actor.notify.debug("in unloadAnims: %s, part: %s, lod: %s" %
         Actor.notify.debug("in unloadAnims: %s, part: %s, lod: %s" %
                            (anims, partName, lodName))
                            (anims, partName, lodName))
 
 
@@ -1283,7 +1302,6 @@ class Actor(PandaObject, NodePath):
         """bindAnim(self, string, string='modelRoot', string='lodRoot')
         """bindAnim(self, string, string='modelRoot', string='lodRoot')
         Bind the named animation to the named part and lod
         Bind the named animation to the named part and lod
         """
         """
-
         if lodName == None:
         if lodName == None:
             lodNames = self.__animControl.keys()
             lodNames = self.__animControl.keys()
         else:
         else:
@@ -1301,7 +1319,9 @@ class Actor(PandaObject, NodePath):
             
             
             
             
     def __bindAnimToPart(self, animName, partName, lodName):
     def __bindAnimToPart(self, animName, partName, lodName):
-        """for internal use only!"""
+        """
+        for internal use only!
+        """
         # make sure this anim is in the dict
         # make sure this anim is in the dict
         if not self.__animControlDict[lodName][partName].has_key(animName):
         if not self.__animControlDict[lodName][partName].has_key(animName):
             Actor.notify.debug("actor has no animation %s", animName)
             Actor.notify.debug("actor has no animation %s", animName)
@@ -1346,7 +1366,8 @@ class Actor(PandaObject, NodePath):
     def __copyPartBundles(self, other):
     def __copyPartBundles(self, other):
         """__copyPartBundles(self, Actor)
         """__copyPartBundles(self, Actor)
         Copy the part bundle dictionary from another actor as this
         Copy the part bundle dictionary from another actor as this
-        instance's own. NOTE: this method does not actually copy geometry"""
+        instance's own. NOTE: this method does not actually copy geometry
+        """
         for lodName in other.__partBundleDict.keys():
         for lodName in other.__partBundleDict.keys():
             self.__partBundleDict[lodName] = {}            
             self.__partBundleDict[lodName] = {}            
             for partName in other.__partBundleDict[lodName].keys():
             for partName in other.__partBundleDict[lodName].keys():

+ 18 - 20
direct/src/directnotify/Logger.py

@@ -6,11 +6,6 @@ import time
 import math
 import math
 
 
 class Logger:
 class Logger:
-
-    """Logger class: """
-    
-    # built-ins
-    
     def __init__(self, fileName="log"):
     def __init__(self, fileName="log"):
         """__init__(self)
         """__init__(self)
         Logger constructor"""    
         Logger constructor"""    
@@ -18,26 +13,26 @@ class Logger:
         self.__startTime = 0.0
         self.__startTime = 0.0
         self.__logFile = None
         self.__logFile = None
         self.__logFileName = fileName
         self.__logFileName = fileName
-
-    
-    # setters and getters
     
     
     def setTimeStamp(self, bool):
     def setTimeStamp(self, bool):
-        """setTimeStamp(self, int)
-        Toggle time stamp printing with log entries on and off"""
+        """
+        Toggle time stamp printing with log entries on and off
+        """
         self.__timeStamp = bool
         self.__timeStamp = bool
 
 
     def getTimeStamp(self):
     def getTimeStamp(self):
-        """getTimeStamp(self)
-        Return whether or not we are printing time stamps with log entries"""
+        """
+        Return whether or not we are printing time stamps with log entries
+        """
         return(self.__timeStamp)
         return(self.__timeStamp)
 
 
 
 
     # logging control
     # logging control
    
    
     def resetStartTime(self):
     def resetStartTime(self):
-        """resetStartTime()
-        Reset the start time of the log file for time stamps"""
+        """
+        Reset the start time of the log file for time stamps
+        """
         self.__startTime = time.time()
         self.__startTime = time.time()
 
 
     def log(self, entryString):
     def log(self, entryString):
@@ -53,8 +48,9 @@ class Logger:
     # logging functions
     # logging functions
     
     
     def __openLogFile(self):
     def __openLogFile(self):
-        """__openLogFile(self)
-        Open a file for logging error/warning messages"""
+        """
+        Open a file for logging error/warning messages
+        """
         self.resetStartTime()
         self.resetStartTime()
         t = time.localtime(self.__startTime)
         t = time.localtime(self.__startTime)
         st = time.strftime("%m-%d-%Y-%H-%M-%S", t)
         st = time.strftime("%m-%d-%Y-%H-%M-%S", t)
@@ -62,14 +58,16 @@ class Logger:
         self.__logFile = open(logFileName, "w")
         self.__logFile = open(logFileName, "w")
 
 
     def __closeLogFile(self):
     def __closeLogFile(self):
-        """__closeLogFile(self)
-        Close the error/warning output file"""
+        """
+        Close the error/warning output file
+        """
         if (self.__logFile != None):
         if (self.__logFile != None):
             self.__logFile.close()
             self.__logFile.close()
 
 
     def __getTimeStamp(self):
     def __getTimeStamp(self):
-        """__getTimeStamp(self)
-        Return the offset between current time and log file startTime"""
+        """
+        Return the offset between current time and log file startTime
+        """
         t = time.time()
         t = time.time()
         dt = t - self.__startTime
         dt = t - self.__startTime
         if (dt >= 86400):
         if (dt >= 86400):

+ 27 - 17
direct/src/directnotify/Notifier.py

@@ -121,19 +121,22 @@ class Notifier:
         return 1 # to allow assert(myNotify.warning("blah"))
         return 1 # to allow assert(myNotify.warning("blah"))
 
 
     def setWarning(self, bool):
     def setWarning(self, bool):
-        """setWarning(self, int)
-        Enable/Disable the printing of warning messages"""
+        """
+        Enable/Disable the printing of warning messages
+        """
         self.__warning = bool
         self.__warning = bool
 
 
     def getWarning(self):
     def getWarning(self):
-        """getWarning(self)
-        Return whether the printing of warning messages is on or off"""
+        """
+        Return whether the printing of warning messages is on or off
+        """
         return(self.__warning)
         return(self.__warning)
 
 
     # debug funcs
     # debug funcs
     def debug(self, debugString):
     def debug(self, debugString):
-        """debug(self, string)
-        Issue the debug message if debug flag is on"""
+        """
+        Issue the debug message if debug flag is on
+        """
         if (self.__debug):
         if (self.__debug):
             string = (self.getTime() + self.__name + '(debug): ' + debugString)
             string = (self.getTime() + self.__name + '(debug): ' + debugString)
             self.__log(string)
             self.__log(string)
@@ -141,19 +144,22 @@ class Notifier:
         return 1 # to allow assert(myNotify.debug("blah"))
         return 1 # to allow assert(myNotify.debug("blah"))
 
 
     def setDebug(self, bool):
     def setDebug(self, bool):
-        """setDebug(self, int)
-        Enable/Disable the printing of debug messages"""
+        """
+        Enable/Disable the printing of debug messages
+        """
         self.__debug = bool
         self.__debug = bool
 
 
     def getDebug(self):
     def getDebug(self):
-        """getDebug(self)
-        Return whether the printing of debug messages is on or off"""
+        """
+        Return whether the printing of debug messages is on or off
+        """
         return(self.__debug)
         return(self.__debug)
 
 
     # info funcs
     # info funcs
     def info(self, infoString):
     def info(self, infoString):
-        """info(self, string)
-        Print the given informational string, if info flag is on"""
+        """
+        Print the given informational string, if info flag is on
+        """
         if (self.__info):
         if (self.__info):
             string = (self.getTime() + self.__name + '(info): ' + infoString)
             string = (self.getTime() + self.__name + '(info): ' + infoString)
             self.__log(string)
             self.__log(string)
@@ -162,7 +168,8 @@ class Notifier:
 
 
     def getInfo(self):
     def getInfo(self):
         """
         """
-        Return whether the printing of info messages is on or off"""
+        Return whether the printing of info messages is on or off
+        """
         return(self.__info)
         return(self.__info)
 
 
     def setInfo(self, bool):
     def setInfo(self, bool):
@@ -173,19 +180,22 @@ class Notifier:
 
 
     # log funcs
     # log funcs
     def __log(self, logEntry):
     def __log(self, logEntry):
-        """__log(self, string)
-        Determine whether to send informational message to the logger"""
+        """
+        Determine whether to send informational message to the logger
+        """
         if (self.__logging):
         if (self.__logging):
             self.__logger.log(logEntry)
             self.__logger.log(logEntry)
 
 
     def getLogging(self):
     def getLogging(self):
         """
         """
-        Return 1 if logging enabled, 0 otherwise"""
+        Return 1 if logging enabled, 0 otherwise
+        """
         return (self.__logging)
         return (self.__logging)
 
 
     def setLogging(self, bool):
     def setLogging(self, bool):
         """
         """
-        Set the logging flag to int (1=on, 0=off)"""
+        Set the logging flag to int (1=on, 0=off)
+        """
         self.__logging = bool
         self.__logging = bool
 
 
     def __print(self, string):
     def __print(self, string):

+ 2 - 9
direct/src/distributed/ClockDelta.py

@@ -241,7 +241,6 @@ class ClockDelta(DirectObject.DirectObject):
         # by which the network time differs from 'now'.
         # by which the network time differs from 'now'.
         if bits == 16:
         if bits == 16:
             diff = self.__signExtend(networkTime - ntime)
             diff = self.__signExtend(networkTime - ntime)
-
         else:
         else:
             # Assume the bits is either 16 or 32.  If it's 32, no need
             # Assume the bits is either 16 or 32.  If it's 32, no need
             # to sign-extend.  32 bits gives us about 227 days of
             # to sign-extend.  32 bits gives us about 227 days of
@@ -273,8 +272,7 @@ class ClockDelta(DirectObject.DirectObject):
 
 
     def getRealNetworkTime(self, bits=16,
     def getRealNetworkTime(self, bits=16,
                            ticksPerSec=NetworkTimePrecision):
                            ticksPerSec=NetworkTimePrecision):
-        """getRealNetworkTime(self)
-
+        """
         Returns the current getRealTime() expressed as a network time.
         Returns the current getRealTime() expressed as a network time.
         """
         """
         return self.localToNetworkTime(self.globalClock.getRealTime(),
         return self.localToNetworkTime(self.globalClock.getRealTime(),
@@ -283,8 +281,7 @@ class ClockDelta(DirectObject.DirectObject):
 
 
     def getFrameNetworkTime(self, bits=16,
     def getFrameNetworkTime(self, bits=16,
                             ticksPerSec=NetworkTimePrecision):
                             ticksPerSec=NetworkTimePrecision):
-        """getFrameNetworkTime(self)
-
+        """
         Returns the current getFrameTime() expressed as a network time.
         Returns the current getFrameTime() expressed as a network time.
         """
         """
         return self.localToNetworkTime(self.globalClock.getFrameTime(),
         return self.localToNetworkTime(self.globalClock.getFrameTime(),
@@ -298,7 +295,6 @@ class ClockDelta(DirectObject.DirectObject):
         Returns the amount of time elapsed (in seconds) on the client
         Returns the amount of time elapsed (in seconds) on the client
         since the server message was sent.  Negative values are
         since the server message was sent.  Negative values are
         clamped to zero.
         clamped to zero.
-        
         """
         """
         now = self.globalClock.getFrameTime()
         now = self.globalClock.getFrameTime()
         dt = now - self.networkToLocalTime(networkTime, now, bits=bits,
         dt = now - self.networkToLocalTime(networkTime, now, bits=bits,
@@ -306,8 +302,6 @@ class ClockDelta(DirectObject.DirectObject):
 
 
         return max(dt, 0.0)
         return max(dt, 0.0)
 
 
-
-
     ### Private functions ###
     ### Private functions ###
 
 
     def __signExtend(self, networkTime):
     def __signExtend(self, networkTime):
@@ -316,7 +310,6 @@ class ClockDelta(DirectObject.DirectObject):
         Preserves the lower NetworkTimeBits of the networkTime value,
         Preserves the lower NetworkTimeBits of the networkTime value,
         and extends the sign bit all the way up.
         and extends the sign bit all the way up.
         """
         """
-
         return ((networkTime & NetworkTimeMask) << NetworkTimeTopBits) >> NetworkTimeTopBits
         return ((networkTime & NetworkTimeMask) << NetworkTimeTopBits) >> NetworkTimeTopBits
 
 
 globalClockDelta = ClockDelta()
 globalClockDelta = ClockDelta()

+ 7 - 9
direct/src/fsm/ClassicFSM.py

@@ -115,7 +115,6 @@ class ClassicFSM(DirectObject):
         return(self.__name)
         return(self.__name)
 
 
     def setName(self, name):
     def setName(self, name):
-        """setName(self, string)"""
         self.__name = name
         self.__name = name
 
 
     def getStates(self):
     def getStates(self):
@@ -135,14 +134,12 @@ class ClassicFSM(DirectObject):
         return(self.__initialState)
         return(self.__initialState)
 
 
     def setInitialState(self, initialStateName):
     def setInitialState(self, initialStateName):
-        """setInitialState(self, string)"""
         self.__initialState = self.getStateNamed(initialStateName)
         self.__initialState = self.getStateNamed(initialStateName)
 
 
     def getFinalState(self):
     def getFinalState(self):
         return(self.__finalState)
         return(self.__finalState)
 
 
     def setFinalState(self, finalStateName):
     def setFinalState(self, finalStateName):
-        """setFinalState(self, string)"""
         self.__finalState = self.getStateNamed(finalStateName)
         self.__finalState = self.getStateNamed(finalStateName)
 
 
     def requestFinalState(self):
     def requestFinalState(self):
@@ -155,8 +152,9 @@ class ClassicFSM(DirectObject):
     # lookup funcs
     # lookup funcs
 
 
     def getStateNamed(self, stateName):
     def getStateNamed(self, stateName):
-        """getStateNamed(self, string)
-        Return the state with given name if found, issue warning otherwise"""
+        """
+        Return the state with given name if found, issue warning otherwise
+        """
         state = self.__states.get(stateName)
         state = self.__states.get(stateName)
         if state:
         if state:
             return state
             return state
@@ -211,7 +209,8 @@ class ClassicFSM(DirectObject):
 
 
     def __transition(self, aState, enterArgList=[], exitArgList=[]):
     def __transition(self, aState, enterArgList=[], exitArgList=[]):
         """__transition(self, State, enterArgList, exitArgList)
         """__transition(self, State, enterArgList, exitArgList)
-        Exit currentState and enter given one"""
+        Exit currentState and enter given one
+        """
         assert(not self.__internalStateInFlux)
         assert(not self.__internalStateInFlux)
         self.__internalStateInFlux = 1
         self.__internalStateInFlux = 1
         self.__exitCurrent(exitArgList)
         self.__exitCurrent(exitArgList)
@@ -220,7 +219,7 @@ class ClassicFSM(DirectObject):
 
 
     def request(self, aStateName, enterArgList=[], exitArgList=[],
     def request(self, aStateName, enterArgList=[], exitArgList=[],
                 force=0):
                 force=0):
-        """request(self, string)
+        """
         Attempt transition from currentState to given one.
         Attempt transition from currentState to given one.
         Return true is transition exists to given state,
         Return true is transition exists to given state,
         false otherwise.
         false otherwise.
@@ -309,7 +308,7 @@ class ClassicFSM(DirectObject):
         self.request(aStateName, enterArgList, exitArgList, force=1)
         self.request(aStateName, enterArgList, exitArgList, force=1)
 
 
     def conditional_request(self, aStateName, enterArgList=[], exitArgList=[]):
     def conditional_request(self, aStateName, enterArgList=[], exitArgList=[]):
-        """request(self, string)
+        """
         'if this transition is defined, do it'
         'if this transition is defined, do it'
         Attempt transition from currentState to given one, if it exists.
         Attempt transition from currentState to given one, if it exists.
         Return true if transition exists to given state,
         Return true if transition exists to given state,
@@ -318,7 +317,6 @@ class ClassicFSM(DirectObject):
         ClassicFSM transitions, letting the same fn be used for different states
         ClassicFSM transitions, letting the same fn be used for different states
         that may not have the same out transitions.
         that may not have the same out transitions.
         """
         """
-        
         assert(not self.__internalStateInFlux)
         assert(not self.__internalStateInFlux)
         if not self.__currentState:
         if not self.__currentState:
             # Make this a warning for now
             # Make this a warning for now

+ 27 - 27
direct/src/fsm/State.py

@@ -74,8 +74,6 @@ class State(DirectObject):
     # can transition to any other state
     # can transition to any other state
     Any = 'ANY'
     Any = 'ANY'
 
 
-    """State class: """
-
     def __init__(self, name, enterFunc=None, exitFunc=None,
     def __init__(self, name, enterFunc=None, exitFunc=None,
                  transitions=Any, inspectorPos = []):
                  transitions=Any, inspectorPos = []):
         """__init__(self, string, func, func, string[], inspectorPos = [])
         """__init__(self, string, func, func, string[], inspectorPos = [])
@@ -92,15 +90,12 @@ class State(DirectObject):
     # setters and getters
     # setters and getters
 
 
     def getName(self):
     def getName(self):
-        """getName(self)"""
         return(self.__name)
         return(self.__name)
 
 
     def setName(self, stateName):
     def setName(self, stateName):
-        """setName(self, string)"""
         self.__name = stateName
         self.__name = stateName
 
 
     def getEnterFunc(self):
     def getEnterFunc(self):
-        """getEnterFunc(self)"""
         return(self.__enterFunc)
         return(self.__enterFunc)
 
 
     if __debug__:
     if __debug__:
@@ -130,11 +125,9 @@ class State(DirectObject):
         self.__enterFunc = stateEnterFunc
         self.__enterFunc = stateEnterFunc
 
 
     def getExitFunc(self):
     def getExitFunc(self):
-        """getExitFunc(self)"""
         return(self.__exitFunc)
         return(self.__exitFunc)
 
 
     def setExitFunc(self, stateExitFunc):
     def setExitFunc(self, stateExitFunc):
-        """setExitFunc(self, func)"""
         if __debug__:
         if __debug__:
             self.redefineFunc(self.__exitFunc, stateExitFunc, ExitFuncRedefineMap)
             self.redefineFunc(self.__exitFunc, stateExitFunc, ExitFuncRedefineMap)
         self.__exitFunc = stateExitFunc
         self.__exitFunc = stateExitFunc
@@ -144,7 +137,7 @@ class State(DirectObject):
         return self.__transitions is State.Any
         return self.__transitions is State.Any
 
 
     def getTransitions(self):
     def getTransitions(self):
-        """getTransitions(self)
+        """
         warning -- if the state transitions to any other state,
         warning -- if the state transitions to any other state,
         returns an empty list (falsely implying that the state
         returns an empty list (falsely implying that the state
         has no transitions)
         has no transitions)
@@ -188,34 +181,40 @@ class State(DirectObject):
     # support for HFSMs
     # support for HFSMs
 
 
     def getChildren(self):
     def getChildren(self):
-        """getChildren(self)
-        Return the list of child FSMs"""
+        """
+        Return the list of child FSMs
+        """
         return(self.__FSMList)
         return(self.__FSMList)
 
 
     def setChildren(self, FSMList):
     def setChildren(self, FSMList):
         """setChildren(self, ClassicFSM[])
         """setChildren(self, ClassicFSM[])
-        Set the children to given list of FSMs"""
+        Set the children to given list of FSMs
+        """
         self.__FSMList = FSMList
         self.__FSMList = FSMList
 
 
     def addChild(self, ClassicFSM):
     def addChild(self, ClassicFSM):
-        """addChild(self, ClassicFSM)
-        Add the given ClassicFSM to list of child FSMs"""
+        """
+        Add the given ClassicFSM to list of child FSMs
+        """
         self.__FSMList.append(ClassicFSM)
         self.__FSMList.append(ClassicFSM)
 
 
     def removeChild(self, ClassicFSM):
     def removeChild(self, ClassicFSM):
-        """removeChild(self, ClassicFSM)
-        Remove the given ClassicFSM from list of child FSMs"""
+        """
+        Remove the given ClassicFSM from list of child FSMs
+        """
         if ClassicFSM in self.__FSMList:
         if ClassicFSM in self.__FSMList:
             self.__FSMList.remove(ClassicFSM)
             self.__FSMList.remove(ClassicFSM)
 
 
     def hasChildren(self):
     def hasChildren(self):
-        """hasChildren(self)
-        Return true if state has child FSMs"""
+        """
+        Return true if state has child FSMs
+        """
         return len(self.__FSMList) > 0
         return len(self.__FSMList) > 0
 
 
     def __enterChildren(self, argList):
     def __enterChildren(self, argList):
-        """__enterChildren(self, argList)
-        Enter all child FSMs"""
+        """
+        Enter all child FSMs
+        """
         for fsm in self.__FSMList:
         for fsm in self.__FSMList:
             # Check to see if the child fsm is already in a state
             # Check to see if the child fsm is already in a state
             # if it is, politely request the initial state
             # if it is, politely request the initial state
@@ -233,8 +232,9 @@ class State(DirectObject):
                 fsm.enterInitialState()
                 fsm.enterInitialState()
 
 
     def __exitChildren(self, argList):
     def __exitChildren(self, argList):
-        """__exitChildren(self, argList)
-        Exit all child FSMs"""
+        """
+        Exit all child FSMs
+        """
         for fsm in self.__FSMList:
         for fsm in self.__FSMList:
             fsm.request((fsm.getFinalState()).getName())
             fsm.request((fsm.getFinalState()).getName())
 
 
@@ -242,9 +242,9 @@ class State(DirectObject):
     # basic State functionality
     # basic State functionality
 
 
     def enter(self, argList=[]):
     def enter(self, argList=[]):
-        """enter(self)
-        Call the enter function for this state"""
-
+        """
+        Call the enter function for this state
+        """
         # enter child FSMs first. It is assumed these have a start
         # enter child FSMs first. It is assumed these have a start
         # state that is safe to enter
         # state that is safe to enter
         self.__enterChildren(argList)
         self.__enterChildren(argList)
@@ -253,8 +253,9 @@ class State(DirectObject):
             apply(self.__enterFunc, argList)
             apply(self.__enterFunc, argList)
 
 
     def exit(self, argList=[]):
     def exit(self, argList=[]):
-        """exit(self)
-        Call the exit function for this state"""
+        """
+        Call the exit function for this state
+        """
         # first exit child FSMs
         # first exit child FSMs
         self.__exitChildren(argList)
         self.__exitChildren(argList)
 
 
@@ -263,7 +264,6 @@ class State(DirectObject):
             apply(self.__exitFunc, argList)
             apply(self.__exitFunc, argList)
 
 
     def __str__(self):
     def __str__(self):
-        """__str__(self)"""
         return "State: name = %s, enter = %s, exit = %s, trans = %s, children = %s" %\
         return "State: name = %s, enter = %s, exit = %s, trans = %s, children = %s" %\
                (self.__name, self.__enterFunc, self.__exitFunc, self.__transitions, self.__FSMList)
                (self.__name, self.__enterFunc, self.__exitFunc, self.__transitions, self.__FSMList)
 
 

+ 0 - 1
direct/src/particles/ParticleEffect.py

@@ -155,7 +155,6 @@ class ParticleEffect(NodePath):
         return self.forceGroupDict.get(name, None)
         return self.forceGroupDict.get(name, None)
 
 
     def getForceGroupDict(self):
     def getForceGroupDict(self):
-        """getForceGroup()"""
         return self.forceGroupDict
         return self.forceGroupDict
 
 
     def saveConfig(self, filename):
     def saveConfig(self, filename):