mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
Add a __bool__ for every __nonzero__ that doesn't already have one
This commit is contained in:
@@ -94,9 +94,8 @@ def run():
|
||||
self->SetMask(mask);
|
||||
""")
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addCppMethod('long', 'GetHandle', '()',
|
||||
doc='MSW-only method to fetch the windows handle for the bitmap.',
|
||||
|
||||
@@ -40,10 +40,8 @@ def run():
|
||||
if ctor.isCtor and ctor.argsString != '()':
|
||||
ctor.mustHaveApp()
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addCppCode("""\
|
||||
#ifdef __WXMAC__
|
||||
|
||||
@@ -39,9 +39,8 @@ def run():
|
||||
c.find('GetPosition').findOverload('int *').ignore()
|
||||
c.find('GetSize').findOverload('int *').ignore()
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
@@ -41,9 +41,8 @@ def run():
|
||||
|
||||
c.find('GetPrintData').overloads = []
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addProperty('MarginBottomRight', 'GetMarginBottomRight', 'SetMarginBottomRight')
|
||||
c.addProperty('MarginTopLeft', 'GetMarginTopLeft', 'SetMarginTopLeft')
|
||||
@@ -62,9 +61,8 @@ def run():
|
||||
c.addCppMethod('wxSize*', 'GetPaperSize', '()', 'return new wxSize(self->GetPaperSize());')
|
||||
c.addCppMethod('void', 'SetPaperSize', '(const wxSize* sz)', 'self->SetPaperSize(*sz);')
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
# TODO: These two methods should use something other than a PyString for
|
||||
# holding the data...
|
||||
@@ -95,9 +93,8 @@ def run():
|
||||
tools.removeVirtuals(c)
|
||||
c.find('SetSetupDialog').ignore()
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addAutoProperties()
|
||||
|
||||
|
||||
@@ -171,7 +171,6 @@ def run():
|
||||
c.addPyMethod('__str__', '(self)', 'return str(self.Get())')
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.Colour"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.IsOk()')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (Colour, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
@@ -184,6 +183,9 @@ def run():
|
||||
""")
|
||||
c.addPyCode('Colour.__safe_for_unpickling__ = True')
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
# Types that can be converted to wx.Colour:
|
||||
# wxColour (duh)
|
||||
# Sequence with 3 or 4 integers
|
||||
|
||||
@@ -46,9 +46,8 @@ def run():
|
||||
# TODO: This ctor ^^ in Classic has a custom implementation for wxGTK that
|
||||
# sets the hotspot. Is that still needed?
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addCppMethod('long', 'GetHandle', '()', """\
|
||||
#ifdef __WXMSW__
|
||||
|
||||
@@ -80,12 +80,10 @@ def run():
|
||||
c = module.find('wxDataViewItem')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('long', '__hash__', '()', """\
|
||||
return (long)self->GetID();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('long', '__hash__', '()', "return (long)self->GetID();")
|
||||
|
||||
c.addCppMethod('bool', '__eq__', '(wxDataViewItem* other)',
|
||||
"return other ? (self->GetID() == other->GetID()) : false;")
|
||||
c.addCppMethod('bool', '__ne__', '(wxDataViewItem* other)',
|
||||
|
||||
@@ -225,9 +225,8 @@ def run():
|
||||
""")
|
||||
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addPyMethod('GetBoundingBox', '(self)', doc="""\
|
||||
GetBoundingBox() -> (x1,y1, x2,y2)\n
|
||||
|
||||
@@ -85,9 +85,8 @@ def run():
|
||||
#c.addProperty('Underlined GetUnderlined SetUnderlined')
|
||||
#c.addProperty('Strikethrough GetStrikethrough SetStrikethrough')
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addCppMethod('void*', 'GetHFONT', '()',
|
||||
doc="Returns the font's native handle.",
|
||||
|
||||
@@ -60,6 +60,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.GBPosition"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (GBPosition, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
@@ -104,6 +105,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.GBSpan"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (GBSpan, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
|
||||
@@ -117,7 +117,6 @@ def run():
|
||||
c.addPyMethod('__str__', '(self)', 'return str(self.Get())')
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.Point"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (Point, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
@@ -192,6 +191,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.Size"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (Size, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
@@ -273,6 +273,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.Rect"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0,0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0,0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (Rect, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
@@ -334,6 +335,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.RealPoint"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (Rect, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
|
||||
@@ -72,6 +72,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.Point2D"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (Point2D, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
@@ -120,6 +121,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.Rect2D"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0,0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0,0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (Rect2D, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
|
||||
@@ -61,6 +61,7 @@ def run():
|
||||
c.mustHaveApp()
|
||||
c.addCppMethod('bool', 'IsOk', '()', 'return !self->IsNull();')
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return !self->IsNull();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return !self->IsNull();")
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
@@ -85,7 +86,7 @@ def run():
|
||||
#if wxUSE_ENH_METAFILE
|
||||
return wxGraphicsContext::Create(*metaFileDC);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
wxPyRaiseNotImplemented();
|
||||
return NULL;
|
||||
""")
|
||||
|
||||
@@ -111,6 +111,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "GridCellCoords"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (GridCellCoords, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
|
||||
@@ -51,8 +51,8 @@ def run():
|
||||
return icon;
|
||||
""")
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addCppMethod('long', 'GetHandle', '()', """\
|
||||
#ifdef __WXMSW__
|
||||
|
||||
@@ -43,8 +43,8 @@ def run():
|
||||
#endif
|
||||
""")
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addCppMethod('int', 'GetIndex', '()', """\
|
||||
#ifdef __WXMSW__
|
||||
|
||||
@@ -359,6 +359,7 @@ def run():
|
||||
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', 'return self->IsOk();')
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addPyMethod('ConvertToBitmap', '(self, depth=-1)',
|
||||
doc="""\
|
||||
|
||||
@@ -40,6 +40,7 @@ def run():
|
||||
c.addPrivateCopyCtor()
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', 'return self->IsOk();')
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
|
||||
c = module.find('wxLanguageInfo')
|
||||
|
||||
@@ -50,6 +50,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "wx.Position"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (Position, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
|
||||
@@ -72,9 +72,9 @@ def run():
|
||||
ctor.find('printout').transfer = True
|
||||
ctor.find('printoutForPrinting').transfer = True
|
||||
c.addPrivateCopyCtor()
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addPyCode("PrintPreview.Ok = wx.deprecated(PrintPreview.IsOk, 'Use IsOk instead.')")
|
||||
|
||||
c = module.find('wxPrinter')
|
||||
|
||||
@@ -171,10 +171,8 @@ def addPixelDataClass(module, pd, img, bpp, doc=""):
|
||||
|
||||
MethodDef(type=itrName, name='GetPixels', isConst=True),
|
||||
|
||||
CppMethodDef('int', '__nonzero__', '()',
|
||||
body="""\
|
||||
return (int)self->operator bool();
|
||||
"""),
|
||||
CppMethodDef('int', '__nonzero__', '()', body="return (int)self->operator bool();"),
|
||||
CppMethodDef('int', '__bool__', '()', body="return self->operator bool();"),
|
||||
])
|
||||
|
||||
# add this class to the module
|
||||
@@ -200,10 +198,8 @@ def addPixelDataClass(module, pd, img, bpp, doc=""):
|
||||
|
||||
MethodDef(type='bool', name='IsOk', isConst=True),
|
||||
|
||||
CppMethodDef('int', '__nonzero__', '()',
|
||||
body="""\
|
||||
return (int)self->IsOk();
|
||||
"""),
|
||||
CppMethodDef('int', '__nonzero__', '()', body="return (int)self->IsOk();"),
|
||||
CppMethodDef('int', '__bool__', '()', body="return self->IsOk();"),
|
||||
|
||||
MethodDef(type='void', name='Offset', items=[
|
||||
ParamDef(type='const %s&' % pd, name='data'),
|
||||
|
||||
@@ -110,11 +110,13 @@ def run():
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
c.find('SetValue').findOverload('units').ignore()
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsValid();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsValid();")
|
||||
|
||||
#-------------------------------------------------------
|
||||
c = module.find('wxTextAttrDimensions')
|
||||
tools.ignoreConstOverloads(c)
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsValid();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsValid();")
|
||||
|
||||
#-------------------------------------------------------
|
||||
c = module.find('wxTextAttrSize')
|
||||
@@ -122,17 +124,20 @@ def run():
|
||||
c.find('SetWidth').findOverload('units').ignore()
|
||||
c.find('SetHeight').findOverload('units').ignore()
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsValid();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsValid();")
|
||||
|
||||
#-------------------------------------------------------
|
||||
c = module.find('wxTextAttrBorder')
|
||||
tools.ignoreConstOverloads(c)
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsValid();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsValid();")
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
c = module.find('wxTextAttrBorders')
|
||||
tools.ignoreConstOverloads(c)
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsValid();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsValid();")
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
@@ -161,6 +166,7 @@ def run():
|
||||
c = module.find('wxRichTextSelection')
|
||||
tools.ignoreConstOverloads(c)
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsValid();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsValid();")
|
||||
c.find('operator[]').ignore()
|
||||
|
||||
|
||||
@@ -185,6 +191,7 @@ def run():
|
||||
c.addPyMethod('__repr__', '(self)', 'return "RichTextRange"+str(self.Get())')
|
||||
c.addPyMethod('__len__', '(self)', 'return len(self.Get())')
|
||||
c.addPyMethod('__nonzero__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__bool__', '(self)', 'return self.Get() != (0,0)')
|
||||
c.addPyMethod('__reduce__', '(self)', 'return (RichTextRange, self.Get())')
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
|
||||
@@ -61,9 +61,8 @@ def run():
|
||||
c.find('wxSound.isResource').ignore()
|
||||
c.find('Create.isResource').ignore()
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.find('Play').renameOverload('filename', 'PlaySound')
|
||||
c.find('IsPlaying').ignore()
|
||||
|
||||
@@ -47,9 +47,8 @@ def run():
|
||||
c.find('wxTreeItemId').overloads.append(ctor)
|
||||
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addCppMethod('bool', '__eq__', '(const wxTreeItemId& other)', """\
|
||||
return *self == *other;
|
||||
|
||||
@@ -43,9 +43,8 @@ def run():
|
||||
c = module.find('wxTreeListItem')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
c.addCppMethod('long', '__hash__', '()', """\
|
||||
return (long)self->GetID();
|
||||
|
||||
@@ -32,9 +32,8 @@ def run():
|
||||
|
||||
c = module.find('wxVideoMode')
|
||||
|
||||
c.addCppMethod('int', '__nonzero__', '()', """\
|
||||
return self->IsOk();
|
||||
""")
|
||||
c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
|
||||
c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
|
||||
|
||||
module.addItem(tools.wxArrayWrapperTemplate(
|
||||
'wxArrayVideoModes', 'wxVideoMode', module))
|
||||
|
||||
Reference in New Issue
Block a user