Ejemplo n.º 1
0
def index(path):
    if path == "":
        return render_template("browse.html", output=getScripts("info"))
    if utils.isScript("info/" + path):
        g.title = path
        return render_template("script.html", output=utils.tabularToDict(utils.runScript("info/" + path)))
    abort(404)
Ejemplo n.º 2
0
def index():
    g.title = "Home"
    g.url_path = '/'
    raw = utils.runScript('index.sh')
    data = utils.tabularToDict(raw)
    return render_template('index.html', output=data)
Ejemplo n.º 3
0
 def test_tabularToDict(self):
     data = "bo is awesome\n1 2 3\n4 5 6"
     dic = OrderedDict([("bo", ("1", "4")), ("is", ("2", "5")), ("awesome", ("3", "6"))])
     assert utils.tabularToDict(data) == dic