def api_rlist(): ScanPathes = get_model("scanpathes") pathes = ScanPathes.filter(ScanPathes.c.release==True).order_by(ScanPathes.c.id.desc()) l = [] for p in pathes: d = p.to_dict() d['csstag'] = crtype2csstag(d['crtype']) l.append(d) return json(l)
def api_package_list(): ScanPathes = get_model("scanpathes") pathes = ScanPathes.filter(ScanPathes.c.package_root==True).order_by(ScanPathes.c.path.asc()) l = [] for p in pathes: d = p.to_dict() d['csstag'] = crtype2csstag(d['crtype']) d['rnote'] = text2html(d['rnote']) l.append(d) return json(l)
def api_package_list(): ScanPathes = get_model("scanpathes") pathes = ScanPathes.filter(ScanPathes.c.package_root == True).order_by( ScanPathes.c.path.asc()) l = [] for p in pathes: d = p.to_dict() d['csstag'] = crtype2csstag(d['crtype']) d['rnote'] = text2html(d['rnote']) l.append(d) return json(l)
def to_api_dict(self): isparent = (self.type == 'd') return { 'id': '%d' % (self.id), 'pid': self.parent, 'name': split(self.path)[-1], 'isparent': isparent, 'csstag': crtype2csstag(self.crtype), 'release': self.release, 'package_root': self.package_root, 'rnote': self.rnote, 'selected': False }
def api_pathinfo(id): ScanPathes = get_model("scanpathes") p = ScanPathes.get(id) d = p.to_dict() d['csstag'] = crtype2csstag(d['crtype']) return json(d)
def to_api_dict(self): isparent = (self.type == 'd') return {'id':'%d'%(self.id),'pid':self.parent,'name':split(self.path)[-1],'isparent':isparent,'csstag':crtype2csstag(self.crtype),'release':self.release,'package_root':self.package_root,'rnote':self.rnote,'selected':False}