Merge branch 'mesalu-fix_384'

This commit is contained in:
Robin Dunn
2018-08-04 18:10:38 -07:00
2 changed files with 12 additions and 1 deletions

View File

@@ -89,6 +89,9 @@ Changes in this release include the following:
* Fix missing parameter tool_id in
wx.lib.agw.ribbon.toolbar.RibbonToolBar.AddToggleTool. (#947)
* Add a step to wx.Config.ReadInt to attempt converting from long to int
under python2. (#384)

View File

@@ -56,11 +56,19 @@ def run():
else:
func.find('defaultVal').default = 'wxEmptyString'
c.addCppMethod('long', 'ReadInt', '(const wxString& key, long defaultVal=0)', """\
c.addCppMethod('long', '_cpp_ReadInt', '(const wxString& key, long defaultVal=0)', """\
long rv;
self->Read(*key, &rv, defaultVal);
return rv;
""")
c.addPyMethod('ReadInt', '(self, key, defaultVal=0)', body="""\
import six
rv = self._cpp_ReadInt(key, defaultVal)
if six.PY2:
rv = int(rv)
return rv
""")
c.addCppMethod('double', 'ReadFloat', '(const wxString& key, double defaultVal=0.0)', """\
double rv;
self->Read(*key, &rv, defaultVal);