def _destroy(self): # Re-enable hotkey and log monitoring before exit hotkeymgr.register(self.parent, config.getint('hotkey_code'), config.getint('hotkey_mods')) if (config.getint('output') & config.OUT_LOG_AUTO) and (config.getint('output') & (config.OUT_LOG_AUTO|config.OUT_LOG_EDSM)): monitor.enable_logging() monitor.start(self.parent) else: monitor.stop() self.destroy()
def run(self): if monitor.start(): try: while True: entry = monitor.get_entry() if entry: self.print_event(entry) continue sleep(1) except KeyboardInterrupt: monitor.stop()
def _destroy(self): # Re-enable hotkey and log monitoring before exit hotkeymgr.register(self.parent, config.getint('hotkey_code'), config.getint('hotkey_mods')) if (config.getint('output') & config.OUT_LOG_AUTO) and (config.getint('output') & (config.OUT_LOG_FILE|config.OUT_LOG_EDSM)): monitor.enable_logging() monitor.start(self.parent) edproxy.start(self.parent) else: monitor.stop() edproxy.stop() self.parent.wm_attributes('-topmost', config.getint('always_ontop') and 1 or 0) self.destroy()