3 class ENFfileError(Exception):
8 def __init__(self
, filename
):
9 encfile
= open(filename
, "rb")
10 c
= reader
.PStokenizer(encfile
.read(), "")
14 self
.name
= c
.gettoken()
17 raise ENCfileError("cannot parse encoding file '%s', expecting '[' got '%s'" % (filename
, token
))
22 raise ENCfileError("not enough charcodes in encoding file '%s'" % filename
)
23 if not token
[0] == "/":
24 raise ENCfileError("token does not start with / in encoding file '%s'" % filename
)
25 self
.vector
.append(token
[1:])
26 if c
.gettoken() != "]":
27 raise ENCfileError("too many charcodes in encoding file '%s'" % filename
)
30 raise ENCfileError("cannot parse encoding file '%s', expecting 'def' got '%s'" % (filename
, token
))