diff --git a/src/app_ex.py b/src/app_ex.py index cdcd5dc0..ebbe9b41 100644 --- a/src/app_ex.py +++ b/src/app_ex.py @@ -178,11 +178,10 @@ logged in on the main display of your Mac.""" def OnPreInit(self): """ - Things that must be done after _BootstrapApp has done its - thing, but would be nice if they were already done by the time - that OnInit is called. + Things that must be done after _BootstrapApp has done its thing, but + would be nice if they were already done by the time that OnInit is + called. """ - print 'OnPreInit' ## wx.StockGDI._initStockObjects() @@ -224,9 +223,9 @@ logged in on the main display of your Mac.""" def SetOutputWindowAttributes(self, title=None, pos=None, size=None): """ - Set the title, position and/or size of the output window if - the stdio has been redirected. This should be called before - any output would cause the output window to be created. + Set the title, position and/or size of the output window if the stdio + has been redirected. This should be called before any output would + cause the output window to be created. """ if self.stdioWin: if title is not None: @@ -236,28 +235,28 @@ logged in on the main display of your Mac.""" if size is not None: self.stdioWin.size = size -## #---------------------------------------------------------------------------- +#---------------------------------------------------------------------------- -## # TODO: Move this someplace else? -## def deprecated(func): -## def new_func(*args, **kwargs): -## import warnings -## warnings.warn("Call to deprecated function %s." % func.__name__, -## category=DeprecationWarning) -## return func(*args, **kwargs) -## new_func.__name__ = func.__name__ -## new_func.__doc__ = func.__doc__ -## new_func.__dict__.update(func.__dict__) -## return new_func +# TODO: Move this someplace else? +def deprecated(func): + def new_func(*args, **kwargs): + import warnings + warnings.warn("Call to deprecated item %s." % func.__name__, + category=DeprecationWarning) + return func(*args, **kwargs) + new_func.__name__ = func.__name__ + new_func.__doc__ = func.__doc__ + new_func.__dict__.update(func.__dict__) + return new_func -## @deprecated -## class PySimpleApp(App): -## """ -## This class is deprecated. Please use wx.App isntead. -## """ -## def __init__(self, *args, **kw): -## App.__init__(self, *args, **kw) +@deprecated +class PySimpleApp(App): + """ + This class is deprecated. Please use wx.App instead. + """ + def __init__(self, *args, **kw): + App.__init__(self, *args, **kw) ## #---------------------------------------------------------------------------- diff --git a/src/core_ex.py b/src/core_ex.py index fee8bf2a..b3cb2d13 100644 --- a/src/core_ex.py +++ b/src/core_ex.py @@ -15,19 +15,19 @@ del _core def version(): """Returns a string containing version and port info""" - if wx.Platform == '__WXMSW__': + if wx.Port == '__WXMSW__': port = 'msw' - elif wx.Platform == '__WXMAC__': - if 'wxOSX-carbon' in wx.PlatformInfo: + elif wx.Port == '__WXMAC__': + if 'wxOSX-carbon' in wx.PortInfo: port = 'osx-carbon' else: port = 'osx-cocoa' - elif wx.Platform == '__WXGTK__': + elif wx.Port == '__WXGTK__': port = 'gtk' - if 'gtk2' in wx.PlatformInfo: + if 'gtk2' in wx.PortInfo: port = 'gtk2' else: - port = '?' + port = '???' return "%s %s" % (wx.VERSION_STRING, port) diff --git a/unittests/test_app.py b/unittests/test_app.py index 4b99d182..d4574d77 100644 --- a/unittests/test_app.py +++ b/unittests/test_app.py @@ -19,8 +19,13 @@ class App(unittest2.TestCase): app = MyApp() self.assertTrue(app.onInit_called) + def test_version(self): + v = wx.version() - + def test_PySimpleApp(self): + app = wx.PySimpleApp() + + #---------------------------------------------------------------------------