Author: ArcRiley Date: 2008-09-03 14:03:20 -0400 (Wed, 03 Sep 2008) New Revision: 1354
Modified: trunk/pysoy/src/actions/Action.pym trunk/pysoy/src/actions/Callback.pym trunk/pysoy/src/actions/Force.pym trunk/pysoy/src/actions/Print.pym trunk/pysoy/src/actions/Quit.pym trunk/pysoy/src/actions/Torque.pym trunk/pysoy/src/actions/__init__.pym Log: No Ticket : * various cleanup in code, comments, and docs * changed term "activated" to "performed" Modified: trunk/pysoy/src/actions/Action.pym =================================================================== --- trunk/pysoy/src/actions/Action.pym 2008-09-03 08:46:36 UTC (rev 1353) +++ trunk/pysoy/src/actions/Action.pym 2008-09-03 18:03:20 UTC (rev 1354) @@ -20,8 +20,7 @@ cdef class Action : '''soy.actions.Action - This is the base Action class which all actions must inherit. - It serves no other purpose. + This is the base Action class which all L{actions<soy.actions>} inherit. ''' ############################################################################ @@ -34,6 +33,8 @@ @rtype : string @return : class name ''' + # + # This eliminates having to include a __repr__ with every action class return '<%s>' % self.__class__.__name__ @@ -44,5 +45,5 @@ cdef void _perform(self, unsigned int _duration) : # - # Action does nothing, this function is here only to be replaced + # Action performs nothing, this function is here only to be replaced return Modified: trunk/pysoy/src/actions/Callback.pym =================================================================== --- trunk/pysoy/src/actions/Callback.pym 2008-09-03 08:46:36 UTC (rev 1353) +++ trunk/pysoy/src/actions/Callback.pym 2008-09-03 18:03:20 UTC (rev 1354) @@ -17,12 +17,10 @@ # # $Id$ -cimport py - cdef class Callback (Action) : '''soy.actions.Callback - This L{action<soy.action.Action>} calls a Python function when activated. + This L{action<soy.action.Action>} calls a Python function when performed. @type callback : function @param callback : Python function to be called when action is performed Modified: trunk/pysoy/src/actions/Force.pym =================================================================== --- trunk/pysoy/src/actions/Force.pym 2008-09-03 08:46:36 UTC (rev 1353) +++ trunk/pysoy/src/actions/Force.pym 2008-09-03 18:03:20 UTC (rev 1354) @@ -20,8 +20,8 @@ cdef class Force (Action) : '''soy.actions.Force - This L{action<soy.action.Action>} adds linear force (velocity) to a target - L{body<soy.bodies.Body>} when activated. + This L{action<soy.action.Action>} adds a force L{vector<soy.atoms.Vector>} + to a target L{body<soy.bodies.Body>} when performed. @type target : soy.bodies.Body @param target : Body which force will be applied to @@ -34,13 +34,12 @@ # Python functions # - def __cinit__(self, target, vector, *args, **kw) : - if not isinstance(target, soy.bodies.Body) : - raise TypeError('first argument must be an instance of soy.bodies.Body') - if not isinstance(vector, soy.atoms.Vector) : - raise TypeError('second argument must be an instance of soy.atoms.Vector') - self._target = target - self._vector = vector + def __cinit__(self, soy.bodies.Body _target, soy.atoms.Vector _vector, + *args, **kw) : + # + # Store these values for later performance + self._target = _target + self._vector = _vector ############################################################################ Modified: trunk/pysoy/src/actions/Print.pym =================================================================== --- trunk/pysoy/src/actions/Print.pym 2008-09-03 08:46:36 UTC (rev 1353) +++ trunk/pysoy/src/actions/Print.pym 2008-09-03 18:03:20 UTC (rev 1354) @@ -20,7 +20,7 @@ cdef class Print (Action) : '''soy.actions.Print - This L{action<soy.action.Action>} prints the specified text on activation. + This L{action<soy.action.Action>} prints the specified text on performance. Note that as of Python 3.0, this class will use the standard print function which can be overridden for adjustable behavior. Modified: trunk/pysoy/src/actions/Quit.pym =================================================================== --- trunk/pysoy/src/actions/Quit.pym 2008-09-03 08:46:36 UTC (rev 1353) +++ trunk/pysoy/src/actions/Quit.pym 2008-09-03 18:03:20 UTC (rev 1354) @@ -20,7 +20,7 @@ cdef class Quit (Action) : '''soy.actions.Quit - This L{action<soy.action.Action>} terminates Python when activated. + This L{action<soy.action.Action>} terminates Python when performed. ''' ############################################################################ @@ -29,4 +29,6 @@ # cdef void _perform(self, unsigned int _duration) : + # + # This signal is caught to terminate all threads stdio.c_raise(15) Modified: trunk/pysoy/src/actions/Torque.pym =================================================================== --- trunk/pysoy/src/actions/Torque.pym 2008-09-03 08:46:36 UTC (rev 1353) +++ trunk/pysoy/src/actions/Torque.pym 2008-09-03 18:03:20 UTC (rev 1354) @@ -20,8 +20,8 @@ cdef class Torque (Action) : '''soy.actions.Torque - This L{action<soy.action.Action>} adds rotational force (torque) to a - target L{body<soy.bodies.Body>} when activated. + This L{action<soy.action.Action>} adds a torque L{axis<soy.atoms.Axis>} + to a target L{body<soy.bodies.Body>} when performed. U{Right hand rule<http://en.wikipedia.org/wiki/Right_hand_rule>}; When you hold your right fist with your thumb out in the direction of @@ -39,13 +39,12 @@ # Python functions # - def __cinit__(self, target, vector, *args, **kw) : - if not isinstance(target, soy.bodies.Body) : - raise TypeError('first argument must be an instance of soy.bodies.Body') - if not isinstance(vector, soy.atoms.Axis) : - raise TypeError('second argument must be an instance of soy.atoms.Axis') - self._target = target - self._vector = vector + def __cinit__(self, soy.bodies.Body _target, soy.atoms.Axis _vector, + *args, **kw) : + # + # Store these values for later performance + self._target = _target + self._vector = _vector ############################################################################ Modified: trunk/pysoy/src/actions/__init__.pym =================================================================== --- trunk/pysoy/src/actions/__init__.pym 2008-09-03 08:46:36 UTC (rev 1353) +++ trunk/pysoy/src/actions/__init__.pym 2008-09-03 18:03:20 UTC (rev 1354) @@ -24,4 +24,5 @@ __version__ = 'Trunk (r'+'$Rev$'[6:-2]+')' cimport ode +cimport py cimport stdio _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn