From 65c8397ddb03acd7607bdc4ec47f8d6a341adf6f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 20 Dec 2019 16:34:58 -0800 Subject: [PATCH] Tweak 3.x versions in the docs to 4.x, to adjust for the difference in version numbers --- etgtools/sphinx_generator.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index 79b101e6..54be413d 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -1042,7 +1042,7 @@ class Section(Node): text = Node.Join(self, with_tail=False) if not text.strip() or len(text.strip()) < 3: - # Empy text or just trailing commas + # Empty text or just trailing commas return '' if self.is_overload and self.share_docstrings: @@ -1065,6 +1065,12 @@ class Section(Node): version = version[0:-1] text = '%s\n%s%s'%(version, sub_spacer, text) + # Show both the wxPython and the wxWidgets version numbers for + # versions >= 3. That's not entirely accurate, but close enough. + if text.startswith('3.'): + wx_ver = text[:5] + text = '4.{}/wxWidgets-{} {}'.format(wx_ver[2], wx_ver, text[5:]) + elif section_type == 'deprecated': # Special treatment for deprecated, wxWidgets devs do not put the version number text = '\n%s%s'%(sub_spacer, text.lstrip('Deprecated'))