4
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2025-08-14 15:58:10 +00:00

replace tabs with spaces

This commit is contained in:
Michał Zieliński
2015-11-21 12:47:21 +01:00
parent 26343b47fb
commit e4b9b130db
6 changed files with 422 additions and 422 deletions

View File

@@ -5,25 +5,25 @@ import graphPlotter
def generate_graph(time_limit=60*60*3):
nodes, edges = load_graph_from_db(time_limit)
print '%d nodes, %d edges' % (len(nodes), len(edges))
nodes, edges = load_graph_from_db(time_limit)
print '%d nodes, %d edges' % (len(nodes), len(edges))
graph = graphPlotter.position_nodes(nodes, edges)
json = graphPlotter.get_graph_json(graph)
graph = graphPlotter.position_nodes(nodes, edges)
json = graphPlotter.get_graph_json(graph)
with open('static/graph.json', 'w') as f:
f.write(json)
with open('static/graph.json', 'w') as f:
f.write(json)
def load_graph_from_db(time_limit):
config = Config('./')
config.from_pyfile('web_config.cfg')
config = Config('./')
config.from_pyfile('web_config.cfg')
with NodeDB(config) as db:
nodes = db.get_nodes(time_limit)
edges = db.get_edges(nodes, 60*60*24*7)
return (nodes, edges)
with NodeDB(config) as db:
nodes = db.get_nodes(time_limit)
edges = db.get_edges(nodes, 60*60*24*7)
return (nodes, edges)
if __name__ == '__main__':
generate_graph()
generate_graph()