예제 #1
0
파일: httpserver.py 프로젝트: kitech/toxsh
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