From cf7b81f367b9c9403412bd7dc2ad4e4cc5c1c6c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Wi=C5=9Bniewski?= Date: Fri, 30 Jun 2023 10:23:20 +0200 Subject: [PATCH] added get_library_information, that uses get_keyword_names etc. --- src/robotremoteserver.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/robotremoteserver.py b/src/robotremoteserver.py index 85ec555..2ea0f8a 100644 --- a/src/robotremoteserver.py +++ b/src/robotremoteserver.py @@ -88,6 +88,7 @@ def _register_functions(self, server): server.register_function(self.run_keyword) server.register_function(self.get_keyword_arguments) server.register_function(self.get_keyword_documentation) + server.register_function(self.get_library_information) server.register_function(self.stop_remote_server) @property @@ -189,6 +190,19 @@ def get_keyword_documentation(self, name): 'Return ``True/False`` depending was server stopped or not.') return self._library.get_keyword_documentation(name) + def get_library_information(self): + info = dict() + for keyword in self.get_keyword_names(): + info[keyword] = dict( + args=self.get_keyword_arguments(keyword), + tags=self.get_keyword_tags(keyword), + doc=self.get_keyword_documentation(keyword), + types=[] + ) + info['__intro__'] = dict(doc=self.get_keyword_documentation('__intro__')) + info['__init__'] = dict(doc=self.get_keyword_documentation('__init__')) + return info + def get_keyword_tags(self, name): if name == 'stop_remote_server': return []