Lots of documentation fixes for ALL the classes

Mainly with regard of class __init__ params and the **keyword param
This commit is contained in:
Davide Andreoli 2015-01-03 20:17:24 +01:00
parent 64c1d33c9f
commit 6ff9998258
97 changed files with 1352 additions and 603 deletions

View File

@ -162,7 +162,7 @@ autodoc_docstring_signature = True
def setup(app):
from sphinx.ext.autodoc import cut_lines
app.connect('autodoc-process-signature', autodoc_process_signature)
app.connect('autodoc-process-docstring', cut_lines(2, what=['class']))
app.connect('autodoc-process-docstring', cut_lines(1, what=['class']))
def autodoc_process_signature(app, what, name, obj, options, signature, return_annotation):
"""Cleanup params: remove the 'self' param and all the cython types"""

View File

@ -0,0 +1,6 @@
.. currentmodule:: efl.ecore
:class:`efl.ecore.AnimatorTimeline` Class
=========================================
.. autoclass:: efl.ecore.AnimatorTimeline

View File

@ -92,6 +92,7 @@ API Reference
x
timer
animator
animator_timeline
poller
idler
idleenterer

View File

@ -17,7 +17,9 @@
cdef class Animator(Eo):
"""Creates an animator to tick off at every animaton tick during main loop
"""
Creates an animator to tick off at every animaton tick during main loop
execution.
This class represents an animator that will call the given ``func``
@ -36,13 +38,23 @@ cdef class Animator(Eo):
returning *False* from ``func``, otherwise they'll continue alive, even
if the current python context delete it's reference to it.
:param func:
function to call every frame. Expected signature::
"""
def __init__(self, func, *args, **kargs):
"""Animator(...)
:param func: function to call at every frame.
:type func: callable
:param \*args: All the remaining arguments will be passed
back in the callback function.
:param \**kwargs: All the remaining keyword arguments will be passed
back in the callback function.
Expected **func** signature::
func(*args, **kargs) -> bool
"""
def __init__(self, func, *args, **kargs):
"""
if not callable(func):
raise TypeError("Parameter 'func' must be callable")
self.func = func
@ -85,11 +97,12 @@ cdef Eina_Bool _ecore_timeline_cb(void *data, double pos) with gil:
return ret
cdef class AnimatorTimeline(Animator):
"""Add an animator that runs for a limited time
:param runtime: The time to run in seconds
:param func: The function to call when it ticks off
cdef class AnimatorTimeline(Animator):
"""
Create an animator that runs for a limited time
This is just like a normal :py:class:`Animator` except the animator only
runs for a limited time specified in seconds by ``runtime``. Once the
@ -111,6 +124,23 @@ cdef class AnimatorTimeline(Animator):
"""
def __init__(self, func, double runtime, *args, **kargs):
"""AnimatorTimeline(...)
:param func: The function to call when it ticks off
:type func: callable
:param runtime: The time to run in seconds
:type runtime: double
:param \*args: All the remaining arguments will be passed
back in the callback function.
:param \**kwargs: All the remaining keyword arguments will be passed
back in the callback function.
Expected **func** signature::
func(pos, *args, **kargs) -> bool
"""
if not callable(func):
raise TypeError("Parameter 'func' must be callable")
self.func = func

View File

@ -166,7 +166,9 @@ cdef void _ecore_exe_pre_free_cb(void *data, const Ecore_Exe *exe) with gil:
cdef class Exe(object):
"""Spawns a child process with its stdin/out available for communication.
"""
Spawns a child process with its stdin/out available for communication.
This function forks and runs the given command using ``/bin/sh``.

View File

@ -56,7 +56,9 @@ cdef Eina_Bool fd_handler_cb(void *data, Ecore_Fd_Handler *fdh) with gil:
cdef class FdHandler(object):
"""Adds a callback for activity on the given file descriptor.
"""
Adds a callback for activity on the given file descriptor.
``func`` will be called during the execution of ``main_loop_begin()``
when the file descriptor is available for reading, or writing, or both.
@ -74,16 +76,19 @@ cdef class FdHandler(object):
- thread wake-up and synchronization;
- non-blocking file description operations.
:param fd: file descriptor or object with fileno() method.
:param flags: bitwise OR of ECORE_FD_READ, ECORE_FD_WRITE...
:param func:
function to call when file descriptor state changes.
Expected signature::
func(fd_handler, *args, **kargs): bool
"""
def __init__(self, fd, int flags, func, *args, **kargs):
"""FdHandler(...)
:param fd: file descriptor or object with fileno() method.
:param flags: bitwise OR of ECORE_FD_READ, ECORE_FD_WRITE...
:param func: function to call when file descriptor state changes.
Expected **func** signature::
func(fd_handler, *args, **kargs): bool
"""
if not callable(func):
raise TypeError("Parameter 'func' must be callable")
self.func = func

