diff options
author | Peng Wu <alexepico@gmail.com> | 2015-02-27 12:00:51 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2015-02-27 12:00:51 +0800 |
commit | 29157570ceaade11ed51fbc45a48e952ef1eae6e (patch) | |
tree | 77fb018d809fd5115b4c8948f16b04b0ac536bbc | |
parent | a7c391bbd323d4fa6c7b87bca0c59fa2885aa143 (diff) | |
parent | b4b9180050dea96c2f522f11d7a20d05fde1e698 (diff) | |
download | ibus-libpinyin-29157570ceaade11ed51fbc45a48e952ef1eae6e.tar.gz ibus-libpinyin-29157570ceaade11ed51fbc45a48e952ef1eae6e.tar.xz ibus-libpinyin-29157570ceaade11ed51fbc45a48e952ef1eae6e.zip |
Merge branch 'encukou-py3'
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | setup/dicttreeview.py | 4 | ||||
-rw-r--r-- | setup/ibus-setup-libpinyin.in | 2 | ||||
-rw-r--r-- | setup/main2.py | 12 |
4 files changed, 15 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 274d3a3..9044967 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,11 @@ AC_PATH_PROG(ENV, env) AC_SUBST(ENV) # check python +AC_ARG_WITH(python, + AS_HELP_STRING([--with-python[=PATH]], + [Select python2 or python3]), + [PYTHON=$with_python], [] +) AM_PATH_PYTHON([2.5]) # --enable-boost diff --git a/setup/dicttreeview.py b/setup/dicttreeview.py index 490f2a5..670a34c 100644 --- a/setup/dicttreeview.py +++ b/setup/dicttreeview.py @@ -172,13 +172,13 @@ class DictionaryTreeView(Gtk.TreeView): if prop.name == 'dictionaries': return self.get_dictionaries() else: - raise AttributeError, 'unknown property %s' % prop.name + raise AttributeError('unknown property %s' % prop.name) def do_set_property(self, prop, value): if prop.name == "dictionaries": self.set_dictionaries(value) else: - raise AttributeError, 'unknown property %s' % prop.name + raise AttributeError('unknown property %s' % prop.name) GObject.type_register(DictionaryTreeView) diff --git a/setup/ibus-setup-libpinyin.in b/setup/ibus-setup-libpinyin.in index da1b15a..2f2dcd4 100644 --- a/setup/ibus-setup-libpinyin.in +++ b/setup/ibus-setup-libpinyin.in @@ -28,5 +28,5 @@ export IBUS_DATAROOTDIR=@datarootdir@ export IBUS_LOCALEDIR=@localedir@ export IBUS_PKGDATADIR=@prefix@/share/@PACKAGE@ cd @prefix@/share/@PACKAGE@/setup/ -exec python main2.py $@ +exec @PYTHON@ main2.py $@ diff --git a/setup/main2.py b/setup/main2.py index 2d19769..20a2dac 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 @@ -474,7 +476,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 |