Move quit_with_error

This commit is contained in:
Erik Johnston 2017-10-02 17:59:34 +01:00
parent b23cb8fba8
commit 3fed5bb25f
2 changed files with 11 additions and 10 deletions

View file

@ -97,3 +97,13 @@ def start_reactor(
daemon.start()
else:
run()
def quit_with_error(error_string):
message_lines = error_string.split("\n")
line_length = max([len(l) for l in message_lines if len(l) < 80]) + 2
sys.stderr.write("*" * line_length + '\n')
for line in message_lines:
sys.stderr.write(" %s\n" % (line.rstrip(),))
sys.stderr.write("*" * line_length + '\n')
sys.exit(1)