|
@@ -147,6 +147,17 @@ class Boxes(object):
|
|
|
|
|
|
@staticmethod
|
|
|
def alert(message, length=0, pad=2, width=78, base="red"):
|
|
|
+ """
|
|
|
+ Display alert message
|
|
|
+
|
|
|
+ length: the printable character length.
|
|
|
+ If the string contains color codes, you'll need
|
|
|
+ to use this so it will be centered properly.
|
|
|
+ If not given, len(message) is used.
|
|
|
+ pad: The spaces at the front and back of the message.
|
|
|
+ width: Defaults to 78 chars wide.
|
|
|
+ base: The background color to use for the alert.
|
|
|
+ """
|
|
|
if base == "red":
|
|
|
color = merge(Style.BRIGHT + Fore.YELLOW + Back.RED)
|
|
|
elif base == "blue":
|