[ibus-typing-booster] master: Fix typo in doc string (a9a1122)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit a9a1122bb32b361818fbc2fd800306894d0560f2
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Thu Dec 17 11:04:37 2015 +0100
Fix typo in doc string
>---------------------------------------------------------------
ibus-typing-booster/engine/m17n_translit.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ibus-typing-booster/engine/m17n_translit.py b/ibus-typing-booster/engine/m17n_translit.py
index c1de137..9981372 100644
--- a/ibus-typing-booster/engine/m17n_translit.py
+++ b/ibus-typing-booster/engine/m17n_translit.py
@@ -210,7 +210,7 @@ class Transliterator:
'gr��n'
If initializing the transliterator fails, for example
- because a non-existing input method was give as the argument,
+ because a non-existing input method was given as the argument,
a ValueError is raised:
>>> trans = Transliterator('ru-translitx')
8 years, 4 months
[ibus-typing-booster] master: Release 1.3.0 (7630d6c)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 7630d6ca3754f375bd96ddbe627c3b3351020f91
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Tue Dec 15 22:58:48 2015 +0100
Release 1.3.0
>---------------------------------------------------------------
ibus-typing-booster/ChangeLog | 11 +++++++++++
ibus-typing-booster/configure.ac | 4 ++--
ibus-typing-booster/ibus-typing-booster.pc.in | 2 +-
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/ibus-typing-booster/ChangeLog b/ibus-typing-booster/ChangeLog
index 61bce35..802932d 100644
--- a/ibus-typing-booster/ChangeLog
+++ b/ibus-typing-booster/ChangeLog
@@ -1,4 +1,15 @@
* Author: Mike FABIAN <mfabian(a)redhat.com>
+* 15 Dez 2015 Released 1.3.0 version
+* Use libm17n directly instead of going through libtranslit
+* Forward key events triggering a commit using ���forward_key_event()��� instead of relying on ���return False��� (Resolves: rhbz#1291238)
+* Add code to use F1-F9 as well as keys to select candidates for commit or remove
+* Don���t commit invisible candidates with select keys with numbers greater than the length of a page of the candidate list
+* Control-arrow-left and Control-arrow-right now commit when the edges of the pre��dit string are reached
+* Alt-<number> does not delete a prediction anymore, now only Control-<number> does this
+* Add an option to disable the use of the digits 1-9 as selection keys (useful if one wants easier number input, selection then works only with the F1-F9 keys)
+* Support input methods using AltGr (e.g. mr-inscript2) and Alt keys (e.g. ta-lk-renganathan) (Resolves: rhbz#1051405, rhbz#772665)
+
+* Author: Mike FABIAN <mfabian(a)redhat.com>
* 02 Nov 2015 Released 1.2.15 version
* Use open() instead of codecs.open() to make the input method help button work again (Resolves: rhbz#1276992)
* Fix some pylint warnings
diff --git a/ibus-typing-booster/configure.ac b/ibus-typing-booster/configure.ac
index 2627871..0eb942e 100755
--- a/ibus-typing-booster/configure.ac
+++ b/ibus-typing-booster/configure.ac
@@ -23,8 +23,8 @@
m4_define([package_name], [ibus-typing-booster])
m4_define([ibus_released], [1])
m4_define([ibus_major_version], [1])
-m4_define([ibus_minor_version], [2])
-m4_define([ibus_micro_version], [15])
+m4_define([ibus_minor_version], [3])
+m4_define([ibus_micro_version], [0])
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/ibus-typing-booster.pc.in b/ibus-typing-booster/ibus-typing-booster.pc.in
index 3999933..e2335a5 100755
--- a/ibus-typing-booster/ibus-typing-booster.pc.in
+++ b/ibus-typing-booster/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.2.15
+Version: 1.3.0
Requires:
Libs:
Cflags:
8 years, 4 months
[ibus-typing-booster] master: Some more debug output (0fe5159)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 0fe515996c7dcc6414ba35a9a56a369dcf176c01
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Thu Dec 17 10:46:17 2015 +0100
Some more debug output
>---------------------------------------------------------------
ibus-typing-booster/engine/factory.py | 17 +++++++++++++++++
ibus-typing-booster/engine/hunspell_suggest.py | 2 +-
ibus-typing-booster/engine/hunspell_table.py | 9 ++++++---
ibus-typing-booster/engine/main.py | 16 ++++++++++++++++
ibus-typing-booster/engine/tabsqlitedb.py | 3 ++-
5 files changed, 42 insertions(+), 5 deletions(-)
diff --git a/ibus-typing-booster/engine/factory.py b/ibus-typing-booster/engine/factory.py
index ca077c3..75cfd99 100755
--- a/ibus-typing-booster/engine/factory.py
+++ b/ibus-typing-booster/engine/factory.py
@@ -22,14 +22,26 @@ from gi.repository import IBus
import hunspell_table
import tabsqlitedb
import re
+import os
+import sys
from gettext import dgettext
_ = lambda a : dgettext ("ibus-typing-booster", a)
N_ = lambda a : a
+debug_level = int(0)
+
class EngineFactory (IBus.Factory):
"""Table IM Engine Factory"""
def __init__(self, bus, db="", icon=""):
+ global debug_level
+ try:
+ debug_level = int(os.getenv('IBUS_TYPING_BOOSTER_DEBUG_LEVEL'))
+ except (TypeError, ValueError):
+ debug_level = int(0)
+ if debug_level > 1:
+ sys.stderr.write("EngineFactory.__init__(bus=%s, db=%s, icon=%s)\n"
+ % (bus, db, icon))
if db:
self.db = tabsqlitedb.tabsqlitedb(config_filename=db)
else:
@@ -43,6 +55,9 @@ class EngineFactory (IBus.Factory):
self.engine_id = 0
def do_create_engine(self, engine_name):
+ if debug_level > 1:
+ sys.stderr.write("EngineFactory.do_create_engine(engine_name=%s)\n"
+ % engine_name)
engine_base_path = "/com/redhat/IBus/engines/table/%s/engine/"
path_patt = re.compile(r'[^a-zA-Z0-9_/]')
self.engine_path = engine_base_path % path_patt.sub ('_', engine_name)
@@ -70,6 +85,8 @@ class EngineFactory (IBus.Factory):
def do_destroy (self):
'''Destructor, which finish some task for IME'''
+ if debug_level > 1:
+ sys.stderr.write("EngineFactory.do_destroy()\n")
for _db in self.dbdict:
self.dbdict[_db].sync_usrdb()
super(EngineFactory, self).destroy()
diff --git a/ibus-typing-booster/engine/hunspell_suggest.py b/ibus-typing-booster/engine/hunspell_suggest.py
index ce66513..8e3a85c 100755
--- a/ibus-typing-booster/engine/hunspell_suggest.py
+++ b/ibus-typing-booster/engine/hunspell_suggest.py
@@ -51,7 +51,7 @@ class Dictionary:
def __init__(self, name=u'en_US'):
if debug_level > 1:
sys.stderr.write(
- "Dictionary.__init__(name=%s)" %name)
+ "Dictionary.__init__(name=%s)\n" %name)
self.loc = '/usr/share/myspell'
self.name = name
self.encoding = 'UTF-8'
diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py
index 1ff0052..cdbd995 100644
--- a/ibus-typing-booster/engine/hunspell_table.py
+++ b/ibus-typing-booster/engine/hunspell_table.py
@@ -107,7 +107,8 @@ class editor(object):
def __init__ (self, config, database):
if debug_level > 1:
- sys.stderr.write("editor __init__()\n")
+ sys.stderr.write("editor __init__(config=%s, database=%s)\n"
+ %(config, database))
self.db = database
self._config = config
self._name = self.db.ime_properties.get('name')
@@ -165,7 +166,7 @@ class editor(object):
try:
if debug_level > 1:
sys.stderr.write(
- "calling Transliterator(%(cur)s)\n"
+ "instantiating Transliterator(%(cur)s)\n"
%{'cur': self._current_ime})
self.trans = Transliterator(self._current_ime)
except ValueError as e:
@@ -571,7 +572,9 @@ class tabengine (IBus.Engine):
except (TypeError, ValueError):
debug_level = int(0)
if debug_level > 1:
- sys.stderr.write("tabengine.__init__() obj_path=%s\n" %obj_path)
+ sys.stderr.write(
+ "tabengine.__init__(bus=%s, obj_path=%s, db=%s)\n"
+ % (bus, obj_path, db))
super(tabengine, self).__init__(
connection=bus.get_connection(), object_path=obj_path)
self._input_purpose = 0
diff --git a/ibus-typing-booster/engine/main.py b/ibus-typing-booster/engine/main.py
index de16183..35cf362 100755
--- a/ibus-typing-booster/engine/main.py
+++ b/ibus-typing-booster/engine/main.py
@@ -27,6 +27,12 @@ from signal import signal, SIGTERM, SIGINT
import factory
import tabsqlitedb
+debug_level = int(0)
+try:
+ debug_level = int(os.getenv('IBUS_TYPING_BOOSTER_DEBUG_LEVEL'))
+except (TypeError, ValueError):
+ debug_level = int(0)
+
try:
config_file_dir = os.path.join(
os.getenv('IBUS_TYPING_BOOSTER_LOCATION'),
@@ -80,6 +86,10 @@ if options.profile:
class IMApp:
def __init__(self, dbfile, exec_by_ibus):
+ if debug_level > 1:
+ sys.stderr.write(
+ "IMApp.__init__(dbfile=%s, exec_by_ibus=%s)\n"
+ % (dbfile, exec_by_ibus))
self.__mainloop = GLib.MainLoop()
self.__bus = IBus.Bus()
self.__bus.connect("disconnected", self.__bus_destroy_cb)
@@ -125,15 +135,21 @@ class IMApp:
def run(self):
+ if debug_level > 1:
+ sys.stderr.write("IMApp.run()\n")
if options.profile:
profile.enable()
self.__mainloop.run()
self.__bus_destroy_cb()
def quit(self):
+ if debug_level > 1:
+ sys.stderr.write("IMApp.quit()\n")
self.__bus_destroy_cb()
def __bus_destroy_cb(self, bus=None):
+ if debug_level > 1:
+ sys.stderr.write("IMApp.__bus_destroy_cb(bus=%s)\n" % bus)
if self.destroyed:
return
print("finalizing:)")
diff --git a/ibus-typing-booster/engine/tabsqlitedb.py b/ibus-typing-booster/engine/tabsqlitedb.py
index 89b9364..8784270 100755
--- a/ibus-typing-booster/engine/tabsqlitedb.py
+++ b/ibus-typing-booster/engine/tabsqlitedb.py
@@ -89,7 +89,8 @@ class tabsqlitedb:
except (TypeError, ValueError):
debug_level = int(0)
if debug_level > 1:
- sys.stderr.write("tabsqlitedb.__init__()")
+ sys.stderr.write("tabsqlitedb.__init__(config_filename=%s)\n"
+ %config_filename)
self._phrase_table_column_names = [
'id',
'input_phrase',
8 years, 4 months
[ibus-typing-booster] master: Remove unused variable self._m17ndb = 'm17n' (671c76e)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 671c76ea9c1e09e3395db207292c25d05f8bd26e
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Thu Dec 17 10:38:00 2015 +0100
Remove unused variable self._m17ndb = 'm17n'
>---------------------------------------------------------------
ibus-typing-booster/engine/hunspell_table.py | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py
index 169e37b..e8ef67b 100644
--- a/ibus-typing-booster/engine/hunspell_table.py
+++ b/ibus-typing-booster/engine/hunspell_table.py
@@ -137,7 +137,6 @@ class editor(object):
self._lookup_table.clear()
self._lookup_table.set_cursor_visible(False)
- self._m17ndb = 'm17n'
self.trans = None
self._supported_imes = []
8 years, 4 months
[ibus-typing-booster] master: Fix syntax error which made the non-transliteration mode fail (e2d5842)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit e2d5842bfa2f34dcdf14d413afd3c5320b2b0bfc
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Thu Dec 17 10:39:18 2015 +0100
Fix syntax error which made the non-transliteration mode fail
Problem found by Pravin Satpute
>---------------------------------------------------------------
ibus-typing-booster/engine/hunspell_table.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py
index e8ef67b..1ff0052 100644
--- a/ibus-typing-booster/engine/hunspell_table.py
+++ b/ibus-typing-booster/engine/hunspell_table.py
@@ -194,7 +194,7 @@ class editor(object):
self._transliterated_string = unicodedata.normalize(
'NFKD', self._transliterated_string)
else:
- self._transliterated_string = u''.join.self._typed_string
+ self._transliterated_string = u''.join(self._typed_string)
if debug_level > 1:
sys.stderr.write(
"update_transliterated_string() self._typed_string=%s\n"
8 years, 4 months
[ibus-typing-booster] master: Update German translation (ee9fbbb)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit ee9fbbb63286d3cf0bd6b0e544c652735a572908
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Wed Dec 16 00:34:31 2015 +0100
Update German translation
>---------------------------------------------------------------
ibus-typing-booster/po/de.po | 60 +++++++++++++-----------
ibus-typing-booster/po/ibus-typing-booster.pot | 58 ++++++++++++-----------
2 files changed, 63 insertions(+), 55 deletions(-)
diff --git a/ibus-typing-booster/po/de.po b/ibus-typing-booster/po/de.po
index 49da678..31961f6 100644
--- a/ibus-typing-booster/po/de.po
+++ b/ibus-typing-booster/po/de.po
@@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Project-Id-Version: ibus-typing-booster 0.0.16\n"
"Report-Msgid-Bugs-To: http://code.google.com/p/ibus/issues/entry\n"
-"POT-Creation-Date: 2015-11-02 14:16+0900\n"
-"PO-Revision-Date: 2015-09-24 13:51+0200\n"
+"POT-Creation-Date: 2015-12-15 23:37+0100\n"
+"PO-Revision-Date: 2015-12-16 00:35+0100\n"
"Last-Translator: Mike FABIAN <mfabian(a)redhat.com>\n"
"Language-Team: German <trans-de(a)lists.fedoraproject.org>\n"
"Language: de\n"
@@ -29,16 +29,16 @@ msgstr "Einstellungen"
msgid "Configure ibus-typing-booster ���%(name)s���"
msgstr "Ibus Typing Booster \"%(name)s\" Einstellungen"
-#: setup/main.py:103
+#: setup/main.py:101
#, python-format
msgid "Unknown format of engine name: IBUS_ENGINE_NAME=%(name)s"
msgstr "Unbekanntes Format des Enginenamens: IBUS_ENGINE_NAME=%(name)s"
-#: setup/main.py:108
+#: setup/main.py:107
msgid "IBUS_ENGINE_NAME environment variable is not set."
msgstr "Die IBUS_ENGINE_NAME Umgebungsvariable variable is nicht gesetzt."
-#: setup/main.py:112
+#: setup/main.py:111
msgid ""
"Cannot determine the config file for this engine. Please use the --config-"
"file option."
@@ -60,29 +60,29 @@ msgstr "Ibus l��uft nicht."
msgid "Preferences for ibus-typing-booster \"%(symbol)s\""
msgstr "Ibus Typing Booster \"%(symbol)s\" Einstellungen"
-#: setup/main.py:262
+#: setup/main.py:273
msgid "Another instance of this app is already running."
msgstr "Eine Instanz dieses Programms l��uft schon."
-#: setup/main.py:357
+#: setup/main.py:368
msgid "Open File ..."
msgstr "��ffne Datei"
-#: setup/main.py:375
+#: setup/main.py:386
#, python-format
msgid "Learned successfully from file %(filename)s."
msgstr "Das Lernen aus der Datei %(filename)s war erfolgreich."
-#: setup/main.py:384
+#: setup/main.py:395
#, python-format
msgid "Learning from file %(filename)s failed."
msgstr "Fehler beim Lernen aus der Datai %(filename)s."
-#: setup/main.py:393
+#: setup/main.py:404
msgid "Are you sure?"
msgstr "Sind Sie sicher?"
-#: setup/main.py:400
+#: setup/main.py:411
msgid ""
"Do you really want to delete all language \n"
"data learned from typing or reading files?"
@@ -90,75 +90,79 @@ msgstr ""
"Wollen Sie wirklich alle Sprachdaten l��schen, die aus den\n"
"Usereingaben oder aus Dateien gelernt wurden?"
-#: setup/setup.glade:29
+#: setup/setup.glade:35
msgid "Close"
msgstr "Schlie��en"
-#: setup/setup.glade:77
+#: setup/setup.glade:83
msgid "Enable suggestions by Tab key"
msgstr "Vorschl��ge nur bei Dr��cken von TAB"
-#: setup/setup.glade:101
+#: setup/setup.glade:106
msgid "Candidate window page size:"
msgstr "Anzahl der Vorschl��ge pro Seite:"
-#: setup/setup.glade:137
+#: setup/setup.glade:142
msgid "Input Method:"
msgstr "Eingabemethode:"
-#: setup/setup.glade:161
+#: setup/setup.glade:167
msgid "Display total number of candidates"
msgstr "Gesamtzahl der Kandidaten anzeigen"
-#: setup/setup.glade:186
+#: setup/setup.glade:192
msgid "Minimum number of chars for completion:"
msgstr "Mindestanzahl Zeichen f��r Vervollst��ndigung"
-#: setup/setup.glade:219
+#: setup/setup.glade:225
msgid "Input Method Help"
msgstr "Hilfe f��r Eingabemethode:"
-#: setup/setup.glade:258
+#: setup/setup.glade:239
+msgid "Use digits as select keys"
+msgstr "Ziffern als Selektionstasten benutzen"
+
+#: setup/setup.glade:282
msgid "Options"
msgstr "Optionen"
-#: setup/setup.glade:291
+#: setup/setup.glade:315
msgid "Install dictionary"
msgstr "Installiere W��rterbuch"
-#: setup/setup.glade:305
+#: setup/setup.glade:329
msgid "Install pyhunspell"
msgstr "pyhunspell installieren"
-#: setup/setup.glade:321
+#: setup/setup.glade:345
msgid "Learn from text file"
msgstr "Aus Textdatei lernen"
-#: setup/setup.glade:340
+#: setup/setup.glade:363
msgid "Install the dictionary package for this engine"
msgstr "Installiere das W��rterbuchpaket f��r diesen Engine"
-#: setup/setup.glade:350
+#: setup/setup.glade:373
msgid "Install pyhunspell package to get spellchecking suggestions"
msgstr ""
"Das pyhunspell Paket installieren um Tippfehlerkorrekturvorschl��ge zu "
"bekommen"
-#: setup/setup.glade:364
+#: setup/setup.glade:387
msgid "Learn your style by reading a text file"
msgstr "Ihren Stil aus einer Textdatei lernen"
-#: setup/setup.glade:378
+#: setup/setup.glade:401
msgid ""
"Delete all personal language data learned from typing or from reading files"
msgstr ""
"Alle Daten l��schen, die aus den Benutzereingaben oder aus Dateien gelernt "
"wurden"
-#: setup/setup.glade:389
+#: setup/setup.glade:413
msgid "Delete learned data"
msgstr "Gelernte Daten l��schen"
-#: setup/setup.glade:426
+#: setup/setup.glade:450
msgid "Dictionaries and personal data"
msgstr "W��rterb��cher und pers��nliche Daten"
diff --git a/ibus-typing-booster/po/ibus-typing-booster.pot b/ibus-typing-booster/po/ibus-typing-booster.pot
index 2147297..cbfcb25 100644
--- a/ibus-typing-booster/po/ibus-typing-booster.pot
+++ b/ibus-typing-booster/po/ibus-typing-booster.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://code.google.com/p/ibus/issues/entry\n"
-"POT-Creation-Date: 2015-11-02 14:16+0900\n"
+"POT-Creation-Date: 2015-12-15 23:37+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
@@ -26,16 +26,16 @@ msgstr ""
msgid "Configure ibus-typing-booster ���%(name)s���"
msgstr ""
-#: setup/main.py:103
+#: setup/main.py:101
#, python-format
msgid "Unknown format of engine name: IBUS_ENGINE_NAME=%(name)s"
msgstr ""
-#: setup/main.py:108
+#: setup/main.py:107
msgid "IBUS_ENGINE_NAME environment variable is not set."
msgstr ""
-#: setup/main.py:112
+#: setup/main.py:111
msgid ""
"Cannot determine the config file for this engine. Please use the --config-"
"file option."
@@ -55,99 +55,103 @@ msgstr ""
msgid "Preferences for ibus-typing-booster \"%(symbol)s\""
msgstr ""
-#: setup/main.py:262
+#: setup/main.py:273
msgid "Another instance of this app is already running."
msgstr ""
-#: setup/main.py:357
+#: setup/main.py:368
msgid "Open File ..."
msgstr ""
-#: setup/main.py:375
+#: setup/main.py:386
#, python-format
msgid "Learned successfully from file %(filename)s."
msgstr ""
-#: setup/main.py:384
+#: setup/main.py:395
#, python-format
msgid "Learning from file %(filename)s failed."
msgstr ""
-#: setup/main.py:393
+#: setup/main.py:404
msgid "Are you sure?"
msgstr ""
-#: setup/main.py:400
+#: setup/main.py:411
msgid ""
"Do you really want to delete all language \n"
"data learned from typing or reading files?"
msgstr ""
-#: setup/setup.glade:29
+#: setup/setup.glade:35
msgid "Close"
msgstr ""
-#: setup/setup.glade:77
+#: setup/setup.glade:83
msgid "Enable suggestions by Tab key"
msgstr ""
-#: setup/setup.glade:101
+#: setup/setup.glade:106
msgid "Candidate window page size:"
msgstr ""
-#: setup/setup.glade:137
+#: setup/setup.glade:142
msgid "Input Method:"
msgstr ""
-#: setup/setup.glade:161
+#: setup/setup.glade:167
msgid "Display total number of candidates"
msgstr ""
-#: setup/setup.glade:186
+#: setup/setup.glade:192
msgid "Minimum number of chars for completion:"
msgstr ""
-#: setup/setup.glade:219
+#: setup/setup.glade:225
msgid "Input Method Help"
msgstr ""
-#: setup/setup.glade:258
+#: setup/setup.glade:239
+msgid "Use digits as select keys"
+msgstr ""
+
+#: setup/setup.glade:282
msgid "Options"
msgstr ""
-#: setup/setup.glade:291
+#: setup/setup.glade:315
msgid "Install dictionary"
msgstr ""
-#: setup/setup.glade:305
+#: setup/setup.glade:329
msgid "Install pyhunspell"
msgstr ""
-#: setup/setup.glade:321
+#: setup/setup.glade:345
msgid "Learn from text file"
msgstr ""
-#: setup/setup.glade:340
+#: setup/setup.glade:363
msgid "Install the dictionary package for this engine"
msgstr ""
-#: setup/setup.glade:350
+#: setup/setup.glade:373
msgid "Install pyhunspell package to get spellchecking suggestions"
msgstr ""
-#: setup/setup.glade:364
+#: setup/setup.glade:387
msgid "Learn your style by reading a text file"
msgstr ""
-#: setup/setup.glade:378
+#: setup/setup.glade:401
msgid ""
"Delete all personal language data learned from typing or from reading files"
msgstr ""
-#: setup/setup.glade:389
+#: setup/setup.glade:413
msgid "Delete learned data"
msgstr ""
-#: setup/setup.glade:426
+#: setup/setup.glade:450
msgid "Dictionaries and personal data"
msgstr ""
8 years, 4 months
[ibus-typing-booster] master: Improve code to handle the left and right arrow keys (26c36bf)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 26c36bf4438c6b29b66a84a3743ef23dc90fa069
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Tue Dec 15 11:27:02 2015 +0100
Improve code to handle the left and right arrow keys
Control-arrow-left and control-arrow-right should also commit when the
end of the pre��dit string is reached, otherwise this is inconsistent
with the behaviour of arrow-left and arrow-right, I think.
I.e. now the first Control-arrow-left moves the cursor to the left of the
pre��dit, another Control-arrow-left commits and sends a Control-arrow-left
to the application.
>---------------------------------------------------------------
ibus-typing-booster/engine/hunspell_table.py | 74 ++++++++++---------------
1 files changed, 30 insertions(+), 44 deletions(-)
diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py
index a876265..6242b58 100644
--- a/ibus-typing-booster/engine/hunspell_table.py
+++ b/ibus-typing-booster/engine/hunspell_table.py
@@ -295,18 +295,6 @@ class editor(object):
'NFC', transliterated_string_up_to_cursor)
return len(transliterated_string_up_to_cursor)
- def control_arrow_left (self):
- '''
- Move cursor to the beginning of the typed string
- '''
- self._typed_string_cursor = 0
-
- def control_arrow_right (self):
- '''
- Move cursor to the end of the typed string
- '''
- self._typed_string_cursor = len(self._typed_string)
-
def append_candidate_to_lookup_table(self, phrase=u'', user_freq=0):
'''append candidate to lookup_table'''
if not phrase:
@@ -1050,22 +1038,6 @@ class tabengine (IBus.Engine):
self._update_ui ()
return res
- if (key.val in (IBus.KEY_Left, IBus.KEY_KP_Left)
- and key.state & IBus.ModifierType.CONTROL_MASK):
- if self._editor.is_empty():
- return False
- self._editor.control_arrow_left()
- self._update_ui()
- return True
-
- if (key.val in (IBus.KEY_Right, IBus.KEY_KP_Right)
- and key.state & IBus.ModifierType.CONTROL_MASK):
- if self._editor.is_empty():
- return False
- self._editor.control_arrow_right()
- self._update_ui()
- return True
-
if (key.val == IBus.KEY_BackSpace
and key.state & IBus.ModifierType.CONTROL_MASK):
if self._editor.is_empty():
@@ -1155,17 +1127,26 @@ class tabengine (IBus.Engine):
IBus.KEY_Left, IBus.KEY_KP_Left):
if self._editor.is_empty():
return False
- if key.val in (IBus.KEY_Right, IBus.KEY_KP_Right):
- if (self._editor._typed_string_cursor
- < len(self._editor._typed_string)):
+ if (key.val in (IBus.KEY_Right, IBus.KEY_KP_Right)
+ and (self._editor._typed_string_cursor
+ < len(self._editor._typed_string))):
+ if key.state & IBus.ModifierType.CONTROL_MASK:
+ # Move cursor to the end of the typed string
+ self._editor._typed_string_cursor = len(
+ self._editor._typed_string)
+ else:
self._editor._typed_string_cursor += 1
- self._update_ui()
- return True
- if key.val in (IBus.KEY_Left, IBus.KEY_KP_Left):
- if self._editor._typed_string_cursor > 0:
+ self._update_ui()
+ return True
+ if (key.val in (IBus.KEY_Left, IBus.KEY_KP_Left)
+ and self._editor._typed_string_cursor > 0):
+ if key.state & IBus.ModifierType.CONTROL_MASK:
+ # Move cursor to the beginning of the typed string
+ self._editor._typed_string_cursor = 0
+ else:
self._editor._typed_string_cursor -= 1
- self._update_ui()
- return True
+ self._update_ui()
+ return True
input_phrase = self._editor.get_transliterated_string()
if not input_phrase:
return False
@@ -1187,14 +1168,19 @@ class tabengine (IBus.Engine):
if key.val in (IBus.KEY_Left, IBus.KEY_KP_Left):
# After committing, the cursor is at the right side of
# the committed string. When the string has been
- # committed because of arrow-left, the cursor has
- # to be moved to the left side of the string. This
- # should be done in a way which works even when
- # surrounding text is not supported. We can do it by
- # forwarding as many arrow-left events to the application
- # as the committed string has characters:
+ # committed because of arrow-left or
+ # control-arrow-left, the cursor has to be moved to
+ # the left side of the string. This should be done in
+ # a way which works even when surrounding text is not
+ # supported. We can do it by forwarding as many
+ # arrow-left events to the application as the
+ # committed string has characters. Because it might
+ # have been control-arrow-left, we need to clear the
+ # CONTROL_MASK:
for c in commit_string:
- self.forward_key_event(key.val, key.code, key.state)
+ self.forward_key_event(
+ key.val, key.code,
+ key.state & ~IBus.ModifierType.CONTROL_MASK)
# Forward the key event which triggered the commit here
# and return True instead of trying to pass that key event
# to the application by returning False. Doing it by
8 years, 4 months
[ibus-typing-booster] master: Use Msymbols instead of just characters when transliterating and storing the typed input (e7c0aed)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit e7c0aed01e92fc219ddea0314e1348f85dfb499b
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Tue Dec 15 18:24:51 2015 +0100
Use Msymbols instead of just characters when transliterating and storing the typed input
Resolves: rhbz#772665 - [RFE] Need support for AltGr mappings
See: https://bugzilla.redhat.com/show_bug.cgi?id=772665
Resolves: rhbz#1051405 - inscript2 layouts are not supported in ibus-typing-booster
See: https://bugzilla.redhat.com/show_bug.cgi?id=1051405
>---------------------------------------------------------------
ibus-typing-booster/engine/hunspell_table.py | 62 +++++++++++++------------
1 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py
index 5f3b66a..169e37b 100644
--- a/ibus-typing-booster/engine/hunspell_table.py
+++ b/ibus-typing-booster/engine/hunspell_table.py
@@ -946,15 +946,13 @@ class tabengine (IBus.Engine):
self._editor.insert_string_at_cursor(list(token))
self._update_ui()
return True
- if (key.val >= 32
- and (not (key.state & IBus.ModifierType.CONTROL_MASK))):
- typed_character = IBus.keyval_to_unicode(key.val)
+ if key.val >= 32 and not key.control:
# If the first character typed is a character which is
# very unlikely to be part of a word
# (e.g. punctuation, a symbol, ..), we might want to
# avoid completion and commit something immediately:
- if (typed_character
- and unicodedata.category(typed_character)
+ if (len(key.msymbol) == 1
+ and unicodedata.category(key.msymbol)
in itb_util.categories_to_trigger_immediate_commit):
if not self._editor.trans_m17n_mode:
# Do not just pass the character through,
@@ -963,7 +961,7 @@ class tabengine (IBus.Engine):
# between the ���.��� and the previous word and this is
# done in commit_string().
self.commit_string(
- typed_character, input_phrase = typed_character)
+ key.msymbol, input_phrase = key.msymbol)
return True
# If transliteration is used, we may need to
# handle a punctuation or symbol character. For
@@ -972,11 +970,11 @@ class tabengine (IBus.Engine):
# therefore we cannot just pass it through. Just
# add it to the input so far and see what comes
# next:
- self._editor.insert_string_at_cursor(list(typed_character))
+ self._editor.insert_string_at_cursor([key.msymbol])
self._update_ui()
return True
if (self._use_digits_as_select_keys
- and typed_character
+ and key.msymbol
in ('1', '2', '3', '4', '5', '6', '7', '8', '9')):
# If digits are used as keys to select candidates
# it is not possibly to type them while the pre��dit
@@ -995,7 +993,7 @@ class tabengine (IBus.Engine):
# want ���3��� to be converted to ���������. So we try
# to transliterate and commit the result:
transliterated_digit = self._editor.trans.transliterate(
- list(typed_character))
+ [key.msymbol])
self.commit_string(
transliterated_digit, input_phrase=transliterated_digit)
return True
@@ -1033,8 +1031,7 @@ class tabengine (IBus.Engine):
self._update_ui ()
return res
- if (key.val == IBus.KEY_BackSpace
- and key.state & IBus.ModifierType.CONTROL_MASK):
+ if key.val == IBus.KEY_BackSpace and key.control:
if self._editor.is_empty():
return False
self._editor.remove_string_before_cursor()
@@ -1048,8 +1045,7 @@ class tabengine (IBus.Engine):
self._update_ui()
return True
- if (key.val == IBus.KEY_Delete
- and key.state & IBus.ModifierType.CONTROL_MASK):
+ if key.val == IBus.KEY_Delete and key.control:
if self._editor.is_empty():
return False
self._editor.remove_string_after_cursor()
@@ -1063,8 +1059,16 @@ class tabengine (IBus.Engine):
self._update_ui()
return True
- # Commit or remove a candidate:
- if self._editor.get_candidates():
+ # Select a candidate to commit or remove:
+ if self._editor.get_candidates() and not key.mod1 and not key.mod5:
+ # key.mod1 (= Alt) and key.mod5 (= AltGr) should not be set
+ # here because:
+ #
+ # - in case of the digits these are used for input, not to select
+ # (e.g. mr-inscript2 transliterates AltGr-4 to ���������)
+ #
+ # - in case of the F1-F9 keys I want to reserve the Alt and AltGr
+ # modifiers for possible future extensions.
index = -1
if self._use_digits_as_select_keys:
if key.val >= IBus.KEY_1 and key.val <= IBus.KEY_9:
@@ -1074,7 +1078,7 @@ class tabengine (IBus.Engine):
if key.val >= IBus.KEY_F1 and key.val <= IBus.KEY_F9:
index = key.val - IBus.KEY_F1
if index >= 0 and index < self._page_size:
- if (key.state & IBus.ModifierType.CONTROL_MASK):
+ if key.control:
# Remove the candidate from the user database
res = self._editor.remove_candidate_from_user_database(
index)
@@ -1125,7 +1129,7 @@ class tabengine (IBus.Engine):
if (key.val in (IBus.KEY_Right, IBus.KEY_KP_Right)
and (self._editor._typed_string_cursor
< len(self._editor._typed_string))):
- if key.state & IBus.ModifierType.CONTROL_MASK:
+ if key.control:
# Move cursor to the end of the typed string
self._editor._typed_string_cursor = len(
self._editor._typed_string)
@@ -1135,7 +1139,7 @@ class tabengine (IBus.Engine):
return True
if (key.val in (IBus.KEY_Left, IBus.KEY_KP_Left)
and self._editor._typed_string_cursor > 0):
- if key.state & IBus.ModifierType.CONTROL_MASK:
+ if key.control:
# Move cursor to the beginning of the typed string
self._editor._typed_string_cursor = 0
else:
@@ -1190,19 +1194,18 @@ class tabengine (IBus.Engine):
self.forward_key_event(key.val, key.code, key.state)
return True
- if IBus.keyval_to_unicode(key.val):
+ if key.unicode:
if self._editor.is_empty():
# first key typed, we will try to complete something now
# get the context if possible
self.get_context()
- typed_character = IBus.keyval_to_unicode(key.val)
- self._editor.insert_string_at_cursor(list(typed_character))
- if (typed_character
- and unicodedata.category(typed_character)
+ self._editor.insert_string_at_cursor([key.msymbol])
+ if (len(key.msymbol) == 1
+ and unicodedata.category(key.msymbol)
in itb_util.categories_to_trigger_immediate_commit):
input_phrase = self._editor.get_transliterated_string()
if (input_phrase
- and input_phrase[-1] == typed_character
+ and input_phrase[-1] == key.msymbol
and not self._editor.trans_m17n_mode):
self.commit_string(
input_phrase + u' ', input_phrase = input_phrase)
@@ -1211,12 +1214,11 @@ class tabengine (IBus.Engine):
# What kind of key was this??
#
- # keychar = IBus.keyval_to_unicode(key.val)
- #
- # returned no result. And apparently it was not handled as
- # a select key or other special key either.
- # So whatever this was, we cannot handle it,
- # just pass it through to the application by returning ���False���.
+ # The unicode character for this key is apparently the empty
+ # string. And apparently it was not handled as a select key
+ # or other special key either. So whatever this was, we
+ # cannot handle it, just pass it through to the application by
+ # returning ���False���.
return False
def do_focus_in (self):
8 years, 4 months
[ibus-typing-booster] master: Add an is_ascii() utility function (a2f95b5)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit a2f95b5e55ad1e4c060af9e2e3e25999a86e1bbe
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Tue Dec 15 16:32:40 2015 +0100
Add an is_ascii() utility function
>---------------------------------------------------------------
ibus-typing-booster/engine/itb_util.py | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/ibus-typing-booster/engine/itb_util.py b/ibus-typing-booster/engine/itb_util.py
index b901db1..9cbc76b 100755
--- a/ibus-typing-booster/engine/itb_util.py
+++ b/ibus-typing-booster/engine/itb_util.py
@@ -3,7 +3,7 @@
#
# ibus-typing-booster - The Tables engine for IBus
#
-# Copyright (c) 2013 Mike FABIAN <mfabian(a)redhat.com>
+# Copyright (c) 2013-2015 Mike FABIAN <mfabian(a)redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -65,3 +65,30 @@ def tokenize(text):
tokens.append(strip_token(s))
return tokens
+def is_ascii(text):
+ '''Checks whether all characters in text are ASCII characters
+
+ Returns ���True��� if the text is all ASCII, ���False��� if not.
+
+ :param text: The text to check
+ :type text: string
+ :rtype: bool
+
+ Examples:
+
+ >>> is_ascii('Abc')
+ True
+
+ >>> is_ascii('Na��ve')
+ False
+ '''
+ try:
+ text.encode('ascii')
+ except UnicodeEncodeError:
+ return False
+ else:
+ return True
+
+if __name__ == "__main__":
+ import doctest
+ doctest.testmod()
8 years, 4 months