Bläddra i källkod

Oh my god sys.path[0] is so good

master
Pete Shadbolt 9 år sedan
förälder
incheckning
682e630353
6 ändrade filer med 8 tillägg och 8 borttagningar
  1. +0
    -0
      abp/graphstate.py
  2. +4
    -4
      abp/server.py
  3. +1
    -1
      abp/viz.py
  4. +1
    -1
      tests/test_graph.py
  5. +1
    -1
      tests/test_json.py
  6. +1
    -1
      tests/test_viz.py

abp/graph.py → abp/graphstate.py Visa fil


+ 4
- 4
abp/server.py Visa fil

@@ -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)


+ 1
- 1
abp/viz.py Visa fil

@@ -2,7 +2,7 @@ import networkx as nx
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
import clifford import clifford
import numpy as np import numpy as np
from graph import GraphState
from graphstate import GraphState


VOP_COLORS = ["red", "green", "blue", "orange", "yellow", "purple", "black", "white"] VOP_COLORS = ["red", "green", "blue", "orange", "yellow", "purple", "black", "white"]




+ 1
- 1
tests/test_graph.py Visa fil

@@ -1,4 +1,4 @@
from abp.graph import GraphState, DiffedGraphState
from abp.graphstate import GraphState, DiffedGraphState
from abp import clifford from abp import clifford
import time import time




+ 1
- 1
tests/test_json.py Visa fil

@@ -1,4 +1,4 @@
from abp.graph import GraphState, DiffedGraphState
from abp.graphstate import GraphState, DiffedGraphState
from abp import clifford from abp import clifford
import time import time
import json import json


+ 1
- 1
tests/test_viz.py Visa fil

@@ -1,4 +1,4 @@
from abp.graph import GraphState
from abp.graphstate import GraphState
from abp import viz from abp import viz






Laddar…
Avbryt
Spara