mirror of
https://github.com/ihabunek/toot.git
synced 2024-11-03 04:17:21 -05:00
parent
72f88831ad
commit
92435d630c
@ -30,6 +30,11 @@ common_args = [
|
||||
"action": 'store_true',
|
||||
"default": False,
|
||||
}),
|
||||
(["--quiet"], {
|
||||
"help": "don't write to stdout on success",
|
||||
"action": 'store_true',
|
||||
"default": False,
|
||||
}),
|
||||
(["--debug"], {
|
||||
"help": "show debug log in console",
|
||||
"action": 'store_true',
|
||||
|
@ -47,9 +47,11 @@ def strip_tags(text):
|
||||
|
||||
|
||||
USE_ANSI_COLOR = "--no-color" not in sys.argv
|
||||
QUIET = "--quiet" in sys.argv
|
||||
|
||||
|
||||
def print_out(*args, **kwargs):
|
||||
if not QUIET:
|
||||
args = [colorize(a) if USE_ANSI_COLOR else strip_tags(a) for a in args]
|
||||
print(*args, **kwargs)
|
||||
|
||||
@ -73,8 +75,8 @@ def print_instance(instance):
|
||||
lines = [line.strip() for line in format_content(description) if line.strip()]
|
||||
for line in lines:
|
||||
for l in wrap(line.strip()):
|
||||
print(l)
|
||||
print()
|
||||
print_out(l)
|
||||
print_out()
|
||||
|
||||
|
||||
def print_account(account):
|
||||
|
Loading…
Reference in New Issue
Block a user