Help command in jython shell

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Help command in jython shell

Post by joleenf »

Hi,

Is there a help command for documentation within the jython shell which would dump the help for commands such as buildWindow?

print dumpObj(buidWindow) is directed toward information programmer could use, buildWindow.__doc__ does not return any useful documentation for a user.

The only way to get the documentation is to search in the help window. It is much quicker to type help(buildWindow) or something like that.

Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: Help command in jython shell

Post by bobc »

Hi Joleen -

From Jon B, 'help' might never work for java code (at least with the current Jython Shell), so your approach of 'print buildWindow.__doc__' is the way to go for documentation. Some functions currently have better docstrings than others. As you noted, buildWindow doesn't have a very good docstring, but we can improve this. There are other functions that do currently have good doc, such as openBundle and getADDEImage.

To get help for methods, such as annotate and setViewpoint, you can run: print _Display.annotate.__doc__ and print _Display.setViewpoint.__doc__. Another approach to this would be:

Code: Select all

d = activeDisplay()
print d.__doc__ # if _Display had a docstring (it needs one)
print d.annotate.__doc__
# and so on

We have created Inquiry 1780 to add docstrings to every function/method in McIDAS-V.

Thanks -
Bob Carp
Post Reply