From 1e448352be0c0dbcdccc41622770c50bc021bbe1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 8 Sep 2016 12:31:15 -0700 Subject: [PATCH] Take care about how wxString and wxArrayString are substituted in the docs. There are some cases where it is a substring and so should not be replaced. --- sphinxtools/postprocess.py | 7 ++++++- sphinxtools/utilities.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sphinxtools/postprocess.py b/sphinxtools/postprocess.py index 3cedc576..a80c63c5 100644 --- a/sphinxtools/postprocess.py +++ b/sphinxtools/postprocess.py @@ -168,9 +168,14 @@ def buildEnumsAndMethods(sphinxDir): text = text.replace(item, '""') # Replace ArrayXXX stuff... - for cpp in ['ArrayString()', 'ArrayInt()', 'ArrayDouble()', 'ArrayString']: + for cpp in ['ArrayString()', 'ArrayInt()', 'ArrayDouble()']: text = text.replace(cpp, '[]') + for cpp, py in [('`ArrayString`', 'list of strings'), + ('`ArrayInt`', 'list of integers'), + ('`ArrayDouble`', 'list of floats')]: + text = text.replace(cpp, py) + # Remove lines with "Event macros" in them... text = text.replace('Event macros:', '') diff --git a/sphinxtools/utilities.py b/sphinxtools/utilities.py index 1b5c8feb..2d7041cf 100644 --- a/sphinxtools/utilities.py +++ b/sphinxtools/utilities.py @@ -178,7 +178,7 @@ def replaceCppItems(line): if item in CPP_ITEMS: continue - if 'wxString' in item: + if 'wxString' == item: item = 'string' elif 'wxCoord' == item: item = 'int'