- mmgen-tool listaddresses: add 'show_age','show_days' options
- init_fail(): make 'silent' override 'MMGEN_TRACEBACK', fixing regression
introduced by 3909339
- test/test.py: improve formatting of --list output
- test/{test,objtest,scrambletest}.py, mmgen/tool.py: indentation (whitespace) fixes
25 lines
631 B
Python
Executable file
25 lines
631 B
Python
Executable file
#!/usr/bin/env python
|
|
import sys,traceback,os
|
|
sys.path.insert(0,'.')
|
|
|
|
if 'TMUX' in os.environ: del os.environ['TMUX']
|
|
os.environ['MMGEN_TRACEBACK'] = '1'
|
|
|
|
tb_source = open(sys.argv[1])
|
|
tb_file = open('my.err','w')
|
|
|
|
try:
|
|
sys.argv.pop(0)
|
|
exec tb_source
|
|
except SystemExit:
|
|
# pass
|
|
e = sys.exc_info()
|
|
sys.exit(int(str(e[1])))
|
|
except:
|
|
l = traceback.format_exception(*sys.exc_info())
|
|
exc = l.pop()
|
|
def red(s): return '{e}[31;1m{}{e}[0m'.format(s,e='\033')
|
|
def yellow(s): return '{e}[33;1m{}{e}[0m'.format(s,e='\033')
|
|
sys.stdout.write('{}{}'.format(yellow(''.join(l)),red(exc)))
|
|
traceback.print_exc(file=tb_file)
|
|
sys.exit(1)
|