create a child method object This is only possible on server side!! args are nodeid, browsename, method_to_be_called, [input argument types], [output argument types] or idx, name, method_to_be_called, [input argument types], [output argument types] if argument types is specified
(parent, *args)
| 124 | |
| 125 | |
| 126 | def create_method(parent, *args): |
| 127 | """ |
| 128 | create a child method object |
| 129 | This is only possible on server side!! |
| 130 | args are nodeid, browsename, method_to_be_called, [input argument types], [output argument types] |
| 131 | or idx, name, method_to_be_called, [input argument types], [output argument types] |
| 132 | if argument types is specified, child nodes advertising what arguments the method uses and returns will be created |
| 133 | a callback is a method accepting the nodeid of the parent as first argument and variants after. returns a list of variants |
| 134 | """ |
| 135 | nodeid, qname = _parse_nodeid_qname(*args[:2]) |
| 136 | callback = args[2] |
| 137 | if len(args) > 3: |
| 138 | inputs = args[3] |
| 139 | else: |
| 140 | inputs = [] |
| 141 | if len(args) > 4: |
| 142 | outputs = args[4] |
| 143 | else: |
| 144 | outputs = [] |
| 145 | return node.Node(parent.server, _create_method(parent, nodeid, qname, callback, inputs, outputs)) |
| 146 | |
| 147 | |
| 148 | def _create_object(server, parentnodeid, nodeid, qname, objecttype): |
nothing calls this directly
no test coverage detected