Looks good, but cast the return to bool() as it is the intent of the c function.

On Sunday, September 5, 2010, Dave Andreoli <[email protected]> wrote:
> Hi pythonist,
> here a small patch to make Elementary.Layout.file_set() return the
> correct value (1 on succes, 0 on errors).
>
> Do you think this is the right way to go ? (many other place in
> python-elementary needs the same)
> or maybe we should rise an exception?
>
> thanks
> DaveMDS
>
>
> http://pastebin.com/GdeJjFXH
>
> ------------------------------------
> Index: include/elementary/c_elementary.pxd
> ===================================================================
> --- include/elementary/c_elementary.pxd (revisione 51843)
> +++ include/elementary/c_elementary.pxd (copia locale)
> @@ -258,6 +258,7 @@
>      # X specific call - wont't work on non-x engines (return 0)
>      Ecore_X_Window elm_win_xwindow_get(evas.c_evas.Evas_Object *obj)
>
> +    # Inwin object
>      evas.c_evas.Evas_Object *elm_win_inwin_add(evas.c_evas.Evas_Object *obj)
>      void elm_win_inwin_activate(evas.c_evas.Evas_Object *obj)
>      void elm_win_inwin_content_set(evas.c_evas.Evas_Object *obj,
> evas.c_evas.Evas_Object *content)
> @@ -364,7 +365,7 @@
>
>      # Layout object
>      evas.c_evas.Evas_Object *elm_layout_add(evas.c_evas.Evas_Object *parent)
> -    void elm_layout_file_set(evas.c_evas.Evas_Object *obj, char
> *file, char *group)
> +    evas.c_evas.Eina_Bool elm_layout_file_set(evas.c_evas.Evas_Object
> *obj, char *file, char *group)
>      evas.c_evas.Eina_Bool
> elm_layout_theme_set(evas.c_evas.Evas_Object *obj, char *clas, char
> *group, char *style)
>      void elm_layout_content_set(evas.c_evas.Evas_Object *obj, char
> *swallow, evas.c_evas.Evas_Object *content)
>      evas.c_evas.Evas_Object *elm_layout_edje_get(evas.c_evas.Evas_Object 
> *obj)
> Index: elementary/elementary.c_elementary_layout.pxi
> ===================================================================
> --- elementary/elementary.c_elementary_layout.pxi       (revisione 51843)
> +++ elementary/elementary.c_elementary_layout.pxi       (copia locale)
> @@ -22,10 +22,10 @@
>          self._set_obj(elm_layout_add(parent.obj))
>
>      def file_set(self, filename, group):
> -        elm_layout_file_set(self.obj, filename, group)
> +        return elm_layout_file_set(self.obj, filename, group)
>
>      def theme_set(self, clas, group, style):
> -        elm_layout_theme_set(self.obj, clas, group, style)
> +        return elm_layout_theme_set(self.obj, clas, group, style)
>
>      def content_set(self, swallow, c_evas.Object content):
>          cdef c_evas.Evas_Object *o
>
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to