From 9a7ca6440abb970bbf163d2b1f5609cd8a38ad39 Mon Sep 17 00:00:00 2001 From: Mansard <nmansard@laas.fr> Date: Tue, 18 Jan 2011 17:20:08 +0100 Subject: [PATCH] Added an helper to get the commands list and doc. --- src/dynamic_graph/entity.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/dynamic_graph/entity.py b/src/dynamic_graph/entity.py index 37c5705..c59d656 100644 --- a/src/dynamic_graph/entity.py +++ b/src/dynamic_graph/entity.py @@ -81,3 +81,25 @@ class Entity (object) : """ wrap.entity_display_signals(self.obj) + def signals(self) : + self.displaySignals() + + + def commands(self): + return wrap.entity_list_commands(self.obj) + + def globalHelp(self): + for cstr in self.commands(): + ctitle=cstr+':' + for i in range(len(cstr),15): + ctitle+=' ' + for docstr in wrap.entity_get_command_docstring(self.obj,cstr).split('\n'): + if (len(docstr)>0) and (not docstr.isspace()): + print ctitle+"\t"+docstr + break + + def help( self,comm=None ): + if comm is None: + self.globalHelp() + else: + print comm+":\n"+wrap.entity_get_command_docstring(self.obj,comm) -- GitLab