mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 00:15:32 +00:00
refactor(linux): make get_ibus_version() public
This commit is contained in:
parent
d32d1b6b78
commit
c6e7337475
2 changed files with 4 additions and 4 deletions
|
|
@ -143,7 +143,7 @@ def verify_ibus_daemon(start):
|
|||
return retval
|
||||
|
||||
|
||||
def _get_ibus_version():
|
||||
def get_ibus_version():
|
||||
ibus_version = subprocess.run(('ibus', 'version'), check=False,
|
||||
stdout=subprocess.PIPE).stdout
|
||||
match = re.search(r'^IBus (.*)\n$', ibus_version.decode('utf-8'))
|
||||
|
|
@ -156,7 +156,7 @@ def _get_ibus_version():
|
|||
|
||||
def _start_ibus_daemon(realuser):
|
||||
try:
|
||||
if version.parse(_get_ibus_version()) >= version.parse('1.5.28'):
|
||||
if version.parse(get_ibus_version()) >= version.parse('1.5.28'):
|
||||
# IBus ~1.5.28 added the `start` command, so we use that if possible
|
||||
# and let IBus deal with the necessary parameters
|
||||
args = ['ibus', 'start', '-d']
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from keyman_config.ibus_util import _get_ibus_version, get_ibus_bus, install_to_ibus, uninstall_from_ibus
|
||||
from keyman_config.ibus_util import get_ibus_version, get_ibus_bus, install_to_ibus, uninstall_from_ibus
|
||||
|
||||
|
||||
@patch('keyman_config.ibus_util.IBus.Bus')
|
||||
|
|
@ -100,7 +100,7 @@ class IbusUtilTests(unittest.TestCase):
|
|||
)
|
||||
|
||||
# Execute
|
||||
ibus_version = _get_ibus_version()
|
||||
ibus_version = get_ibus_version()
|
||||
|
||||
# Verify
|
||||
self.assertEqual(ibus_version, '1.5.28')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue