Better project structure

This commit is contained in:
Anthony Sottile 2014-04-12 07:28:25 -07:00
parent f31f092f9b
commit 1746a97e24
52 changed files with 221 additions and 189 deletions

View file

@ -1,4 +1,3 @@
import sys
RED = '\033[41m'
@ -8,18 +7,19 @@ TURQUOISE = '\033[46;30m'
NORMAL = '\033[0m'
class InvalidColorSetting(ValueError): pass
class InvalidColorSetting(ValueError):
pass
def format_color(text, color, use_color):
def format_color(text, color, use_color_setting):
"""Format text with color.
Args:
text - Text to be formatted with color if `use_color`
color - The color start string
use_color - Whether or not to color
use_color_setting - Whether or not to color
"""
if not use_color:
if not use_color_setting:
return text
else:
return u'{0}{1}{2}'.format(color, text, NORMAL)