skip menu and go to main content

body start

gdic_sh

Open  ndic_sh.py 패치

09.07.31-15:29:04

305345

Submitted by Homin Lee

Assignee Nobody

View942

Priority3

다음 명령어를 커맨드라인에서 실행한 경우:
$ ndic_sh.py dictionary

아래와 같이:
...
------------------------------
Traceback (most recent call last):
  File "./ndic_sh.py", line 144, in <module>
    content = readHTMLSource(result[con + 1], 'euc-kr')
IndexError: list index out of range

에러가 나오면서 끝나는 버그를 수정했습니다.
*gdic_sh 에서는 이런 std_err를 보여주지 않기에 문제가 없어보입니다.

이 문제는 naver에서 준 xml의 total element의 값과, 실제 item의 개수가 같지 않아 발생하며,
total은 무시하고, item element의 개수를 새는 방향으로 수정했습니다.

그리고, -그놈 라이브러리?인-libxml2 대신 Python 2.5부터 기본 내장된
ElementTree를 사용해 xml파싱을 하게 수정했습니다.

소스가 다소 깔끔해 졌고, 출력은 기존과 같고, 성능은 거의 비슷 합니다. ;)

패치 첨부하였습니다.

Comments on this artfact

0 Comments

Homin Lee

File added 449: ndic_sh_patch_20090731_suapapa.diff

09.07.31-15:29:04