trim trailing space etg directory

This commit is contained in:
Metallicow
2016-11-10 12:08:36 -06:00
parent b4e9d89f1a
commit ebc8d0d971
248 changed files with 4074 additions and 4075 deletions

View File

@@ -16,55 +16,55 @@ NAME = "geometry"
DOCSTRING = ""
# The classes and/or the basename of the Doxygen XML files to be processed by
# this script.
ITEMS = [
# this script.
ITEMS = [
'wxPoint2DDouble',
'wxRect2DDouble',
]
]
#---------------------------------------------------------------------------
def run():
# Parse the XML file(s) building a collection of Extractor objects
module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
etgtools.parseDoxyXML(module, ITEMS)
#-----------------------------------------------------------------
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
module.addHeaderCode('#include <wx/wx.h>')
#---------------------------------------
# wxPoint2D and wxRect2D tweaks
c = module.find('wxPoint2DDouble')
c.renameClass('Point2D')
c.find('wxPoint2DDouble').findOverload('wxPoint2DInt').ignore()
c.find('m_x').pyName = 'x'
c.find('m_y').pyName = 'y'
c.find('GetFloor.x').out = True
c.find('GetFloor.y').out = True
c.find('GetRounded.x').out = True
c.find('GetRounded.y').out = True
# these have link errors
c.find('SetPolarCoordinates').ignore()
c.find('operator/=').findOverload('wxDouble').ignore()
c.find('operator*=').findOverload('wxDouble').ignore()
c.convertFromPyObject = tools.convertTwoDoublesTemplate('wxPoint2DDouble')
c.addCppMethod('PyObject*', 'Get', '()', """\
return sipBuildResult(0, "(dd)", self->m_x, self->m_y);
""",
""",
briefDoc="""\
Get() -> (x,y)\n
Get() -> (x,y)\n
Return the x and y properties as a tuple.""")
# Add sequence protocol methods and other goodies
c.addPyMethod('__str__', '(self)', 'return str(self.Get())')
c.addPyMethod('__repr__', '(self)', 'return "wx.Point2D"+str(self.Get())')
@@ -77,39 +77,39 @@ def run():
if idx == 0: self.x = val
elif idx == 1: self.y = val
else: raise IndexError
""")
""")
c.addPyCode('Point2D.__safe_for_unpickling__ = True')
# ignore these operator methods, since we are not wrapping the Int version
c.find('operator*=').findOverload('wxInt32').ignore()
c.find('operator/=').findOverload('wxInt32').ignore()
# ignore all the global operators too, there is no equivallent in Python
for item in module:
if isinstance(item, etgtools.FunctionDef) and item.name.startswith('operator'):
for f in item.all():
f.ignore()
c = module.find('wxRect2DDouble')
c.renameClass('Rect2D')
c.find('m_x').pyName = 'x'
c.find('m_y').pyName = 'y'
c.find('m_width').pyName = 'width'
c.find('m_height').pyName = 'height'
c.convertFromPyObject = tools.convertFourDoublesTemplate('wxRect2DDouble')
c.addCppMethod('PyObject*', 'Get', '()', """\
return sipBuildResult(0, "(dddd)",
return sipBuildResult(0, "(dddd)",
self->m_x, self->m_y, self->m_width, self->m_height);
""",
""",
briefDoc="""\
Get() -> (x, y, width, height)\n
Get() -> (x, y, width, height)\n
Return the rectangle's properties as a tuple.""")
# Add sequence protocol methods and other goodies
c.addPyMethod('__str__', '(self)', 'return str(self.Get())')
c.addPyMethod('__repr__', '(self)', 'return "wx.Rect2D"+str(self.Get())')
@@ -124,16 +124,16 @@ def run():
elif idx == 2: self.width = val
elif idx == 3: self.height = val
else: raise IndexError
""")
""")
c.addPyCode('Rect2D.__safe_for_unpickling__ = True')
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
#---------------------------------------------------------------------------
if __name__ == '__main__':
run()