summaryrefslogtreecommitdiff
path: root/efl/eo
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2013-05-14 21:51:29 +0200
committerdavemds <dave@gurumeditation.it>2013-05-14 21:51:29 +0200
commit5913721de9f752bc113dabdc83a1d3b96f428b6e (patch)
treec846e5277b65b64d17370837272e0c27073c2978 /efl/eo
parent236d66caf8d14e8e22f8211d94430f880f944e24 (diff)
Python-EFL: implemented decorators for edje.
Decorators implemented in a much more simple and generic way than before, we can use them in other place too. 3 deco implemented: @on_signal(emission, source) @message_handler @on_text_change I choosed the 'strange' on_* naming convention to not clash/confuse with normal callback functions, tell me if you don't like.
Diffstat (limited to 'efl/eo')
-rw-r--r--efl/eo/efl.eo.pyx16
1 files changed, 16 insertions, 0 deletions
diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index 3b1fab1..8efd914 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -233,6 +233,22 @@ cdef object object_from_instance(cEo *obj):
233 return o 233 return o
234 234
235 235
236cdef void _register_decorated_callbacks(object obj):
237 """ Serach every attrib of the pyobj for a __decorated_callbacks__ object,
238 a list actually. If found then exec the functions listed there, with their
239 arguments. Must be called just after the _set_obj call.
240 List items signature: ("function_name", *args)
241 """
242 cdef object attr_name, attrib, func_name, func
243
244 for attr_name in dir(obj):
245 attrib = getattr(obj, attr_name)
246 if hasattr(attrib, "__decorated_callbacks__"):
247 for (func_name, *args) in getattr(attrib, "__decorated_callbacks__"):
248 func = getattr(obj, func_name)
249 func(*args)
250
251
236###################################################################### 252######################################################################
237 253
238 254