Created
January 5, 2012 01:01
-
-
Save tkfm-yamaguchi/1563134 to your computer and use it in GitHub Desktop.
Do not run wx app more (python)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class appMain(wx.App): | |
"""Application class | |
""" | |
def OnInit(self): | |
""" Construction event handler | |
Called by wx when application launch. | |
Check whether the app already running, | |
if it has been running, abort launching. | |
:rtype: boolean | |
:return: whether construction process has succeed. | |
""" | |
self.name = APP.NAME | |
self.version = APP.VERSION | |
self.instance = wx.SingleInstanceChecker(self.name) | |
# -- Check another instance already running? | |
if self.instance.IsAnotherRunning(): | |
wx_utils.show_message(None, TEXT.ALREADY_RUNNING, TEXT.TITLE.NOTICE) | |
return False # wx would be abort. | |
else: | |
print TEXT.STARTING | |
#self._launch_data_viewer() | |
self._launch_stat_frame() # stat debug | |
return True # wx continues. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment