From 6d2a8b48de43d5a07c8c0ea813f61db30722b320 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 7 Jun 2010 13:26:11 +0000 Subject: Updated files to match PEP 257 git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5899 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Component.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lib/Component.py') 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) -- cgit v1.2.3-1-g7c22