From c176b0e336a59c7efe312e2aabc1aee57b4a533a Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Fri, 4 Nov 2005 22:16:25 +0000 Subject: [PATCH] formatting --- direct/src/directnotify/Logger.py | 5 +++-- direct/src/directutil/Mopath.py | 2 -- .../src/distributed/DistributedSmoothNode.py | 8 ++----- direct/src/gui/OnscreenGeom.py | 3 +-- direct/src/gui/OnscreenImage.py | 3 +-- direct/src/interval/ActorInterval.py | 2 -- direct/src/interval/MopathInterval.py | 4 ++-- direct/src/leveleditor/LevelEditor.py | 2 +- direct/src/showbase/LerpBlendHelpers.py | 2 +- direct/src/showbase/ShowBase.py | 6 +----- direct/src/task/Timer.py | 21 ------------------- direct/src/tkpanels/NotifyPanel.py | 2 +- direct/src/tkpanels/TaskManagerPanel.py | 2 +- 13 files changed, 14 insertions(+), 48 deletions(-) diff --git a/direct/src/directnotify/Logger.py b/direct/src/directnotify/Logger.py index 3a907e8f81..0df916ed79 100644 --- a/direct/src/directnotify/Logger.py +++ b/direct/src/directnotify/Logger.py @@ -7,8 +7,9 @@ import math class Logger: def __init__(self, fileName="log"): - """__init__(self) - Logger constructor""" + """ + Logger constructor + """ self.__timeStamp = 1 self.__startTime = 0.0 self.__logFile = None diff --git a/direct/src/directutil/Mopath.py b/direct/src/directutil/Mopath.py index 7fee3909df..fec9e60e68 100644 --- a/direct/src/directutil/Mopath.py +++ b/direct/src/directutil/Mopath.py @@ -82,8 +82,6 @@ class Mopath(PandaObject): return tIn def getFinalState(self): - """ getFinalState() - """ pos = Point3(0) if (self.xyzNurbsCurve != None): self.xyzNurbsCurve.getPoint(self.maxT, pos) diff --git a/direct/src/distributed/DistributedSmoothNode.py b/direct/src/distributed/DistributedSmoothNode.py index b17b4253bd..9ae9518086 100644 --- a/direct/src/distributed/DistributedSmoothNode.py +++ b/direct/src/distributed/DistributedSmoothNode.py @@ -143,12 +143,10 @@ class DistributedSmoothNode(DistributedNode.DistributedNode, def forceToTruePosition(self): - """forceToTruePosition(self) - + """ This forces the node to reposition itself to its latest known position. This may result in a pop as the node skips the last of its lerp points. - """ if (not self.isLocal()) and \ self.smoother.getLatestPosition(): @@ -156,13 +154,11 @@ class DistributedSmoothNode(DistributedNode.DistributedNode, self.smoother.clearPositions(1) def reloadPosition(self): - """reloadPosition(self) - + """ This function re-reads the position from the node itself and clears any old position reports for the node. This should be used whenever show code bangs on the node position and expects it to stick. - """ self.smoother.clearPositions(0) self.smoother.setMat(self.getMat()) diff --git a/direct/src/gui/OnscreenGeom.py b/direct/src/gui/OnscreenGeom.py index b062acf6c5..f06aa6d365 100644 --- a/direct/src/gui/OnscreenGeom.py +++ b/direct/src/gui/OnscreenGeom.py @@ -11,8 +11,7 @@ class OnscreenGeom(PandaObject, NodePath): color = None, parent = None, sort = 0): - """__init__(self, ...) - + """ Make a geom node from string or a node path, put it into the 2d sg and set it up with all the indicated parameters. diff --git a/direct/src/gui/OnscreenImage.py b/direct/src/gui/OnscreenImage.py index 350711ec94..bba5c06351 100644 --- a/direct/src/gui/OnscreenImage.py +++ b/direct/src/gui/OnscreenImage.py @@ -11,8 +11,7 @@ class OnscreenImage(PandaObject, NodePath): color = None, parent = None, sort = 0): - """__init__(self, ...) - + """ Make a image node from string or a node path, put it into the 2d sg and set it up with all the indicated parameters. diff --git a/direct/src/interval/ActorInterval.py b/direct/src/interval/ActorInterval.py index 40f1cd9bae..c9f44ea2b4 100644 --- a/direct/src/interval/ActorInterval.py +++ b/direct/src/interval/ActorInterval.py @@ -40,8 +40,6 @@ class ActorInterval(Interval.Interval): startFrame=None, endFrame=None, playRate=1.0, name=None, forceUpdate=0, partName=None, lodName=None): - """__init__(name) - """ # Generate unique id id = 'Actor-%s-%d' % (animName, ActorInterval.animNum) ActorInterval.animNum += 1 diff --git a/direct/src/interval/MopathInterval.py b/direct/src/interval/MopathInterval.py index 37e4d5c025..2dcae93d24 100644 --- a/direct/src/interval/MopathInterval.py +++ b/direct/src/interval/MopathInterval.py @@ -34,8 +34,8 @@ class MopathInterval(LerpInterval.LerpFunctionInterval): self.node = node def __doMopath(self, t): - """ updateFunc(t, event) - Go to time t + """ + Go to time t """ self.mopath.goTo(self.node, t) diff --git a/direct/src/leveleditor/LevelEditor.py b/direct/src/leveleditor/LevelEditor.py index 8ea95b03e9..2d01f3baff 100644 --- a/direct/src/leveleditor/LevelEditor.py +++ b/direct/src/leveleditor/LevelEditor.py @@ -792,7 +792,7 @@ class LevelEditor(NodePath, PandaObject): self.traversalOn() def configureDriveModeCollisionData(self): - """initializeCollisions(self) + """ Set up the local avatar for collisions """ # Set up the collision sphere diff --git a/direct/src/showbase/LerpBlendHelpers.py b/direct/src/showbase/LerpBlendHelpers.py index 6941c3df35..f3fbc10020 100644 --- a/direct/src/showbase/LerpBlendHelpers.py +++ b/direct/src/showbase/LerpBlendHelpers.py @@ -14,7 +14,7 @@ noBlend = NoBlendType() def getBlend(blendType): - """getBlend(string) + """ Return the C++ blend class corresponding to blendType string """ # Note, this is temporary until blend functions get exposed diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index b1009430b9..398f2d712b 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -976,8 +976,7 @@ class ShowBase(DirectObject.DirectObject): mw.node().addRegion(PGMouseWatcherBackground()) def enableSoftwareMousePointer(self): - """enableSoftwareMousePointer(self) - + """ Creates some geometry and parents it to render2d to show the currently-known mouse position. Useful if the mouse pointer is invisible for some reason. @@ -1007,21 +1006,18 @@ class ShowBase(DirectObject.DirectObject): KeyboardButton.control()) def addAngularIntegrator(self): - """addAngularIntegrator(self)""" if (self.physicsMgrAngular == 0): self.physicsMgrAngular = 1 integrator = AngularEulerIntegrator() self.physicsMgr.attachAngularIntegrator(integrator) def enableParticles(self): - """enableParticles(self)""" self.particleMgrEnabled = 1 self.physicsMgrEnabled = 1 self.taskMgr.remove('manager-update') self.taskMgr.add(self.updateManagers, 'manager-update') def disableParticles(self): - """enableParticles(self)""" self.particleMgrEnabled = 0 self.physicsMgrEnabled = 0 self.taskMgr.remove('manager-update') diff --git a/direct/src/task/Timer.py b/direct/src/task/Timer.py index 7b816b070a..27d481c9ad 100644 --- a/direct/src/task/Timer.py +++ b/direct/src/task/Timer.py @@ -2,12 +2,9 @@ from pandac.PandaModules import * import Task class Timer: - id = 0 def __init__(self, name=None): - """ __init__() - """ self.finalT = 0.0 self.currT = 0.0 if (name == None): @@ -18,8 +15,6 @@ class Timer: self.callback = None def start(self, t, name): - """ start(t, name) - """ if (self.started): self.stop() self.callback = None @@ -31,8 +26,6 @@ class Timer: self.started = 1 def startCallback(self, t, callback): - """ startCallback(t, callback) - """ if (self.started): self.stop() self.callback = callback @@ -43,8 +36,6 @@ class Timer: self.started = 1 def stop(self): - """ stop() - """ if (not self.started): return 0.0 taskMgr.remove(self.name + '-run') @@ -52,38 +43,26 @@ class Timer: return self.currT def resume(self): - """ resume() - """ assert(self.currT <= self.finalT) assert(self.started == 0) self.start(self.finalT - self.currT, self.name) def restart(self): - """ restart() - """ if (self.callback != None): self.startCallback(self.finalT, self.callback) else: self.start(self.finalT, self.name) def isStarted(self): - """ isStarted() - """ return self.started def addT(self, t): - """ addT(t) - """ self.finalT = self.finalT + t def setT(self, t): - """ setT(t) - """ self.finalT = t def getT(self): - """ getT() - """ return (self.finalT - self.currT) def __timerTask(self, task): diff --git a/direct/src/tkpanels/NotifyPanel.py b/direct/src/tkpanels/NotifyPanel.py index 7f8a190bd1..6db4b35274 100644 --- a/direct/src/tkpanels/NotifyPanel.py +++ b/direct/src/tkpanels/NotifyPanel.py @@ -4,7 +4,7 @@ class NotifyPanel: a panel to control direct/panda notify categories.""" def __init__(self, directNotify, tl = None): - """__init__(self) + """ NotifyPanel class pops up a control panel to view/set notify levels for all available DIRECT and PANDA notify categories """ diff --git a/direct/src/tkpanels/TaskManagerPanel.py b/direct/src/tkpanels/TaskManagerPanel.py index 15b552fff4..8a6ebd8c32 100644 --- a/direct/src/tkpanels/TaskManagerPanel.py +++ b/direct/src/tkpanels/TaskManagerPanel.py @@ -41,7 +41,7 @@ class TaskManagerWidget(PandaObject): """ def __init__(self, parent, taskMgr): - """__init__(self) + """ TaskManagerWidget class pops up a control panel to view/delete tasks managed by the taskManager. """