コード例 #1
0
def start():
    logger.info("server init...")
    config.verify_directories_created()
    try:
        HTTPServer.start(MostrarInfo)
        WebSocket.start(MostrarInfo)

        # Da por levantado el servicio
        logger.info("--------------------------------------------------------------------")
        logger.info("Alfa Iniciado")
        logger.info("La URL para acceder es http://%s:%s" % (myip, http_port))
        logger.info("WebSocket Server iniciado en ws://%s:%s" % (myip, websocket_port))
        logger.info("--------------------------------------------------------------------")
        logger.info("Runtime Path      : " + config.get_runtime_path())
        logger.info("Data Path         : " + config.get_data_path())
        logger.info("Download Path     : " + config.get_setting("downloadpath"))
        logger.info("DownloadList Path : " + config.get_setting("downloadlistpath"))
        logger.info("Bookmark Path     : " + config.get_setting("bookmarkpath"))
        logger.info("VideoLibrary Path : " + config.get_setting("videolibrarypath"))
        logger.info("--------------------------------------------------------------------")
        MostrarInfo()

        start = True
        while start:
            time.sleep(1)

    except KeyboardInterrupt:
        print 'Deteniendo el servidor HTTP...'
        HTTPServer.stop()
        print 'Deteniendo el servidor WebSocket...'
        WebSocket.stop()
        print 'Alfa Detenido'
        start = False
コード例 #2
0
def start():
    logger.info("pelisalacarta server init...")
    config.verify_directories_created()
    try:
        HTTPServer.start(MostrarInfo)
        WebSocket.start(MostrarInfo)

        # Da por levantado el servicio
        logger.info("--------------------------------------------------------------------")
        logger.info("Pelisalacarta Iniciado")
        logger.info("La URL para acceder es http://" + myip + ":" + str(http_port))
        logger.info("WebSocket Server iniciado en ws://" + myip + ":" + str(websocket_port))
        logger.info("--------------------------------------------------------------------")
        logger.info("Runtime Path      : " + config.get_runtime_path())
        logger.info("Data Path         : " + config.get_data_path())
        logger.info("Download Path     : " + config.get_setting("downloadpath"))
        logger.info("DownloadList Path : " + config.get_setting("downloadlistpath"))
        logger.info("Bookmark Path     : " + config.get_setting("bookmarkpath"))
        logger.info("Library Path      : " + config.get_setting("librarypath"))
        logger.info("--------------------------------------------------------------------")
        MostrarInfo()

        start = True
        while start:
            time.sleep(1)

    except KeyboardInterrupt:
        print 'Deteniendo el servidor HTTP...'
        HTTPServer.stop()
        print 'Deteniendo el servidor WebSocket...'
        WebSocket.stop()
        print 'Pelisalacarta Detenido'
        start = False
コード例 #3
0
def start():
  logger.info("pelisalacarta server init...")
  config.verify_directories_created() 
  try: 
      import HTTPServer
      HTTPServer.start()
      import WebSocket
      WebSocket.start(ProcessRequest,MostrarInfo)
      
        
      # Da por levantado el servicio
      logger.info("--------------------------------------------------------------------")
      logger.info("Pelisalacarta Iniciado")
      logger.info("La URL para acceder es http://" + myip + ":" + str(PORT))
      logger.info("WebSocket Server iniciado en ws://"+ myip + ":" + str(WebsocketPort))
      logger.info("--------------------------------------------------------------------")
      logger.info("Runtime Path      = " + config.get_runtime_path())
      logger.info("Data Path         = " + config.get_data_path())
      logger.info("Download Path     = " + config.get_setting("downloadpath") )
      logger.info("DownloadList Path = " + config.get_setting("downloadlistpath"))
      logger.info("Bookmark Path     = " + config.get_setting("bookmarkpath"))
      logger.info("Library Path      = " + config.get_setting("library_path"))
      logger.info("Cache Path        : " + config.get_setting("cache.dir"))  
      logger.info("Cookies Path      : " + config.get_setting("cookies.dir"))  
      logger.info("--------------------------------------------------------------------")
      MostrarInfo()
      
      Start = True
      while Start:
        pass
  except KeyboardInterrupt:
      print 'Deteniendo el servidor'
      HTTPServer.stop()
      WebSocket.stop()
      Start= False
コード例 #4
0
ファイル: main.py プロジェクト: CelalV/Python_Projects
def main():

    udpServer = UDP_Server.UDPServer()
    udpServer.start()

    httpserver = HTTPServer()
    httpserver.start()
コード例 #5
0
ファイル: web-browser2.py プロジェクト: mahesh-km/scripts
def main():
       try:
          httpd = HTTPServer(('', 10001), CustomHandler)
          print ('started httpd...')
          httpd.serve_forever()
       except KeyboardInterrupt:
          print ('^C received, shutting down server')
          httpd.socket.close()
コード例 #6
0
 def apaga_servicio_http(self):
     self.boton_in_http.setVisible(True)
     self.boton_of_http.setVisible(False)
     print("Server turned off")
     try:
         HTTPServer.apaga_servidor()
     except:
         pass
