def read_dash(self, fname): try: dash = json.load(file(fname)) c.title = dash.get('title', os.path.basename(fname)) c.updated = dash.get('updated', time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(os.path.getmtime(fname)))) c.headers = dash.get('headers', []) c.note = dash.get('note', '') c.data = dash.get('data', []) return render('/dash.mako') except: return "ERROR - %s" % fname
def read_dash(self, fname): try: dash = json.load(file(fname)) c.title = dash.get('title', os.path.basename(fname)) c.updated = dash.get( 'updated', time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(fname)))) c.headers = dash.get('headers', []) c.note = dash.get('note', '') c.data = dash.get('data', []) return render('/dash.mako') except: return "ERROR - %s" % fname
def index(self): c.body = self.scan_dashes() return render('/index.mako')