Enlightenment CVS committal

Author  : barbieri
Project : e17
Module  : proto/python-efl

Dir     : e17/proto/python-efl/python-evas/evas


Modified Files:
        evas.c_evas_object.pxi 
Added Files:
        decorators.py 


Log Message:
Decorators to make development easier, less error prone and more consistent.

===================================================================
RCS file: /cvs/e/e17/proto/python-efl/python-evas/evas/evas.c_evas_object.pxi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- evas.c_evas_object.pxi      24 Jul 2007 14:20:07 -0000      1.8
+++ evas.c_evas_object.pxi      15 Aug 2007 14:03:34 -0000      1.9
@@ -8,6 +8,14 @@
     python.Py_DECREF(self)
 
 
+cdef _register_decorated_callbacks(obj):
+    for attr_name in dir(obj):
+        attr_value = getattr(obj, attr_name)
+        if callable(attr_value) and hasattr(attr_value, "evas_event_callback"):
+            t = getattr(attr_value, "evas_event_callback")
+            obj.event_callback_add(t, attr_value)
+
+
 cdef public class Object [object PyEvasObject, type PyEvasObject_Type]:
     def __new__(self, *a, **ka):
         self.obj = NULL
@@ -41,6 +49,7 @@
         evas_object_data_set(obj, "python-evas", <void *>self)
         evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE, obj_free_cb,
                                        <void *>self)
+        _register_decorated_callbacks(self)
         return 1
 
     def __dealloc__(self):



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to