relocated “croak” and “report” functionality to here. needs to be altered in all scripts that still use the ASCIItable class for those…
This commit is contained in:
parent
b528088653
commit
2aa1073949
|
@ -5,6 +5,21 @@ import sys,time,random,threading
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from optparse import OptionParser, Option
|
from optparse import OptionParser, Option
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
def croak(self,
|
||||||
|
what,
|
||||||
|
newline = True):
|
||||||
|
# -----------------------------
|
||||||
|
sys.stderr.write(('\n'.join(map(str,what)) if not hasattr(what, "strip")
|
||||||
|
and hasattr(what, "__getitem__")
|
||||||
|
or hasattr(what, "__iter__") else str(what))
|
||||||
|
+('\n' if newline else ''))
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
def report(who,what):
|
||||||
|
# -----------------------------
|
||||||
|
croak( ('\033[1m'+str(who)+'\033[0m' if who else '') + (': '+what if what else '') )
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
def emph(what):
|
def emph(what):
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
|
Loading…
Reference in New Issue