mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 01:30:07 +01:00
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:
@@ -691,7 +691,10 @@ def PostProcess(folder):
|
||||
elif stripline == '<dl class="attribute">' and not properties_done:
|
||||
line = '<br><h3>Properties<a class="headerlink" href="#properties" title="Permalink to this headline">¶</a></h3>' + '\n' + line
|
||||
properties_done = True
|
||||
|
||||
|
||||
if '<em> ' in line and '–' in line:
|
||||
line = line.replace('<em> ', '<em>')
|
||||
|
||||
newtext += line + '\n'
|
||||
|
||||
for old, new in list(enum_dict.items()):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user