Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.73 KB | None | 0 0
  1. class Colors:
  2.     purple = '\033[94m'
  3.     magenta = '\033[95m'
  4.     green = '\033[92m'
  5.     yellow = '\033[93m'
  6.     red = '\033[91m'
  7.     white = '\033[0m'
  8.  
  9. class Aligns:
  10.     center = '{0:^75s}'
  11.     center_top = '\n{0:^75s}'
  12.     center_bottom = '{0:^75s}\n'
  13.     center_full = '\n{0:^75s}\n'
  14.  
  15.     align_top = '\n{0:^0s}'
  16.     align_bottom = '{0:^0s}\n'
  17.     align_full = '\n{0:^0s}\n'
  18.  
  19.  
  20. separator_underscore = '{0:_^75s}'.format('_')
  21. separator_dash = '{0:-^75s}'.format('-')
  22.  
  23.  
  24. MessageTypes = {
  25.  
  26.   'welcome': Colors.purple + Aligns.center_top + Colors.white,
  27.  
  28.   'step': Colors.magenta + Aligns.center + Colors.white,
  29.   'step_t': Colors.magenta + Aligns.center_top + Colors.white,
  30.   'step_b': Colors.magenta + Aligns.center_bottom + Colors.white,
  31.   'step_f': Colors.magenta + Aligns.center_full + Colors.white,
  32.  
  33.   'normal_t': Aligns.align_top,
  34.   'normal_b': Aligns.align_bottom,
  35.   'normal_f': Aligns.align_full,
  36.  
  37.   'passed': Colors.green + '{0}' + Colors.white,
  38.   'passed_t': Colors.green + Aligns.align_top + Colors.white,
  39.   'passed_b': Colors.green + Aligns.align_bottom + Colors.white,
  40.   'passed_f': Colors.green + Aligns.align_full + Colors.white,
  41.  
  42.   'warning': Colors.yellow + '{0}' + Colors.white,
  43.   'warning_t': Colors.yellow + Aligns.align_top + Colors.white,
  44.   'warning_b': Colors.yellow + Aligns.align_bottom + Colors.white,
  45.   'warning_f': Colors.yellow + Aligns.align_full + Colors.white,
  46.  
  47.   'failed': Colors.red + '{0}' + Colors.white,  
  48.   'failed_t': Colors.red + Aligns.align_top + Colors.white,
  49.   'failed_b': Colors.red + Aligns.align_bottom + Colors.white,
  50.   'failed_f': Colors.red + Aligns.align_full + Colors.white  
  51. }
  52.  
  53.  
  54. def message(message, type):
  55.   return MessageTypes.get(type, '{0}').format(message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement