refactor: Create engine package, extracting data sources to sources.py, and add refactoring documentation.

This commit is contained in:
2026-03-14 20:56:24 -07:00
parent 6a5a73fd88
commit dcc3718012
4 changed files with 325 additions and 0 deletions

31
engine/config.py Normal file
View File

@@ -0,0 +1,31 @@
"""
Configuration constants, CLI flags, and glyph tables.
"""
import sys
# ─── RUNTIME ──────────────────────────────────────────────
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 'news'
FIREHOSE = '--firehose' in sys.argv
# ─── NTFY MESSAGE QUEUE ──────────────────────────────────
NTFY_TOPIC = "https://ntfy.sh/klubhaus_terminal_mainline/json?since=20s&poll=1"
NTFY_POLL_INTERVAL = 15 # seconds between polls
MESSAGE_DISPLAY_SECS = 30 # how long a message holds the screen
# ─── FONT RENDERING ──────────────────────────────────────
FONT_PATH = "/Users/genejohnson/Documents/CS Bishop Drawn/CSBishopDrawn-Italic.otf"
FONT_SZ = 60
RENDER_H = 8 # terminal rows per rendered text line
# ─── SCROLL / FRAME ──────────────────────────────────────
SCROLL_DUR = 3.75 # seconds per headline
FRAME_DT = 0.05 # 50ms base frame rate (20 FPS)
FIREHOSE_H = 12 # firehose zone height (terminal rows)
# ─── GLYPHS ───────────────────────────────────────────────
GLITCH = "░▒▓█▌▐╌╍╎╏┃┆┇┊┋"
KATA = "ハミヒーウシナモニサワツオリアホテマケメエカキムユラセネスタヌヘ"