def runServer(kodi = '', kodi_home = '', startBrowser=False):
importer = ksi.KodiScriptImporter(kodi, kodi_home)
importer.install(True)
kodiSrv = KodiServer(importer)
wsgiApp = partial(application, server=kodiSrv)
server_address = ('localhost', 5000)
httpd = make_server(
server_address[0], # The host name
server_address[1], # A port number where to wait for the request
wsgiApp # The application object name, in this case a function
)
srvThread = threading.Thread(target=httpd.serve_forever)
if startBrowser:
webbrowser.open('http://{}:{}'.format(*server_address))
srvThread.start()
return httpd
评论列表
文章目录