|
|
|
@ -101,16 +101,19 @@ _TAG_COLOR = { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def message(tag, message, explanatory_text=None, do_newline=False): |
|
|
|
|
sys.stdout.write('%s%s%s\x1b[%d;%dm%s\x1b[0m: %s%s' % ( |
|
|
|
|
_BEGINNING_OF_LINE, |
|
|
|
|
_CLEAR_LINE, |
|
|
|
|
'\n%s' % explanatory_text if explanatory_text is not None else '', |
|
|
|
|
_COLORS[_TAG_COLOR[tag]][1], |
|
|
|
|
_COLORS[_TAG_COLOR[tag]][0], |
|
|
|
|
tag, |
|
|
|
|
message, |
|
|
|
|
'\n' if do_newline or explanatory_text is not None else '')) |
|
|
|
|
sys.stdout.flush() |
|
|
|
|
try: |
|
|
|
|
sys.stdout.write('%s%s%s\x1b[%d;%dm%s\x1b[0m: %s%s' % ( |
|
|
|
|
_BEGINNING_OF_LINE, |
|
|
|
|
_CLEAR_LINE, |
|
|
|
|
'\n%s' % explanatory_text if explanatory_text is not None else '', |
|
|
|
|
_COLORS[_TAG_COLOR[tag]][1], |
|
|
|
|
_COLORS[_TAG_COLOR[tag]][0], |
|
|
|
|
tag, |
|
|
|
|
message, |
|
|
|
|
'\n' if do_newline or explanatory_text is not None else '')) |
|
|
|
|
sys.stdout.flush() |
|
|
|
|
except: |
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def which(filename): |
|
|
|
|