summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2016-09-06 12:54:52 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2016-10-19 20:17:02 +0900
commitc1aa57c2bbbb8049bc79a6fe9b346570e9e1a436 (patch)
tree041b07c26c276e11bf6c266125bd870d4d7049e2
parent2e652b292b6d0140e4b848f275b6feb52c055aaa (diff)
downloadibus-anthy-c1aa57c2bbbb8049bc79a6fe9b346570e9e1a436.tar.gz
Fixed __cmd_predict()
-rw-r--r--engine/python2/engine.py10
-rw-r--r--engine/python3/engine.py10
2 files changed, 10 insertions, 10 deletions
diff --git a/engine/python2/engine.py b/engine/python2/engine.py
index 6a3fa6e..bb32b66 100644
--- a/engine/python2/engine.py
+++ b/engine/python2/engine.py
@@ -1120,7 +1120,7 @@ class Engine(IBus.EngineSimple):
# fill lookup_table
self.__lookup_table.clear()
- for i in xrange(0, seg_stat.nr_predictions):
+ for i in xrange(0, nr_predictions):
buf = self.__context.get_prediction(i)
candidate = UN(buf)
self.__lookup_table.append_candidate(IBus.Text.new_from_string(candidate))
@@ -1778,8 +1778,8 @@ class Engine(IBus.EngineSimple):
try:
if getattr(self, cmd)(keyval, state):
return True
- except:
- printerr('Unknown command = %s' % cmd)
+ except Exception as err:
+ printerr('Error command: %s: %s' % (cmd, str(err)))
return False
def RS():
@@ -1906,8 +1906,8 @@ class Engine(IBus.EngineSimple):
try:
if getattr(self, cmd)(keyval, state):
return True
- except:
- printerr('Unknown command = %s' % cmd)
+ except Exception as err:
+ printerr('Error command: %s: %s' % (cmd, str(err)))
# If input mode is not LATIN, eat Ctrl+Shift+u
hex_mod_mask = IBus.ModifierType.SHIFT_MASK | \
diff --git a/engine/python3/engine.py b/engine/python3/engine.py
index 3a8df72..1215fb8 100644
--- a/engine/python3/engine.py
+++ b/engine/python3/engine.py
@@ -1115,7 +1115,7 @@ class Engine(IBus.EngineSimple):
# fill lookup_table
self.__lookup_table.clear()
- for i in range(0, seg_stat.nr_predictions):
+ for i in range(0, nr_predictions):
buf = self.__context.get_prediction(i)
candidate = buf
self.__lookup_table.append_candidate(IBus.Text.new_from_string(candidate))
@@ -1772,8 +1772,8 @@ class Engine(IBus.EngineSimple):
try:
if getattr(self, cmd)(keyval, state):
return True
- except:
- printerr('Unknown command = %s' % cmd)
+ except Exception as err:
+ printerr('Error command: %s: %s' % (cmd, str(err)))
return False
def RS():
@@ -1900,8 +1900,8 @@ class Engine(IBus.EngineSimple):
try:
if getattr(self, cmd)(keyval, state):
return True
- except:
- printerr('Unknown command = %s' % cmd)
+ except Exception as err:
+ printerr('Error command: %s: %s' % (cmd, str(err)))
# If input mode is not LATIN, eat Ctrl+Shift+u
hex_mod_mask = IBus.ModifierType.SHIFT_MASK | \