summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-03-26 12:57:25 +0800
committerPeng Wu <alexepico@gmail.com>2015-03-26 12:57:25 +0800
commit958b9239d02e56c06a603bd4304ae0321b2a512a (patch)
tree9fdb01ce07634f9908a6cb646b6ee5242732b560
parent772d9878d25dfec2bbc4205c6756d9d877d244b9 (diff)
downloadibus-libzhuyin-958b9239d02e56c06a603bd4304ae0321b2a512a.tar.gz
ibus-libzhuyin-958b9239d02e56c06a603bd4304ae0321b2a512a.tar.xz
ibus-libzhuyin-958b9239d02e56c06a603bd4304ae0321b2a512a.zip
migrate setup dialog to python 3.x
-rw-r--r--configure.ac5
-rw-r--r--setup/ibus-setup-libzhuyin.in2
-rw-r--r--setup/main.py4
3 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index b723d8a..927da4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,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/ibus-setup-libzhuyin.in b/setup/ibus-setup-libzhuyin.in
index 1dd5238..3cdc037 100644
--- a/setup/ibus-setup-libzhuyin.in
+++ b/setup/ibus-setup-libzhuyin.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 main.py $@
+exec @PYTHON@ main.py $@
diff --git a/setup/main.py b/setup/main.py
index b2840dc..5631570 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -18,6 +18,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
@@ -298,7 +300,7 @@ class PreferencesWindow:
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