diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2021-04-27 19:56:07 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2021-04-27 19:56:07 +0900 |
commit | 84f080278a7351a26df441429bd58e5931944c32 (patch) | |
tree | b459fe7e3e071a53612b4540e0a8572c0b669873 /setup | |
parent | 26be2cc471911a41f198e6c6c82a61994bea379a (diff) | |
download | ibus-anthy-84f080278a7351a26df441429bd58e5931944c32.tar.gz |
Fix covscan result
- Fix double quote not to re-splitting elements
- Fix deprecated GObject private
- Fix section variable initialization
- Fix dlg variable condition assignment
Diffstat (limited to 'setup')
-rw-r--r-- | setup/python2/ibus-setup-anthy.in | 4 | ||||
-rw-r--r-- | setup/python2/main.py | 8 | ||||
-rw-r--r-- | setup/python3/ibus-setup-anthy.in | 4 | ||||
-rw-r--r-- | setup/python3/main.py | 6 |
4 files changed, 13 insertions, 9 deletions
diff --git a/setup/python2/ibus-setup-anthy.in b/setup/python2/ibus-setup-anthy.in index b936d2c..81c9dfc 100644 --- a/setup/python2/ibus-setup-anthy.in +++ b/setup/python2/ibus-setup-anthy.in @@ -4,7 +4,7 @@ # ibus-tmpl - The Input Bus template project # # Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com> -# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com> +# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com> # Copyright (c) 2007-2016 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify @@ -22,4 +22,4 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. export IBUS_LOCALEDIR=@localedir@ -exec @PYTHON@ @prefix@/share/ibus-anthy/setup/main.py $@ +exec @PYTHON@ @prefix@/share/ibus-anthy/setup/main.py "$@" diff --git a/setup/python2/main.py b/setup/python2/main.py index 4e6b15b..f870ee5 100644 --- a/setup/python2/main.py +++ b/setup/python2/main.py @@ -4,7 +4,7 @@ # # Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com> # Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com> -# Copyright (c) 2010-2019 Takao Fujiwara <takao.fujiwara1@gmail.com> +# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com> # Copyright (c) 2007-2019 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify @@ -1253,7 +1253,7 @@ class AnthySetup(object): model_combobox = combobox.get_model() method = model_combobox[id][1] type = user_data - section_base = None + section = None key = input.get_text() value = output.get_text() left_text = left.get_text() @@ -1308,7 +1308,7 @@ class AnthySetup(object): l, i = tv.get_selection().get_selected() type = l[i][0] key = l[i][1] - section_base = None + section = None if type == 'romaji': section = 'romaji-typing-rule' elif type == 'kana': @@ -1379,6 +1379,7 @@ class AnthySetup(object): def on_btn_dict_add_clicked(self, widget): file = None id = None + dlg = None if Gtk.Buildable.get_name(widget) == 'dict:btn_add': dlg = Gtk.FileChooserDialog(title=_("Open Dictionary File"), @@ -1394,6 +1395,7 @@ class AnthySetup(object): _("_OK"), Gtk.ResponseType.OK) dlg.add_buttons(*buttons) + assert(dlg != None), 'Button name is undefined.' vbox = self.__builder.get_object('dict:add_extra_vbox') if Gtk.Buildable.get_name(widget) == 'dict:btn_add': # Need to init for the second time diff --git a/setup/python3/ibus-setup-anthy.in b/setup/python3/ibus-setup-anthy.in index b936d2c..81c9dfc 100644 --- a/setup/python3/ibus-setup-anthy.in +++ b/setup/python3/ibus-setup-anthy.in @@ -4,7 +4,7 @@ # ibus-tmpl - The Input Bus template project # # Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com> -# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com> +# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com> # Copyright (c) 2007-2016 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify @@ -22,4 +22,4 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. export IBUS_LOCALEDIR=@localedir@ -exec @PYTHON@ @prefix@/share/ibus-anthy/setup/main.py $@ +exec @PYTHON@ @prefix@/share/ibus-anthy/setup/main.py "$@" diff --git a/setup/python3/main.py b/setup/python3/main.py index 7e16093..6641f7f 100644 --- a/setup/python3/main.py +++ b/setup/python3/main.py @@ -1246,7 +1246,7 @@ class AnthySetup(object): model_combobox = combobox.get_model() method = model_combobox[id][1] type = user_data - section_base = None + section = None key = input.get_text() value = output.get_text() left_text = left.get_text() @@ -1301,7 +1301,7 @@ class AnthySetup(object): l, i = tv.get_selection().get_selected() type = l[i][0] key = l[i][1] - section_base = None + section = None if type == 'romaji': section = 'romaji-typing-rule' elif type == 'kana': @@ -1372,6 +1372,7 @@ class AnthySetup(object): def on_btn_dict_add_clicked(self, widget): file = None id = None + dlg = None if Gtk.Buildable.get_name(widget) == 'dict:btn_add': dlg = Gtk.FileChooserDialog(title=_("Open Dictionary File"), @@ -1387,6 +1388,7 @@ class AnthySetup(object): _("_OK"), Gtk.ResponseType.OK) dlg.add_buttons(*buttons) + assert (dlg != None), 'Button name is undefined.' vbox = self.__builder.get_object('dict:add_extra_vbox') if Gtk.Buildable.get_name(widget) == 'dict:btn_add': # Need to init for the second time |