summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2012-06-10 18:04:21 +0000
committerKai Huuhko <kai.huuhko@gmail.com>2012-06-10 18:04:21 +0000
commit2a550ec48d7f4bdeecea0c18352f3d31b2ab4660 (patch)
tree0acd04a87184d25fab57d4ac87066f21dcbd0800
parentccce81c1d177dd5136cf67d54c2916c72fa7815a (diff)
python-ecore: py3ization.
SVN revision: 71915
-rw-r--r--INSTALL15
-rw-r--r--ecore/__init__.py4
-rw-r--r--ecore/ecore.c_ecore_exe.pxi4
-rw-r--r--ecore/evas/ecore.evas.c_ecore_evas.pyx2
-rw-r--r--ecore/x/__init__.py42
-rw-r--r--m4/cython.m42
-rw-r--r--m4/python.m44
7 files changed, 39 insertions, 34 deletions
diff --git a/INSTALL b/INSTALL
index 7d1c323..6e90e07 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
1Installation Instructions 1Installation Instructions
2************************* 2*************************
3 3
4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 4Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
52006, 2007, 2008, 2009 Free Software Foundation, Inc. 5Inc.
6 6
7 Copying and distribution of this file, with or without modification, 7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright 8are permitted in any medium without royalty provided the copyright
@@ -226,6 +226,11 @@ order to use an ANSI C compiler:
226 226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX. 227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228 228
229 HP-UX `make' updates targets which have the same time stamps as
230their prerequisites, which makes it generally unusable when shipped
231generated files such as `configure' are involved. Use GNU `make'
232instead.
233
229 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot 234 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
230parse its `<wchar.h>' header file. The option `-nodtk' can be used as 235parse its `<wchar.h>' header file. The option `-nodtk' can be used as
231a workaround. If GNU CC is not installed, it is therefore recommended 236a workaround. If GNU CC is not installed, it is therefore recommended
@@ -304,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
304overridden in the site shell script). 309overridden in the site shell script).
305 310
306Unfortunately, this technique does not work for `CONFIG_SHELL' due to 311Unfortunately, this technique does not work for `CONFIG_SHELL' due to
307an Autoconf bug. Until the bug is fixed you can use this workaround: 312an Autoconf limitation. Until the limitation is lifted, you can use
313this workaround:
308 314
309 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash 315 CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
310 316
311`configure' Invocation 317`configure' Invocation
312====================== 318======================
@@ -362,4 +368,3 @@ operates.
362 368
363`configure' also accepts some other, not widely useful, options. Run 369`configure' also accepts some other, not widely useful, options. Run
364`configure --help' for more details. 370`configure --help' for more details.
365
diff --git a/ecore/__init__.py b/ecore/__init__.py
index db32e55..edcf04b 100644
--- a/ecore/__init__.py
+++ b/ecore/__init__.py
@@ -17,9 +17,9 @@
17 17
18#!/usr/bin/env python2 18#!/usr/bin/env python2
19 19
20import c_ecore 20import ecore.c_ecore
21 21
22from c_ecore import shutdown, time_get, loop_time_get, timer_add, \ 22from ecore.c_ecore import shutdown, time_get, loop_time_get, timer_add, \
23 main_loop_begin, main_loop_quit, main_loop_iterate, \ 23 main_loop_begin, main_loop_quit, main_loop_iterate, \
24 main_loop_glib_integrate, event_handler_add, event_type_new, \ 24 main_loop_glib_integrate, event_handler_add, event_type_new, \
25 animator_add, animator_frametime_set, animator_frametime_get, \ 25 animator_add, animator_frametime_set, animator_frametime_get, \
diff --git a/ecore/ecore.c_ecore_exe.pxi b/ecore/ecore.c_ecore_exe.pxi
index 269f1f6..3a500e4 100644
--- a/ecore/ecore.c_ecore_exe.pxi
+++ b/ecore/ecore.c_ecore_exe.pxi
@@ -842,7 +842,7 @@ cdef class EventExeData(Event):
842 self.exe = _ecore_exe_event_mapping.get(<long>obj.exe) 842 self.exe = _ecore_exe_event_mapping.get(<long>obj.exe)
843 if self.exe is None: 843 if self.exe is None:
844 return -1 844 return -1
845 self.data = PyString_FromStringAndSize(<char*>obj.data, obj.size) 845 self.data = PyUnicode_FromStringAndSize(<char*>obj.data, obj.size)
846 self.size = obj.size 846 self.size = obj.size
847 self.lines = [] 847 self.lines = []
848 848
@@ -850,7 +850,7 @@ cdef class EventExeData(Event):
850 if obj.lines: 850 if obj.lines:
851 i = 0 851 i = 0
852 while obj.lines[i].line != NULL: 852 while obj.lines[i].line != NULL:
853 line_append(PyString_FromStringAndSize( 853 line_append(PyUnicode_FromStringAndSize(
854 obj.lines[i].line, obj.lines[i].size)) 854 obj.lines[i].line, obj.lines[i].size))
855 i += 1 855 i += 1
856 856
diff --git a/ecore/evas/ecore.evas.c_ecore_evas.pyx b/ecore/evas/ecore.evas.c_ecore_evas.pyx
index 159601e..93bccba 100644
--- a/ecore/evas/ecore.evas.c_ecore_evas.pyx
+++ b/ecore/evas/ecore.evas.c_ecore_evas.pyx
@@ -113,7 +113,7 @@ def engine_type_supported_get(method):
113 113
114 if isinstance(method, (int, long)): 114 if isinstance(method, (int, long)):
115 method_id = method 115 method_id = method
116 elif isinstance(method, basestring): 116 elif isinstance(method, str):
117 method_id = engine_type_from_name(method) 117 method_id = engine_type_from_name(method)
118 if method_id < 0: 118 if method_id < 0:
119 raise ValueError("unknown method name %r" % method) 119 raise ValueError("unknown method name %r" % method)
diff --git a/ecore/x/__init__.py b/ecore/x/__init__.py
index 4105427..4215202 100644
--- a/ecore/x/__init__.py
+++ b/ecore/x/__init__.py
@@ -105,27 +105,27 @@ ECORE_X_WINDOW_CONFIGURE_MASK_BORDER_WIDTH = 16
105ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING = 32 105ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING = 32
106ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE = 64 106ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE = 64
107 107
108ECORE_X_EVENT_MASK_NONE = 0L # 0L 108ECORE_X_EVENT_MASK_NONE = 0 # 0L
109ECORE_X_EVENT_MASK_KEY_DOWN = 1L # (1L << 0) 109ECORE_X_EVENT_MASK_KEY_DOWN = 1 # (1L << 0)
110ECORE_X_EVENT_MASK_KEY_UP = 2L # (1L << 1) 110ECORE_X_EVENT_MASK_KEY_UP = 2 # (1L << 1)
111ECORE_X_EVENT_MASK_MOUSE_DOWN = 4L # (1L << 2) 111ECORE_X_EVENT_MASK_MOUSE_DOWN = 4 # (1L << 2)
112ECORE_X_EVENT_MASK_MOUSE_UP = 8L # (1L << 3) 112ECORE_X_EVENT_MASK_MOUSE_UP = 8 # (1L << 3)
113ECORE_X_EVENT_MASK_MOUSE_IN = 16L # (1L << 4) 113ECORE_X_EVENT_MASK_MOUSE_IN = 16 # (1L << 4)
114ECORE_X_EVENT_MASK_MOUSE_OUT = 32L # (1L << 5) 114ECORE_X_EVENT_MASK_MOUSE_OUT = 32 # (1L << 5)
115ECORE_X_EVENT_MASK_MOUSE_MOVE = 64L # (1L << 6) 115ECORE_X_EVENT_MASK_MOUSE_MOVE = 64 # (1L << 6)
116ECORE_X_EVENT_MASK_WINDOW_DAMAGE = 32768L # (1L << 15) 116ECORE_X_EVENT_MASK_WINDOW_DAMAGE = 32768 # (1L << 15)
117ECORE_X_EVENT_MASK_WINDOW_VISIBILITY = 65536L # (1L << 16) 117ECORE_X_EVENT_MASK_WINDOW_VISIBILITY = 65536 # (1L << 16)
118ECORE_X_EVENT_MASK_WINDOW_CONFIGURE = 131072L # (1L << 17) 118ECORE_X_EVENT_MASK_WINDOW_CONFIGURE = 131072 # (1L << 17)
119ECORE_X_EVENT_MASK_WINDOW_RESIZE_MANAGE = 262144L # (1L << 18) 119ECORE_X_EVENT_MASK_WINDOW_RESIZE_MANAGE = 262144 # (1L << 18)
120ECORE_X_EVENT_MASK_WINDOW_MANAGE = 524288L # (1L << 19) 120ECORE_X_EVENT_MASK_WINDOW_MANAGE = 524288 # (1L << 19)
121ECORE_X_EVENT_MASK_WINDOW_CHILD_CONFIGURE = 1048576L # (1L << 20) 121ECORE_X_EVENT_MASK_WINDOW_CHILD_CONFIGURE = 1048576 # (1L << 20)
122ECORE_X_EVENT_MASK_WINDOW_FOCUS_CHANGE = 2097152L # (1L << 21) 122ECORE_X_EVENT_MASK_WINDOW_FOCUS_CHANGE = 2097152 # (1L << 21)
123ECORE_X_EVENT_MASK_WINDOW_PROPERTY = 4194304L # (1L << 22) 123ECORE_X_EVENT_MASK_WINDOW_PROPERTY = 4194304 # (1L << 22)
124ECORE_X_EVENT_MASK_WINDOW_COLORMAP = 8388608L # (1L << 23) 124ECORE_X_EVENT_MASK_WINDOW_COLORMAP = 8388608 # (1L << 23)
125ECORE_X_EVENT_MASK_WINDOW_GRAB = 16777216L # (1L << 24) 125ECORE_X_EVENT_MASK_WINDOW_GRAB = 16777216 # (1L << 24)
126ECORE_X_EVENT_MASK_MOUSE_WHEEL = 536870912L # (1L << 29) 126ECORE_X_EVENT_MASK_MOUSE_WHEEL = 536870912 # (1L << 29)
127ECORE_X_EVENT_MASK_WINDOW_FOCUS_IN = 1073741824L # (1L << 30) 127ECORE_X_EVENT_MASK_WINDOW_FOCUS_IN = 1073741824 # (1L << 30)
128ECORE_X_EVENT_MASK_WINDOW_FOCUS_OUT = 2147483648L # (1L << 31) 128ECORE_X_EVENT_MASK_WINDOW_FOCUS_OUT = 2147483648 # (1L << 31)
129 129
130ECORE_X_GRAVITY_FORGET = 0 130ECORE_X_GRAVITY_FORGET = 0
131ECORE_X_GRAVITY_UNMAP = 0 131ECORE_X_GRAVITY_UNMAP = 0
diff --git a/m4/cython.m4 b/m4/cython.m4
index ba1d432..5353b6d 100644
--- a/m4/cython.m4
+++ b/m4/cython.m4
@@ -8,7 +8,7 @@ ifelse([$1], [], [_msg=""], [_msg=" >= $1"])
8AC_MSG_CHECKING(for Cython$_msg) 8AC_MSG_CHECKING(for Cython$_msg)
9AC_CACHE_VAL(py_cv_cython, [ 9AC_CACHE_VAL(py_cv_cython, [
10 10
11prog="import Cython.Compiler.Version; print Cython.Compiler.Version.version" 11prog="import Cython.Compiler.Version; print(Cython.Compiler.Version.version)"
12CYTHON_VERSION=`$PYTHON -c "$prog" 2>&AC_FD_CC` 12CYTHON_VERSION=`$PYTHON -c "$prog" 2>&AC_FD_CC`
13 13
14py_cv_cython=no 14py_cv_cython=no
diff --git a/m4/python.m4 b/m4/python.m4
index 02acac8..f625251 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -47,8 +47,8 @@ if test -x "$PYTHON_INCLUDES"; then
47PYTHON_INCLUDES="-I$PYTHON_INCLUDES" 47PYTHON_INCLUDES="-I$PYTHON_INCLUDES"
48else 48else
49dnl deduce PYTHON_INCLUDES 49dnl deduce PYTHON_INCLUDES
50py_prefix=`$PYTHON -c "import sys; print sys.prefix"` 50py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"`
51py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` 51py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"`
52if test -x "$PYTHON-config"; then 52if test -x "$PYTHON-config"; then
53PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` 53PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
54else 54else