|
From: Kevin A. <al...@se...> - 2005-12-29 21:02:42
|
I moved the dumpDocs formerly in the widgets.py sample into a new
module called documentation.py. The logic is essentially the same, but
the helper methods are now helper functions so they can be used from
any application. To test documenting the background class I just ran
minimal.py with the shell since it has no additional class methods of
its own:
>>> from PythonCard import documentation
>>> documentation.dumpDocs(self)
This will create an HTML file similar to the ones for the components,
but specific to the background object passed in. I need to do a bit
more tweaking, but something similar can then be done for any
combination of background and components in any application, making it
easy to document your own applications as well as just generate a
specific component doc for something that might not be in widgets.py at
the moment.
We still have the problem of the HTML being pretty ugly, but at least
we're making some progress ;-p
One thing you might notice is that method aliases do get documented
properly from wxPython provided doc strings and so on. For example,
Background close is defined as:
close = wx.Frame.Close
so its args are (*args, **kwargs) and the doc string is:
"Close(self, bool force=False) -> bool This function simply generates
a EVT_CLOSE event whose handler usually tries to close the window. It
doesn't close the window itself, however. If force is False (the
default) then the window's close handler will be allowed to veto the
destruction of the window."
Generating component docs from widgets.py should still work the way it
used to. If I managed to break something let me know.
At one point Robin had made modifications to one of the Python
documentation tools. I've posted a question on wxPython-dev to find out
the status of that and see if we might try it out for ourselves as well
to see if it would make for a better reference doc tool.
ka
|