Evas.SmartObject: Trivial changes
Removed cruft, upgraded cls == NULL log message level to ERR, added formatter to SO example logging.
This commit is contained in:
parent
fbc22d850d
commit
d416425f51
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
"""
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue