initial commit
This commit is contained in:
commit
c3b94b7106
91 changed files with 56958 additions and 0 deletions
24
configs/lighttpd/cgi-bin/get_topo.py
Executable file
24
configs/lighttpd/cgi-bin/get_topo.py
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/python
|
||||
import os, sys
|
||||
from cgi import escape
|
||||
import cgitb; cgitb.enable()
|
||||
from random import randint
|
||||
import json
|
||||
|
||||
ret = {}
|
||||
|
||||
with open('LOCLTOPO') as f:
|
||||
array = []
|
||||
for line in f:
|
||||
array.append([int(x) for x in line.split()])
|
||||
|
||||
#print "rows = %d" % len(array)
|
||||
#print "columns = %d" % len(array[0])
|
||||
|
||||
ret["rows"] = len(array)
|
||||
ret["columns"] = len(array[0])
|
||||
ret["data"] = array
|
||||
|
||||
print "Content-Type: application/json"
|
||||
print
|
||||
print(json.JSONEncoder().encode(ret))
|
Loading…
Add table
Add a link
Reference in a new issue