위젯별 투명도와 밝은·어두운 색상 및 글자 크기와 표시 항목을 추가했다. 모든 위젯에 함께 적용하는 기본값과 개별 설정을 구분하고 크기에 따라 배치를 바꾼다. 포럼에 APK와 전체 소스 및 사용법과 제작 매뉴얼을 함께 배포한다. 앱 단위 검사 34개와 서버 검사 63개 및 웹 날짜·업데이트 검사 통과. 공개 소스에서 APK 빌드와 정적 검사 오류 0개 확인. 경고는 69개다. Android 16 가상 기기에서 기존 앱 위에 설치하고 투명 위젯과 큰 글자 및 RemoteViews 검사를 확인했다. 실제 휴대폰과 다른 홈 화면 앱의 절전·크기 동작은 별도 확인이 필요하다. 회원 DB와 인증 정보 및 배포 서명 키와 내부 운영 기록은 공개 자료에 포함하지 않았다.
31 lines
1.6 KiB
Python
31 lines
1.6 KiB
Python
"""한국 음력 변환표를 앱과 웹에 함께 배포한다. 실행 의존성은 korean-lunar-calendar==0.3.1이다.
|
|
|
|
월의 시작일만 저장하고 실제 날짜는 시작일과의 차이로 구한다. 윤달을 일반 월과 별도 행으로
|
|
남겨 두므로 같은 음력 월이 두 번 나타나도 구분된다. 공휴일 여부는 이 자료로 추정하지 않는다.
|
|
"""
|
|
from datetime import date
|
|
from importlib.metadata import distribution
|
|
import json
|
|
from pathlib import Path
|
|
from korean_lunar_calendar import KoreanLunarCalendar
|
|
|
|
root = Path(__file__).resolve().parents[1]
|
|
calendar = KoreanLunarCalendar()
|
|
epoch = date(1970, 1, 1)
|
|
rows = []
|
|
for year in range(1899, 2051):
|
|
for month in range(1, 13):
|
|
for leap in (False, True):
|
|
if calendar.setLunarDate(year, month, 1, leap) and calendar.isIntercalation == leap:
|
|
solar = date(calendar.solarYear, calendar.solarMonth, calendar.solarDay)
|
|
rows.append([(solar - epoch).days, month, int(leap)])
|
|
rows.sort()
|
|
data = json.dumps({'start': '1900-01-01', 'end': '2050-12-31', 'months': rows}, separators=(',', ':'))
|
|
dist = distribution('korean-lunar-calendar')
|
|
license_file = next(p for p in dist.files if p.name == 'LICENSE')
|
|
license_text = Path(dist.locate_file(license_file)).read_text(encoding='utf-8')
|
|
for folder in (root / 'app/src/main/assets', root / 'server/web'):
|
|
(folder / 'lunar-months.json').write_text(data, encoding='utf-8')
|
|
(folder / 'lunar-LICENSE.txt').write_text(license_text, encoding='utf-8')
|
|
print('한국 음력 월 시작일', len(rows), '개. 표시 범위 1900~2050년.')
|