formatted return message also on interactive shells
This commit is contained in:
parent
100a2031d3
commit
669ca82ce1
|
@ -70,7 +70,7 @@ class Geom():
|
|||
message[-1] = util.delete(message[-1])
|
||||
message.append('max microstructure: {}'.format(np.nanmax(self.microstructure)))
|
||||
|
||||
return util.srepr(message)
|
||||
return util.return_message(message)
|
||||
|
||||
def set_comments(self,comments):
|
||||
self.comments = []
|
||||
|
|
|
@ -189,6 +189,17 @@ def progressBar(iteration, total, prefix='', bar_length=50):
|
|||
|
||||
if iteration == total: sys.stderr.write('\n')
|
||||
sys.stderr.flush()
|
||||
|
||||
|
||||
class return_message():
|
||||
"""Object with formatted return message"""
|
||||
|
||||
def __init__(self,message):
|
||||
self.message = message
|
||||
|
||||
def __repr__(self):
|
||||
"""Return message suitable for interactive shells"""
|
||||
return srepr(self.message)
|
||||
|
||||
|
||||
def leastsqBound(func, x0, args=(), bounds=None, Dfun=None, full_output=0,
|
||||
|
|
Loading…
Reference in New Issue