From 92bc95f86a834b2853c77bbbfa1c0021213e1e17 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 19 Sep 2012 11:40:52 -0400 Subject: documented Packages base class --- src/lib/Bcfg2/Server/Plugin/base.py | 11 +++++++++++ src/lib/Bcfg2/Server/Plugin/interfaces.py | 10 ++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugin') diff --git a/src/lib/Bcfg2/Server/Plugin/base.py b/src/lib/Bcfg2/Server/Plugin/base.py index 6b75bd174..74ec6df39 100644 --- a/src/lib/Bcfg2/Server/Plugin/base.py +++ b/src/lib/Bcfg2/Server/Plugin/base.py @@ -3,6 +3,7 @@ import os import logging + class Debuggable(object): """ Mixin to add a debugging interface to an object and expose it via XML-RPC on :class:`Bcfg2.Server.Plugin.base.Plugin` objects """ @@ -11,6 +12,14 @@ class Debuggable(object): __rmi__ = ['toggle_debug'] def __init__(self, name=None): + """ + :param name: The name of the logger object to get. If none is + supplied, the full name of the class (including + module) will be used. + :type name: string + + .. autoattribute:: __rmi__ + """ if name is None: name = "%s.%s" % (self.__class__.__module__, self.__class__.__name__) @@ -92,6 +101,8 @@ class Plugin(Debuggable): filesystem :type datastore: string :raises: :class:`Bcfg2.Server.Plugin.exceptions.PluginInitError` + + .. autoattribute:: __rmi__ """ object.__init__(self) self.Entries = {} diff --git a/src/lib/Bcfg2/Server/Plugin/interfaces.py b/src/lib/Bcfg2/Server/Plugin/interfaces.py index ea0b50233..59f3636fb 100644 --- a/src/lib/Bcfg2/Server/Plugin/interfaces.py +++ b/src/lib/Bcfg2/Server/Plugin/interfaces.py @@ -10,6 +10,7 @@ from Bcfg2.Compat import Queue, Empty, Full, cPickle from exceptions import * from base import Plugin + class Generator(object): """ Generator plugins contribute to literal client configurations. That is, they generate entry contents. @@ -46,7 +47,7 @@ class Generator(object): return False def HandleEntry(self, entry, metadata): - """ HandlesEntry is the slow path method for binding + """ HandleEntry is the slow path method for binding configuration binding requests. It is called if the ``Entries`` dict does not contain a method for binding the entry, and :func:`HandlesEntry` @@ -230,7 +231,7 @@ class Connector(object): :param metadata: The client metadata :type metadata: Bcfg2.Server.Plugins.Metadata.ClientMetadata - :return: list of strings + :return: dict """ return dict() @@ -473,8 +474,9 @@ class StructureValidator(object): :param metadata: The client metadata :type metadata: Bcfg2.Server.Plugins.Metadata.ClientMetadata :param config: A list of lxml.etree._Element objects - describing the structures for this client - :type config: list + describing the structures (i.e., bundles) for + this client. This can be modified in place. + :type config: list of lxml.etree._Element :returns: None :raises: :class:`Bcfg2.Server.Plugin.exceptions.ValidationError` """ -- cgit v1.2.3-1-g7c22