kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=bc0f40e54c4790bd106b904eb0842fc46b42ee15

commit bc0f40e54c4790bd106b904eb0842fc46b42ee15
Author: Kai Huuhko <kai.huu...@gmail.com>
Date:   Mon May 4 03:35:50 2015 +0300

    Add automated init/shutdown to rest of the modules
---
 efl/ecore_x/efl.ecore_x.pyx | 5 +++++
 efl/edje/efl.edje.pyx       | 8 ++++----
 efl/emotion/efl.emotion.pyx | 3 +++
 efl/ethumb/efl.ethumb.pyx   | 3 +++
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/efl/ecore_x/efl.ecore_x.pyx b/efl/ecore_x/efl.ecore_x.pyx
index 4baf32b..cf0e90e 100644
--- a/efl/ecore_x/efl.ecore_x.pyx
+++ b/efl/ecore_x/efl.ecore_x.pyx
@@ -19,6 +19,8 @@
 from cpython cimport PyMem_Malloc, PyMem_Free, PyUnicode_AsUTF8String
 from efl.utils.deprecated cimport DEPRECATED
 
+import atexit
+
 
 def init(name=None):
     """Initialize the X display connection to the given display.
@@ -322,3 +324,6 @@ def cursor_free(Ecore_X_Cursor c):
 
 include "efl.ecore_x_window.pxi"
 include "efl.ecore_x_events.pxi"
+
+init()
+atexit.register(shutdown)
diff --git a/efl/edje/efl.edje.pyx b/efl/edje/efl.edje.pyx
index b9201c6..dad8ff4 100644
--- a/efl/edje/efl.edje.pyx
+++ b/efl/edje/efl.edje.pyx
@@ -30,10 +30,6 @@ Classes
 
 """
 
-
-import traceback
-import warnings
-
 from cpython cimport PyMem_Malloc, PyMem_Free, PyUnicode_AsUTF8String
 cimport libc.stdlib
 from libc.stdint cimport uintptr_t
@@ -45,6 +41,9 @@ from efl.eo cimport _object_mapping_register, 
object_from_instance, \
 from efl.utils.conversions cimport _ctouni, _touni, \
     eina_list_strings_to_python_list
 
+import traceback
+import warnings
+import atexit
 
 
 def init():
@@ -288,3 +287,4 @@ include "efl.edje_object.pxi"
 
 
 init()
+atexit.register(shutdown)
diff --git a/efl/emotion/efl.emotion.pyx b/efl/emotion/efl.emotion.pyx
index 809d250..ffe1318 100644
--- a/efl/emotion/efl.emotion.pyx
+++ b/efl/emotion/efl.emotion.pyx
@@ -41,6 +41,8 @@ from efl.utils.conversions cimport _ctouni
 from efl.evas cimport Canvas, evas_object_smart_callback_add, \
     evas_object_smart_callback_del
 
+import atexit
+
 
 cdef void _emotion_callback(void *data, Evas_Object *o, void *ei) with gil:
     cdef Emotion obj
@@ -1285,3 +1287,4 @@ _object_mapping_register("Emotion_Object", Emotion)
 
 
 init()
+atexit.register(shutdown)
diff --git a/efl/ethumb/efl.ethumb.pyx b/efl/ethumb/efl.ethumb.pyx
index 9f6f831..573f811 100644
--- a/efl/ethumb/efl.ethumb.pyx
+++ b/efl/ethumb/efl.ethumb.pyx
@@ -15,6 +15,8 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this Python-EFL.  If not, see <http://www.gnu.org/licenses/>.
 
+import atexit
+
 def init():
     return ethumb_init()
 
@@ -28,3 +30,4 @@ cdef class PyEthumb:
 
 
 init()
+atexit.register(shutdown)

-- 


Reply via email to