Initial checkin of new API implementation
[plcapi.git] / PLC / Methods / system / methodHelp.py
1 from PLC.Method import Method
2 from PLC.Parameter import Parameter
3
4 class methodHelp(Method):
5     """
6     Returns help text if defined for the method passed, otherwise
7     returns an empty string.
8     """
9
10     roles = []
11     accepts = [Parameter(str, 'Method name')]
12     returns = Parameter(str, 'Method help')
13
14     def __init__(self, api):
15         Method.__init__(self, api)
16         self.name = "system.methodHelp"
17
18     def call(self, method):
19         function = self.api.callable(method)
20         return function.help()