plugin: format docstring as rst

Change-Id: I14de69e743aece44b496aa62e89a8066b1fdde67
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou
2013-02-11 16:49:02 +01:00
parent 01f46b7a01
commit 39ae236ece

View File

@@ -56,11 +56,16 @@ class NotificationBase(PluginBase):
@abc.abstractmethod @abc.abstractmethod
def get_exchange_topics(self, conf): def get_exchange_topics(self, conf):
"""Return a sequence of ExchangeTopics defining the exchange and """Return a sequence of ExchangeTopics defining the exchange and
topics to be connected for this plugin.""" topics to be connected for this plugin.
:param conf: Configuration.
"""
@abc.abstractmethod @abc.abstractmethod
def process_notification(self, message): def process_notification(self, message):
"""Return a sequence of Counter instances for the given message.""" """Return a sequence of Counter instances for the given message.
:param message: Message to process."""
def notification_to_metadata(self, event): def notification_to_metadata(self, event):
"""Transform a payload dict to a metadata dict.""" """Transform a payload dict to a metadata dict."""
@@ -94,7 +99,7 @@ class PublisherBase(PluginBase):
@abc.abstractmethod @abc.abstractmethod
def publish_counters(self, context, counters, source): def publish_counters(self, context, counters, source):
"Publish counters into final conduit" "Publish counters into final conduit."
class TransformerBase(PluginBase): class TransformerBase(PluginBase):
@@ -104,29 +109,28 @@ class TransformerBase(PluginBase):
@abc.abstractmethod @abc.abstractmethod
def handle_sample(self, context, counter, source): def handle_sample(self, context, counter, source):
"""Transform a counter """Transform a counter.
parameter:
context: Passed from the data collector
counters: An interator of counters.
source: Passed from data collector.
:param context: Passed from the data collector.
:param counter: A counter.
:param source: Passed from data collector.
""" """
def flush(self, context, source): def flush(self, context, source):
"""Flush counters cached previously""" """Flush counters cached previously.
:param context: Passed from the data collector.
:param source: Source of counters that are being published."""
return [] return []
def __init__(self, **parameter): def __init__(self, **kwargs):
"""Setup transformer """Setup transformer.
Each time a transformed is involved in a pipeline, a new transformer Each time a transformed is involved in a pipeline, a new transformer
instance is created and chained into the pipeline. i.e. transformer instance is created and chained into the pipeline. i.e. transformer
instance is per pipeline. This helps if transformer need keep some instance is per pipeline. This helps if transformer need keep some
cache and per-pipeline information. cache and per-pipeline information.
parameter: :param kwargs: The parameters that are defined in pipeline config file.
kwds: the parameter that is defined in pipeline config file
""" """
super(TransformerBase, self).__init__() super(TransformerBase, self).__init__()