Skip to content

Commit

Permalink
Finish termcolor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
karel-brinda committed Jun 21, 2017
1 parent 3051a11 commit d5a2da6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pyfaidx
pysam
snakemake
svg42pdf>=0.1.1
termcolor

22 changes: 15 additions & 7 deletions rnftools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import snakemake
import os
import re
from termcolor import colored, cprint

import rnftools.mishmash
import rnftools.lavender
Expand Down Expand Up @@ -72,12 +71,17 @@ def message(message, program=None, subprogram=None):
else:
subprogram_part = "{}: ".format(subprogram)

cprint(
print(
"".join([program_part, subprogram_part, message]),
"blue",
attrs=['bold'],
file=sys.stderr,
)

#cprint(
# "".join([program_part, subprogram_part, message]),
# "blue",
# attrs=['bold'],
#)


def error(message, program=None, subprogram=None, exception=None):
if exception != None:
Expand All @@ -93,11 +97,15 @@ def error(message, program=None, subprogram=None, exception=None):
else:
subprogram_part = "{}: ".format(subprogram)

cprint(
print(
"".join([program_part, subprogram_part, "Error: ", message]),
"red",
attrs=['bold'],
file=sys.stderr,
)
#cprint(
# "".join([program_part, subprogram_part, "Error: ", message]),
# "red",
# attrs=['bold'],
#)

if exception != None:
raise exception(message)
Expand Down

0 comments on commit d5a2da6

Please sign in to comment.