supersede: colorize.

This commit is contained in:
Jimmy Berry 2017-04-26 21:10:52 -05:00
parent 2c592bdb53
commit 9f84a7c321
2 changed files with 11 additions and 7 deletions

View File

@ -89,8 +89,7 @@ class AdiCommand:
# Auto-superseding request in adi command
stage_info, code = self.api.update_superseded_request(request)
if stage_info:
print(line + Fore.MAGENTA +
' ({})'.format(SupersedeCommand.CODE_MAP[code]) + Fore.RESET)
print(line + ' ({})'.format(SupersedeCommand.CODE_MAP[code]))
continue
# Only create staging projec the first time a non superseded

View File

@ -1,9 +1,11 @@
from colorama import Fore
class SupersedeCommand(object):
CODE_MAP = {
None: 'superseded',
True: 'declined',
False: 'ignored',
None: Fore.MAGENTA + 'superseded' + Fore.RESET,
True: Fore.RED + 'declined' + Fore.RESET,
False: Fore.WHITE + 'ignored' + Fore.RESET,
}
def __init__(self, api):
@ -17,5 +19,8 @@ class SupersedeCommand(object):
if code is not None:
verbage += ' in favor of'
print('request {} for {} {} {} in {}'.format(
request.get('id'), target_package, verbage,
stage_info['rq_id'], stage_info['prj']))
request.get('id'),
Fore.CYAN + target_package + Fore.RESET,
verbage,
stage_info['rq_id'],
Fore.YELLOW + stage_info['prj']))