We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 734f4dd commit 421a23bCopy full SHA for 421a23b
lib.py
@@ -15,6 +15,7 @@
15
import threading
16
import struct
17
import socket
18
+import textwrap
19
20
21
import os.path
@@ -259,6 +260,16 @@ def error_exit(msg, status=1):
259
260
sys.stderr.write('Error: %s\n' % msg)
261
sys.exit(status)
262
263
+def error_textwrap(self, msg, status, wrap_text=True):
264
+ if wrap_text:
265
+ new_msg = "\n[ERROR]: %s" % msg
266
+ wrapped = textwrap.wrap(new_msg, 79)
267
+ new_msg = "\n".join(wrapped) + "\n"
268
+ else:
269
+ new_msg = msg
270
+
271
+ sys.stderr.write(new_msg)
272
+ sys.exit(status)
273
274
def shutdown():
275
print "exit"
0 commit comments