From: Ed Bartosh Date: Mon, 19 Aug 2013 15:40:55 +0000 (+0300) Subject: Extended repa list output X-Git-Tag: 0.1~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cce1e2e73992ede7d58fa02158016021aa23c2ac;p=tools%2Frepa.git Extended repa list output Added more information to the repa list output. - list of projects for the submissions - list of images for the submissions and groups Change-Id: I468fe0124cfa9f32dc9871ee1d847bf3d829145e Signed-off-by: Ed Bartosh Reviewed-on: https://otctools.jf.intel.com/review/5993 Tested-by: OTC Tools Tester --- diff --git a/repa/list.py b/repa/list.py index 2af2ec2..6ff71ae 100755 --- a/repa/list.py +++ b/repa/list.py @@ -28,35 +28,36 @@ def get_status(obs, project): for pkginfo in target['packages']: codes.add(pkginfo[1]) status = ','.join(codes) or 'None' - return 'packages: ' + status + return status +def show_images(meta): + if 'images' in meta: + print ' images:', ','.join("%s:%s" % (img['name'], img['status']) \ + for img in meta['images']) + def list_submissions(obs, regexp): """List submissions and groups.""" # submissions - submissions = set() - header = True + groups = [] for project, desc in obs.get_projects('^%s.*%s' % (OBS_PREFIX, regexp)): + meta = json.loads(desc) if ':submitgroup:' in project: + groups.append(meta) continue - meta = json.loads(desc) - submissions.add(meta['git_tag']) - if header: - print ':::: Submissions:' - header = False - print meta['git_tag'], meta['obs_target_prj'], \ - get_status(obs, project) - - # Groups, related to selected submissions - header = True - for project, desc in obs.get_projects('^%ssubmitgroup' % OBS_PREFIX): - meta = json.loads(desc) - lsub = set(meta['submissions']) - if lsub.intersection(submissions): - if header: - print ':::: Groups:' - header = False - print meta['name'], ','.join(subm.split('/')[-1] for subm in lsub) + print meta['git_tag'], meta['obs_target_prj'], + print ' projects: ', ' '.join(meta['projects']) + print " builds:", get_status(obs, project) + show_images(meta) + print + + # groups + for meta in groups: + print meta['name'] + print ' submissions:', ' '.join(subm.split('/')[-1] \ + for subm in meta['submissions']) + show_images(meta) + print class List(object):