Skip to content

Commit

Permalink
Trim trailing space etgtools directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Metallicow committed Dec 5, 2016
1 parent e6884f7 commit 067569d
Show file tree
Hide file tree
Showing 7 changed files with 791 additions and 791 deletions.
28 changes: 14 additions & 14 deletions etgtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@ def parseDoxyXML(module, class_or_filename_list):
"""
Parse a list of Doxygen XML files and add the item(s) found there to the
ModuleDef object.
If a name in the list a wx class name then the Doxygen XML filename is
calculated from that name, otherwise it is treated as a filename in the
Doxygen XML output folder.
"""

def _classToDoxyName(name, attempts, base='class'):
import string
filename = base
for c in name:
if c in string.ascii_uppercase:
filename += '_' + c.lower()
else:
filename += c
filename += c
filename = os.path.join(XMLSRC, filename) + '.xml'
attempts.append(filename)
return filename

def _includeToDoxyName(name):
name = os.path.basename(name)
name = name.replace('.h', '_8h')
Expand All @@ -65,7 +65,7 @@ def _includeToDoxyName(name):
else:
name = 'interface_2wx_2' + name
return os.path.join(XMLSRC, name) + '.xml', name + '.xml'

for class_or_filename in class_or_filename_list:
attempts = []
pathname = _classToDoxyName(class_or_filename, attempts)
Expand All @@ -80,39 +80,39 @@ def _includeToDoxyName(name):
print(msg)
print("Tried: %s" % ('\n '.join(attempts)))
raise DoxyXMLError(msg)

if verbose():
print("Loading %s..." % pathname)
_filesparsed.add(pathname)

root = et.parse(pathname).getroot()
for element in root:
# extract and add top-level elements from the XML document
item = module.addElement(element)

# Also automatically parse the XML for the include file to get related
# typedefs, functions, enums, etc.
# Make sure though, that for interface files we only parse the one
# that belongs to this class. Otherwise, enums, etc. will be defined
# in multiple places.
xmlname = class_or_filename.replace('wx', '').lower()

if hasattr(item, 'includes'):
for inc in item.includes:
pathname, name = _includeToDoxyName(inc)
if os.path.exists(pathname) \
and pathname not in _filesparsed \
and ("interface" not in name or xmlname in name) \
and name not in class_or_filename_list:
class_or_filename_list.append(name)
class_or_filename_list.append(name)

_filesparsed.clear()

module.parseCompleted()

#---------------------------------------------------------------------------


#---------------------------------------------------------------------------


Loading

0 comments on commit 067569d

Please sign in to comment.