View File

@ -34,7 +34,9 @@ cdef int _progress_cb(void *data, const char *file, long int dltotal,
cdef class FileDownload(object):
""" Download the given url to destination.
"""
Download the given url to destination.
You must provide the full url, including 'http://', 'ftp://' or 'file://'.
If ``dst`` already exist it will not be overwritten and the function will fail.
@ -69,13 +71,16 @@ cdef class FileDownload(object):
"/path/to/destination", None, None)
ecore.file_download_abort(dl)
:param url: The complete url to download
:param dst: Where to download the file
:param completion_cb: A callback called on download complete
:param progress_cb: A callback called during the download operation
"""
def __init__(self, url, dst, completion_cb, progress_cb, *args, **kargs):
"""FileDownload(...)
:param url: The complete url to download
:param dst: Where to download the file
:param completion_cb: A callback called on download complete
:param progress_cb: A callback called during the download operation
"""
cdef Ecore_File_Download_Job *job
if completion_cb is not None and not callable(completion_cb):

View File

@ -27,7 +27,9 @@ cdef void _file_monitor_cb(void *data, Ecore_File_Monitor *em, Ecore_File_Event
cdef class FileMonitor(object):
""" Monitor the given path for changes.
"""
Monitor the given path for changes.
The callback signatures is::
@ -54,16 +56,18 @@ cdef class FileMonitor(object):
ecore.FileMonitor("/tmp", monitor_cb)
ecore.main_loop_begin()
:param path: The complete path of the folder you want to monitor.
:type path: str
:param monitor_cb: A callback called when something change in `path`
:type monitor_cb: callable
.. versionadded:: 1.8
"""
def __init__(self, path, monitor_cb, *args, **kargs):
"""FileMonitor(...)
:param path: The complete path of the folder you want to monitor.
:type path: str
:param monitor_cb: A callback called when something change in `path`
:type monitor_cb: callable
"""
if not callable(monitor_cb):
raise TypeError("Parameter 'monitor_cb' must be callable")

View File

