Skip to content

v0.0.6 — Phase C: convenience helpers

Choose a tag to compare

@JunDamin JunDamin released this 15 Apr 06:11
· 79 commits to main since this release

🎯 Phase C — 편의 헬퍼

pyhwpx 비교 분석에서 도출된 편의 메소드들 추가.

신규 API (10개)

페이지 탐색

  • app.goto_page(n) — N번째 페이지로 이동

형광펜

  • app.highlight(color) — 선택 영역에 markpen (shade_color 와 다름)
    • 문자열 '#FFFF00' / Color / (r,g,b) 튜플 모두 지원

이미지 export

  • app.save_page_image(n, path) — 페이지 → 이미지 파일
  • app.save_all_page_images(dir) — 전체 페이지 일괄 export

단위 변환 (instance methods)

  • app.mm_to_hwpunit(mm) / hwpunit_to_mm(hu)
  • app.point_to_hwpunit(pt) / hwpunit_to_point(hu)
  • app.rgb_color(r, g, b) — RGB → HWP BBGGRR

상태 조회

  • app.status property — KeyIndicator + PageCount 를 dict 로:
    {'page': 1, 'total_pages': 4, 'section': 1, 'column': 1,
     'line': 4, 'print_page': 1, 'char_index': 0, 'insert_mode': ...}

Color 클래스 확장

  • Color.from_rgb(r, g, b) — RGB 튜플로 생성
  • Color.from_hex(hex_str) — 명시적 hex 생성자

버그 수정

  • app.current_page 가 section 번호 반환하던 문제 → KeyIndicator[5] 사용

호환성

100% backward compatible. 1,059 unit tests 통과.

Full changelog: v0.0.5...v0.0.6