From 2355ceb1981aedada60bf31ba3aa83bfb1a6ade8 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 4 Jun 2016 14:32:21 -0700 Subject: [PATCH] Use fullname on constants in the converted text --- etgtools/sphinx_generator.py | 21 +++++++-------------- sphinxtools/utilities.py | 15 ++++++++------- src/event_ex.py | 2 -- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index bda936e6..8096117b 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -1540,7 +1540,7 @@ class XRef(Node): hascomma = '::' in text original = text - text = removeWxPrefix(text) # *** + text = removeWxPrefix(text) text = text.replace("::", ".") if "(" in text: @@ -2400,7 +2400,7 @@ class XMLDocString(object): if bases: stream.write('(') - bases = [removeWxPrefix(b) for b in bases] + bases = [removeWxPrefix(b) for b in bases] # *** stream.write(', '.join(bases)) stream.write(')') @@ -2653,8 +2653,7 @@ class XMLDocString(object): function = self.xml_item name = function.pyName or function.name - imm = ItemModuleMap() - fullname = imm.get_fullname(name) + fullname = ItemModuleMap().get_fullname(name) if self.is_overload: definition = '**%s** ' % name @@ -2730,8 +2729,10 @@ class XMLDocString(object): continue docstrings = v.briefDoc - name = convertToPython(removeWxPrefix(v.name)) # *** - stream.write('%-80s'%name) + name = v.pyName if v.pyName else removeWxPrefix(v.name) + name = ItemModuleMap().get_fullname(name) + name = convertToPython(name) # *** + stream.write('%-80s' % name) if not isinstance(docstrings, string_base): rest_class = self.RecurseXML(docstrings, self.root) @@ -2744,14 +2745,6 @@ class XMLDocString(object): text_file = os.path.join(SPHINXROOT, self.output_file) - #if os.path.isfile(text_file): - # message = '\nWARNING: Duplicated description for `%s` enumeration.\n\n' \ - # 'The duplicated instance will still be written to its output ReST file but\n' \ - # 'Sphinx/Docutils will issue a warning when building the HTML docs.\n\n' - # - # duplicated = self.output_file.replace('.enumeration.txt', '') - # print message % duplicated - if count > 0 and write: writeSphinxOutput(stream, self.output_file) diff --git a/sphinxtools/utilities.py b/sphinxtools/utilities.py index df73f9a1..e19099be 100644 --- a/sphinxtools/utilities.py +++ b/sphinxtools/utilities.py @@ -26,7 +26,7 @@ else: string_base = str # Phoenix-specific imports - +from etgtools.item_module_map import ItemModuleMap from .templates import TEMPLATE_CONTRIB from .constants import IGNORE, PUNCTUATION, MODULENAME_REPLACE from .constants import CPP_ITEMS, VERSION, VALUE_MAP @@ -342,18 +342,19 @@ def convertToPython(text): if "::" in word and not word.endswith("::"): # Bloody SetCursorEvent... - word = word.replace("::wx", ".") + word = word.replace("::wx", ".") # *** word = word.replace("::", ".") - word = "`%s`"%word + word = "`%s`" % word newline.append(word) continue - if newword.upper() == newword and newword not in PUNCTUATION and \ - newword not in IGNORE and len(newword.strip()) > 1 and \ - not isNumeric(newword) and newword not in ['DC', 'GCDC']: + if (newword.upper() == newword and newword not in PUNCTUATION and + newword not in IGNORE and len(newword.strip()) > 1 and + not isNumeric(newword) and newword not in ['DC', 'GCDC']): if '``' not in newword and '()' not in word and '**' not in word: - word = word.replace(newword, "``%s``"%newword) + word = word.replace(newword, "``%s``" % + ItemModuleMap().get_fullname(newword)) word = word.replace('->', '.') newline.append(word) diff --git a/src/event_ex.py b/src/event_ex.py index c8dbb569..7e8a8524 100644 --- a/src/event_ex.py +++ b/src/event_ex.py @@ -26,8 +26,6 @@ EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) -EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) -EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )