Browse Source

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

master
Pete Shadbolt 8 years ago
parent
commit
682e630353
6 changed files with 8 additions and 8 deletions
  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 View File


+ 4
- 4
abp/server.py View File

@@ -7,7 +7,7 @@ import json
import threading
import time
import os
from graph import GraphState
from graphstate import GraphState


class VizHandler(SimpleHTTPRequestHandler):
@@ -18,7 +18,7 @@ class VizHandler(SimpleHTTPRequestHandler):
SimpleHTTPRequestHandler.__init__(self, *args, **kwargs)

def get_state(self):
""" Get the current graph state """
""" Get the current graphstate state """
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
@@ -77,13 +77,13 @@ def demograph():


if __name__ == '__main__':
os.chdir("/home/pete/physics/abp/static")
where = os.path.join(sys.path[0], "../static")
os.chdir(where)
server = Server()
server.start()

g = demograph()


while True:
server.update(g)
time.sleep(1)


+ 1
- 1
abp/viz.py View File

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

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



+ 1
- 1
tests/test_graph.py View File

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



+ 1
- 1
tests/test_json.py View File

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


+ 1
- 1
tests/test_viz.py View File

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




Loading…
Cancel
Save