X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethod.py;fp=PLC%2FMethod.py;h=783bc5d25307e77918cd7a3dcdfd99a6cde287c6;hb=31996e41f306bb850e9309aaaf8d157137ece1f4;hp=275316fbe7d43d83e04173b1ff4232533001af91;hpb=880e7c2c999eb2795ec3354c3e829cd1a62cf7c9;p=plcapi.git diff --git a/PLC/Method.py b/PLC/Method.py index 275316f..783bc5d 100644 --- a/PLC/Method.py +++ b/PLC/Method.py @@ -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