mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
make kakasi cmd more easily customizable
This commit is contained in:
parent
f47afc3ebf
commit
6ffa8cd191
1 changed files with 2 additions and 1 deletions
|
@ -10,6 +10,7 @@ from anki.hooks import addHook
|
||||||
modelTag = "Japanese"
|
modelTag = "Japanese"
|
||||||
srcField = "Expression"
|
srcField = "Expression"
|
||||||
dstField = "Reading"
|
dstField = "Reading"
|
||||||
|
kakasiCmd = "kakasi -isjis -osjis -u -f -s -JH -p"
|
||||||
|
|
||||||
class KakasiController(object):
|
class KakasiController(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -46,7 +47,7 @@ class KakasiController(object):
|
||||||
from errno import ENOENT
|
from errno import ENOENT
|
||||||
raise OSError(ENOENT, 'Kakasi not available')
|
raise OSError(ENOENT, 'Kakasi not available')
|
||||||
# don't convert kana to hiragana
|
# don't convert kana to hiragana
|
||||||
p = Popen("kakasi -isjis -osjis -u -f -s -JH -p", shell=True,
|
p = Popen(kakasiCmd, shell=True,
|
||||||
bufsize=-1, stdin=PIPE, stdout=PIPE)
|
bufsize=-1, stdin=PIPE, stdout=PIPE)
|
||||||
(self.kin, self.kout) = (p.stdin, p.stdout)
|
(self.kin, self.kout) = (p.stdin, p.stdout)
|
||||||
self._open = True
|
self._open = True
|
||||||
|
|
Loading…
Reference in a new issue