Use fullname on constants in the converted text

This commit is contained in:
Robin Dunn
2016-06-04 14:32:21 -07:00
parent a21a23d32f
commit 2355ceb198
3 changed files with 15 additions and 23 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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 )