Sphinxed Phoenix Documentation 2

Hi All,

    I have committed all my Python scripts to generate the ReST
docstrings input for Sphinx, plus some more things, into the latest
SVN Phoenix branch. In addition to the scripts, this is what I have
done:

1) I have translated all the wxWidgets overviews for the classes
ported to Phoenix until now (25 *.rst files into the
"docs/sphinx/rest_substitutions/overviews/" folder

2) All the C++ snippet of code present in the wxWidgets XML docstrings
have been translated for the classes ported to Phoenix up to now,
except a few of them for which I have no idea of how to translate them
or if even it makes sense to translate them (my scripts will issue a
warning if they find an unconverted snippet of code, so you can see
which ones they are). They live in the
"docs/sphinx/rest_substitutions/snippets/python/converted" folder for
the converted Python ones, and in the
"docs/sphinx/rest_substitutions/snippets/cpp" folder for the raw C++
ones (these gets generated at runtime, so you won't see them in the
SVN commit).

3) I have merged some of the screenshots of widgets Werner has sent me
(sorry I didn't have time to put them all in, I'll do it soon). These
are only MSW screenshots. A special thanks to Werner for all the
screenies he has sent me the last few days, impressive job.

4) I have slightly modified 3 or 4 of already existing Python files in
SVN, namely the extractors.py, generators.py and tweaker_tools.py,
together with the main build.py script to add the documentation
building process. In this regard, the way you call the building script
should be:

python build.py touch etg sphinx

the "sphinx" command must always be the last one called, as it depends
on what the generators do during the "etg" command If you have already
run the "touch etg" commands, then you can simply write:

python build.py sphinx

And this will create the HTML documentation.

5) The newly generated documentation is here:

http://xoomer.virgilio.it/infinity77/Phoenix/main.html

I didn't manage to put docstrings and comment everywhere into my
Python scripts, but this is something I will have to do because some
hacks really need clarifications. I am committing this stuff now as I
am going to Kenya for 2 weeks on holiday and I won't even look at a
computer for those 15 days :smiley: . In any case, if the developers can
resist the urge of heavily modifying the Python scripts in the
"sphinxtools" folder and the "sphinx_generator.py" file for 15 days,
then I'll complete the docstrings and comment them all so it will be
clearer what they are actually doing. I will also take a look at if
(and how) the scripts may break once Robin/Kevin start adding more and
more new classes to Phoenix.

In some places the scripts may seem a bit too convoluted, but you
should have seen the mess they were before I refactored them
completely during the last week.

** NOTE **: if any developer wishes to add some more documentation
stuff (like new overviews, other pure-Python specific stuff,
whatever), please **do not** use the *.txt extension if you work in
any of the /docs/sphinx/ sub-folders. Please use the *.rst format.
There is no problem if you work on a higher level folder (right now we
have the MigrationGuide.txt and the TODO.txt files up in the directory
hierarchy).

The various sub-folders I have created in the SVN repository will need
some kind of README, but I really have run out of time. I'll do it
when I get back.

There are a number of wxWidgets documentation bugs I found while
working on this thing, I'll make a summary when I get back if anyone
is interested.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

import PyQt4.QtGui

Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
ImportError: No module named PyQt4.QtGui

import pygtk

Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
ImportError: No module named pygtk

···

import wx

Many thanks Andrea. Now I know what I'll be doing this weekend! :slight_smile:

···

On 12/30/11 11:31 AM, Andrea Gavana wrote:

Hi All,

     I have committed all my Python scripts to generate the ReST
docstrings input for Sphinx, plus some more things, into the latest
SVN Phoenix branch.

--
Robin Dunn
Software Craftsman

Andrea,

Looks like there is a failure in the sphinxtools code on the buildbot.

http://buildbot.wxpython.org:8010/builders/runtests/builds/332/steps/shell/logs/stdio

You shouldn't depend on WXWIN being set. There is some code in etgtools/__init__.py that shows how I've dealt with that, and I think there is a function somewhere that does something similar that can be called to get the wx path.

There will likely be other things wrong on the buildbot as it may not have Sphinx or other dependencies installed yet, but it would be good if you could get it to go as far as it is possible without it. When Kevin returns he can update that build slave with whatever is needed, and I should really look into setting up one or two of my own.