コード例 #7
0
 def apaga_servicio_http(self):
     self.panel_servicios.append("Servidor HTTP apagado")
     self.statusbar.showMessage("Servidor HTTP apagado")
     self.boton_in_http.setVisible(True)
     self.boton_off_http.setVisible(False)
     pixmap = QtGui.QPixmap('img/off.png')
     self.estado_http.setPixmap(pixmap)
     try:
         HTTPServer.apaga_servidor()
     except:
         pass
コード例 #8
0
def start():
    logger.info("pelisalacarta server init...")
    config.verify_directories_created()
    try:
        import HTTPServer
        HTTPServer.start()
        import WebSocket
        WebSocket.start(ProcessRequest, MostrarInfo)

        # Da por levantado el servicio
        logger.info(
            "--------------------------------------------------------------------"
        )
        logger.info("Pelisalacarta Iniciado")
        logger.info("La URL para acceder es http://" + myip + ":" + str(PORT))
        logger.info("WebSocket Server iniciado en ws://" + myip + ":" +
                    str(WebsocketPort))
        logger.info(
            "--------------------------------------------------------------------"
        )
        logger.info("Runtime Path      = " + config.get_runtime_path())
        logger.info("Data Path         = " + config.get_data_path())
        logger.info("Download Path     = " +
                    config.get_setting("downloadpath"))
        logger.info("DownloadList Path = " +
                    config.get_setting("downloadlistpath"))
        logger.info("Bookmark Path     = " +
                    config.get_setting("bookmarkpath"))
        logger.info("Library Path      = " +
                    config.get_setting("library_path"))
        logger.info("Cache Path        : " + config.get_setting("cache.dir"))
        logger.info("Cookies Path      : " + config.get_setting("cookies.dir"))
        logger.info(
            "--------------------------------------------------------------------"
        )
        MostrarInfo()

        Start = True
        while Start:
            pass
    except KeyboardInterrupt:
        print 'Deteniendo el servidor'
        HTTPServer.stop()
        WebSocket.stop()
        Start = False
コード例 #9
0
def start():
    logger.info("pelisalacarta server init...")
    import services
    config.verify_directories_created()
    try:
        import HTTPServer
        HTTPServer.start(MostrarInfo)
        import WebSocket
        WebSocket.start(MostrarInfo)

        # Da por levantado el servicio
        logger.info("--------------------------------------------------------------------")
        logger.info("Pelisalacarta Iniciado")
        logger.info("La URL para acceder es http://" + myip + ":" + str(http_port))
        logger.info("WebSocket Server iniciado en ws://" + myip + ":" + str(websocket_port))
        logger.info("--------------------------------------------------------------------")
        logger.info("Runtime Path      : " + config.get_runtime_path())
        logger.info("Data Path         : " + config.get_data_path())
        logger.info("Download Path     : " + config.get_setting("downloadpath"))
        logger.info("DownloadList Path : " + config.get_setting("downloadlistpath"))
        logger.info("Bookmark Path     : " + config.get_setting("bookmarkpath"))
        logger.info("Library Path      : " + config.get_setting("librarypath"))
        logger.info("--------------------------------------------------------------------")
        MostrarInfo()

        start = True
        while start:
            time.sleep(1)

    except KeyboardInterrupt:
        print 'Deteniendo el servidor HTTP...'
        HTTPServer.stop()
        print 'Deteniendo el servidor WebSocket...'
        WebSocket.stop()
        print 'Pelisalacarta Detenido'
        start = False
コード例 #10
0
 def inicia_servicio_http(self):
     self.boton_in_http.setVisible(False)
     self.boton_of_http.setVisible(True)
     HTTPServer.inicia_servidor(IPScanner.getMyIpAddress(), 80, False)
コード例 #11
0
ファイル: HTTPServerDemo.py プロジェクト: chenmai/python-ote
            content = content.encode(enc)          
            f = io.BytesIO()  
            f.write(content)  
            f.seek(0)  
            self.send_response(200)  
            self.send_header("Content-type", "text/html; charset=%s" % enc)  
            self.send_header("Content-Length", str(len(content)))  
            self.end_headers()  
            shutil.copyfileobj(f,self.wfile)   

def transDicts(params):
    dicts={}
    if len(params)==0:
        return
    params = params.split('&')
    for param in params:
        dicts[param.split('=')[0]]=param.split('=')[1]
    return dicts
       
if __name__=='__main__':
    
    try:
        server = HTTPServer(('', 8000), MyRequestHandler)
        print ('started httpserver...')
        server.serve_forever()

    except KeyboardInterrupt:
        server.socket.close()
    
    pass
コード例 #12
0
 def inicia_servicio_http(self):
     self.boton_in_http.setVisible(False)
     self.boton_off_http.setVisible(True)
     pixmap = QtGui.QPixmap('img/on.png')
     self.estado_http.setPixmap(pixmap)
     HTTPServer.start_http_server(IPScanner.getMyIpAddress(), self.spinner_default_http.value(), False)