summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2015-03-09 21:01:55 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2015-03-09 21:01:55 +0200
commitd416425f5130263c9cee26672c76bbf9c2fd09ea (patch)
treef23ec9f5d027f388d872973e198d14b119bcae73
parentfbc22d850d600bcae4e145f81e2ce6c7c3b02d46 (diff)
Evas.SmartObject: Trivial changes
Removed cruft, upgraded cls == NULL log message level to ERR, added formatter to SO example logging.
-rw-r--r--efl/evas/efl.evas.pyx3
-rw-r--r--efl/evas/efl.evas_object.pxi20
-rw-r--r--efl/evas/efl.evas_object_smart.pxi24
-rw-r--r--examples/elementary/test_core_evas_smart.py7
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
915 915
916 916
917from efl.utils.conversions cimport eina_list_strings_to_python_list 917from efl.utils.conversions cimport eina_list_strings_to_python_list
918from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, EINA_LOG_DOM_WARN 918from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, EINA_LOG_DOM_WARN, \
919 EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT
919from efl.utils.logger cimport add_logger 920from efl.utils.logger cimport add_logger
920 921
921cdef int PY_EFL_EVAS_LOG_DOMAIN = add_logger(__name__).eina_log_domain 922cdef 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):
235 def evas_get(self): 235 def evas_get(self):
236 return object_from_instance(evas_object_evas_get(self.obj)) 236 return object_from_instance(evas_object_evas_get(self.obj))
237 237
238# TODO move to Eo
239# def type_get(self):
240# """type_get()
241#
242# Get the Evas object's type
243#
244# :rtype: string
245# """
246# if self.obj:
247# return _ctouni(evas_object_type_get(self.obj))
248
249# property type:
250# """Type name, ie: "rectangle".
251#
252# :type: string
253#
254# """
255# def __get__(self):
256# return self.type_get()
257
258 def smart_member_add(self, SmartObject parent): 238 def smart_member_add(self, SmartObject parent):
259 """ 239 """
260 240
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:
33 33
34 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 34 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
35 if tmp == NULL: 35 if tmp == NULL:
36 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 36 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
37 return 37 return
38 cls = <Smart>tmp 38 cls = <Smart>tmp
39 39
@@ -65,7 +65,7 @@ cdef void _smart_object_move(Evas_Object *o, Evas_Coord x, Evas_Coord y) with gi
65 65
66 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 66 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
67 if tmp == NULL: 67 if tmp == NULL:
68 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 68 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
69 return 69 return
70 cls = <Smart>tmp 70 cls = <Smart>tmp
71 71
@@ -91,7 +91,7 @@ cdef void _smart_object_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h) with
91 91
92 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 92 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
93 if tmp == NULL: 93 if tmp == NULL:
94 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 94 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
95 return 95 return
96 cls = <Smart>tmp 96 cls = <Smart>tmp
97 97
@@ -117,7 +117,7 @@ cdef void _smart_object_show(Evas_Object *o) with gil:
117 117
118 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 118 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
119 if tmp == NULL: 119 if tmp == NULL:
120 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 120 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
121 return 121 return
122 cls = <Smart>tmp 122 cls = <Smart>tmp
123 123
@@ -143,7 +143,7 @@ cdef void _smart_object_hide(Evas_Object *o) with gil:
143 143
144 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 144 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
145 if tmp == NULL: 145 if tmp == NULL:
146 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 146 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
147 return 147 return
148 cls = <Smart>tmp 148 cls = <Smart>tmp
149 149
@@ -169,7 +169,7 @@ cdef void _smart_object_color_set(Evas_Object *o, int r, int g, int b, int a) wi
169 169
170 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 170 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
171 if tmp == NULL: 171 if tmp == NULL:
172 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 172 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
173 return 173 return
174 cls = <Smart>tmp 174 cls = <Smart>tmp
175 175
@@ -196,7 +196,7 @@ cdef void _smart_object_clip_set(Evas_Object *o, Evas_Object *clip) with gil:
196 196
197 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 197 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
198 if tmp == NULL: 198 if tmp == NULL:
199 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 199 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
200 return 200 return
201 cls = <Smart>tmp 201 cls = <Smart>tmp
202 202
@@ -224,7 +224,7 @@ cdef void _smart_object_clip_unset(Evas_Object *o) with gil:
224 224
225 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 225 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
226 if tmp == NULL: 226 if tmp == NULL:
227 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 227 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
228 return 228 return
229 cls = <Smart>tmp 229 cls = <Smart>tmp
230 230
@@ -250,7 +250,7 @@ cdef void _smart_object_calculate(Evas_Object *o) with gil:
250 250
251 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 251 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
252 if tmp == NULL: 252 if tmp == NULL:
253 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 253 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
254 return 254 return
255 cls = <Smart>tmp 255 cls = <Smart>tmp
256 256
@@ -277,7 +277,7 @@ cdef void _smart_object_member_add(Evas_Object *o, Evas_Object *clip) with gil:
277 277
278 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 278 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
279 if tmp == NULL: 279 if tmp == NULL:
280 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 280 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
281 return 281 return
282 cls = <Smart>tmp 282 cls = <Smart>tmp
283 283
@@ -306,7 +306,7 @@ cdef void _smart_object_member_del(Evas_Object *o, Evas_Object *clip) with gil:
306 306
307 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 307 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
308 if tmp == NULL: 308 if tmp == NULL:
309 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 309 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
310 return 310 return
311 cls = <Smart>tmp 311 cls = <Smart>tmp
312 312
@@ -336,7 +336,7 @@ cdef void _smart_callback(void *data, Evas_Object *o, void *event_info) with gil
336 336
337 tmp = evas_smart_data_get(evas_object_smart_smart_get(o)) 337 tmp = evas_smart_data_get(evas_object_smart_smart_get(o))
338 if tmp == NULL: 338 if tmp == NULL:
339 EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL) 339 EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "cls is NULL!", NULL)
340 return 340 return
341 cls = <Smart>tmp 341 cls = <Smart>tmp
342 342
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):
189if __name__ == "__main__": 189if __name__ == "__main__":
190 import logging 190 import logging
191 efl_log = logging.getLogger("efl") 191 efl_log = logging.getLogger("efl")
192 efl_log.addHandler(logging.StreamHandler()) 192 efl_log_form = logging.Formatter(
193 "[%(name)s] %(levelname)s in %(funcName)s:%(lineno)d - %(message)s"
194 )
195 efl_log_handler = logging.StreamHandler()
196 efl_log_handler.setFormatter(efl_log_form)
197 efl_log.addHandler(efl_log_handler)
193 elementary.init() 198 elementary.init()
194 core_evas_smart_clicked(None) 199 core_evas_smart_clicked(None)
195 elementary.run() 200 elementary.run()