Example #1
0
 def set_prompt(self, username, breadcrumbs):
     c_pri = color.set('green')
     c_un = color.set('cyan')
     c_d = color.set('green')
     self.prompt = c_pri + 'CS ' + c_un + username + \
                    c_pri + ' ' + ' > '.join(breadcrumbs) + \
                    c_d + '$ ' + color.clear()
Example #2
0
 def do_colortest(self, s):
     for name in color.color_codes.keys():
         print "% 4s %s% 6s" % ('', color.set(name), name),
         print color.clear(), 'bg:',
         for x in color.color_codes.keys():
             print "%s% 6s" % (color.set(x, bg=name), x),
         print color.clear()
         print "% 4s %s% 6s" % ('bold', color.set(name, bold=True), name),
         print color.clear(), 'bg:', 
         for x in color.color_codes.keys():
             print "%s% 6s" % (color.set(x, bold=True, bg=name), x),
         print color.clear()
Example #3
0
 def __init__(self, lb_shell, lb):
     base_shell.__init__(self)
     self.lb_shell = lb_shell
     self.set_prompt(self.lb_shell.main_shell.username, ['Load Balancer', self.lb_shell.region, lb.name])
     self.lb = lb
     self.intro = color.set('yellow') + "If you make any updates, they are" + \
             " not finalized until you run update or commit" + color.clear()
Example #4
0
 def notice(self, text, *args):
     c_notice = color.set('green')
     text += ' ' + ' '.join(args)
     print c_notice, text, color.clear()
Example #5
0
 def warning(self, text, *args):
     c_warn = color.set('yellow', bold=True)
     text += ' ' + ' '.join(args)
     print c_warn, text, color.clear()
Example #6
0
 def alert(self, text, *args):
     c_alert = color.set('red')
     text += ' ' + ' '.join(args)
     print c_alert, text, color.clear()
Example #7
0
 def error(self, text, *args):
     c_error = color.set('purple', bold=True)
     text += ' ' + ' '.join(args)
     print c_error, "Error:", text, color.clear()