Beispiel #1
0
    def __init__(self, input_q,  output_q, endpoint, **kwds):
        from http import http_server

        threading.Thread.__init__ (self, **kwds)
        self.setDaemon(1)
        self.input_q = input_q
        self.output_q = output_q
        self.endpoint = endpoint
        self.keep_running = True
        self.server = http_server(self.input_q, self.output_q, self.endpoint)

        self.start()
Beispiel #2
0
import http
import network
import time
import auto_setup

Server = http.http_server(80)

while True:
    auto_setup.DoAutoSetup(Server)
Beispiel #3
0
import pygame
from pygame.locals import *

try:
	# create sequencer
	seq = sequencer()
	
	# create UDP UBUS trigger interface
	ubus_server = ubus.ubus_listener(seq)
	
	# create a config manager
	config_manager = config(sequencer=seq, ubus_server=ubus_server)
	
	# create HTTP management interface
	http_server = http.http_server(port=9988, sequencer=seq, ubus_server=ubus_server, config_manager=config_manager)
	
	# load config file
	if len(sys.argv) > 1:
		# switch to config dir if given
		os.chdir(os.path.dirname(sys.argv[1]))
		# load config
		config_manager.load(os.path.basename(sys.argv[1]))
	else:
		dir = 'sounds'
		if os.path.exists(dir) == False:
			os.mkdir(dir)
		os.chdir(dir)
	
	# run servers on new threads
	t1 = threading.Thread(target=http_server.listen)