def _main(): class _ServerTester(QObject): def __init__(self, parent = None): #super(ServerTester, self).__init__(parent) QObject.__init__(self) print(super()) return def onNewRequest(self, request, response): #qDebug("here, " + str(request)) response.setHeader('Content-Length', '12') response.writeHead(200) response.write('12345\n12345\n') response.end() import qtutil qInstallMessageHandler(qtutil.qt_debug_handler) a = QCoreApplication(sys.argv) qtutil.pyctrl() # _qogc.start() httpd = QHttpServer() httpd.listen() # httpd.close() tster = _ServerTester() httpd.newRequest.connect(tster.onNewRequest) print(tster.objectName()) a.exec_()
def _main(): class _ServerTester(QObject): def __init__(self, parent=None): #super(ServerTester, self).__init__(parent) QObject.__init__(self) print(super()) return def onNewRequest(self, request, response): #qDebug("here, " + str(request)) response.setHeader('Content-Length', '12') response.writeHead(200) response.write('12345\n12345\n') response.end() import qtutil qInstallMessageHandler(qtutil.qt_debug_handler) a = QCoreApplication(sys.argv) qtutil.pyctrl() # _qogc.start() httpd = QHttpServer() httpd.listen() # httpd.close() tster = _ServerTester() httpd.newRequest.connect(tster.onNewRequest) print(tster.objectName()) a.exec_()
def main(): a = QApplication(sys.argv) qtutil.pyctrl() act = NitroServer() qDebug('execing...') return a.exec_()
def main(): app = QApplication(sys.argv) import qtutil qtutil.pyctrl() mw = MainWindow() mw.show() app.exec_() return
def main(): a = QApplication(sys.argv) qtutil.pyctrl() qDebug('aaa'.encode('utf8') + '成'.encode('utf-8')) mw = MainWindow() # mw.show() shbox = ShellBox() qDebug('execing...') return a.exec_()
def main(): import qtutil app = QCoreApplication(sys.argv) qtutil.pyctrl() fid = '398C8161D038FD328A573FFAA0F5FAAF7FFDE5E8B4350E7D15E6AFD0B993FC529FA90C343627' #sock = ToxFileSocket() #sock.connectToHost(fid, 12345) #tster = _TestToxMsgSocket() #tster.runit() tster = _TestToxServer() tster.runit() app.exec_() return
def main(): app = QCoreApplication(sys.argv) qtutil.pyctrl() config_file = "./toxtun.ini" if len(sys.argv) == 2: config_file = sys.argv[1] if not os.path.exists(config_file): print("config file is not exists: %s" % config_file) help() sys.exit(1) elif len(sys.argv) == 1: pass else: print("provide a valid config file please") help() sys.exit(1) tuncli = ToxNetTunCli(config_file) tuncli.start() app.exec_() return
def main(): app = QCoreApplication(sys.argv) qtutil.pyctrl() config_file = './toxtun.ini' if len(sys.argv) == 2: config_file = sys.argv[1] if not os.path.exists(config_file): print('config file is not exists: %s' % config_file) help() sys.exit(1) elif len(sys.argv) == 1: pass else: print('provide a valid config file please') help() sys.exit(1) tuncli = ToxNetTunCli(config_file) tuncli.start() app.exec_() return
def main(): app = QCoreApplication(sys.argv) qtutil.pyctrl() config_file = './toxtun.ini' if len(sys.argv) == 2: config_file = sys.argv[1] if not os.path.exists(config_file): print('config file is not exists: %s' % config_file) help() sys.exit(1) elif len(sys.argv) == 1: pass else: print('provide a valid config file please') help() sys.exit(1) tunsrv = ToxTunFileSrv(config_file) tunsrv.start() app.exec_() return