auto: 일일 백업 2026-06-21 02:00

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hyowons
2026-06-21 02:00:02 +09:00
parent 5a11a21562
commit 40cc290035
4 changed files with 43 additions and 3 deletions
+3
View File
@@ -0,0 +1,3 @@
# 2026-06-20
- 오전 브리핑 HTML 조립 로직 변경: 오선(@futuresnow) 또는 비하이브 장전 시황 요약이 없으면 메일 하단에 `오선 요약 없음`, `비하이브 요약 없음`을 짧게 표시하도록 `scripts/briefing_mail.py`에 footer note를 추가했다.
+33
View File
@@ -1106,6 +1106,37 @@ def _article_card(a: dict) -> str:
return '\n'.join(parts)
def _briefing_footer_note(lines: list[str]) -> str:
if not lines:
return ''
S = HTML_STYLES
body = '<br>'.join(html_escape(line) for line in lines if str(line).strip())
if not body:
return ''
return (
f'<div style="margin-top:18px;padding-top:11px;border-top:1px solid #eee;'
f'{S["source"]}">{body}</div>'
)
def _morning_missing_summary_notes(data: dict) -> list[str]:
notes = []
us_market = data.get('us_market') or {}
behive_market = data.get('behive_market') or {}
if not us_market.get('available_today'):
notes.append('오선 요약 없음')
elif not data.get('overseas_summary'):
notes.append('오선 요약 없음')
if not behive_market.get('available_today'):
notes.append('비하이브 요약 없음')
elif not data.get('domestic_summary'):
notes.append('비하이브 요약 없음')
return notes
def build_html_body(data: dict) -> str:
S = HTML_STYLES
mode = data.get('mode', 'morning')
@@ -1172,6 +1203,8 @@ def build_html_body(data: dict) -> str:
out.append(f'<div style="{S["news_section"]}">주요 뉴스</div>')
for a in articles:
out.append(_article_card(a))
if mode == 'morning':
out.append(_briefing_footer_note(_morning_missing_summary_notes(data)))
out.append('</div>')
return '\n'.join(out)