Skip to content

Commit

Permalink
Fixed Hiragana to Katakana with F7 key.
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwarat committed Oct 21, 2010
1 parent 9901e45 commit 91ddf1f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion engine/kana.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __get_kana_typing_rule(self, enchars, retval=None):
section = self._kana_typing_rule_section
if section != None:
if enchars in prefs.keys(section):
value = prefs.get_value(section, enchars)
value = unicode(str(prefs.get_value(section, enchars)))
if value == '':
value = None
if value == None:
Expand Down
2 changes: 1 addition & 1 deletion engine/romaji.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __get_romaji_typing_rule(self, enchars, retval=None):
section = self._romaji_typing_rule_section
if section != None:
if enchars in prefs.keys(section):
value = prefs.get_value(section, enchars)
value = unicode(str(prefs.get_value(section, enchars)))
if value == '':
value = None
if value == None:
Expand Down
16 changes: 12 additions & 4 deletions engine/thumb.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,13 @@ def __init_layout_table(self):
prefs = self.__prefs
for k in prefs.keys(section):
value = prefs.get_value(section, k)
if len(value) == 3 and value[0] == '' and \
value[1] == '' and value[2] == '':
if value == None or len(value) != 3 or \
(str(value[0]) == '' and \
str(value[1]) == '' and str(value[2]) == ''):
continue
value = [unicode(str(value[0])),
unicode(str(value[1])),
unicode(str(value[2]))]
self.__table[ord(k)] = value
for c in value:
self.__r_table[c] = k
Expand Down Expand Up @@ -510,9 +514,13 @@ def _init_layout_table(cls):
prefs = cls._prefs
for k in prefs.keys(section):
value = prefs.get_value(section, k)
if len(value) == 3 and value[0] == '' and \
value[1] == '' and value[2] == '':
if value == None or len(value) != 3 or \
(str(value[0]) == '' and \
str(value[1]) == '' and str(value[2]) == ''):
continue
value = [unicode(str(value[0])),
unicode(str(value[1])),
unicode(str(value[2]))]
for c in value:
cls._r_table[c] = k
else:
Expand Down

0 comments on commit 91ddf1f

Please sign in to comment.