Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def print_separator(text: Optional[str] = None, fat: bool = False) -> None:
columns = shutil.get_terminal_size().columns
sep = "━" if fat else "─"
if not text:
print(sep * columns)
else:
sep_len = (columns - len(text) - 2)
padding = sep_len // 2
printt(sep * padding)
printt(" ", text, " ", bold=fat)
printtln(sep * (padding + (sep_len % 2)))
def print_separator(text: Optional[str] = None, fat: bool = False) -> None:
columns = shutil.get_terminal_size().columns
sep = "━" if fat else "─"
if not text:
print(sep * columns)
else:
sep_len = (columns - len(text) - 2)
padding = sep_len // 2
printt(sep * padding)
printt(" ", text, " ", bold=fat)
printtln(sep * (padding + (sep_len % 2)))
print_separator("Playing now", fat=True)
printt(_("Title: "))
printtln(video.title, bold=True)
printt(_("Channel: "))
printtln(video.channel.displayname, bold=True)
description = video.description
if DESCRIPTION_ENABLED and description is not None:
columns = shutil.get_terminal_size().columns
lines = description.splitlines()
print_separator(_("Video description"))
for line in lines:
print(wrap.fill(line, width=columns))
print_separator(fat=True)
print()
def print_separator(text: Optional[str] = None, fat: bool = False) -> None:
columns = shutil.get_terminal_size().columns
sep = "━" if fat else "─"
if not text:
print(sep * columns)
else:
sep_len = (columns - len(text) - 2)
padding = sep_len // 2
printt(sep * padding)
printt(" ", text, " ", bold=fat)
printtln(sep * (padding + (sep_len % 2)))
def print_prompt():
prompt_format = "{prompt_text} > "
prompt = prompt_format.format(prompt_text=self.get_prompt_text())
printt(prompt, foreground=self.get_prompt_color(), bold=True, replace=True)
break
if char in {"\x04", "\x03"}: # Ctrl+d, Ctrl+d
break
if char in {"\r", ""}:
tag = tags[0]
break
if char == "\x7f": # DEL
tag = tag[:-1]
elif char in alphabet:
tag += char
print_prompt()
printt(tag)
print()
return tag, hook_triggered