kuuko pushed a commit to branch master. http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=d416425f5130263c9cee26672c76bbf9c2fd09ea
commit d416425f5130263c9cee26672c76bbf9c2fd09ea Author: Kai Huuhko <kai.huu...@gmail.com> Date: Mon Mar 9 21:01:55 2015 +0200 Evas.SmartObject: Trivial changes Removed cruft, upgraded cls == NULL log message level to ERR, added formatter to SO example logging. --- efl/evas/efl.evas.pyx | 3 ++- efl/evas/efl.evas_object.pxi | 20 -------------------- efl/evas/efl.evas_object_smart.pxi | 24 ++++++++++++------------ examples/elementary/test_core_evas_smart.py | 7 ++++++- 4 files changed, 20 insertions(+), 34 deletions(-) diff --git a/efl/evas/efl.evas.pyx b/efl/evas/efl.evas.pyx index 4b32c4e..69c1ca9 100644 --- a/efl/evas/efl.evas.pyx +++ b/efl/evas/efl.evas.pyx @@ -915,7 +915,8 @@ Module level functions from efl.utils.conversions cimport eina_list_strings_to_python_list -from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, EINA_LOG_DOM_WARN +from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, EINA_LOG_DOM_WARN, \ + EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT from efl.utils.logger cimport add_logger cdef int PY_EFL_EVAS_LOG_DOMAIN = add_logger(__name__).eina_log_domain diff --git a/efl/evas/efl.evas_object.pxi b/efl/evas/efl.evas_object.pxi index 34eefef..ec14248 100644 --- a/efl/evas/efl.evas_object.pxi +++ b/efl/evas/efl.evas_object.pxi @@ -235,26 +235,6 @@ cdef class Object(Eo): def evas_get(self): return object_from_instance(evas_object_evas_get(self.obj)) -# TODO move to Eo -# def type_get(self): -# """type_get() -# -# Get the Evas object's type -# -# :rtype: string -# """ -# if self.obj: -# return _ctouni(evas_object_type_get(self.obj)) - -# property type: -# """Type name, ie: "rectangle". -# -# :type: string -# -# """ -# def __get__(self): -# return self.type_get() - def smart_member_add(self, SmartObject parent): """ diff --git a/efl/evas/efl.evas_object_smart.pxi b/efl/evas/efl.evas_object_smart.pxi index c15fb48..4cc7af5 100644 --- a/efl/evas/efl.evas_object_smart.pxi +++ b/efl/evas/efl.evas_object_smart.pxi @@ -33,7 +33,7 @@ cdef void _smart_object_delete(Evas_Object *o) with gil: tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -65,7 +65,7 @@ cdef void _smart_object_move(Evas_Object *o, Evas_Coord x, Evas_Coord y) with gi tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -91,7 +91,7 @@ cdef void _smart_object_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h) with tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -117,7 +117,7 @@ cdef void _smart_object_show(Evas_Object *o) with gil: tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -143,7 +143,7 @@ cdef void _smart_object_hide(Evas_Object *o) with gil: tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -169,7 +169,7 @@ cdef void _smart_object_color_set(Evas_Object *o, int r, int g, int b, int a) wi tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -196,7 +196,7 @@ cdef void _smart_object_clip_set(Evas_Object *o, Evas_Object *clip) with gil: tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -224,7 +224,7 @@ cdef void _smart_object_clip_unset(Evas_Object *o) with gil: tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -250,7 +250,7 @@ cdef void _smart_object_calculate(Evas_Object *o) with gil: tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -277,7 +277,7 @@ cdef void _smart_object_member_add(Evas_Object *o, Evas_Object *clip) with gil: tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -306,7 +306,7 @@ cdef void _smart_object_member_del(Evas_Object *o, Evas_Object *clip) with gil: tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp @@ -336,7 +336,7 @@ cdef void _smart_callback(void *data, Evas_Object *o, void *event_info) with gil tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) if tmp == NULL: - EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) + EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) return cls = <Smart>tmp diff --git a/examples/elementary/test_core_evas_smart.py b/examples/elementary/test_core_evas_smart.py index 2137f51..e1bb7cf 100644 --- a/examples/elementary/test_core_evas_smart.py +++ b/examples/elementary/test_core_evas_smart.py @@ -189,7 +189,12 @@ def core_evas_smart_clicked(obj, item=None): if __name__ == "__main__": import logging efl_log = logging.getLogger("efl") - efl_log.addHandler(logging.StreamHandler()) + efl_log_form = logging.Formatter( + "[%(name)s] %(levelname)s in %(funcName)s:%(lineno)d - %(message)s" + ) + efl_log_handler = logging.StreamHandler() + efl_log_handler.setFormatter(efl_log_form) + efl_log.addHandler(efl_log_handler) elementary.init() core_evas_smart_clicked(None) elementary.run() --