davemds pushed a commit to branch master. http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=9e2ad3382ebe6ad8671b4a1041828b5b1cf3e121
commit 9e2ad3382ebe6ad8671b4a1041828b5b1cf3e121 Author: Dave Andreoli <[email protected]> Date: Wed Dec 31 12:42:08 2014 +0100 elm.Theme: added group_base_list_get() function --- efl/elementary/theme.pxd | 1 + efl/elementary/theme.pyx | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/efl/elementary/theme.pxd b/efl/elementary/theme.pxd index 19df0e4..a57e08f 100644 --- a/efl/elementary/theme.pxd +++ b/efl/elementary/theme.pxd @@ -43,6 +43,7 @@ cdef extern from "Elementary.h": Eina_List *elm_theme_name_available_list_new() void elm_theme_name_available_list_free(Eina_List *list) char *elm_theme_data_get(Elm_Theme *th, const char *key) + Eina_List *elm_theme_group_base_list(Elm_Theme *th, const char *base) cdef class Theme(object): cdef Elm_Theme *th diff --git a/efl/elementary/theme.pyx b/efl/elementary/theme.pyx index 4a62b66..a15b5f0 100644 --- a/efl/elementary/theme.pyx +++ b/efl/elementary/theme.pyx @@ -90,6 +90,7 @@ from libc.stdint cimport uintptr_t from efl.eo cimport PY_REFCOUNT from efl.utils.conversions cimport _ctouni, eina_list_strings_to_python_list +from efl.eina cimport eina_list_free, eina_stringshare_del cdef class Theme(object): @@ -402,6 +403,39 @@ cdef class Theme(object): return _ctouni(elm_theme_data_get(self.th, <const char *>key if key is not None else NULL)) + def group_base_list_get(self, base not None): + """Get a list of groups that match the initial base string given. + + This function will walk all theme files configured in the theme + and find all groups that BEGIN with the string ``begin`` and have + that string as at LEAST their start. + + :param base: The base string group collection to look for + :type base: string + + :return: The list of group names found (sorted) + :rtype: list of strings + + .. versionadded:: 1.13 + + """ + cdef: + const char *s + list ret = [] + Eina_List *lst, *itr + + if isinstance(base, unicode): base = PyUnicode_AsUTF8String(base) + lst = elm_theme_group_base_list(self.th, <const char *>base) + itr = lst + while itr: + s = <const char *>itr.data + ret.append(_ctouni(s)) + eina_stringshare_del(s) + itr = itr.next + eina_list_free(lst) + return ret + + def theme_list_item_path_get(f not None, bint in_search_path): """Return the full path for a theme element --
