diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index d5457061..b3f5b904 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -277,8 +277,9 @@ class Node(object): text = (text is not None and [text] or [''])[0] tail = (tail is not None and [tail] or [''])[0] - if text.strip() in REMOVED_LINKS: - return '' + for link in REMOVED_LINKS: + if link in text.strip(): + return '' text = ConvertToPython(text) @@ -730,7 +731,7 @@ class Parameter(Node): self.pdef = pdef self.name = pdef.name - self.type = PythonizeType(pdef.type) + self.type = PythonizeType(pdef.type, is_param=True) # ----------------------------------------------------------------------- # @@ -2547,7 +2548,7 @@ class XMLDocString(object): else: - rtype = PythonizeType(after) + rtype = PythonizeType(after, is_param=False) if not rtype: return @@ -3438,7 +3439,7 @@ class SphinxGenerator(generators.DocsGeneratorBase): else: - rtype = PythonizeType(after) + rtype = PythonizeType(after, is_param=False) if not rtype: return '' diff --git a/sphinxtools/postprocess.py b/sphinxtools/postprocess.py index 46032d3b..429b20c0 100644 --- a/sphinxtools/postprocess.py +++ b/sphinxtools/postprocess.py @@ -691,7 +691,10 @@ def PostProcess(folder): elif stripline == '
' and not properties_done: line = '

PropertiesΒΆ

' + '\n' + line properties_done = True - + + if ' ' in line and '–' in line: + line = line.replace(' ', '') + newtext += line + '\n' for old, new in list(enum_dict.items()): diff --git a/sphinxtools/utilities.py b/sphinxtools/utilities.py index e58e878d..20913a42 100644 --- a/sphinxtools/utilities.py +++ b/sphinxtools/utilities.py @@ -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 diff --git a/wx/lib/busy.py b/wx/lib/busy.py index 56b44db1..7041e71d 100644 --- a/wx/lib/busy.py +++ b/wx/lib/busy.py @@ -9,7 +9,7 @@ #--------------------------------------------------------------------------- """ -A class like wx.BusyInfo but which doesn't take up so much space by default +A class like :class:`BusyInfo` but which doesn't take up so much space by default and which has a nicer look. """ @@ -21,7 +21,7 @@ from wx.lib.stattext import GenStaticText as StaticText class BusyInfo(object): """ - This class is just like :class:`wx.BusyInfo`, except that its default + This class is just like :class:`BusyInfo`, except that its default size is smaller, (unless the size of the message requires a larger window size) and the background and foreground colors of the message box can be set. @@ -29,7 +29,7 @@ class BusyInfo(object): Creating an instace of the class witll create an show a window with the given message, and when the instance is deleted then that window will be closed. This class also implements the context manager magic methods, so - it can be used with Python's 'with` statement, like this:: + it can be used with Python's `with` statement, like this:: with BusyInfo('Please wait...'): doSomethingThatNeedsWaiting() @@ -38,16 +38,16 @@ class BusyInfo(object): def __init__(self, msg, parent=None, bgColour=None, fgColour=None): """ - Create a new `BusyInfo`. + Create a new :class:`BusyInfo`. - :param `msg`: a string to be displayed in the BusyInfo window. - :param `parent`: an optional window to be used as the parent of - the `BusyInfo`. If given then the BusyInfo will be centered + :param string `msg`: a string to be displayed in the BusyInfo window. + :param Window `parent`: an optional window to be used as the parent of + the `:class:`BusyInfo`. If given then the BusyInfo will be centered over that window, otherwise it will be centered on the screen. - :param `bgColour`: :class:`Colour` to be used for the background - of the `BusyInfo` - :param `fgColour`: :class:`Colour` to be used for the foreground (text) - of the `BusyInfo` + :param Colour `bgColour`: colour to be used for the background + of the :class:`BusyInfo` + :param Colour `fgColour`: colour to be used for the foreground (text) + of the :class:`BusyInfo` """ self.frame = _InfoFrame(parent, msg, bgColour, fgColour) self.frame.Show() @@ -59,7 +59,7 @@ class BusyInfo(object): def Close(self): """ - Hide and close the busy info box + Hide and close the busy info box. """ if self.frame: self.frame.Hide() diff --git a/wx/lib/softwareupdate.py b/wx/lib/softwareupdate.py index 0eac12f7..e946bd9c 100644 --- a/wx/lib/softwareupdate.py +++ b/wx/lib/softwareupdate.py @@ -59,8 +59,8 @@ class UpdateAbortedError(RuntimeError): class SoftwareUpdate(object): """ - Mix this class with wx.App and call InitForUpdates from the derived class' - OnInit method. Be sure that the wx.App has set a display name + Mix this class with :class:`App` and call :meth:`InitForUpdates` from the derived class' + OnInit method. Be sure that the :class:`App` has set a display name (self.SetAppDisplayName) as that value will be used in the update dialogs. """ @@ -100,7 +100,7 @@ class SoftwareUpdate(object): def AutoCheckForUpdate(self, frequencyInDays, parentWindow=None, cfg=None): """ - If it has been frequencyInDays since the last auto-check then check if + If it has been `frequencyInDays` since the last auto-check then check if a software update is available and prompt the user to download and install it. This can be called after a application has started up, and if there is no update available the user will not be bothered.