Example #1
0
def launchUI():
    global header
    header = loadHtmlFile("header.html")
    uiserver.beginServing()
    uiserver.setCallback(controlsCallback, "/controls")
    displayStartPage()
    webbrowser.open('http://localhost:'+str(uiserver.server.server_address[1]))
Example #2
0
def launchUI():
    global header
    header = loadHtmlFile("header.html")
    uiserver.beginServing()
    uiserver.setCallback(controlsCallback, "/controls")
    displayStartPage()
    webbrowser.open('http://localhost:' +
                    str(uiserver.server.server_address[1]))
Example #3
0
def launchUI():
    global header
    header = loadHtmlFile("header.html")
    uiserver.beginServing()
    uiserver.setCallback(controlsCallback, "/controls")
    displayStartPage()
    url = 'http://localhost:'+str(uiserver.server.server_address[1])
    print("PDBFixer running: %s " % url)
    webbrowser.open(url)

    # the uiserver is running in a background daemon thread that dies whenever
    # the main thread exits. So, to keep the whole process alive, we just sleep
    # here in the main thread. When Control-C is called, the main thread shuts
    # down and then the uiserver exits. Without this daemon/sleep combo, the
    # process cannot be killed with Control-C. Reference stack overflow link:
    # http://stackoverflow.com/a/11816038/1079728
    while True:
        time.sleep(0.5)
Example #4
0
def launchUI():
    global header
    header = loadHtmlFile("header.html")
    uiserver.beginServing()
    uiserver.setCallback(controlsCallback, "/controls")
    displayStartPage()
    url = 'http://localhost:' + str(uiserver.server.server_address[1])
    print("PDBFixer running: %s " % url)
    webbrowser.open(url)

    # the uiserver is running in a background daemon thread that dies whenever
    # the main thread exits. So, to keep the whole process alive, we just sleep
    # here in the main thread. When Control-C is called, the main thread shuts
    # down and then the uiserver exits. Without this daemon/sleep combo, the
    # process cannot be killed with Control-C. Reference stack overflow link:
    # http://stackoverflow.com/a/11816038/1079728

    global uiIsRunning
    uiIsRunning = True
    while uiIsRunning:
        time.sleep(0.5)