diff options
-rwxr-xr-x | repa/list.py | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/repa/list.py b/repa/list.py index 0e0251b..d92e4fa 100755 --- a/repa/list.py +++ b/repa/list.py @@ -106,7 +106,7 @@ def get_sr(obs, project, package, tag, status): return sreq[0] def list_submissions(obs, target, processes, base, is_colorize=False, - showurls=False, ignore='', showtime=False): + showurls=False, ignore='', showtime=False, refprj=False): """List submissions and groups.""" colorizer = Colorizer(is_colorize) # submissions @@ -136,17 +136,33 @@ def list_submissions(obs, target, processes, base, is_colorize=False, rsr = get_sr(obs, base, projects[0], tag, 'revoked') if rsr: base_status = colorizer.red('rejected. SR %s' % rsr) - print '%-37s %-37s %-37s %s' % \ - (meta['git_tag'], - get_status(meta, colorizer, build_results, - ignore, obs, showtime), - base_status, ','.join(projects)) + if refprj: + print '%-37s %-37s %-37s %-37s %s' % \ + (meta['git_tag'], + meta['ref_obs_target_prj'], + get_status(meta, colorizer, build_results, + ignore, obs, showtime), + base_status, ','.join(projects)) + else: + print '%-37s %-37s %-37s %s' % \ + (meta['git_tag'], + get_status(meta, colorizer, build_results, + ignore, obs, showtime), + base_status, ','.join(projects)) else: - print '%-37s %-37s %s' % \ - (meta['git_tag'], \ - get_status(meta, colorizer, build_results, - ignore, obs, showtime), - ','.join(projects)) + if refprj: + print '%-37s %-37s %-37s %s' % \ + (meta['git_tag'], + meta['ref_obs_target_prj'], + get_status(meta, colorizer, build_results, + ignore, obs, showtime), + ','.join(projects)) + else: + print '%-37s %-37s %s' % \ + (meta['git_tag'], + get_status(meta, colorizer, build_results, + ignore, obs, showtime), + ','.join(projects)) if showurls: show_urls(meta) @@ -185,6 +201,9 @@ class List(object): parser.add_argument('--showtime', action='store_true', help='show build time', default=config.get('showtime', '').lower() == 'on') + parser.add_argument('--refprj', action='store_true', + help='Show submission reference project in project', + default=config.get('refprj', '').lower() == 'on') @staticmethod def run(argv): @@ -192,7 +211,7 @@ class List(object): obs = OBS(argv.apiurl, argv.apiuser, argv.apipasswd) return list_submissions(obs, argv.project, argv.processes, argv.base, argv.colorize, argv.showurls, argv.ignore, - argv.showtime) + argv.showtime, argv.refprj) if __name__ == '__main__': |