def stats(self): """ controller for the stats widget """ try: m = g.p.connect() except ConnectionClosed: return render('/null.html') c.stats = m.stats() aa = AlbumArt() c.dir_size = aa.dir_size() return render('/stats.html')
def stats(self): """ controller for the stats widget """ try: self.m = g.p.connect() except (NoMPDConnection, ConnectionClosed): return render('/null.html') c.stats = self.m.stats() aa = AlbumArt() c.dir_size = aa.dir_size() return render('/stats.html')