====
[plcapi.git] / PLC / Method.py
index 275316f..571c3eb 100644 (file)
@@ -16,7 +16,7 @@ from types import StringTypes
 from PLC.Faults import *
 from PLC.Parameter import Parameter, Mixed, python_type, xmlrpc_type
 from PLC.Auth import Auth
-from PLC.Debug import profile, log
+from PLC.Debug import profile
 from PLC.Events import Event, Events
 from PLC.Nodes import Node, Nodes
 from PLC.Persons import Person, Persons
@@ -59,13 +59,18 @@ class Method (object):
 
         return True
 
-    def __init__(self, api):
+    def __init__(self, api,caller=None):
         self.name = self.__class__.__name__
         self.api = api
 
-        # Auth may set this to a Person instance (if an anonymous
-        # method, will remain None).
-        self.caller = None
+        if caller: 
+            # let a method call another one by propagating its caller
+            self.caller=caller
+        else:
+            # Auth may set this to a Person instance (if an anonymous
+            # method, will remain None).
+            self.caller = None
+        
 
         # API may set this to a (addr, port) tuple if known
         self.source = None