self.hotkey = Hotkey(self.handle_hotkey) def handle_hotkey(self): self.fire.emit() def stop(self): self.hotkey.stop() def run(self): self.hotkey.start() if __name__ == '__main__': import sys import os logging.basicConfig( filename=os.path.expanduser('~/.lit.server.log'), filemode='w', format='%(asctime)s - %(levelname)s - %(message)s', level=logging.DEBUG ) app = QCoreApplication(sys.argv) set_app_info(app, 'litserver') server = Server() QMetaObject.invokeMethod( server, 'start', Qt.QueuedConnection ) sys.exit(app.exec_())
if __name__ == '__main__': logging.basicConfig( filename=os.path.expanduser('~/.lit.log'), filemode='w', format='%(asctime)s - %(levelname)s - %(message)s', level=logging.DEBUG ) client = None try: start_server() import sys argv = sys.argv app = QApplication(argv) STYLESHEET = 'style.css' set_app_info(app, 'lit') app.setQuitOnLastWindowClosed(False) # style with open(STYLESHEET, 'r') as f: app.setStyleSheet(f.read()) worker = Worker() from client import Client client = Client() QMetaObject.invokeMethod( client, 'start', Qt.QueuedConnection )