def Main(): import proxy.Agent as poster poster.fork_if() import os.path sys.path.append(os.path.join(sys.path[0], 'runtime')) sys.path.append(os.path.join(sys.path[0], 'plugin')) app = wx.PySimpleApp() frame = MainFrame() frame.Center() frame.Show(True) app.MainLoop()
def OnClose(self, event): # TODO: Stopping playing before exiting Record.CANCELLED = True # not enough try: if self.proxy: Proxy.stop() self.proxy.join() self.proxy = None import proxy.Agent as poster poster.kill_if() self.TryAutoSave() except Exception, e: import Logger log = Logger.getLogger() log.exception('Ignornig Exception when closing application:\n%s', e)