@ -17,15 +17,17 @@
cdef class Idler(Eo):
"""Add an idler handler.
"""
Add an idler handler.
This class represents an idler on the event loop that will
call ``func`` when there is nothing more to do. The function will
be passed any extra parameters given to constructor.
When the idler ``func`` is called, it must return a value of either
True or False (remember that Python returns None if no value is
explicitly returned and None evaluates to False). If it returns
**True** or **False** (remember that Python returns **None** if no value
is explicitly returned and **None** evaluates to False). If it returns
**True**, it will be called again when system become idle, or if it
returns **False** it will be deleted automatically making any
references/handles for it invalid.
@ -36,14 +38,22 @@ cdef class Idler(Eo):
Idlers are useful for progressively prossessing data without blocking.
:param func:
Function to call when system is idle.
Expected signature::
"""
def __init__(self, func, *args, **kargs):
"""Idler(...)
:param func: Function to call when system is idle.
:type func: callable
:param \*args: All the remaining arguments will be passed
back in the callback function.
:param \**kwargs: All the remaining keyword arguments will be passed
back in the callback function.
Expected **func** signature::
func(*args, **kargs): bool
"""
def __init__(self, func, *args, **kargs):
"""
if not callable(func):
raise TypeError("Parameter 'func' must be callable")
self.func = func
@ -72,33 +82,45 @@ cdef class Idler(Eo):
cdef class IdleEnterer(Idler):
"""Add an idle enterer handler.
"""
Add an idle enterer handler.
This class represents a function that will be called before systems
enter idle. The function will be passed any extra parameters given
to constructor.
When the idle enterer ``func`` is called, it must return a value of
either *True* or *False* (remember that Python returns *None* if no value
is explicitly returned and *None* evaluates to *False*). If it returns
*True*, it will be called again when system become idle, or if it
returns *False* it will be deleted automatically making any
either **True** or **False** (remember that Python returns **None** if
no value is explicitly returned and **None** evaluates to **False**). If
it returns **True**, it will be called again when system become idle, or
if it returns **False** it will be deleted automatically making any
references/handles for it invalid.
Idle enterers should be stopped/deleted by means of delete() or
returning *False* from ``func``, otherwise they'll continue alive, even
returning **False** from ``func``, otherwise they'll continue alive, even
if the current python context delete it's reference to it.
Idle enterer are useful for post-work jobs, like garbage collection.
:param func:
Function to call when system enters idle.
Expected signature::
func(*args, **kargs): bool
"""
def __init__(self, func, *args, **kargs):
"""IdleEnterer(...)
:param func: Function to call when system enters idle.
:type func: callable
:param \*args: All the remaining arguments will be passed
back in the callback function.
:param \**kwargs: All the remaining keyword arguments will be passed
back in the callback function.
Expected **func** signature::
func(*args, **kargs): bool
"""
if not callable(func):
raise TypeError("Parameter 'func' must be callable")
self.func = func
@ -112,7 +134,9 @@ cdef class IdleEnterer(Idler):
cdef class IdleExiter(Idler):
"""Add an idle exiter handler.
"""
Add an idle exiter handler.
This class represents a function that will be called before systems
exits idle. The function will be passed any extra parameters given
@ -129,14 +153,21 @@ cdef class IdleExiter(Idler):
returning *False* from ``func``, otherwise they'll continue alive, even
if the current python context delete it's reference to it.
:param func:
Function to call when system exits idle.
Expected signature::
"""
def __init__(self, func, *args, **kargs):
""" IdleExiter(...)
:param func: Function to call when system exits idle.
:param \*args: All the remaining arguments will be passed
back in the callback function.
:param \**kwargs: All the remaining keyword arguments will be passed
back in the callback function.
Expected **func** signature::
func(*args, **kargs): bool
"""
def __init__(self, func, *args, **kargs):
"""
if not callable(func):
raise TypeError("Parameter 'func' must be callable")
self.func = func
@ -145,6 +176,7 @@ cdef class IdleExiter(Idler):
self._set_obj(ecore_idle_exiter_add(_ecore_task_cb, <void *>self))
def delete(self):
"""Stop callback emission and free internal resources."""
ecore_idle_exiter_del(self.obj)

View File

@ -56,17 +56,28 @@ cdef class Poller(Eo):
ecore.Poller(4, poller_cb)
:param interval: The poll interval
:type interval: int
:param func: The function to call at every interval
:type func: callable
:param poll_type: The ticker type to attach the poller to. Must be ECORE_POLLER_CORE
:type poll_type: Ecore_Poll_Type
.. versionadded:: 1.8
"""
def __init__(self, int interval, func, pol_type=0, *args, **kargs):
"""Poller(...)
:param interval: The poll interval
:type interval: int
:param func: The function to call at every interval
:type func: callable
:param pol_type: The ticker type to attach the poller to. Must be ECORE_POLLER_CORE
:type pol_type: Ecore_Poll_Type
:param \*args: All the remaining arguments will be passed
back in the callback function.
:param \**kwargs: All the remaining keyword arguments will be passed
back in the callback function.
Expected **func** signature::
func(*args, **kargs): bool
"""
if not callable(func):
raise TypeError("Parameter 'func' must be callable")
self.func = func

