ffmap-backend/lib/alfred.py

21 lines
335 B
Python
Raw Normal View History

import subprocess
import json
2015-03-24 16:49:37 +01:00
def _fetch(data_type):
2015-03-24 17:41:02 +01:00
output = subprocess.check_output(
["alfred-json", "-z", "-f", "json", "-r", str(data_type)])
2015-03-24 16:49:37 +01:00
return json.loads(output.decode("utf-8")).values()
def nodeinfo():
2015-03-24 16:49:37 +01:00
return _fetch(158)
def statistics():
2015-03-24 16:49:37 +01:00
return _fetch(159)
def vis():
2015-03-24 16:49:37 +01:00
return _fetch(160)