From f532a40fae55f25ff4f37264bb67685e8b48ed86 Mon Sep 17 00:00:00 2001 From: Kai Huuhko Date: Wed, 3 Apr 2013 16:31:22 +0000 Subject: [PATCH] Elm: Add documentation for the exceptions added earlier. --- TODO | 2 ++ efl/elementary/entry.pyx | 3 ++- efl/elementary/fileselector.pyx | 1 + efl/elementary/genlist.pyx | 1 + efl/elementary/icon.pyx | 1 + efl/elementary/image.pyx | 1 + efl/elementary/layout_class.pyx | 38 ++++++++++++++------------------- efl/elementary/photo.pyx | 1 + efl/elementary/photocam.pyx | 1 + efl/elementary/video.pyx | 1 + 10 files changed, 27 insertions(+), 23 deletions(-) diff --git a/TODO b/TODO index 5b8fe9f..23869bb 100644 --- a/TODO +++ b/TODO @@ -62,6 +62,8 @@ CHANGES FROM 1.7 to 1.8 - efl.elementary.genlist.GenlistItem.tooltip_window_mode_set - efl.elementary.icon.Icon.standard_set - efl.elementary.image.Image.file_set + - efl.elementary.layout_class.LayoutClass.file_set + - efl.elementary.layout_class.LayoutClass.theme_set - efl.elementary.layout_class.LayoutClass.box_append - efl.elementary.layout_class.LayoutClass.box_prepend - efl.elementary.layout_class.LayoutClass.box_insert_before diff --git a/efl/elementary/entry.pyx b/efl/elementary/entry.pyx index f955c11..c310ac5 100644 --- a/efl/elementary/entry.pyx +++ b/efl/elementary/entry.pyx @@ -1057,6 +1057,7 @@ cdef class Entry(Object): will be silently discarded and any non-saved changes will be lost. :type: tuple of strings (file, format) + :raise RuntimeError: when setting the file fails """ def __get__(self): @@ -1075,7 +1076,7 @@ cdef class Entry(Object): if not elm_entry_file_set(self.obj, a1 if a1 is not None else NULL, a2 if a2 is not None else ""): - raise RuntimeError + raise RuntimeError("Could not set file") cpdef file_get(self): cdef const_char *file cdef Elm_Text_Format format diff --git a/efl/elementary/fileselector.pyx b/efl/elementary/fileselector.pyx index 3048f04..b8c578e 100644 --- a/efl/elementary/fileselector.pyx +++ b/efl/elementary/fileselector.pyx @@ -205,6 +205,7 @@ cdef class Fileselector(LayoutClass): widget :type: string + :raise RuntimeError: when setting the selected file path fails """ def __get__(self): diff --git a/efl/elementary/genlist.pyx b/efl/elementary/genlist.pyx index 14a4c04..c8fb78c 100644 --- a/efl/elementary/genlist.pyx +++ b/efl/elementary/genlist.pyx @@ -1013,6 +1013,7 @@ cdef class GenlistItem(ObjectItem): It will instead be limited only by the size of the display. :type: bool + :raise RuntimeError: when setting the mode fails """ def __set__(self, disable): diff --git a/efl/elementary/icon.pyx b/efl/elementary/icon.pyx index fb8635d..4959d04 100644 --- a/efl/elementary/icon.pyx +++ b/efl/elementary/icon.pyx @@ -196,6 +196,7 @@ cdef class Icon(Image): .. seealso:: Image.file :type: string + :raise RuntimeError: when setting the standard icon fails """ def __get__(self): diff --git a/efl/elementary/image.pyx b/efl/elementary/image.pyx index 70ec84f..e8ee2c4 100644 --- a/efl/elementary/image.pyx +++ b/efl/elementary/image.pyx @@ -114,6 +114,7 @@ cdef class Image(Object): the extension, :py:attr:`file_edje` must be used, instead. :type: string or tuple of strings + :raise RuntimeError: when setting the file fails """ def __set__(self, value): diff --git a/efl/elementary/layout_class.pyx b/efl/elementary/layout_class.pyx index bbf1f89..649c616 100644 --- a/efl/elementary/layout_class.pyx +++ b/efl/elementary/layout_class.pyx @@ -52,6 +52,7 @@ cdef class LayoutClass(Object): layout. :type: tuple of string + :raise RuntimeError: when setting the file fails """ def __set__(self, value): @@ -74,6 +75,7 @@ cdef class LayoutClass(Object): :py:attr:`style`. :type: tuple of strings + :raise RuntimeError: when setting the theme fails """ def __set__(self, theme): @@ -175,8 +177,7 @@ cdef class LayoutClass(Object): :param child: the child object to append to box. :type child: :py:class:`evas.object.Object` - :return: ``True`` on success, ``False`` otherwise - :rtype: bool + :raise RuntimeError: when adding the box fails """ if isinstance(part, unicode): part = part.encode("UTF-8") @@ -206,8 +207,7 @@ cdef class LayoutClass(Object): :param child: the child object to prepend to box. :type child: :py:class:`evas.object.Object` - :return: ``True`` on success, ``False`` otherwise - :rtype: bool + :raise RuntimeError: when adding to box fails """ if isinstance(part, unicode): part = part.encode("UTF-8") @@ -239,8 +239,7 @@ cdef class LayoutClass(Object): :param reference: another reference object to insert before in box. :type reference: :py:class:`evas.object.Object` - :return: ``True`` on success, ``False`` otherwise - :rtype: bool + :raise RuntimeError: when inserting to box fails """ if isinstance(part, unicode): part = part.encode("UTF-8") @@ -272,8 +271,7 @@ cdef class LayoutClass(Object): :param pos: the numeric position >=0 to insert the child. :type pos: int - :return: ``True`` on success, ``False`` otherwise - :rtype: bool + :raise RuntimeError: when inserting to box fails """ if isinstance(part, unicode): part = part.encode("UTF-8") @@ -329,8 +327,7 @@ cdef class LayoutClass(Object): dangling on the canvas. :type clear: bool - :return: ``True`` on success, ``False`` otherwise - :rtype: bool + :raise RuntimeError: when removing all items fails """ if isinstance(part, unicode): part = part.encode("UTF-8") @@ -370,8 +367,7 @@ cdef class LayoutClass(Object): :param rowspan: how many rows should be used to store this object. (>= 1) :type rowspan: int - :return: ``True`` on success, ``False`` otherwise - :rtype: bool + :raise RuntimeError: when packing an item fails """ if isinstance(part, unicode): part = part.encode("UTF-8") @@ -427,8 +423,7 @@ cdef class LayoutClass(Object): dangling on the canvas. :type clear: bool - :return: ``True`` on success, ``False`` otherwise - :rtype: bool + :raise RuntimeError: when clearing the table fails """ if isinstance(part, unicode): part = part.encode("UTF-8") @@ -533,9 +528,7 @@ cdef class LayoutClass(Object): :param cursor: cursor name to use, see Elementary_Cursor.h :type cursor: string - :return: True on success or False on failure, that may be - part not exists or it has "mouse_events: 0". - :rtype: bool + :raise RuntimeError: when setting the parts cursor fails """ if isinstance(part_name, unicode): part_name = part_name.encode("UTF-8") @@ -568,8 +561,8 @@ cdef class LayoutClass(Object): :param part_name: a part from loaded edje group, that had a cursor set with :py:func:`part_cursor_set()`. :type part_name: string - :return: ``True`` on success, ``False`` otherwise - :rtype: bool + + :raise RuntimeError: when unsetting the part cursor fails """ if isinstance(part_name, unicode): part_name = part_name.encode("UTF-8") @@ -587,9 +580,7 @@ cdef class LayoutClass(Object): :param style: the theme style to use (default, transparent, ...) :type style: string - :return: True on success or False on failure, that may be - part not exists or it did not had a cursor set. - :rtype: bool + :raise RuntimeError: when setting the part cursor style fails """ if isinstance(part_name, unicode): part_name = part_name.encode("UTF-8") @@ -636,6 +627,9 @@ cdef class LayoutClass(Object): part not exists or it did not had a cursor set. :rtype: bool + :raise RuntimeError: when setting the engine_only setting fails, + when part does not exist or has no cursor set. + """ if isinstance(part_name, unicode): part_name = part_name.encode("UTF-8") if not elm_layout_part_cursor_engine_only_set(self.obj, diff --git a/efl/elementary/photo.pyx b/efl/elementary/photo.pyx index 3be98e0..68d9c11 100644 --- a/efl/elementary/photo.pyx +++ b/efl/elementary/photo.pyx @@ -49,6 +49,7 @@ cdef class Photo(Object): """Set the file that will be used as photo :type: string + :raise RuntimeError: when setting the file fails """ def __set__(self, filename): diff --git a/efl/elementary/photocam.pyx b/efl/elementary/photocam.pyx index 7605957..4e8e2c1 100644 --- a/efl/elementary/photocam.pyx +++ b/efl/elementary/photocam.pyx @@ -103,6 +103,7 @@ cdef class Photocam(Object): displayed at the full quality needed. :type: string + :raise RuntimeError: when setting the file fails """ def __set__(self, file): diff --git a/efl/elementary/video.pyx b/efl/elementary/video.pyx index 5645808..3ec0537 100644 --- a/efl/elementary/video.pyx +++ b/efl/elementary/video.pyx @@ -46,6 +46,7 @@ cdef class Video(LayoutClass): request and list the available Webcam on your system). :type: string + :raise RuntimeError: when setting the file/uri fails """ def __set__(self, filename):