View File

@ -26,26 +26,34 @@ cdef class Timer(Eo):
parameters given to constructor.
When the timer ``func`` is called, it must return a value of either
*True* or *False* (remember that Python returns *None* if no value is
explicitly returned and *None* evaluates to *False*). If it returns
*True*, it will be called again at the next interval, or if it returns
*False* it will be deleted automatically making any references/handles
**True** or **False** (remember that Python returns **None** if no value is
explicitly returned and **None** evaluates to **False**). If it returns
**True**, it will be called again at the next interval, or if it returns
**False** it will be deleted automatically making any references/handles
for it invalid.
Timers should be stopped/deleted by means of ``delete()`` or
returning *False* from ``func``, otherwise they'll continue alive, even
if the current python context delete it's reference to it.
:param interval: interval in seconds.
:type interval: float
:param func:
function to callback when timer expires.
The function signature is::
"""
def __init__(self, double interval, func, *args, **kargs):
"""Timer(...)
:param interval: interval in seconds.
:type interval: float
:param func: function to callback when timer expires.
:type func: callable
:param \*args: All the remaining arguments will be passed
back in the callback function.
:param \**kwargs: All the remaining keyword arguments will be passed
back in the callback function.
Expected **func** signature::
func(*args, **kargs): bool
"""
def __init__(self, double interval, func, *args, **kargs):
"""
if not callable(func):
raise TypeError("Parameter 'func' must be callable")
self.func = func

View File

@ -86,11 +86,13 @@ class EdjeLoadError(Exception):
cdef class Edje(Object):
"""Edje evas object.
"""
This is a high level `efl.evas.SmartObject` that is defined as a group of
parts (`efl.evas.Object`, usually written in text files (.edc) and
compiled as a package using EET to store resources (.edj).
Edje evas object.
This is a high level :class:`efl.evas.SmartObject` that is defined as a
group of parts, usually written in text files (.edc) and compiled as a
package using EET to store resources (.edj).
Edje is an important EFL component because it makes easy to split logic
and UI, usually used as theme engine but can be much more powerful than
@ -128,7 +130,24 @@ cdef class Edje(Object):
self._signal_callbacks = {}
def __init__(self, Canvas canvas not None, file=None, group=None, size=None,
geometry=None, **kwargs):
geometry=None, **kwargs):
"""Edje(...)
:param canvas: Evas canvas for this object
:type canvas: :py:class:`~efl.evas.Canvas`
:keyword file: File name
:type file: string
:keyword group: Group name
:type group: string
:keyword size: Min size for the object
:type size: tuple of ints
:keyword geometry: Geometry for the object
:type geometry: tuple of ints
:keyword \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(edje_object_add(canvas.obj))
_register_decorated_callbacks(self)
@ -295,19 +314,19 @@ cdef class Edje(Object):
int r3, int g3, int b3, int a3):
"""Set color class.
:parm color_class: color class name
:parm r:
:parm g:
:parm b:
:parm a:
:parm r2:
:parm g2:
:parm b2:
:parm a2:
:parm r3:
:parm g3:
:parm b3:
:parm a3:
:param color_class: color class name
:param r:
:param g:
:param b:
:param a:
:param r2:
:param g2:
:param b2:
:param a2:
:param r3:
:param g3:
:param b3:
:param a3:
"""
if isinstance(color_class, unicode):

View File

@ -36,15 +36,18 @@ cdef void access_activate_cb(void *data, Evas_Object *part_obj, Elm_Object_Item
pass
cdef class Accessible(Object):
"""
"""An accessible object."""
An accessible object.
Register evas object as an accessible object.
:since: 1.8
"""
def __init__(self, target, parent = None):
"""__init__(target, parent = None)
Register evas object as an accessible object.
:since: 1.8
"""Accessible(...)
:param target: The evas object to register as an accessible object.
:param parent: The elementary object which is used for creating

View File

@ -106,10 +106,21 @@ def _cb_string_conv(uintptr_t addr):
return _ctouni(s) if s is not NULL else None
cdef class Actionslider(LayoutClass):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Actionslider(..)
:param parent: Parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_actionslider_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -24,11 +24,10 @@ Widget description
------------------
The background widget is used for setting a solid color, image or Edje group
as a background to a window or any container object.
as a background to a window (unless it has transparency enabled) or any
container object.
The background widget is used for setting (solid) background decorations
to a window (unless it has transparency enabled) or to any container
object. It works just like an image, but has some properties useful to a
It works just like an image, but has some properties useful to a
background, like setting it to tiled, centered, scaled or stretched.
@ -79,10 +78,21 @@ ELM_BG_OPTION_TILE = enums.ELM_BG_OPTION_TILE
ELM_BG_OPTION_LAST = enums.ELM_BG_OPTION_LAST
cdef class Background(LayoutClass):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Background(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_bg_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -174,16 +174,21 @@ cdef Evas_Object_Box_Layout _py_elm_box_layout_resolv(int layout) with gil:
return evas_object_box_layout_vertical
cdef class Box(Object):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
By default, the box will be in vertical mode and non-homogeneous.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""By default, the box will be in vertical mode and non-homogeneous.
"""Box(...)
:param parent: The parent object
:type parent: :py:class:`~efl.elementary.object.Object`
:return: The new object or None if it cannot be created
:rtype: :py:class:`Box`
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_box_add(parent.obj))

