summaryrefslogtreecommitdiffstats
path: root/src/lib/Component.py
diff options
context:
space:
mode:
authorFabian Affolter <fabian@bernewireless.net>2010-06-07 13:26:11 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-06-07 08:42:53 -0500
commit6d2a8b48de43d5a07c8c0ea813f61db30722b320 (patch)
treefad57e3a0ccc188d9fa69c5c93a18346d5d3b558 /src/lib/Component.py
parent3599dc2990dafbacdb5aa54a6bd338850cefa770 (diff)
downloadbcfg2-6d2a8b48de43d5a07c8c0ea813f61db30722b320.tar.gz
bcfg2-6d2a8b48de43d5a07c8c0ea813f61db30722b320.tar.bz2
bcfg2-6d2a8b48de43d5a07c8c0ea813f61db30722b320.zip
Updated files to match PEP 257
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5899 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Component.py')
-rw-r--r--src/lib/Component.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/Component.py b/src/lib/Component.py
index 1a4c35d02..9cdf23b9d 100644
--- a/src/lib/Component.py
+++ b/src/lib/Component.py
@@ -90,6 +90,7 @@ def exposed(func):
def my_method (self, param1, param2):
do_stuff()
my_method = expose(my_method)
+
"""
func.exposed = True
return func
@@ -112,7 +113,6 @@ def readonly(func):
return func
class Component (object):
-
"""Base component.
Intended to be served as an instance by Cobalt.Component.XMLRPCServer
@@ -127,6 +127,7 @@ class Component (object):
Methods:
save -- pickle the component to a file
do_tasks -- perform automatic tasks for the component
+
"""
name = "component"
@@ -137,6 +138,7 @@ class Component (object):
Keyword arguments:
statefile -- file in which to save state automatically
+
"""
self.statefile = kwargs.get("statefile", None)
self.logger = logging.getLogger("%s %s" % (self.implementation, self.name))
@@ -148,6 +150,7 @@ class Component (object):
Automatic tasks are member callables with an attribute
automatic == True.
+
"""
for name, func in inspect.getmembers(self, callable):
if getattr(func, "automatic", False):
@@ -179,6 +182,7 @@ class Component (object):
Arguments:
method_name -- name of the method to resolve
+
"""
try:
func = getattr(self, method_name)
@@ -193,6 +197,7 @@ class Component (object):
method -- XML-RPC method name
args -- tuple of paramaters to method
+
"""
need_to_lock = True
if method in dispatch_dict:
@@ -247,6 +252,7 @@ class Component (object):
Arguments:
method_name -- name of method to get help on
+
"""
try:
func = self._resolve_exposed_method(method_name)