|
@@ -7,7 +7,7 @@ import json |
|
|
import threading |
|
|
import threading |
|
|
import time |
|
|
import time |
|
|
import os |
|
|
import os |
|
|
from graph import GraphState |
|
|
|
|
|
|
|
|
from graphstate import GraphState |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VizHandler(SimpleHTTPRequestHandler): |
|
|
class VizHandler(SimpleHTTPRequestHandler): |
|
@@ -18,7 +18,7 @@ class VizHandler(SimpleHTTPRequestHandler): |
|
|
SimpleHTTPRequestHandler.__init__(self, *args, **kwargs) |
|
|
SimpleHTTPRequestHandler.__init__(self, *args, **kwargs) |
|
|
|
|
|
|
|
|
def get_state(self): |
|
|
def get_state(self): |
|
|
""" Get the current graph state """ |
|
|
|
|
|
|
|
|
""" Get the current graphstate state """ |
|
|
self.send_response(200) |
|
|
self.send_response(200) |
|
|
self.send_header('Content-Type', 'application/json') |
|
|
self.send_header('Content-Type', 'application/json') |
|
|
self.end_headers() |
|
|
self.end_headers() |
|
@@ -77,13 +77,13 @@ def demograph(): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
os.chdir("/home/pete/physics/abp/static") |
|
|
|
|
|
|
|
|
where = os.path.join(sys.path[0], "../static") |
|
|
|
|
|
os.chdir(where) |
|
|
server = Server() |
|
|
server = Server() |
|
|
server.start() |
|
|
server.start() |
|
|
|
|
|
|
|
|
g = demograph() |
|
|
g = demograph() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while True: |
|
|
while True: |
|
|
server.update(g) |
|
|
server.update(g) |
|
|
time.sleep(1) |
|
|
time.sleep(1) |
|
|