View File

@ -101,10 +101,21 @@ ELM_BUBBLE_POS_BOTTOM_LEFT = enums.ELM_BUBBLE_POS_BOTTOM_LEFT
ELM_BUBBLE_POS_BOTTOM_RIGHT = enums.ELM_BUBBLE_POS_BOTTOM_RIGHT
cdef class Bubble(LayoutClass):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Bubble(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_bubble_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -68,10 +68,21 @@ from efl.evas cimport Object as evasObject
from layout_class cimport LayoutClass
cdef class Button(LayoutClass):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Button(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_button_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -202,7 +202,6 @@ ELM_DAY_LAST = enums.ELM_DAY_LAST
cdef class CalendarMark(object):
"""
An item for the Calendar widget.
@ -236,9 +235,11 @@ cdef class CalendarMark(object):
cdef Elm_Calendar_Mark *obj
def __init__(self, evasObject cal, mark_type, mark_time,
Elm_Calendar_Mark_Repeat_Type repeat):
"""Create a new Calendar mark
Elm_Calendar_Mark_Repeat_Type repeat):
"""CalendarMark(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param mark_type: A string used to define the type of mark. It will be
emitted to the theme, that should display a related modification on these
days representation.
@ -284,10 +285,21 @@ cdef class CalendarMark(object):
elm_calendar_mark_del(self.obj)
cdef class Calendar(LayoutClass):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Calendar(..)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_calendar_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -55,10 +55,21 @@ from efl.evas cimport Object as evasObject
from layout_class cimport LayoutClass
cdef class Check(LayoutClass):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Check(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_check_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -115,10 +115,21 @@ ELM_CLOCK_EDIT_SEC_UNIT = enums.ELM_CLOCK_EDIT_SEC_UNIT
ELM_CLOCK_EDIT_ALL = enums.ELM_CLOCK_EDIT_ALL
cdef class Clock(LayoutClass):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Clock(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_clock_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -88,12 +88,29 @@ def _cb_object_item_conv(uintptr_t addr):
return _object_item_to_python(it)
cdef class ColorselectorPaletteItem(ObjectItem):
"""
"""An item for the :py:class:`Colorselector` widget."""
An item for the :py:class:`Colorselector` widget.
"""
cdef int r, g, b, a
def __init__(self, int r, int g, int b, int a, *args, **kwargs):
"""ColorselectorPaletteItem(...)
:param r: Red value of color
:type r: int
:param g: Green value of color
:type g: int
:param b: Blue value of color
:type b: int
:param a: Alpha value of color
:type a: int
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self.r, self.g, self.b, self.a = r, g, b, a
self.args, self.kwargs = args, kwargs
@ -152,10 +169,21 @@ cdef class ColorselectorPaletteItem(ObjectItem):
cdef class Colorselector(LayoutClass):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Colorselector(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_colorselector_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -53,10 +53,21 @@ from efl.evas cimport Object as evasObject
from layout_class cimport LayoutClass
cdef class Conformant(LayoutClass):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Conformant(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_conformant_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -106,8 +106,15 @@ ELM_CTXPOPUP_DIRECTION_UP = enums.ELM_CTXPOPUP_DIRECTION_UP
ELM_CTXPOPUP_DIRECTION_UNKNOWN = enums.ELM_CTXPOPUP_DIRECTION_UNKNOWN
cdef class CtxpopupItem(ObjectItem):
"""
"""An item for Ctxpopup widget."""
An item for Ctxpopup widget.
.. warning:: Ctxpopup can't hold both an item list and a content at the
same time. When an item is added, any previous content will be
removed.
"""
cdef:
bytes label
@ -115,19 +122,17 @@ cdef class CtxpopupItem(ObjectItem):
def __init__(self, label = None, evasObject icon = None,
callback = None, cb_data = None, *args, **kargs):
"""
.. warning:: Ctxpopup can't hold both an item list and a content at the
same time. When an item is added, any previous content will be
removed.
"""CtxpopupItem(...)
:param icon: Icon to be set on new item
:type icon: :py:class:`~efl.evas.Object`
:param label: The Label of the new item
:type label: string
:param func: Convenience function called when item selected
:type func: function
:return: The item added or ``None``, on errors
:rtype: :py:class:`CtxpopupItem`
:param icon: Icon to be set on new item
:type icon: :py:class:`efl.evas.Object`
:param callback: Convenience function called when item selected
:type callback: callable
:param cb_data: User data for the callback function
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
if callback is not None:
@ -145,10 +150,6 @@ cdef class CtxpopupItem(ObjectItem):
def append_to(self, evasObject ctxpopup):
"""Add a new item to a ctxpopup object.
.. warning:: Ctxpopup can't hold both an item list and a content at the
same time. When an item is added, any previous content will be
removed.
.. seealso:: :py:attr:`~efl.elementary.object.Object.content`
:param ctxpopup: The Ctxpopup widget this item is to be appended on
@ -178,10 +179,6 @@ cdef class CtxpopupItem(ObjectItem):
def prepend_to(self, evasObject ctxpopup):
"""Prepend a new item to a ctxpopup object.
.. warning:: Ctxpopup can't hold both an item list and a content at the
same time. When an item is added, any previous content will be
removed.
.. seealso:: :py:attr:`~efl.elementary.object.Object.content`
:param ctxpopup: The Ctxpopup widget this item is to be prepended on
@ -234,14 +231,24 @@ cdef class CtxpopupItem(ObjectItem):
cdef class Ctxpopup(LayoutClass):
"""This is the class that actually implements the widget.
"""
This is the class that actually implements the widget.
.. versionchanged:: 1.8
Inherits from LayoutClass
Inherits from :py:class:`~efl.elementary.layout_class.LayoutClass`
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Ctxpopup(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_ctxpopup_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)

View File

@ -36,80 +36,58 @@ format.
Elm_datetime supports only the following sub set of libc date format specifiers:
**%%Y**
The year as a decimal number including the century (example: 2011).
**%%Y** The year as a decimal number including the century (example: 2011).
**%%y**
The year as a decimal number without a century (range 00 to 99)
**%%y** The year as a decimal number without a century (range 00 to 99)
**%%m**
The month as a decimal number (range 01 to 12).
**%%m** The month as a decimal number (range 01 to 12).
**%%b**
The abbreviated month name according to the current locale.
**%%b** The abbreviated month name according to the current locale.
**%%B**
The full month name according to the current locale.
**%%B** The full month name according to the current locale.
**%%h**
The abbreviated month name according to the current locale(same as %%b).
**%%h** The abbreviated month name according to the current locale(same as %%b).
**%%d**
The day of the month as a decimal number (range 01 to 31).
**%%d** The day of the month as a decimal number (range 01 to 31).
**%%e**
The day of the month as a decimal number (range 1 to 31). single
digits are preceded by a blank.
**%%e** The day of the month as a decimal number (range 1 to 31). single
digits are preceded by a blank.
**%%I**
The hour as a decimal number using a 12-hour clock (range 01 to 12).
**%%I** The hour as a decimal number using a 12-hour clock (range 01 to 12).
**%%H**
The hour as a decimal number using a 24-hour clock (range 00 to 23).
**%%H** The hour as a decimal number using a 24-hour clock (range 00 to 23).
**%%k**
The hour (24-hour clock) as a decimal number (range 0 to 23). single
digits are preceded by a blank.
**%%k** The hour (24-hour clock) as a decimal number (range 0 to 23). single
digits are preceded by a blank.
**%%l**
The hour (12-hour clock) as a decimal number (range 1 to 12); single
digits are preceded by a blank.
**%%l** The hour (12-hour clock) as a decimal number (range 1 to 12); single
digits are preceded by a blank.
**%%M**
The minute as a decimal number (range 00 to 59).
**%%M** The minute as a decimal number (range 00 to 59).
**%%p**
Either 'AM' or 'PM' according to the given time value, or the
corresponding strings for the current locale. Noon is treated as 'PM'
and midnight as 'AM'
**%%p** Either 'AM' or 'PM' according to the given time value, or the
corresponding strings for the current locale. Noon is treated as 'PM'
and midnight as 'AM'
**%%P**
Like %p but in lower case: 'am' or 'pm' or a corresponding string for
the current locale.
**%%P** Like %p but in lower case: 'am' or 'pm' or a corresponding string for
the current locale.
**%%c**
The preferred date and time representation for the current locale.
**%%c** The preferred date and time representation for the current locale.
**%%x**
The preferred date representation for the current locale without the time.
**%%x** The preferred date representation for the current locale without the time.
**%%X**
The preferred time representation for the current locale without the date.
**%%X** The preferred time representation for the current locale without the date.
**%%r**
The complete calendar time using the AM/PM format of the current locale.
**%%r** The complete calendar time using the AM/PM format of the current locale.
**%%R**
The hour and minute in decimal numbers using the format %H:%M.
**%%R** The hour and minute in decimal numbers using the format %H:%M.
**%%T**
The time of day in decimal numbers using the format %H:%M:%S.
**%%T** The time of day in decimal numbers using the format %H:%M:%S.
**%%D**
The date using the format %%m/%%d/%%y.
**%%D** The date using the format %%m/%%d/%%y.
**%%F** The date using the format %%Y-%%m-%%d.
**%%F**
The date using the format %%Y-%%m-%%d.
(For more reference on the available **LIBC date format specifiers**,
please visit the link:
@ -194,7 +172,7 @@ The following functions are expected to be implemented in a Datetime module:
|__________| |__________|
Any module can use the following shared functions that are implemented in
elm_datetime.c :
elm_datetime.c:
**field_format_get()** - gives the field format.
@ -207,10 +185,8 @@ To enable a module, set the ELM_MODULES environment variable as shown:
This widget emits the following signals, besides the ones sent from
:py:class:`~efl.elementary.layout_class.LayoutClass`:
- ``changed`` - whenever Datetime field value is changed, this
signal is sent.
- ``language,changed`` - whenever system locale changes, this
signal is sent.
- ``changed`` - whenever Datetime field value is changed, this signal is sent.
- ``language,changed`` - whenever system locale changes, this signal is sent.
- ``focused`` - When the datetime has received focus. (since 1.8)
- ``unfocused`` - When the datetime has lost focus. (since 1.8)
@ -269,10 +245,21 @@ ELM_DATETIME_MINUTE = enums.ELM_DATETIME_MINUTE
ELM_DATETIME_AMPM = enums.ELM_DATETIME_AMPM
cdef class Datetime(Object):
"""
"""This is the class that actually implements the widget."""
This is the class that actually implements the widget.
"""
def __init__(self, evasObject parent, *args, **kwargs):
"""Datetime(...)
:param parent: The parent object
:type parent: :py:class:`efl.evas.Object`
:param \**kwargs: All the remaining keyword arguments are interpreted
as properties of the instance
"""
self._set_obj(elm_datetime_add(parent.obj))
self._set_properties_from_keyword_args(kwargs)
@ -290,80 +277,57 @@ cdef class Datetime(Object):
Following are the allowed set of format specifiers for each datetime field.
**%%Y**
The year as a decimal number including the century.
**%%Y** The year as a decimal number including the century.
**%%y**
The year as a decimal number without a century (range 00 to 99).
**%%y** The year as a decimal number without a century (range 00 to 99).
**%%m**
The month as a decimal number (range 01 to 12).
**%%m** The month as a decimal number (range 01 to 12).
**%%b**
The abbreviated month name according to the current locale.
**%%b** The abbreviated month name according to the current locale.
**%%B**
The full month name according to the current locale.
**%%B** The full month name according to the current locale.
**%%h**
The abbreviated month name according to the current locale(same as %%b).
**%%h** The abbreviated month name according to the current locale(same as %%b).
**%%d**
The day of the month as a decimal number (range 01 to 31).
**%%d** The day of the month as a decimal number (range 01 to 31).
**%%e**
The day of the month as a decimal number (range 1 to 31). single
digits are preceded by a blank.
**%%e** The day of the month as a decimal number (range 1 to 31). single
digits are preceded by a blank.
**%%I**
The hour as a decimal number using a 12-hour clock (range 01 to 12).
**%%I** The hour as a decimal number using a 12-hour clock (range 01 to 12).
**%%H**
The hour as a decimal number using a 24-hour clock (range 00 to 23).
**%%H** The hour as a decimal number using a 24-hour clock (range 00 to 23).
**%%k**
The hour (24-hour clock) as a decimal number (range 0 to 23). single
digits are preceded by a blank.
**%%k** The hour (24-hour clock) as a decimal number (range 0 to 23). single
digits are preceded by a blank.
**%%l**
The hour (12-hour clock) as a decimal number (range 1 to 12); single
digits are preceded by a blank.
**%%l** The hour (12-hour clock) as a decimal number (range 1 to 12); single
digits are preceded by a blank.
**%%M**
The minute as a decimal number (range 00 to 59).
**%%M** The minute as a decimal number (range 00 to 59).
**%%p**
Either 'AM' or 'PM' according to the given time value, or the
corresponding strings for the current locale. Noon is treated as 'PM'
and midnight as 'AM'.
**%%p** Either 'AM' or 'PM' according to the given time value, or the
corresponding strings for the current locale. Noon is treated as 'PM'
and midnight as 'AM'.
**%%P**
Like %p but in lower case: 'am' or 'pm' or a corresponding string for
the current locale.
**%%P** Like %p but in lower case: 'am' or 'pm' or a corresponding string for
the current locale.
**%%c**
The preferred date and time representation for the current locale.
**%%c** The preferred date and time representation for the current locale.
**%%x**
The preferred date representation <