mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
python3: make kakasi build
Since these are all being opened as non-binary, it makes no sense to then immediately decode them.
This commit is contained in:
parent
8aceae428e
commit
c940d9941a
@ -168,7 +168,7 @@ class Kakasi(Command): # {{{
|
|||||||
def mkitaiji(self, src, dst):
|
def mkitaiji(self, src, dst):
|
||||||
dic = {}
|
dic = {}
|
||||||
for line in open(src, "r"):
|
for line in open(src, "r"):
|
||||||
line = line.decode("utf-8").strip()
|
line = line.strip()
|
||||||
if line.startswith(';;'): # skip comment
|
if line.startswith(';;'): # skip comment
|
||||||
continue
|
continue
|
||||||
if re.match(r"^$",line):
|
if re.match(r"^$",line):
|
||||||
@ -182,7 +182,7 @@ class Kakasi(Command): # {{{
|
|||||||
def mkkanadict(self, src, dst):
|
def mkkanadict(self, src, dst):
|
||||||
dic = {}
|
dic = {}
|
||||||
for line in open(src, "r"):
|
for line in open(src, "r"):
|
||||||
line = line.decode("utf-8").strip()
|
line = line.strip()
|
||||||
if line.startswith(';;'): # skip comment
|
if line.startswith(';;'): # skip comment
|
||||||
continue
|
continue
|
||||||
if re.match(r"^$",line):
|
if re.match(r"^$",line):
|
||||||
@ -194,7 +194,7 @@ class Kakasi(Command): # {{{
|
|||||||
f.write(msgpack_dumps(dic))
|
f.write(msgpack_dumps(dic))
|
||||||
|
|
||||||
def parsekdict(self, line):
|
def parsekdict(self, line):
|
||||||
line = line.decode("utf-8").strip()
|
line = line.strip()
|
||||||
if line.startswith(';;'): # skip comment
|
if line.startswith(';;'): # skip comment
|
||||||
return
|
return
|
||||||
(yomi, kanji) = line.split(' ')
|
(yomi, kanji) = line.split(' ')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user