forked from miurahr/pykakasi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
72 lines (61 loc) · 1.95 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/python
# derivered from unihandecode setup.py
from setuptools import Command,setup
import unittest
import os
import nose
class GenKanwa(Command):
user_options = [ ]
def initialize_options(self):
pass
def finalize_options(self):
pass
def genDict(self, src_f, pkl_f):
import genkanwadict
kanwa = genkanwadict.mkkanwa()
src = os.path.join('data',src_f)
dst = os.path.join('pykakasi',pkl_f)
try:
os.unlink(dst)
except:
pass
kanwa.mkdict(src, dst)
def run(self):
import genkanwadict
DICTS = [
('itaijidict.utf8', 'itaijidict2.pickle'),
('hepburndict.utf8', 'hepburndict2.pickle'),
('kunreidict.utf8', 'kunreidict2.pickle'),
('passportdict.utf8', 'passportdict2.pickle'),
('hepburnhira.utf8', 'hepburnhira2.pickle'),
('kunreihira.utf8', 'kunreihira2.pickle'),
('passporthira.utf8', 'passporthira2.pickle')
]
for (s,p) in DICTS:
self.genDict(s, p)
src = os.path.join('data','kakasidict.utf8')
dst = os.path.join('pykakasi','kanwadict2.db')
try:
os.unlink(dst)
except:
pass
kanwa = genkanwadict.mkkanwa()
kanwa.run(src, dst)
def readme():
with open(os.path.join(os.path.dirname(__file__),'README.rst')) as f:
return f.read()
setup(name='pykakasi',
version='0.23',
description='Python implementation of kakasi - kana kanji simple inversion library',
url='http://github.com/miurahr/pykakasi',
license='GPLv3',
long_description=readme(),
author='Hioshi Miura',
author_email='[email protected]',
packages = [ 'pykakasi' ],
provides = [ 'pykakasi' ],
scripts = ["kakasi"],
include_package_data = True,
test_suite = 'nose.collector',
cmdclass = { 'genkanwa':GenKanwa }
)