Phoenix: Revise the way `:param: and :rtype: are handled in sphinx_generator.py so that the module name does not appear in front of the class. Minor cleanups to the docstrings generators. Fixed interlinks in wx.lib.busy.py and wx.lib.softwareupdate.py`.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Andrea Gavana
2012-12-06 20:33:39 +00:00
parent 66840744d2
commit 9decb82713
5 changed files with 38 additions and 24 deletions

View File

@@ -232,13 +232,15 @@ def ReplaceCppItems(line):
# ----------------------------------------------------------------------- #
def PythonizeType(ptype):
def PythonizeType(ptype, is_param):
"""
Replaces various C++ specific stuff with more Pythonized version of them,
for parameter lists and return types (i.e., the `:param:` and `:rtype:`
ReST roles).
:param string `ptype`: any string.
:param string `ptype`: any string;
:param bool `is_param`: ``True`` if this is a parameter description, ``False``
if it is a return type.
:rtype: `string`
"""
@@ -295,7 +297,15 @@ def PythonizeType(ptype):
ptype = ptype[0:-1]
if ' ' not in ptype:
ptype = ':class:`%s`'%ptype
else:
if is_param and '.' in ptype:
modules = MODULENAME_REPLACE.values()
modules.sort()
modules = modules[1:]
if ptype.split('.')[0] + '.' in modules:
ptype = ':ref:`%s`'%ptype
return ptype