def get(self): device = self.request.arguments.get('device', [None])[0] type = self.request.arguments.get('type', [None])[0] files = File.browse(device, type) try: devicemap = eval(open("/usr/local/share/devices.dict").read()) except: devicemap = {} for fileobj in files: fileobj.base62 = base62_encode(fileobj.id) devicelist = Device.get_all() namelist = {} for codename in devicelist: if codename in devicemap: namelist[codename] = devicemap[codename] else: namelist[codename] = codename def respond(builds): return self.render("browse.mako", {'request_type': type, 'request_device': device, 'devices': devicelist, 'devicenames': namelist, 'files': files, 'builds': builds}) #self.stats.incr('view_browse') #return self.activebuilds.get(respond) return respond([])
def respond(builds): return self.render("browse.mako", {'request_type': type, 'request_device': device, 'devices': Device.get_all(), 'files': files, 'builds': builds})