supersede: colorize.
This commit is contained in:
parent
2c592bdb53
commit
9f84a7c321
@ -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
|
||||
|
@ -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']))
|
||||
|
Loading…
x
Reference in New Issue
Block a user