···

On 12/30/11 12:20 PM, Robin Dunn wrote:

On 12/30/11 11:31 AM, Andrea Gavana wrote:

Hi All,

I have committed all my Python scripts to generate the ReST
docstrings input for Sphinx, plus some more things, into the latest
SVN Phoenix branch.

Many thanks Andrea. Now I know what I'll be doing this weekend! :slight_smile:

--
Robin Dunn
Software Craftsman

I've just moved phoenixDir and wxDir to buildtools.config so they can more easily be used from other places.

···

On 12/30/11 12:36 PM, Robin Dunn wrote:

On 12/30/11 12:20 PM, Robin Dunn wrote:

On 12/30/11 11:31 AM, Andrea Gavana wrote:

Hi All,

I have committed all my Python scripts to generate the ReST
docstrings input for Sphinx, plus some more things, into the latest
SVN Phoenix branch.

Many thanks Andrea. Now I know what I'll be doing this weekend! :slight_smile:

Andrea,

Looks like there is a failure in the sphinxtools code on the buildbot.

http://buildbot.wxpython.org:8010/builders/runtests/builds/332/steps/shell/logs/stdio

You shouldn't depend on WXWIN being set. There is some code in
etgtools/__init__.py that shows how I've dealt with that, and I think
there is a function somewhere that does something similar that can be
called to get the wx path.

There will likely be other things wrong on the buildbot as it may not
have Sphinx or other dependencies installed yet, but it would be good if
you could get it to go as far as it is possible without it. When Kevin
returns he can update that build slave with whatever is needed, and I
should really look into setting up one or two of my own.

--
Robin Dunn
Software Craftsman

Hi Robin,

Hi All,

I have committed all my Python scripts to generate the ReST
docstrings input for Sphinx, plus some more things, into the latest
SVN Phoenix branch.

Many thanks Andrea. Now I know what I'll be doing this weekend! :slight_smile:

Andrea,

Looks like there is a failure in the sphinxtools code on the buildbot.

http://buildbot.wxpython.org:8010/builders/runtests/builds/332/steps/shell/logs/stdio

You shouldn't depend on WXWIN being set. There is some code in
etgtools/__init__.py that shows how I've dealt with that, and I think
there is a function somewhere that does something similar that can be
called to get the wx path.

There will likely be other things wrong on the buildbot as it may not
have Sphinx or other dependencies installed yet, but it would be good if
you could get it to go as far as it is possible without it. When Kevin
returns he can update that build slave with whatever is needed, and I
should really look into setting up one or two of my own.

For the moment I simply taken your code from etgtools/__init__.py and
plugged it in into the constants.py file. Of course that is not very
ideal as it is yet another code duplication, but I am really running
short of time (I'll leave in a few hours) so it was the quickest (and
dirtiest) workaround I could find.

I'll refactor it to use the already existing definition/functions into
buildtools.config as soon as I get back, unless you wish to do it
yourself.

If you can let me know in the next couple of hours if the buildbot is
happier now, I'd appreciate it.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 30 December 2011 22:02, Robin Dunn wrote:

On 12/30/11 12:36 PM, Robin Dunn wrote:

On 12/30/11 12:20 PM, Robin Dunn wrote:

On 12/30/11 11:31 AM, Andrea Gavana wrote:

It looks like the assert in that new code is being triggered. Don't worry about it for now, I'll fix it in a few minutes.

I have another question for you. Is there some reason that you went back to the prior sipCurrentVersion and MD5 values or was that just some mistake in merging my changes into your code? See lines 39-44 at

http://trac.wxwidgets.org/changeset?new=70205%40wxPython%2FPhoenix%2Ftrunk%2Fbuild.py&old=70148%40wxPython%2FPhoenix%2Ftrunk%2Fbuild.py

Also, is there any reason that some of the sphinx specific stuff in the build.etg() command function couldn't be moved to the first part of the sphinx command?

···

On 12/30/11 1:19 PM, Andrea Gavana wrote:

Hi Robin,

On 30 December 2011 22:02, Robin Dunn wrote:

On 12/30/11 12:36 PM, Robin Dunn wrote:

On 12/30/11 12:20 PM, Robin Dunn wrote:

