From bc20a35ea9584abe53b51edc56dcae7e6e064ab6 Mon Sep 17 00:00:00 2001 From: Gene Johnson Date: Mon, 16 Mar 2026 03:01:22 -0700 Subject: [PATCH] refactor: Fix import ordering and code formatting with ruff Organize imports in render.py and scroll.py to meet ruff style requirements. Add blank lines for code formatting compliance. --- engine/app.py | 7 +++++-- engine/config.py | 6 ++++-- engine/render.py | 2 ++ engine/scroll.py | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/engine/app.py b/engine/app.py index 1382692..10eea6d 100644 --- a/engine/app.py +++ b/engine/app.py @@ -75,7 +75,9 @@ def _draw_color_picker(themes_list, selected): print(CLR, end="") print() - print(f" {G_HI}▼ COLOR THEME{RST} {W_GHOST}─ ↑/↓ or j/k to move, Enter/q to select{RST}") + print( + f" {G_HI}▼ COLOR THEME{RST} {W_GHOST}─ ↑/↓ or j/k to move, Enter/q to select{RST}" + ) print(f" {W_GHOST}{'─' * (tw() - 4)}{RST}\n") for i, (theme_id, theme) in enumerate(themes_list): @@ -341,7 +343,7 @@ def main(): print() _subtitle = { "poetry": "literary consciousness stream", - "code": "source consciousness stream", + "code": "source consciousness stream", }.get(config.MODE, "digital consciousness stream") print(f" {W_DIM}v0.1 · {_subtitle}{RST}") print(f" {W_GHOST}{'─' * (w - 4)}{RST}") @@ -365,6 +367,7 @@ def main(): save_cache(items) elif config.MODE == "code": from engine.fetch_code import fetch_code + slow_print(" > INITIALIZING SOURCE ARRAY...\n") time.sleep(0.2) print() diff --git a/engine/config.py b/engine/config.py index 5b045db..005f5b8 100644 --- a/engine/config.py +++ b/engine/config.py @@ -58,8 +58,10 @@ HEADLINE_LIMIT = 1000 FEED_TIMEOUT = 10 MIC_THRESHOLD_DB = 50 # dB above which glitches intensify MODE = ( - "poetry" if "--poetry" in sys.argv or "-p" in sys.argv - else "code" if "--code" in sys.argv + "poetry" + if "--poetry" in sys.argv or "-p" in sys.argv + else "code" + if "--code" in sys.argv else "news" ) FIREHOSE = "--firehose" in sys.argv diff --git a/engine/render.py b/engine/render.py index ccf1e12..c0ecb7d 100644 --- a/engine/render.py +++ b/engine/render.py @@ -15,6 +15,7 @@ from engine.sources import NO_UPPER, SCRIPT_FONTS, SOURCE_LANGS from engine.terminal import RST from engine.translate import detect_location_language, translate_headline + # ─── GRADIENT ───────────────────────────────────────────── def _color_codes_to_ansi(color_codes): """Convert a list of 256-color codes to ANSI escape code strings. @@ -80,6 +81,7 @@ def _default_magenta_gradient(): "\033[2;38;5;235m", # near black ] + # ─── FONT LOADING ───────────────────────────────────────── _FONT_OBJ = None _FONT_OBJ_KEY = None diff --git a/engine/scroll.py b/engine/scroll.py index b50b793..4f190f9 100644 --- a/engine/scroll.py +++ b/engine/scroll.py @@ -18,7 +18,7 @@ from engine.effects import ( noise, vis_trunc, ) -from engine.render import big_wrap, lr_gradient, msg_gradient, make_block +from engine.render import big_wrap, lr_gradient, make_block, msg_gradient from engine.terminal import CLR, RST, W_COOL, th, tw