X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64e8a1f072f09865b57ce399fa4401009e08d314..05e00ac5ef410707da86d98786cbb268100a7337:/wxPython/src/core.i?ds=sidebyside diff --git a/wxPython/src/core.i b/wxPython/src/core.i index be891ef234..93df66902a 100644 --- a/wxPython/src/core.i +++ b/wxPython/src/core.i @@ -10,8 +10,7 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -%module core - +%module(package="wx") _core %{ #include "wx/wxPython/wxPython_int.h" @@ -26,25 +25,47 @@ %include my_typemaps.i %include _core_api.i -%include _core_rename.i +%include __core_rename.i %native(_wxPySetDictionary) __wxPySetDictionary; %native(_wxPyFixStockObjects) __wxPyFixStockObjects; + %pythoncode { %#// Give a reference to the dictionary of this module to the C++ extension %#// code. -_core._wxPySetDictionary(vars()) +_core_._wxPySetDictionary(vars()) %#// A little trick to make 'wx' be a reference to this module so wx.Names can %#// be used here. import sys as _sys wx = _sys.modules[__name__] -} +} #endif +%pythoncode { +%#---------------------------------------------------------------------------- + +def _deprecated(callable, msg=None): + """ + Create a wrapper function that will raise a DeprecationWarning + before calling the callable. + """ + if msg is None: + msg = "%s is deprecated" % callable + def deprecatedWrapper(*args, **kwargs): + import warnings + warnings.warn(msg, DeprecationWarning, stacklevel=2) + return callable(*args, **kwargs) + deprecatedWrapper.__doc__ = msg + return deprecatedWrapper + + +%#---------------------------------------------------------------------------- +} + //--------------------------------------------------------------------------- // Include all the files that make up the core module