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)
def index(): g.title = "Home" g.url_path = '/' raw = utils.runScript('index.sh') data = utils.tabularToDict(raw) return render_template('index.html', output=data)
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