From 389fa6e979e21ad178e9bb80e42b08466ef56667 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 25 Feb 2023 12:52:51 +0000 Subject: [PATCH] Use console.rule between sections of dl's new logs These are handy to separate the logs to be per-title, and per section of initialization. --- devine/commands/dl.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/devine/commands/dl.py b/devine/commands/dl.py index 2deb2f6..9aac186 100644 --- a/devine/commands/dl.py +++ b/devine/commands/dl.py @@ -28,6 +28,8 @@ from pywidevine.cdm import Cdm as WidevineCdm from pywidevine.device import Device from pywidevine.remotecdm import RemoteCdm from tqdm import tqdm +from rich.padding import Padding +from rich.rule import Rule from devine.core.config import config from devine.core.console import console @@ -282,8 +284,10 @@ class dl: self.log.error("No titles returned, nothing to download...") sys.exit(1) - for line in str(titles).splitlines(keepends=False): - console.log(line) + console.print(Padding( + Rule(f"[rule.text]{titles.__class__.__name__}: {titles}"), + (1, 2) + )) if list_titles: for title in titles: @@ -294,7 +298,11 @@ class dl: if isinstance(title, Episode) and wanted and f"{title.season}x{title.number}" not in wanted: continue - console.log(f"Getting tracks for {title}") + console.print(Padding( + Rule(f"[rule.text]{title}"), + (1, 2) + )) + if slow and i != 0: delay = random.randint(60, 120) with console.status(f"Delaying by {delay} seconds..."):