On 12/30/11 11:31 AM, Andrea Gavana wrote:

Hi All,

I have committed all my Python scripts to generate the ReST
docstrings input for Sphinx, plus some more things, into the latest
SVN Phoenix branch.

Many thanks Andrea. Now I know what I'll be doing this weekend! :slight_smile:

Andrea,

Looks like there is a failure in the sphinxtools code on the buildbot.

http://buildbot.wxpython.org:8010/builders/runtests/builds/332/steps/shell/logs/stdio

You shouldn't depend on WXWIN being set. There is some code in
etgtools/__init__.py that shows how I've dealt with that, and I think
there is a function somewhere that does something similar that can be
called to get the wx path.

For the moment I simply taken your code from etgtools/__init__.py and
plugged it in into the constants.py file. Of course that is not very
ideal as it is yet another code duplication, but I am really running
short of time (I'll leave in a few hours) so it was the quickest (and
dirtiest) workaround I could find.

I'll refactor it to use the already existing definition/functions into
buildtools.config as soon as I get back, unless you wish to do it
yourself.

If you can let me know in the next couple of hours if the buildbot is
happier now, I'd appreciate it.

--
Robin Dunn
Software Craftsman

Ah, I see you already have made the changes. :slight_smile:

···

On 12/30/11 1:36 PM, Robin Dunn wrote:

On 12/30/11 1:19 PM, Andrea Gavana wrote:

For the moment I simply taken your code from etgtools/__init__.py and
plugged it in into the constants.py file. Of course that is not very
ideal as it is yet another code duplication, but I am really running
short of time (I'll leave in a few hours) so it was the quickest (and
dirtiest) workaround I could find.

I'll refactor it to use the already existing definition/functions into
buildtools.config as soon as I get back, unless you wish to do it
yourself.

If you can let me know in the next couple of hours if the buildbot is
happier now, I'd appreciate it.

It looks like the assert in that new code is being triggered. Don't
worry about it for now, I'll fix it in a few minutes.

--
Robin Dunn
Software Craftsman

Hi Robin,

Hi All,

I have committed all my Python scripts to generate the ReST
docstrings input for Sphinx, plus some more things, into the latest
SVN Phoenix branch.

Many thanks Andrea. Now I know what I'll be doing this weekend! :slight_smile:

Andrea,

Looks like there is a failure in the sphinxtools code on the buildbot.

http://buildbot.wxpython.org:8010/builders/runtests/builds/332/steps/shell/logs/stdio

You shouldn't depend on WXWIN being set. There is some code in
etgtools/__init__.py that shows how I've dealt with that, and I think
there is a function somewhere that does something similar that can be
called to get the wx path.

For the moment I simply taken your code from etgtools/__init__.py and
plugged it in into the constants.py file. Of course that is not very
ideal as it is yet another code duplication, but I am really running
short of time (I'll leave in a few hours) so it was the quickest (and
dirtiest) workaround I could find.

I'll refactor it to use the already existing definition/functions into
buildtools.config as soon as I get back, unless you wish to do it
yourself.

If you can let me know in the next couple of hours if the buildbot is
happier now, I'd appreciate it.

It looks like the assert in that new code is being triggered. Don't worry
about it for now, I'll fix it in a few minutes.

I have another question for you. Is there some reason that you went back to
the prior sipCurrentVersion and MD5 values or was that just some mistake in
merging my changes into your code? See lines 39-44 at

wxTrac has been migrated to GitHub Issues - wxWidgets

My apologies, that was my mistake in merging the code...

Also, is there any reason that some of the sphinx specific stuff in the
build.etg() command function couldn't be moved to the first part of the
sphinx command?

Uhm, for example? Most (almost all) of what it gets done in the
sphinx_generator depends absolutely on the stuff passed by the
extractors. There might be something I'll be able to move to the first
part of the Sphinx command, but is it really worth the effort?

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 30 December 2011 22:36, Robin Dunn wrote:

On 12/30/11 1:19 PM, Andrea Gavana wrote:

On 30 December 2011 22:02, Robin Dunn wrote:

On 12/30/11 12:36 PM, Robin Dunn wrote:

On 12/30/11 12:20 PM, Robin Dunn wrote:

On 12/30/11 11:31 AM, Andrea Gavana wrote: