Fix up some docstrings

This commit is contained in:
Andrew Resch 2010-03-25 14:43:15 -07:00
parent e7e480cf3e
commit 73db03a33b

View File

@ -58,7 +58,7 @@ class Component(object):
Deluge core. Deluge core.
**update()** - This method is called every 1 second by default while the **update()** - This method is called every 1 second by default while the
Componented is in a "Started" state. The interval can be Componented is in a *Started* state. The interval can be
specified during instantiation. The update() timer can be specified during instantiation. The update() timer can be
paused by instructing the :class:`ComponentRegistry` to pause paused by instructing the :class:`ComponentRegistry` to pause
this Component. this Component.
@ -67,6 +67,18 @@ class Component(object):
Component is in a "Started" state when this is called, a Component is in a "Started" state when this is called, a
call to stop() will be issued prior to shutdown(). call to stop() will be issued prior to shutdown().
**States:**
A Component can be in one of these 3 states.
**Started** - The Component has been started by the :class:`ComponentRegistry`
and will have it's update timer started.
**Stopped** - The Component has either been stopped or has yet to be started.
**Paused** - The Component has had it's update timer stopped, but will
still be considered in a Started state.
""" """
def __init__(self, name, interval=1, depend=None): def __init__(self, name, interval=1, depend=None):
self._component_name = name self._component_name = name
@ -172,8 +184,7 @@ class ComponentRegistry(object):
:param obj: the Component object :param obj: the Component object
:type obj: object :type obj: object
:raises ComponentAlreadyRegistered: if a component with the same name :raises ComponentAlreadyRegistered: if a component with the same name is already registered.
is already registered.
""" """
name = obj._component_name name = obj._component_name
@ -205,15 +216,14 @@ class ComponentRegistry(object):
def start(self, names=[]): def start(self, names=[]):
""" """
Starts Components that are currently in a Stopped state and their Starts Components that are currently in a Stopped state and their
dependencies. If :param:`names` is specified, will only start those dependencies. If *names* is specified, will only start those
Components and their dependencies and if not it will start all Components and their dependencies and if not it will start all
registered components. registered components.
:param names: a list of Components to start :param names: a list of Components to start
:type names: list :type names: list
:returns: a Deferred object that will fire once all Components have been :returns: a Deferred object that will fire once all Components have been sucessfully started
sucessfully started
:rtype: twisted.internet.defer.Deferred :rtype: twisted.internet.defer.Deferred
""" """
@ -242,14 +252,13 @@ class ComponentRegistry(object):
def stop(self, names=[]): def stop(self, names=[]):
""" """
Stops Components that are currently not in a Stopped state. If Stops Components that are currently not in a Stopped state. If
:param:`names` is specified, then it will only stop those Components, *names* is specified, then it will only stop those Components,
and if not it will stop all the registered Components. and if not it will stop all the registered Components.
:param names: a list of Components to start :param names: a list of Components to start
:type names: list :type names: list
:returns: a Deferred object that will fire once all Components have been :returns: a Deferred object that will fire once all Components have been sucessfully stopped
sucessfully stopped
:rtype: twisted.internet.defer.Deferred :rtype: twisted.internet.defer.Deferred
""" """
@ -269,14 +278,13 @@ class ComponentRegistry(object):
def pause(self, names=[]): def pause(self, names=[]):
""" """
Pauses Components that are currently in a Started state. If Pauses Components that are currently in a Started state. If
:param:`names` is specified, then it will only pause those Components, *names* is specified, then it will only pause those Components,
and if not it will pause all the registered Components. and if not it will pause all the registered Components.
:param names: a list of Components to pause :param names: a list of Components to pause
:type names: list :type names: list
:returns: a Deferred object that will fire once all Components have been :returns: a Deferred object that will fire once all Components have been sucessfully paused
sucessfully paused
:rtype: twisted.internet.defer.Deferred :rtype: twisted.internet.defer.Deferred
""" """
@ -296,14 +304,13 @@ class ComponentRegistry(object):
def resume(self, names=[]): def resume(self, names=[]):
""" """
Resumes Components that are currently in a Paused state. If Resumes Components that are currently in a Paused state. If
:param:`names` is specified, then it will only resume those Components, *names* is specified, then it will only resume those Components,
and if not it will resume all the registered Components. and if not it will resume all the registered Components.
:param names: a list of Components to resume :param names: a list of Components to resume
:type names: list :type names: list
:returns: a Deferred object that will fire once all Components have been :returns: a Deferred object that will fire once all Components have been sucessfully resumed
sucessfully resumed
:rtype: twisted.internet.defer.Deferred :rtype: twisted.internet.defer.Deferred
""" """
@ -327,8 +334,7 @@ class ComponentRegistry(object):
be called when the program is exiting to ensure all Components have a be called when the program is exiting to ensure all Components have a
chance to properly shutdown. chance to properly shutdown.
:returns: a Deferred object that will fire once all Components have been :returns: a Deferred object that will fire once all Components have been sucessfully resumed
sucessfully resumed
:rtype: twisted.internet.defer.Deferred :rtype: twisted.internet.defer.Deferred
""" """