Example #1
0
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)
Example #2
0
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)
Example #3
0
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)
Example #4
0
 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
     }
Example #5
0
def api_pathinfo(id):
    ScanPathes = get_model("scanpathes")
    p = ScanPathes.get(id)
    d = p.to_dict()
    d['csstag'] = crtype2csstag(d['crtype'])
    return json(d)
Example #6
0
 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}
Example #7
0
def api_pathinfo(id):
    ScanPathes = get_model("scanpathes")
    p = ScanPathes.get(id)
    d = p.to_dict()
    d['csstag'] = crtype2csstag(d['crtype'])
    return json(d)