2016-11-24 08:59:28 +03:00
|
|
|
#!/usr/bin/env python3
|
2016-10-17 15:49:59 +03:00
|
|
|
|
|
|
|
import os
|
2016-11-24 08:59:28 +03:00
|
|
|
import sys
|
2017-01-23 06:26:52 +03:00
|
|
|
import shutil
|
|
|
|
import subprocess
|
2016-11-24 08:59:28 +03:00
|
|
|
|
2016-10-17 15:49:59 +03:00
|
|
|
base = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
os.chdir(base)
|
2016-11-24 08:59:28 +03:00
|
|
|
sys.path.insert(0, base)
|
|
|
|
|
|
|
|
from kitty.terminfo import generate_terminfo # noqa
|
|
|
|
|
|
|
|
with open('terminfo/kitty.terminfo', 'w') as f:
|
|
|
|
f.write(generate_terminfo())
|
|
|
|
|
2016-10-17 15:49:59 +03:00
|
|
|
os.environ['TERMINFO'] = os.path.join(base, 'terminfo')
|
2018-02-08 07:56:13 +03:00
|
|
|
subprocess.check_call(['tic', '-x', 'terminfo/kitty.terminfo'])
|
2017-01-23 06:26:52 +03:00
|
|
|
# On OS X tic puts the compiled database into a different directory
|
|
|
|
try:
|
|
|
|
os.mkdir('terminfo/78')
|
|
|
|
except FileExistsError:
|
|
|
|
pass
|
|
|
|
shutil.copy2('terminfo/x/xterm-kitty', 'terminfo/78')
|