Enlightenment CVS committal

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

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


Modified Files:
        epsilon.request.pyx 


Log Message:
Epsilon major overhaul, breaks API.

I fixed many issues with epsilon, mainly the Epsilon_Requests, since
it broke the ABI, I also changed the API and now it looks a bit
better.

Changes overview:
 - epsilon_thumb_{init,shutdown} -> epsilon_request_{init,shutdown}
 - epsilon_del -> epsilon_request_del()
 - epsilon_add(file, dest, size, data) -> epsilon_request_add(file, size, data)
   reason: nobody was using "dest", and if one tried to, it was not
   implemented. Instead of implementing this, leave to users that
   could call ecore_file_cp() on the handler.
 - epsilon_request_add() has a fast path check for already existent
   thumbnails, instead of going to the server, just
   ecore_event_add(). To handle epsilon_request_del() fine, we now
   have to keep the Ecore_Event for further deletion.
 - epsilon_exists() now just checks the mtime of source and thumbnail,
   if source is newer, then return EPSILON_FAIL so users regenerate
   it. There is a possible optimization to be done (it's marked on
   code in the right place) that can read original file tags to avoid
   regenerating for copies, but it's not reliable and should be
   checked after the current ones.
 - reoder CFLAGS path order to first use local headers instead of the
   system.
 - check for errors when loading plugins.
 - updated every use of these API in e17 CVS.

If you find a problem with these, let me know and I'll fix.


===================================================================
RCS file: 
/cvs/e/e17/proto/python-efl/python-epsilon/epsilon/epsilon.request.pyx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- epsilon.request.pyx 31 Oct 2007 15:25:32 -0000      1.2
+++ epsilon.request.pyx 2 Nov 2007 08:03:46 -0000       1.3
@@ -6,10 +6,10 @@
     )
 
 def shutdown():
-    epsilon_shutdown()
+    epsilon_request_shutdown()
 
 def init():
-    return epsilon_thumb_init()
+    return epsilon_request_init()
 
 EPSILON_THUMB_NORMAL = 0
 EPSILON_THUMB_LARGE = 1
@@ -26,17 +26,14 @@
 
     The thumbnailer daemon 'epsilon_thumbd' is automatically started.
     """
-    def __init__(self, func, char *path, dest=None,
-                 int size=EPSILON_THUMB_NORMAL):
+    def __init__(self, func, char *path, int size=EPSILON_THUMB_NORMAL):
         """Epsilon Request constructor.
 
         @parm func: function to call when request is served.
         @parm path: file to process.
-        @path dest: if provided (not None), specify where to store the thumb.
         @path size: EPSILON_THUMB_NORMAL or EPSILON_THUMB_LARGE (it's not the
            size in pixels!)
         """
-        cdef char *d
         if not callable(func):
             raise TypeError("Parameter 'func' must be callable")
 
@@ -46,11 +43,7 @@
 
         if self.obj == NULL:
             self.func = func
-            if dest is not None:
-                d = dest
-            else:
-                d = NULL
-            self.obj = epsilon_add(path, d, size, <void*>self)
+            self.obj = epsilon_request_add(path, size, <void*>self)
             if self.obj != NULL:
                 python.Py_INCREF(self)
 
@@ -68,13 +61,13 @@
 
     def __dealloc__(self):
         if self.obj != NULL:
-            epsilon_del(self.obj)
+            epsilon_request_del(self.obj)
             self.obj = NULL
 
     def delete(self):
         "Stop thumbnail request, free resources."
         if self.obj != NULL:
-            epsilon_del(self.obj)
+            epsilon_request_del(self.obj)
             self.obj = NULL
             self.func = None
             python.Py_DECREF(self)
@@ -106,7 +99,7 @@
     property status:
         def __get__(self):
             if self.obj != NULL:
-                return self.obj.status
+                return bool(self.obj.status)
 
 
 init()



-------------------------------------------------------------------------
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