示例#1
0
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_()
示例#2
0
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_()
示例#3
0
文件: nitro.py 项目: kitech/toxsh
def main():
    a = QApplication(sys.argv)
    qtutil.pyctrl()

    act = NitroServer()

    qDebug('execing...')
    return a.exec_()
示例#4
0
def main():
    a = QApplication(sys.argv)
    qtutil.pyctrl()

    act = NitroServer()

    qDebug('execing...')
    return a.exec_()
示例#5
0
文件: latrix.py 项目: kitech/triline
def main():
    app = QApplication(sys.argv)
    import qtutil
    qtutil.pyctrl()

    mw = MainWindow()
    mw.show()

    app.exec_()
    return
示例#6
0
def main():
    app = QApplication(sys.argv)
    import qtutil
    qtutil.pyctrl()

    mw = MainWindow()
    mw.show()

    app.exec_()
    return
示例#7
0
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_()
示例#8
0
文件: toxshd.py 项目: kitech/toxsh
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_()
示例#9
0
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
示例#10
0
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
示例#11
0
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
示例#12
0
文件: toxtunsrv.py 项目: kitech/toxsh
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