Enlightenment CVS committal

Author  : barbieri
Project : e17
Module  : proto

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


Modified Files:
        ecore.c_ecore_animator.pxi ecore.c_ecore_fd_handler.pxi 
        ecore.c_ecore_idle_enterer.pxi ecore.c_ecore_idle_exiter.pxi 
        ecore.c_ecore_idler.pxi ecore.c_ecore_timer.pxi 


Log Message:
Fix usage of Pyrex __new__, it was causing problems with inheritance.

Pyrex's __new__() method is confusing, you cannot raise exceptions and
every method should have the same signature, otherwise you'll get error
from the parent class. This method, AFAIU is just meant to ensure
things are initialized once.

I moved my code to be executed from __init__(), then I can do regular
python things, as check for correct type of parameters.



===================================================================
RCS file: 
/cvs/e/e17/proto/python-efl/python-ecore/ecore/ecore.c_ecore_animator.pxi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore.c_ecore_animator.pxi  17 Jul 2007 23:07:20 -0000      1.2
+++ ecore.c_ecore_animator.pxi  19 Jul 2007 15:06:44 -0000      1.3
@@ -1,7 +1,7 @@
 # This file is included verbatim by c_ecore.pyx
 
 cdef class Animator:
-    def __new__(self, func, args, kargs):
+    def __init__(self, func, args, kargs):
         self.func = func
         self.args = args
         self.kargs = kargs
===================================================================
RCS file: 
/cvs/e/e17/proto/python-efl/python-ecore/ecore/ecore.c_ecore_fd_handler.pxi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore.c_ecore_fd_handler.pxi        17 Jul 2007 23:07:20 -0000      1.2
+++ ecore.c_ecore_fd_handler.pxi        19 Jul 2007 15:06:44 -0000      1.3
@@ -8,11 +8,15 @@
     if obj._prepare_callback is None:
         return
     func, args, kargs = obj._prepare_callback
-    func(obj, *args, **kargs)
+    try:
+        func(obj, *args, **kargs)
+    except Exception, e:
+        import traceback
+        traceback.print_exc()
 
 
 cdef class FdHandler:
-    def __new__(self, func, args, kargs):
+    def __init__(self, func, args, kargs):
         self.func = func
         self.args = args
         self.kargs = kargs
===================================================================
RCS file: 
/cvs/e/e17/proto/python-efl/python-ecore/ecore/ecore.c_ecore_idle_enterer.pxi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore.c_ecore_idle_enterer.pxi      17 Jul 2007 23:07:20 -0000      1.2
+++ ecore.c_ecore_idle_enterer.pxi      19 Jul 2007 15:06:44 -0000      1.3
@@ -1,7 +1,7 @@
 # This file is included verbatim by c_ecore.pyx
 
 cdef class IdleEnterer:
-    def __new__(self, func, args, kargs):
+    def __init__(self, func, args, kargs):
         self.func = func
         self.args = args
         self.kargs = kargs
===================================================================
RCS file: 
/cvs/e/e17/proto/python-efl/python-ecore/ecore/ecore.c_ecore_idle_exiter.pxi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore.c_ecore_idle_exiter.pxi       17 Jul 2007 23:07:20 -0000      1.2
+++ ecore.c_ecore_idle_exiter.pxi       19 Jul 2007 15:06:44 -0000      1.3
@@ -1,7 +1,7 @@
 # This file is included verbatim by c_ecore.pyx
 
 cdef class IdleExiter:
-    def __new__(self, func, args, kargs):
+    def __init__(self, func, args, kargs):
         self.func = func
         self.args = args
         self.kargs = kargs
===================================================================
RCS file: 
/cvs/e/e17/proto/python-efl/python-ecore/ecore/ecore.c_ecore_idler.pxi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore.c_ecore_idler.pxi     17 Jul 2007 23:07:20 -0000      1.2
+++ ecore.c_ecore_idler.pxi     19 Jul 2007 15:06:44 -0000      1.3
@@ -1,7 +1,7 @@
 # This file is included verbatim by c_ecore.pyx
 
 cdef class Idler:
-    def __new__(self, func, args, kargs):
+    def __init__(self, func, args, kargs):
         self.func = func
         self.args = args
         self.kargs = kargs
===================================================================
RCS file: 
/cvs/e/e17/proto/python-efl/python-ecore/ecore/ecore.c_ecore_timer.pxi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore.c_ecore_timer.pxi     17 Jul 2007 23:07:20 -0000      1.2
+++ ecore.c_ecore_timer.pxi     19 Jul 2007 15:06:44 -0000      1.3
@@ -1,7 +1,7 @@
 # This file is included verbatim by c_ecore.pyx
 
 cdef class Timer:
-    def __new__(self, double interval, func, args, kargs):
+    def __init__(self, double interval, func, args, kargs):
         self._interval = interval
         self.func = func
         self.args = args



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to