import contextlib
import re
import sys
+import textwrap
import time
import socket
m.group(1) for m in re.finditer("\s*([^,\s]+)\s*,?\s*", list_of_hosts))
return p
+
+def align_text(text, left_margin=17, max_width=160):
+ lines = []
+ for line in text.split('\n'):
+ temp_lines = textwrap.wrap(line, max_width - left_margin)
+ temp_lines = [(' ' * left_margin + line) for line in temp_lines]
+ lines.append('\n'.join(temp_lines))
+ ret = '\n'.join(lines)
+ return ret.lstrip()