-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
조유성
authored and
조유성
committed
May 11, 2014
1 parent
215f862
commit b8164e8
Showing
3 changed files
with
21 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,19 @@ | ||
# -*- coding: utf-8 -*- # | ||
|
||
messages = [ | ||
'원본 자막 파일이 존재하지 않습니다.', | ||
|
||
'원본 자막 파일의 인코딩을 감지할 수 없습니다.', | ||
|
||
"""원본 자막 파일은 올바른 SMI 파일이 아닙니다. | ||
(verbose 옵션은 오류의 발생 위치를 확인하는 데 도움을 줄 수 있습니다.)""", | ||
|
||
"""지정한 파일 형식으로는 변환할 수 없습니다. | ||
(지원 목록 : vtt)""", | ||
|
||
'알 수 없는 오류가 발생했습니다.' | ||
] | ||
|
||
# 변환 오류 클래스 | ||
class ConversionError(Exception): | ||
messages = ( | ||
'Cannot access to the input file.', | ||
'Cannot find correct encoding for the input file.', | ||
'Cannot parse the input file. It seems not to be a valid SAMI file.\n(Verbose option may show you the position the error occured in)', | ||
'Cannot convert into the specified type. (Suppored types : vtt)', | ||
'Cannot convert the input file before parsing it.', | ||
'Unknown error occured.' | ||
) | ||
|
||
def __init__(self, code): | ||
self.code = code | ||
self.msg = messages[-(code+1)] | ||
self.msg = self.messages[-(code+1)] | ||
|
||
def __str__(self): | ||
return self.msg+' ('+str(self.code)+')' | ||
return self.msg+' ('+str(self.code)+')' |