diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-02-02 10:39:36 +0100 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2015-02-02 10:39:36 +0100 |
commit | 5b2ca650b21d60a481e861ce998d2a0bbd2fb64d (patch) | |
tree | 1e279847bd724abdc2df428034e135566d9a3873 /setup/main2.py | |
parent | 1bc034eaa38e56c9b9fc0151b9d56cfe3912af29 (diff) | |
download | ibus-libpinyin-5b2ca650b21d60a481e861ce998d2a0bbd2fb64d.tar.gz ibus-libpinyin-5b2ca650b21d60a481e861ce998d2a0bbd2fb64d.tar.xz ibus-libpinyin-5b2ca650b21d60a481e861ce998d2a0bbd2fb64d.zip |
Enable running setup scripts with Python 3
The default uses 'python'.
To use 'python3', ./configure --with-python=python3
Diffstat (limited to 'setup/main2.py')
-rw-r--r-- | setup/main2.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/setup/main2.py b/setup/main2.py index a860e3e..354cbb0 100644 --- a/setup/main2.py +++ b/setup/main2.py @@ -21,6 +21,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +from __future__ import print_function + import gettext import locale @@ -268,8 +270,8 @@ class PreferencesDialog: def __correct_pinyin_toggled_cb(widget): val = widget.get_active() - map(lambda w: self.__builder.get_object(w[0]).set_sensitive(val), - self.__correct_pinyin_widgets) + for w in self.__correct_pinyin_widgets: + self.__builder.get_object(w[0]).set_sensitive(val) self.__correct_pinyin.connect("toggled", __correct_pinyin_toggled_cb) # init value @@ -304,8 +306,8 @@ class PreferencesDialog: def __fuzzy_pinyin_toggled_cb(widget): val = widget.get_active() - map(lambda w: self.__builder.get_object(w[0]).set_sensitive(val), - self.__fuzzy_pinyin_widgets) + for w in self.__fuzzy_pinyin_widgets: + self.__builder.get_object(w[0]).set_sensitive(val) self.__fuzzy_pinyin.connect("toggled", __fuzzy_pinyin_toggled_cb) # init value @@ -452,7 +454,7 @@ class PreferencesDialog: elif isinstance(val, str): var = GLib.Variant.new_string(val) else: - print >> sys.stderr, "val(%s) is not in support type." % repr(val) + print("val(%s) is not in support type." % repr(val), file=sys.stderr) return self.__values[name] = val |