예제 #1
0
파일: handlers.py 프로젝트: shiznu/GetCM
    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([])
예제 #2
0
파일: handlers.py 프로젝트: kingfs/GetCM
 def respond(builds):
     return self.render("browse.mako", {'request_type': type, 'request_device': device, 'devices': Device.get_all(), 'files': files, 'builds': builds})