2019-01-22 20:25:04 +00:00
|
|
|
import click
|
|
|
|
|
2019-05-05 09:45:24 +00:00
|
|
|
|
2019-01-22 20:25:04 +00:00
|
|
|
def title(text):
|
|
|
|
indent = 8
|
|
|
|
separator = "=" * (len(text) + 2 * indent)
|
|
|
|
message = "{separator}\n{indent}{text}\n{separator}".format(
|
2019-05-05 09:45:24 +00:00
|
|
|
separator=separator, indent=" " * indent, text=text
|
2019-01-22 20:25:04 +00:00
|
|
|
)
|
|
|
|
return click.style(message, fg="green")
|
|
|
|
|
2019-05-05 09:45:24 +00:00
|
|
|
|
2019-01-22 20:25:04 +00:00
|
|
|
def info(text):
|
|
|
|
return click.style(text, fg="blue")
|
|
|
|
|
2019-05-05 09:45:24 +00:00
|
|
|
|
2019-01-22 20:25:04 +00:00
|
|
|
def error(text):
|
|
|
|
return click.style(text, fg="red")
|
|
|
|
|
2019-05-05 09:45:24 +00:00
|
|
|
|
2019-01-22 20:25:04 +00:00
|
|
|
def command(text):
|
|
|
|
return click.style(text, fg="magenta")
|
|
|
|
|
2019-05-05 09:45:24 +00:00
|
|
|
|
2019-01-22 20:25:04 +00:00
|
|
|
def question(text):
|
|
|
|
return click.style(text, fg="yellow")
|
|
|
|
|
2019-05-05 09:45:24 +00:00
|
|
|
|
2019-01-22 20:25:04 +00:00
|
|
|
def alert(text):
|
|
|
|
return click.style("⚠️ " + text, fg="yellow", bold=True)
|