|
@@ -1,3 +1,4 @@ |
|
|
|
|
|
#!/usr/bin/python |
|
|
from websocket_server import WebsocketServer |
|
|
from websocket_server import WebsocketServer |
|
|
from SimpleHTTPServer import SimpleHTTPRequestHandler |
|
|
from SimpleHTTPServer import SimpleHTTPRequestHandler |
|
|
from BaseHTTPServer import HTTPServer |
|
|
from BaseHTTPServer import HTTPServer |
|
@@ -5,9 +6,11 @@ from SocketServer import ThreadingMixIn |
|
|
import os, sys, threading |
|
|
import os, sys, threading |
|
|
import webbrowser |
|
|
import webbrowser |
|
|
import argparse |
|
|
import argparse |
|
|
|
|
|
import abp |
|
|
|
|
|
|
|
|
clients = [] |
|
|
clients = [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def new_message(client, server, message): |
|
|
def new_message(client, server, message): |
|
|
print "Received update from client {}.".format(client["id"]) |
|
|
print "Received update from client {}.".format(client["id"]) |
|
|
server.send_message_to_all(message) |
|
|
server.send_message_to_all(message) |
|
@@ -29,7 +32,7 @@ if __name__ == '__main__': |
|
|
args = parser.parse_args() |
|
|
args = parser.parse_args() |
|
|
|
|
|
|
|
|
# Change to the right working dir |
|
|
# Change to the right working dir |
|
|
where = os.path.join(sys.path[0], "../static") |
|
|
|
|
|
|
|
|
where = os.path.join(os.path.dirname(abp.__path__[0]), "static") |
|
|
os.chdir(where) |
|
|
os.chdir(where) |
|
|
|
|
|
|
|
|
# Start the HTTP server |
|
|
# Start the HTTP server |