Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Colors:
- purple = '\033[94m'
- magenta = '\033[95m'
- green = '\033[92m'
- yellow = '\033[93m'
- red = '\033[91m'
- white = '\033[0m'
- class Aligns:
- center = '{0:^75s}'
- center_top = '\n{0:^75s}'
- center_bottom = '{0:^75s}\n'
- center_full = '\n{0:^75s}\n'
- align_top = '\n{0:^0s}'
- align_bottom = '{0:^0s}\n'
- align_full = '\n{0:^0s}\n'
- separator_underscore = '{0:_^75s}'.format('_')
- separator_dash = '{0:-^75s}'.format('-')
- MessageTypes = {
- 'welcome': Colors.purple + Aligns.center_top + Colors.white,
- 'step': Colors.magenta + Aligns.center + Colors.white,
- 'step_t': Colors.magenta + Aligns.center_top + Colors.white,
- 'step_b': Colors.magenta + Aligns.center_bottom + Colors.white,
- 'step_f': Colors.magenta + Aligns.center_full + Colors.white,
- 'normal_t': Aligns.align_top,
- 'normal_b': Aligns.align_bottom,
- 'normal_f': Aligns.align_full,
- 'passed': Colors.green + '{0}' + Colors.white,
- 'passed_t': Colors.green + Aligns.align_top + Colors.white,
- 'passed_b': Colors.green + Aligns.align_bottom + Colors.white,
- 'passed_f': Colors.green + Aligns.align_full + Colors.white,
- 'warning': Colors.yellow + '{0}' + Colors.white,
- 'warning_t': Colors.yellow + Aligns.align_top + Colors.white,
- 'warning_b': Colors.yellow + Aligns.align_bottom + Colors.white,
- 'warning_f': Colors.yellow + Aligns.align_full + Colors.white,
- 'failed': Colors.red + '{0}' + Colors.white,
- 'failed_t': Colors.red + Aligns.align_top + Colors.white,
- 'failed_b': Colors.red + Aligns.align_bottom + Colors.white,
- 'failed_f': Colors.red + Aligns.align_full + Colors.white
- }
- def message(message, type):
- return MessageTypes.get(type, '{0}').format(message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement