simplified reporting using "emph"
This commit is contained in:
parent
8f32d03a9e
commit
5f9fae1b75
|
@ -4,6 +4,7 @@
|
|||
|
||||
import os,sys
|
||||
import numpy as np
|
||||
import util
|
||||
|
||||
class ASCIItable():
|
||||
'''
|
||||
|
@ -67,6 +68,10 @@ class ASCIItable():
|
|||
or hasattr(what, "__iter__") else str(what))
|
||||
+('\n' if newline else '')),
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
def report_name(self, scriptName, fileName):
|
||||
self.croak(util.emph(scriptName)+(': '+fileName if fileName else ''))
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
def close(self,
|
||||
dismiss = False):
|
||||
|
@ -530,4 +535,4 @@ class ASCIItable():
|
|||
microstructure[i:i+s] = items[:s]
|
||||
i += s
|
||||
|
||||
return microstructure
|
||||
return microstructure
|
||||
|
|
|
@ -55,7 +55,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name, buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header -------------------------------------------
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name, buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name, buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name, buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name, buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header -------------------------------------------
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
table.head_read() # read ASCII header info
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
table.head_read() # read ASCII header info
|
||||
table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:]))
|
||||
|
|
|
@ -38,7 +38,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ for name in filenames:
|
|||
buffered = False)
|
||||
except: continue
|
||||
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
tables = []
|
||||
for addTable in options.table:
|
||||
try:
|
||||
|
@ -74,4 +74,4 @@ for name in filenames:
|
|||
|
||||
table.close() # close ASCII tables
|
||||
for addTable in tables:
|
||||
addTable.close()
|
||||
addTable.close()
|
||||
|
|
|
@ -65,7 +65,7 @@ for name in filenames:
|
|||
prefix+os.path.basename(name)) if name else name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ for name in filenames:
|
|||
outname = options.label+'_averaged_'+name if name else name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ sanity checks ---------------------------------------
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ for name in filenames:
|
|||
buffered = False)
|
||||
except:
|
||||
continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ for name in filenames:
|
|||
os.path.basename(name)) if name else name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ assemble info -----------------------------------------
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ assemble info ---------------------------------------
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ for name in filenames:
|
|||
labeled = options.label != None,
|
||||
readonly = True)
|
||||
except: continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ for name in filenames:
|
|||
labeled = options.label != None,
|
||||
readonly = True)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ for name in filenames:
|
|||
labeled = options.label != None,
|
||||
readonly = True)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak(damask.util.emph(scriptName)+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ read header ------------------------------------------
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False, labeled = options.labeled, readonly = True)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ output head ---------------------------------------
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ for name in filenames:
|
|||
table = damask.ASCIItable(name = name,
|
||||
buffered = False)
|
||||
except: continue
|
||||
table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else ''))
|
||||
table.report_name(scriptName,name)
|
||||
|
||||
# ------------------------------------------ assemble header ---------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue