def _start_setup(self):
'''Start the setup tool if it is not running yet'''
if self._setup_pid != 0:
pid, dummy_state = os.waitpid(self._setup_pid, os.P_NOWAIT)
if pid != self._setup_pid:
# If the last setup tool started from here is still
# running the pid returned by the above os.waitpid()
# is 0. In that case just return, don’t start a
# second setup tool.
return
self._setup_pid = 0
setup_cmd = os.path.join(
os.getenv('IBUS_HUNSPELL_LIB_LOCATION'),
'ibus-setup-typing-booster')
config_file = self._name.replace('typing-booster:', '') + '.conf'
self._setup_pid = os.spawnl(
os.P_NOWAIT,
setup_cmd,
'ibus-setup-typing-booster',
'--config-file %s' %config_file)
评论列表
文章目录