def test_colors(): style = color.color_style() style.ERROR = termcolors.make_style(fg='red', opts=('bold',)) style.INFO = termcolors.make_style(fg='blue') style.OK = termcolors.make_style(fg='green') style.WARNING = termcolors.make_style(fg='yellow') print style.ERROR('I am red and bold') print style.INFO('I am blue') print style.OK('I am green') print style.WARNING('I am yellow')
#!/usr/bin/python #-*- coding:utf-8 -*- import color style = color.color_style() print style.ERROR('it is error') print style.NOTICE('it is notice')
def __init__(self, argv=None): self.argv = argv or sys.argv[:] self.prog_name = os.path.basename(self.argv[0]) self.style = color_style( ) self.version = None
def __init__(self): self.style = color_style()
def __init__(self): self.style = color_style( )
def __init__(self, argv=None): self.argv = argv or sys.argv[:] self.prog_name = os.path.basename(self.argv[0]) self.style = color_style() self.version = None