Add automated init/shutdown to rest of the modules

This commit is contained in:
Kai Huuhko 2015-05-04 03:35:50 +03:00
parent 532bc85acd
commit bc0f40e54c
4 changed files with 15 additions and 4 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)