update package structure, move non-executables to lib

This commit is contained in:
Martin Weinelt 2015-03-24 22:10:54 +01:00
commit c74b7b95fb
10 changed files with 21 additions and 16 deletions

20
lib/alfred.py Normal file
View file

@ -0,0 +1,20 @@
import subprocess
import json
def _fetch(data_type):
output = subprocess.check_output(
["alfred-json", "-z", "-f", "json", "-r", str(data_type)])
return json.loads(output.decode("utf-8")).values()
def nodeinfo():
return _fetch(158)
def statistics():
return _fetch(159)
def vis():
return _fetch(160)