Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 215a48ff1503c944fc06e64bc2288de6828e2db3
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Sun Jul 17 09:59:36 2016 +0200
Release 1.4.8
>---------------------------------------------------------------
ChangeLog | 6 ++++++
configure.ac | 2 +-
ibus-typing-booster.pc.in | 2 +-
typing-booster.appdata.xml | 16 ++++++++++++++++
4 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1ff8cca..ccae293 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
* Author: Mike FABIAN <mfabian(a)redhat.com>
+* 17 Jul 2016 Released 1.4.8 version
+* Make m17n_translit handle ���NoIme��� as a dummy input method
+* Simplify some code in hunspell_table.py which did treat ���NoIme��� as a special case
+* Commit pre��dit if modifier keys without transliteration are typed and pass the key through (Resolves: rhbz#1351748)
+
+* Author: Mike FABIAN <mfabian(a)redhat.com>
* 11 Jul 2016 Released 1.4.7 version
* Check if the commit key would change the transliteration if used as regular input (Resolves: rhbz#1353672)
diff --git a/configure.ac b/configure.ac
index da03c4b..ff55ee6 100755
--- a/configure.ac
+++ b/configure.ac
@@ -24,7 +24,7 @@ m4_define([package_name], [ibus-typing-booster])
m4_define([ibus_released], [1])
m4_define([ibus_major_version], [1])
m4_define([ibus_minor_version], [4])
-m4_define([ibus_micro_version], [7])
+m4_define([ibus_micro_version], [8])
m4_define(ibus_maybe_datestamp,
m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
diff --git a/ibus-typing-booster.pc.in b/ibus-typing-booster.pc.in
index 967009f..e37b866 100755
--- a/ibus-typing-booster.pc.in
+++ b/ibus-typing-booster.pc.in
@@ -11,7 +11,7 @@ enginedir=/usr/share/ibus/engine
Name: IBus-Typing-Booster
Description: Table Based Input Method Framework for Intelligent Input Bus for Linux / Unix OS
-Version: 1.4.7
+Version: 1.4.8
Requires:
Libs:
Cflags:
diff --git a/typing-booster.appdata.xml b/typing-booster.appdata.xml
index 48e57ab..1657860 100644
--- a/typing-booster.appdata.xml
+++ b/typing-booster.appdata.xml
@@ -21,6 +21,22 @@
<url type="bugtracker">https://github.com/mike-fabian/ibus-typing-booster/issues</url>
<url type="help">https://mike-fabian.github.io/ibus-typing-booster/documentation.html</url>
<releases>
+ <release version="1.4.8" date="2016-07-17" urgency="medium">
+ <description>
+ <ul>
+ <li>
+ Commit pre��dit if modifier keys without transliteration
+ are typed and pass the key through (Resolves:
+ rhbz#1351748). Solve this bug in a better way, for the
+ modifier key combinations which do not have a
+ transliteration, pass them through not only when the
+ pre��dit is empty, if the pre��dit is non-empty, commit the
+ pre��dit and then pass the modifier key combination
+ through.
+ </li>
+ </ul>
+ </description>
+ </release>
<release version="1.4.7" date="2016-07-11" urgency="medium">
<description>
<ul>
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit f60b26aabe46392422c37749b511c23d3c2a4e0e
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Thu Jul 14 09:17:52 2016 +0200
Commit pre��dit if modifier keys without transliteration are typed and pass the key through
Resolves: rhbz#1351748 - Gujarati & Hindi itrans method fails to perform cut,
copy, paste & undo using 'ctrl' key sequences.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1351748
Solve this bug in a better way, for the modifier key combinations
which do not have a transliteration, pass them through not only when
the pre��dit is empty, if the pre��dit is non-empty, commit the pre��dit
and then pass the modifier key combination through.
>---------------------------------------------------------------
engine/hunspell_table.py | 83 +++++++++++++++++++++++----------------------
1 files changed, 42 insertions(+), 41 deletions(-)
diff --git a/engine/hunspell_table.py b/engine/hunspell_table.py
index 07267df..a74b913 100644
--- a/engine/hunspell_table.py
+++ b/engine/hunspell_table.py
@@ -1045,6 +1045,20 @@ class tabengine (IBus.Engine):
self._update_preedit ()
self._update_aux ()
+ def has_transliteration(self, msymbol_list):
+ transliterators = self._editor.get_transliterators()
+ for ime in self.get_current_imes():
+ if transliterators[ime].transliterate(
+ msymbol_list) != ''.join(msymbol_list):
+ if debug_level > 1:
+ sys.stderr.write(
+ "has_transliteration(%s) == True\n" %msymbol_list)
+ return True
+ if debug_level > 1:
+ sys.stderr.write(
+ "has_transliteration(%s) == False\n" %msymbol_list)
+ return False
+
def commit_string (self, commit_phrase, input_phrase=u''):
if not input_phrase:
input_phrase = self._editor.get_transliterated_strings()[
@@ -1412,9 +1426,34 @@ class tabengine (IBus.Engine):
return True
# These keys may trigger a commit:
- if key.val in (IBus.KEY_Return, IBus.KEY_KP_Enter, IBus.KEY_space,
- IBus.KEY_Right, IBus.KEY_KP_Right,
- IBus.KEY_Left, IBus.KEY_KP_Left):
+ if (key.val in (IBus.KEY_Return, IBus.KEY_KP_Enter, IBus.KEY_space,
+ IBus.KEY_Right, IBus.KEY_KP_Right,
+ IBus.KEY_Left, IBus.KEY_KP_Left)
+ or (len(key.msymbol) == 3
+ and key.msymbol[:2] in ('A-', 'C-', 'G-')
+ and not self.has_transliteration([key.msymbol]))):
+ # See:
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1351748
+ # If the user types a modifier key combination, it
+ # might have a transliteration in some input methods.
+ # For example, AltGr-4 (key.msymbol = 'G-4')
+ # transliterates to ��� when the ���hi-inscript2��� input
+ # method is used. But trying to handle all modifier
+ # key combinations as input is not nice because it
+ # prevents the use of such key combinations for other
+ # purposes. C-c is usually used for for copying, C-v
+ # for pasting for example. If the user has typed a
+ # modifier key combination, check whether any of the
+ # current input methods actually transliterates it to
+ # something. If none of the current input methods uses
+ # it, the key combination can be passed through to be
+ # used for its original purpose. If the pre��dit is
+ # non empty, commit the pre��dit first before passing
+ # the modifier key combination through. (Passing
+ # something like C-a through without committing the
+ # pre��dit would be quite confusing, C-a usually goes
+ # to the beginning of the current line, leaving the
+ # pre��dit open while moving would be strange).
if self._editor.is_empty():
return False
if (key.val in (IBus.KEY_Right, IBus.KEY_KP_Right)
@@ -1506,44 +1545,6 @@ class tabengine (IBus.Engine):
# first key typed, we will try to complete something now
# get the context if possible
self.get_context()
- if (self._editor.is_empty() and len(key.msymbol) == 3
- and key.msymbol[:2] in ('A-', 'C-', 'G-')):
- # See:
- # https://bugzilla.redhat.com/show_bug.cgi?id=1351748
- # If the user types AltGr-<something> or
- # Control-<something>, this might have a
- # transliteration in some input methods. For example,
- # AltGr-4 (key.msymbol = 'G-4') transliterates to ���
- # when the ���hi-inscript2��� input method is used. But
- # trying to handle all Alt-, Control-, and AltGr-
- # stuff as input is not nice because it prevents the
- # use of such key combinations for other purposes.
- # C-c is usually used for for copying, C-v for pasting
- # for example. If the user has typed a key combination
- # starting with such a modifier key, check whether any
- # of the current input methods actually transliterates
- # it to something. If none of the current input
- # methods uses it, the key combination can be passed
- # through to be used for its original purpose. But do
- # this only when the pre��dit is empty, if there is
- # already something in the pre��dit, it seems to
- # confusing to me to pass it through. If the pre��dit
- # is non empty, keep handling key.msymbol as input,
- # that seems more obvious.
- has_transliteration = False
- transliterators = self._editor.get_transliterators()
- for ime in self.get_current_imes():
- if transliterators[ime].transliterate(
- [key.msymbol]) != key.msymbol:
- has_transliteration = True
- if not has_transliteration:
- if debug_level > 1:
- sys.stderr.write(
- "_process_key_event() "
- + "key.msymbol=%s has no transliteration, "
- %key.msymbol
- + "passing through.")
- return False
self._editor.insert_string_at_cursor([key.msymbol])
if (len(key.msymbol) == 1
and unicodedata.category(key.msymbol)
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 6d389cf817a7ff21146abd8ba3aa5bb914819c86
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Wed Jul 13 13:17:58 2016 +0200
Make m17n_translit handle ���NoIme��� as a dummy input method
It is nicer to handle the input method with the special name ���NoIme���
as a special case in m17n_translit. Then ���NoIme��� can be treated as
just another input method in hunspell_table.py instead of having
special cases in many places there.
>---------------------------------------------------------------
engine/m17n_translit.py | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/engine/m17n_translit.py b/engine/m17n_translit.py
index 7b98931..66591e9 100644
--- a/engine/m17n_translit.py
+++ b/engine/m17n_translit.py
@@ -230,6 +230,10 @@ class Transliterator:
>>> trans.transliterate(list('gru"n'))
'gr��n'
+ >>> trans = Transliterator('NoIme')
+ >>> trans.transliterate(['a', 'b', 'c', 'C-c', 'G-4'])
+ 'abcC-cG-4'
+
If initializing the transliterator fails, for example
because a non-existing input method was given as the argument,
a ValueError is raised:
@@ -250,9 +254,17 @@ class Transliterator:
Raises ValueError if something fails.
:param ime: Full name of the m17n input method, for example
- ���hi-inscript2��� or ���t-latn-post���
+ ���hi-inscript2��� or ���t-latn-post���. There is one
+ special input method name ���NoIme���. The input method
+ ���NoIme��� is just a dummy which does not transliteration
+ at all, it only joins the list of Msymbol names to
+ a string.
:type ime: string
'''
+ self._dummy = False
+ if ime == 'NoIme':
+ self._dummy = True
+ return
language = ime.split('-')[0]
name = '-'.join(ime.split('-')[1:])
self._im = libm17n__minput_open_im(
@@ -272,13 +284,20 @@ class Transliterator:
def transliterate(self, msymbol_list):
'''Transliterate a list of Msymbol names
- :param msymbol_list: A list of python strings which
- are interpreted as the names of Msymbols
- to transliterate
+ Returns the transliteration as a string.
+
+ :param msymbol_list: A list of strings which are interpreted
+ as the names of Msymbols to transliterate.
+ If the input method has the special name ���NoIme���,
+ no transliteration is done, the list of
+ Msymbols is just joined to a single string.
+ :type msymbol_list: A list of strings
:rtype: string
'''
if type(msymbol_list) != type([]):
raise ValueError('Argument of transliterate() must be a list.')
+ if self._dummy:
+ return u''.join(msymbol_list)
libm17n__minput_reset_ic(self._ic)
output = ''
for symbol in msymbol_list + ['nil']:
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit f471e0433b5248f3cd92e1628e0346fde9cc53a1
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Mon Jul 11 15:47:14 2016 +0200
Check if the commit key would change the transliteration if used as regular input
Resolves: rhbz#1353672 - Hindi-IN Hunspell method misprints character.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1353672
>---------------------------------------------------------------
engine/hunspell_table.py | 23 ++++++++++++++++++++---
engine/m17n_translit.py | 3 +++
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/engine/hunspell_table.py b/engine/hunspell_table.py
index 38582f5..c621d3b 100644
--- a/engine/hunspell_table.py
+++ b/engine/hunspell_table.py
@@ -1453,9 +1453,26 @@ class tabengine (IBus.Engine):
self._editor.get_typed_string_cursor() - 1)
self._update_ui()
return True
- input_phrase = (
- self._editor.get_transliterated_strings()[
- self.get_current_imes()[0]])
+ # This key does not only a cursor movement in the pre��dit,
+ # it really triggers a commit. We need to transliterate
+ # the pre��dit again here, because adding the commit key to
+ # the input might influence the transliteration. For example
+ # When using hi-itrans, ���. ��� translates to ������ ���
+ # (See: https://bugzilla.redhat.com/show_bug.cgi?id=1353672)
+ preedit_ime = self.get_current_imes()[0]
+ if preedit_ime == 'NoIme':
+ input_phrase = (
+ self._editor.get_transliterated_strings()[preedit_ime])
+ else:
+ input_phrase = self._editor.get_transliterators()[
+ preedit_ime].transliterate(
+ self._editor.get_typed_string() + [key.msymbol])
+ # If the transliteration now ends with the commit key, cut
+ # it off because the commit key is passed to the
+ # application later anyway and we do not want to pass it
+ # twice:
+ if len(key.msymbol) and input_phrase.endswith(key.msymbol):
+ input_phrase = input_phrase[:-len(key.msymbol)]
if not input_phrase:
return False
if not self._editor.get_candidates():
diff --git a/engine/m17n_translit.py b/engine/m17n_translit.py
index 701af40..7b98931 100644
--- a/engine/m17n_translit.py
+++ b/engine/m17n_translit.py
@@ -201,6 +201,9 @@ class Transliterator:
>>> trans.transliterate(list('namaste'))
'������������������'
+ >>> trans.transliterate(list('. '))
+ '��� '
+
Hindi-Inscript2 uses the AltGr key a lot, 'G-4' is
the MSymbol name for AltGr-4 and it transliterates
to something different than just '4':
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 366d7e9840cae8fd759e7986d549b6143478f1df
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Fri Jul 1 17:16:01 2016 +0200
Pass modifier key combinations through if there is no possible transliteration for that key combination
Resolves: rhbz#1351748 - Gujarati & Hindi itrans method fails to perform cut,
copy, paste & undo using 'ctrl' key sequences.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1351748
>---------------------------------------------------------------
engine/hunspell_table.py | 43 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/engine/hunspell_table.py b/engine/hunspell_table.py
index b2f0a17..38582f5 100644
--- a/engine/hunspell_table.py
+++ b/engine/hunspell_table.py
@@ -645,6 +645,10 @@ class editor(object):
else:
self._current_imes = imes
+ def get_transliterators(self):
+ '''Get current dictionary of transliterator objects'''
+ return self._transliterators
+
def push_context(self, phrase):
self._pp_phrase = self._p_phrase
self._p_phrase = phrase
@@ -1504,6 +1508,45 @@ class tabengine (IBus.Engine):
# first key typed, we will try to complete something now
# get the context if possible
self.get_context()
+ if (self._editor.is_empty() and len(key.msymbol) == 3
+ and key.msymbol[:2] in ('A-', 'C-', 'G-')):
+ # See:
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1351748
+ # If the user types AltGr-<something> or
+ # Control-<something>, this might have a
+ # transliteration in some input methods. For example,
+ # AltGr-4 (key.msymbol = 'G-4') transliterates to ���
+ # when the ���hi-inscript2��� input method is used. But
+ # trying to handle all Alt-, Control-, and AltGr-
+ # stuff as input is not nice because it prevents the
+ # use of such key combinations for other purposes.
+ # C-c is usually used for for copying, C-v for pasting
+ # for example. If the user has typed a key combination
+ # starting with such a modifier key, check whether any
+ # of the current input methods actually transliterates
+ # it to something. If none of the current input
+ # methods uses it, the key combination can be passed
+ # through to be used for its original purpose. But do
+ # this only when the pre��dit is empty, if there is
+ # already something in the pre��dit, it seems to
+ # confusing to me to pass it through. If the pre��dit
+ # is non empty, keep handling key.msymbol as input,
+ # that seems more obvious.
+ has_transliteration = False
+ for ime in self.get_current_imes():
+ if ime != 'NoIme':
+ if self._editor.get_transliterators()[
+ ime].transliterate(
+ [key.msymbol]) != key.msymbol:
+ has_transliteration = True
+ if not has_transliteration:
+ if debug_level > 1:
+ sys.stderr.write(
+ "_process_key_event() "
+ + "key.msymbol=%s has no transliteration, "
+ %key.msymbol
+ + "passing through.")
+ return False
self._editor.insert_string_at_cursor([key.msymbol])
if (len(key.msymbol) == 1
and unicodedata.category(key.msymbol)