Skip to content

Instantly share code, notes, and snippets.

@tkfm-yamaguchi
Created January 5, 2012 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkfm-yamaguchi/1563134 to your computer and use it in GitHub Desktop.
Save tkfm-yamaguchi/1563134 to your computer and use it in GitHub Desktop.
Do not run wx app more (python)
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