[EGIT] [apps/epour] feature/create-torrent 01/01: Add bin/epour-create-torrent

2020-05-23 Thread Kai Huuhko
kuuko pushed a commit to branch feature/create-torrent.

http://git.enlightenment.org/apps/epour.git/commit/?id=5eb19682ff67eaf85bf7fd5c0a455c9d531a76f4

commit 5eb19682ff67eaf85bf7fd5c0a455c9d531a76f4
Author: Kai Huuhko 
Date:   Sat May 23 16:42:02 2020 +0300

Add bin/epour-create-torrent
---
 bin/epour-create-torrent | 249 +++
 1 file changed, 249 insertions(+)

diff --git a/bin/epour-create-torrent b/bin/epour-create-torrent
new file mode 100755
index 000..6f095b8
--- /dev/null
+++ b/bin/epour-create-torrent
@@ -0,0 +1,249 @@
+#!/usr/bin/env python3
+#
+#  Epour - A bittorrent client using EFL and libtorrent
+#
+#  Copyright 2012-2017 Kai Huuhko 
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 3 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+#  MA 02110-1301, USA.
+#
+
+import os
+
+import libtorrent as lt
+
+from efl import elementary as elm
+from efl.evas import EXPAND_BOTH, FILL_BOTH, EXPAND_HORIZ, FILL_HORIZ
+
+
+data = {"trackers": list()}
+
+class CreateTorrentGui(elm.StandardWindow):
+def __init__(self):
+super().__init__("testi", "testi", autodel=True)
+
+data["storage"] = lt.file_storage()
+
+nf = elm.Naviframe(self, size_hint_weight=EXPAND_BOTH)
+self.resize_object_add(nf)
+nf.show()
+
+first_next = elm.Button(self, text="Files/Directories")
+second_prev = elm.Button(self, text="Base Directory")
+second_next = elm.Button(self, text="Tracker URLs")
+third_prev = elm.Button(self, text="Files/Directories")
+third_next = elm.Button(self, text="Generate")
+fourth_prev = elm.Button(self, text="Tracker URLs")
+
+first_content = BaseDirectorySelection(self)
+second_content = FileSelection(self)
+third_content = TrackerAddition(self)
+fourth_content = TorrentGenerate(self)
+
+first = elm.NaviframeItem("Select Base Directory", 
next_btn=first_next, content=first_content)
+second = elm.NaviframeItem("Select Files/Directories", 
prev_btn=second_prev, next_btn=second_next, content=second_content)
+third = elm.NaviframeItem("Add Tracker URLs", prev_btn=third_prev, 
next_btn=third_next, content=third_content)
+fourth = elm.NaviframeItem("Generate Torrent", prev_btn=fourth_prev, 
content=fourth_content)
+
+def first_next_cb(obj):
+second.promote()
+
+def second_prev_cb(obj):
+first.promote()
+
+def second_next_cb(obj):
+third.promote()
+
+def third_prev_cb(obj):
+second.promote()
+
+def third_next_cb(obj):
+fourth.promote()
+
+def fourth_prev_cb(obj):
+third.promote()
+
+
first_content.selector.callback_directory_open_add(second_content.basedir_changed_cb)
+
+
+first_next.callback_clicked_add(first_next_cb)
+second_prev.callback_clicked_add(second_prev_cb)
+second_next.callback_clicked_add(second_next_cb)
+third_prev.callback_clicked_add(third_prev_cb)
+third_next.callback_clicked_add(third_next_cb)
+fourth_prev.callback_clicked_add(fourth_prev_cb)
+
+for page in first, second, third, fourth:
+page.push_to(nf)
+
+first.promote()
+
+self.size = 400, 400
+self.show()
+
+
+class BaseDirectorySelection(elm.Box):
+def __init__(self, parent, *args, **kwargs):
+super().__init__(parent, *args, **kwargs)
+
+def bdir_cb(obj, path):
+if not path:
+return
+data["base_dir"] = path
+
+selector = self.selector = elm.Fileselector(
+self,
+size_hint_weight=EXPAND_BOTH,
+size_hint_align=FILL_BOTH,
+buttons_ok_cancel=False,
+folder_only=True,
+expandable=False
+)
+selector.callback_directory_open_add(bdir_cb)
+selector.show()
+self.pack_end(selector)
+
+class FileSelection(elm.Box):
+def __init__(self, parent, *args, **kwargs):
+super().__init__(parent, *args, **kwargs)
+
+self.size_hint_weight=EXPAND_BOTH
+self.size_hint_align=FILL_BOT

[EGIT] [website/www-content] master 01/01: Wiki page download-latest changed with summary [Bump Epour version (released in 2017!)] by Kai Huuhko

2020-10-21 Thread Kai Huuhko
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=d4214997c107869c99759c5ceef1de9d11876292

commit d4214997c107869c99759c5ceef1de9d11876292
Author: Kai Huuhko 
Date:   Wed Oct 21 12:57:18 2020 -0700

Wiki page download-latest changed with summary [Bump Epour version 
(released in 2017!)] by Kai Huuhko
---
 pages/download-latest.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pages/download-latest.txt b/pages/download-latest.txt
index 74f86e6a7..55150f859 100644
--- a/pages/download-latest.txt
+++ b/pages/download-latest.txt
@@ -7,7 +7,7 @@ terminology_v = 1.8.1
 rage_v= 0.3.1
 econnman_v= 1.1
 ephoto_v  = 1.5
-epour_v   = 0.6.0
+epour_v   = 0.7.0
 evisum_v  = 0.5.7
 extra_v   = 0.0.1
 

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Follow changes in Eo

2016-03-04 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=05c19962dc966f4ca1d64435ad29c7f9d49ef170

commit 05c19962dc966f4ca1d64435ad29c7f9d49ef170
Author: Kai Huuhko 
Date:   Fri Mar 4 11:07:51 2016 +0200

Follow changes in Eo

- version 4 (eo_add changes coming later)
- events
---
 efl/elementary/elementary_cdef.pxi |   2 +-
 efl/elementary/systray.pxi | 130 -
 efl/elementary/systray_cdef.pxi|  34 +-
 efl/eo/efl.eo.pyx  |  62 +++---
 efl/evas/efl.evas_object_smart.pxi |  28 
 include/efl.c_eo.pxd   |  54 ---
 6 files changed, 128 insertions(+), 182 deletions(-)

diff --git a/efl/elementary/elementary_cdef.pxi 
b/efl/elementary/elementary_cdef.pxi
index 2e3c1cc..bf56d09 100644
--- a/efl/elementary/elementary_cdef.pxi
+++ b/efl/elementary/elementary_cdef.pxi
@@ -1,4 +1,4 @@
-from efl.c_eo cimport Eo as cEo, Eo_Class, eo_add, eo_do, eo_do_ret
+from efl.c_eo cimport Eo as cEo, Eo_Class, eo_add
 from efl.eina cimport Eina_Rectangle, Eina_Compare_Cb, \
 eina_list_free, eina_list_append, eina_stringshare_del
 from efl.evas cimport Eina_List, Eina_Bool, Evas_Object, Evas_Font_Size, \
diff --git a/efl/elementary/systray.pxi b/efl/elementary/systray.pxi
index 7bf021b..e08cd80 100644
--- a/efl/elementary/systray.pxi
+++ b/efl/elementary/systray.pxi
@@ -37,27 +37,21 @@ cdef class Systray(Eo):
 """
 def __set__(self, value):
 if isinstance(value, unicode): value = 
PyUnicode_AsUTF8String(value)
-eo_do(self.obj, elm_obj_systray_id_set(
-value if value is not None else NULL
+elm_obj_systray_id_set(
+self.obj, value if value is not None else NULL
 )
-)
 
 def __get__(self):
-cdef const char *value = ""
-eo_do_ret(self.obj, value, elm_obj_systray_id_get())
-return _ctouni(value)
+return _ctouni(elm_obj_systray_id_get(self.obj))
 
 def id_set(self, value):
 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
-eo_do(self.obj, elm_obj_systray_id_set(
-value if value is not None else NULL
+elm_obj_systray_id_set(
+self.obj, value if value is not None else NULL
 )
-)
 
 def id_get(self):
-cdef const char *value = ""
-eo_do_ret(self.obj, value, elm_obj_systray_id_get())
-return _ctouni(value)
+return _ctouni(elm_obj_systray_id_get(self.obj))
 
 property category:
 """
@@ -68,20 +62,16 @@ cdef class Systray(Eo):
 
 """
 def __set__(self, Elm_Systray_Category value):
-eo_do(self.obj, elm_obj_systray_category_set(value))
+elm_obj_systray_category_set(self.obj, value)
 
 def __get__(self):
-cdef Elm_Systray_Category value = ELM_SYSTRAY_CATEGORY_APP_STATUS
-eo_do_ret(self.obj, value, elm_obj_systray_category_get())
-return value
+return elm_obj_systray_category_get(self.obj)
 
 def category_set(self, Elm_Systray_Category value):
-eo_do(self.obj, elm_obj_systray_category_set(value))
+elm_obj_systray_category_set(self.obj, value)
 
 def category_get(self):
-cdef Elm_Systray_Category value = ELM_SYSTRAY_CATEGORY_APP_STATUS
-eo_do_ret(self.obj, value, elm_obj_systray_category_get())
-return value
+return elm_obj_systray_category_get(self.obj)
 
 property icon_theme_path:
 """The path to the theme where the icons can be found.
@@ -92,27 +82,21 @@ cdef class Systray(Eo):
 """
 def __set__(self, value):
 if isinstance(value, unicode): value = 
PyUnicode_AsUTF8String(value)
-eo_do(self.obj, elm_obj_systray_icon_theme_path_set(
-value if value is not None else NULL
+elm_obj_systray_icon_theme_path_set(
+self.obj, value if value is not None else NULL
 )
-)
 
 def __get__(self):
-cdef const char *value = ""
-eo_do_ret(self.obj, value, elm_obj_systray_icon_theme_path_get())
-return _ctouni(value)
+return _ctouni(elm_obj_systray_icon_theme_path_get(self.obj))
 
 def icon_theme_path_set(self, value):
 if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value)
-eo_do(self.obj, elm_obj_systray_icon_theme_path_set(
-value if value is not None else NULL
+elm_obj_systray_icon_theme_path_set(
+self.obj, value if value is not None else NULL
 )
-)
 
 def icon_theme_path_get(self):
-cdef const char *value = ""
-eo_do

[EGIT] [apps/econnman] master 01/01: Add support for IPv6

2016-03-04 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/econnman.git/commit/?id=18e7be6bf80df6b86965ba93391b205339fc7267

commit 18e7be6bf80df6b86965ba93391b205339fc7267
Author: Kai Huuhko 
Date:   Sat Mar 5 08:20:56 2016 +0200

Add support for IPv6
---
 econnman-bin.in | 212 
 1 file changed, 197 insertions(+), 15 deletions(-)

diff --git a/econnman-bin.in b/econnman-bin.in
index 2715f1d..4f23acb 100755
--- a/econnman-bin.in
+++ b/econnman-bin.in
@@ -56,10 +56,10 @@ except:
 
 dbus_ml = DBusEcoreMainLoop()
 bus = dbus.SystemBus(mainloop=dbus_ml)
-log = logging.getLogger("econnman")
+log = logging.getLogger("econnman-bin")
 log_handler = logging.StreamHandler()
 log_formatter = logging.Formatter(
-"%(relativeCreated)d %(levelname)s %(name)s: %(message)s"
+"%(created)d %(name)s [%(levelname)s]:: %(message)s (@lineno %(lineno)d)"
 )
 log_handler.setFormatter(log_formatter)
 log.addHandler(log_handler)
@@ -347,6 +347,20 @@ class ObjectView(object):
 sc.callback_changed_add(callback)
 return sc, items
 
+def add_label_and_segment_control(self, box, options, callback, label):
+lb = self.add_label(box, label)
+
+sc = SegmentControl(box)
+sc.size_hint_weight = EXPAND_HORIZ
+sc.size_hint_align = FILL_BOTH
+items = {}
+for o in options:
+items[o] = sc.item_add(None, o)
+sc.show()
+box.pack_end(sc)
+sc.callback_changed_add(callback)
+return lb, sc, items
+
 def add_frame_and_box(self, box, label):
 fr = Frame(box)
 fr.size_hint_weight = EXPAND_HORIZ
@@ -925,6 +939,28 @@ class ServiceView(ObjectView):
 """
 bus_interface = "net.connman.Service"
 
+ipv4_fields = (#("Method", "ipv4_method"),
+   ("Address", "ipv4_address"),
+   ("Netmask", "ipv4_netmask"),
+   ("Gateway", "ipv4_gateway"),
+   )
+ipv6_fields = (#("Method", "ipv6_method"),
+   ("Address", "ipv6_address"),
+   ("Prefix Length", "ipv6_prefix_length"),
+   ("Gateway", "ipv6_gateway"),
+   #("Privacy", "ipv6_privacy"),
+   )
+proxy_fields = (("Method", "proxy_method"),
+("URL", "proxy_url"),
+("Servers", "proxy_servers"),
+("Excludes", "proxy_excludes"),
+)
+vpn_fields = (  # named Provider in spec
+  ("Host", "vpn_host"),
+  ("Domain", "vpn_domain"),
+  ("Name", "vpn_name"),
+  ("Type", "vpn_type"),
+  )
 eth_fields = (("Method", "eth_method"),
   ("Interface", "eth_iface"),
   ("Address", "eth_addr"),
@@ -932,15 +968,6 @@ class ServiceView(ObjectView):
   ("Speed", "eth_speed"),
   ("Duplex", "eth_duplex"),
   )
-vpn_fields = (("Host", "vpn_host"),
-  ("Domain", "vpn_domain"),
-  ("Name", "vpn_name"),
-  ("Type", "vpn_type"),
-  )
-ipv4_fields = (("Address", "ipv4_address"),
-   ("Netmask", "ipv4_netmask"),
-   ("Gateway", "ipv4_gateway"),
-   )
 
 top_widgets = (
 "connect",
@@ -959,6 +986,7 @@ class ServiceView(ObjectView):
 "domains_label",
 "domains_entry",
 "ipv4_frame",
+"ipv6_frame",
 "proxy_frame",
 "ethernet_frame",
 "vpn_frame",
@@ -1033,10 +1061,22 @@ class ServiceView(ObjectView):
 en.callback_unfocused_add(self._on_ipv4_property_unfocused)
 setattr(self, attr, en)
 
-# section: IPv6: similar to ipv4? refactor ipv4?
-if properties.get("IPv6"):
-fr, bx = self.add_frame_and_box(self.box, "IPv6")
-lb = self.add_label(bx, "TODO")
+# section: IPv6
+self.ipv6_properties = {"IPv6": {}, "IPv6.Configuration": {}}
+fr, bx = self.add_frame_and_box(self.box, "IPv6")
+self.ipv6_frame 

[EGIT] [bindings/python/python-efl] master 01/01: More Eo updates

2016-03-09 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=77d023dfe1fecfc980968c91bd8e170b06539e15

commit 77d023dfe1fecfc980968c91bd8e170b06539e15
Author: Kai Huuhko 
Date:   Wed Mar 9 20:07:05 2016 +0200

More Eo updates
---
 efl/elementary/systray.pxi |  4 +++-
 efl/eo/efl.eo.pyx  | 10 +-
 include/efl.c_eo.pxd   |  7 +++
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/efl/elementary/systray.pxi b/efl/elementary/systray.pxi
index e08cd80..4407ecc 100644
--- a/efl/elementary/systray.pxi
+++ b/efl/elementary/systray.pxi
@@ -26,7 +26,9 @@ cdef class Systray(Eo):
 """
 
 def __init__(self, Eo parent not None, *args, **kwargs):
-self._set_obj(eo_add(elm_systray_class_get(), parent.obj))
+cdef cEo *obj
+eo_add(&obj, elm_systray_class_get(), parent.obj)
+self._set_obj(obj)
 self._set_properties_from_keyword_args(kwargs)
 
 property id:
diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index aa5bbaf..73e905c 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -39,12 +39,12 @@ from efl.eina cimport Eina_Bool, \
 from efl.c_eo cimport Eo as cEo, eo_init, eo_shutdown, eo_del, \
 eo_class_name_get, eo_class_get, eo_base_class_get,\
 eo_key_data_set, eo_key_data_get, eo_key_data_del, \
-eo_event_callback_add, eo_event_callback_del, EO_EV_DEL, \
+eo_event_callback_add, eo_event_callback_del, EO_BASE_EVENT_DEL, \
 eo_parent_get, eo_parent_set, Eo_Event_Description, \
 eo_event_freeze, eo_event_thaw, eo_event_freeze_count_get, \
 eo_event_global_freeze, eo_event_global_thaw, \
 eo_event_global_freeze_count_get, EO_CALLBACK_STOP, \
-eo_children_iterator_new, Eo_Event2
+eo_children_iterator_new, Eo_Event
 
 from efl.utils.logger cimport add_logger
 
@@ -182,14 +182,14 @@ cdef void _register_decorated_callbacks(Eo obj):
 ##
 
 
-cdef Eina_Bool _eo_event_del_cb(void *data, const Eo_Event2 *event) with gil:
+cdef Eina_Bool _eo_event_del_cb(void *data, const Eo_Event *event) with gil:
 cdef:
 Eo self = data
 const char *cls_name = eo_class_name_get(eo_class_get(self.obj))
 
 EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN, "Deleting Eo: %s", cls_name)
 
-eo_event_callback_del(self.obj, EO_EV_DEL, _eo_event_del_cb, self)
+eo_event_callback_del(self.obj, EO_BASE_EVENT_DEL, _eo_event_del_cb, 
self)
 eo_key_data_del(self.obj, "python-eo")
 self.obj = NULL
 Py_DECREF(self)
@@ -253,7 +253,7 @@ cdef class Eo(object):
 
 self.obj = obj
 eo_key_data_set(self.obj, "python-eo", self)
-eo_event_callback_add(self.obj, EO_EV_DEL, _eo_event_del_cb, self)
+eo_event_callback_add(self.obj, EO_BASE_EVENT_DEL, _eo_event_del_cb, 
self)
 Py_INCREF(self)
 
 return 1
diff --git a/include/efl.c_eo.pxd b/include/efl.c_eo.pxd
index 66207ab..d4906fa 100644
--- a/include/efl.c_eo.pxd
+++ b/include/efl.c_eo.pxd
@@ -77,20 +77,19 @@ cdef extern from "Eo.h":
 const Eo_Event_Description *desc # The event description. */
 void *event_info # Extra event information passed by the event caller. 
*/
 ctypedef _Eo_Event Eo_Event
-ctypedef _Eo_Event Eo_Event2
 
 
 
 # Eo Events
 #
 
-cdef const Eo_Event_Description *EO_EV_DEL
+cdef const Eo_Event_Description *EO_BASE_EVENT_DEL
 
 
 
 # Other typedefs
 #
-ctypedef Eina_Bool (*Eo_Event_Cb)(void *data, const Eo_Event2 *event)
+ctypedef Eina_Bool (*Eo_Event_Cb)(void *data, const Eo_Event *event)
 
 ctypedef void (*eo_key_data_free_func)(void *)
 
@@ -101,7 +100,7 @@ cdef extern from "Eo.h":
 int eo_init()
 int eo_shutdown()
 
-Eo *eo_add(const Eo_Class *klass, Eo *parent, ...)
+void eo_add(Eo **objp, const Eo_Class *klass, Eo *parent, ...)
 Eo *eo_ref(const Eo *obj)
 void eo_unref(const Eo *obj)
 int eo_ref_get(const Eo *obj)

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Shuffle in the latest Eo memes

2016-03-18 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=41c1779e81eb4388528bed6054855206c017f317

commit 41c1779e81eb4388528bed6054855206c017f317
Author: Kai Huuhko 
Date:   Sat Mar 19 01:08:33 2016 +0200

Shuffle in the latest Eo memes
---
 efl/elementary/systray.pxi | 3 +--
 include/efl.c_eo.pxd   | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/efl/elementary/systray.pxi b/efl/elementary/systray.pxi
index 4407ecc..ab76be3 100644
--- a/efl/elementary/systray.pxi
+++ b/efl/elementary/systray.pxi
@@ -26,8 +26,7 @@ cdef class Systray(Eo):
 """
 
 def __init__(self, Eo parent not None, *args, **kwargs):
-cdef cEo *obj
-eo_add(&obj, elm_systray_class_get(), parent.obj)
+cdef cEo *obj = eo_add(elm_systray_class_get(), parent.obj)
 self._set_obj(obj)
 self._set_properties_from_keyword_args(kwargs)
 
diff --git a/include/efl.c_eo.pxd b/include/efl.c_eo.pxd
index d4906fa..390435f 100644
--- a/include/efl.c_eo.pxd
+++ b/include/efl.c_eo.pxd
@@ -100,7 +100,7 @@ cdef extern from "Eo.h":
 int eo_init()
 int eo_shutdown()
 
-void eo_add(Eo **objp, const Eo_Class *klass, Eo *parent, ...)
+Eo *eo_add(const Eo_Class *klass, Eo *parent, ...)
 Eo *eo_ref(const Eo *obj)
 void eo_unref(const Eo *obj)
 int eo_ref_get(const Eo *obj)

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Elementary: Implement drag and drop

2015-12-09 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=453c2a123c61c91d4af37c66e212ded6437e7796

commit 453c2a123c61c91d4af37c66e212ded6437e7796
Author: Kai Huuhko 
Date:   Wed Dec 9 20:54:07 2015 +0200

Elementary: Implement drag and drop

Has some issues which we can work on later, should be API stable now.
---
 efl/elementary/cnp_callbacks.pxi  | 176 +++-
 efl/elementary/gengrid_widget.pxi | 162 +-
 efl/elementary/genlist_widget.pxi | 169 ++-
 efl/elementary/object.pxi | 336 ++
 examples/elementary/test_dnd.py   | 255 +++--
 5 files changed, 626 insertions(+), 472 deletions(-)

diff --git a/efl/elementary/cnp_callbacks.pxi b/efl/elementary/cnp_callbacks.pxi
index 2e56c95..83b4646 100644
--- a/efl/elementary/cnp_callbacks.pxi
+++ b/efl/elementary/cnp_callbacks.pxi
@@ -18,6 +18,7 @@ cdef extern from "Elementary.h":
 ctypedef void(*Elm_Drag_Done)   (void *data, 
Evas_Object *obj, Eina_Bool accepted)
 ctypedef void(*Elm_Drag_Accept) (void *data, 
Evas_Object *obj, Eina_Bool doaccept)
 ctypedef void(*Elm_Drag_Pos)(void *data, 
Evas_Object *obj, Evas_Coord x, Evas_Coord y, Elm_Xdnd_Action action)
+ctypedef void(*Elm_Drag_Start)  (void *data, 
Evas_Object *obj)
 ctypedef void(*Elm_Drag_Item_Container_Pos) (void *data, 
Evas_Object *cont, Elm_Object_Item *it, Evas_Coord x, Evas_Coord y, int 
xposret, int yposret, Elm_Xdnd_Action action)
 ctypedef Eina_Bool   (*Elm_Drop_Item_Container_Cb)  (void *data, 
Evas_Object *obj, Elm_Object_Item *it, Elm_Selection_Data *ev, int xposret, int 
yposret)
 
@@ -37,30 +38,22 @@ cdef extern from "Elementary.h":
 
 ctypedef _Elm_Drag_User_Info Elm_Drag_User_Info
 
-ctypedef Eina_Bool  (*Elm_Item_Container_Data_Get_Cb)(
-Evas_Object *obj,
-Elm_Object_Item *it,
-Elm_Drag_User_Info *info)
-
-Eina_Bool elm_drag_item_container_add(Evas_Object *obj, double tm_to_anim, 
double tm_to_drag, Elm_Xy_Item_Get_Cb itemgetcb, Elm_Item_Container_Data_Get_Cb 
data_get)
-Eina_Bool elm_drag_item_container_del(Evas_Object *obj)
-Eina_Bool elm_drop_item_container_add(Evas_Object *obj,
-  Elm_Sel_Format format,
-  Elm_Xy_Item_Get_Cb itemgetcb,
-  Elm_Drag_State entercb, void *enterdata,
-  Elm_Drag_State leavecb, void *leavedata,
-  Elm_Drag_Item_Container_Pos poscb, void *posdata,
-  Elm_Drop_Item_Container_Cb dropcb, void *cbdata)
-Eina_Bool elm_drop_item_container_del(Evas_Object *obj)
+ctypedef Eina_Bool   (*Elm_Item_Container_Data_Get_Cb)(Evas_Object 
*obj, Elm_Object_Item *it, Elm_Drag_User_Info *info)
 
 Eina_Bool   elm_cnp_selection_set(Evas_Object *obj, 
Elm_Sel_Type selection, Elm_Sel_Format format, const void *buf, size_t buflen)
 Eina_Bool   elm_cnp_selection_get(Evas_Object *obj, 
Elm_Sel_Type selection, Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata)
 Eina_Bool   elm_object_cnp_selection_clear(Evas_Object *obj, 
Elm_Sel_Type selection)
 voidelm_cnp_selection_loss_callback_set(Evas_Object 
*obj, Elm_Sel_Type selection, Elm_Selection_Loss_Cb func, const void *data)
-# Eina_Bool   elm_drop_target_add(Evas_Object *obj, 
Elm_Sel_Format format, Elm_Drag_State entercb, void *enterdata, Elm_Drag_State 
leavecb, void *leavedata, Elm_Drag_Pos poscb, void *posdata, Elm_Drop_Cb 
dropcb, void *cbdata)
-# Eina_Bool   elm_drop_target_del(Evas_Object *obj)
-# Eina_Bool   elm_drag_start(Evas_Object *obj, Elm_Sel_Format 
format, const char *data, Elm_Xdnd_Action action, Elm_Drag_Icon_Create_Cb 
createicon, void *createdata, Elm_Drag_Pos dragpos, void *dragdata, 
Elm_Drag_Accept acceptcb, void *acceptdata, Elm_Drag_State dragdone, void 
*donecbdata)
-# Eina_Bool   elm_drag_action_set(Evas_Object *obj, 
Elm_Xdnd_Action action)
+Eina_Bool   elm_drop_target_add(Evas_Object *obj, 
Elm_Sel_Format format, Elm_Drag_State entercb, void *enterdata, Elm_Drag_State 
leavecb, void *leavedata, Elm_Drag_Pos poscb, void *posdata, Elm_Drop_Cb 
dropcb, void *dropdata)
+Eina_Bool   elm_drop_target_del(Evas_Object *obj, 
Elm_Sel_Format format, Elm_Drag_State entercb, void *enterdata, Elm_Drag_State 
leavecb, void *leavedata, Elm_Drag_Pos poscb, void *posdata, Elm_Drop_Cb 
dropcb, void *dropdata)
+Eina_Bool   elm_drag_start(Evas_Object *obj, Elm_Sel_Format 
format, const char *data, Elm_Xdnd_Action action, Elm_Drag_Icon_Create_Cb 
createicon, void *createdata, Elm_Drag_Pos dragpos, void *dragdata, 
Elm_Drag_Accept acceptcb, void *acceptdata, Elm_Drag_State dragdone, void 
*donecbdata)
+Eina_Bool  

[EGIT] [bindings/python/python-efl] master 01/01: print()--

2015-12-09 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=5d73c59088961ece986c6754615b68d9bbd0475a

commit 5d73c59088961ece986c6754615b68d9bbd0475a
Author: Kai Huuhko 
Date:   Wed Dec 9 21:02:59 2015 +0200

print()--
---
 efl/elementary/cnp_callbacks.pxi | 10 --
 1 file changed, 10 deletions(-)

diff --git a/efl/elementary/cnp_callbacks.pxi b/efl/elementary/cnp_callbacks.pxi
index 83b4646..8c49ae7 100644
--- a/efl/elementary/cnp_callbacks.pxi
+++ b/efl/elementary/cnp_callbacks.pxi
@@ -106,7 +106,6 @@ cdef Eina_Bool py_elm_drop_cb(void *data, Evas_Object *obj, 
Elm_Selection_Data *
 :param ev: struct holding information about selected data
 
 """
-print("in drop_cb")
 assert data != NULL, "data is NULL"
 cdef:
 SelectionData sd = SelectionData.__new__(SelectionData)
@@ -136,7 +135,6 @@ cdef Elm_Object_Item *py_elm_xy_item_get_cb(Evas_Object 
*obj, Evas_Coord x, Evas
 :return: object under x,y cords or NULL if not found.
 
 """
-print("in xy_item_get_cb")
 assert obj != NULL, "obj is NULL"
 
 cdef:
@@ -187,7 +185,6 @@ cdef Evas_Object *py_elm_drag_icon_create_cb(
 :return: An object to fill the drag window with or NULL if not needed
 
 """
-print("in drag_icon_create_cb")
 assert data != NULL, "data is NULL"
 
 cdef:
@@ -227,7 +224,6 @@ cdef void py_elm_drag_state_cb(void *data, Evas_Object 
*obj) with gil:
 :param obj: The object where the drag started
 
 """
-print("in drag_state_cb")
 assert data != NULL, "data is NULL"
 
 cdef:
@@ -248,7 +244,6 @@ cdef void py_elm_drag_done_cb(void *data, Evas_Object *obj, 
Eina_Bool accepted)
 :param accepted: TRUE if the dropped-data is accepted on drop
 
 """
-print("in drag_done_cb")
 assert data != NULL, "data is NULL"
 
 cdef:
@@ -269,7 +264,6 @@ cdef void py_elm_drag_accept_cb(void *data, Evas_Object 
*obj, Eina_Bool doaccept
 :param doaccept: A boolean as to if the target accepts the drag or not
 
 """
-print("in drag_accept_cb")
 assert data != NULL, "data is NULL"
 
 cdef:
@@ -292,7 +286,6 @@ cdef void py_elm_drag_pos_cb(void *data, Evas_Object *obj,
 :param y: The Y coordinate relative to the top-left of the object
 
 """
-print("in drag_pos_cb")
 assert data != NULL, "data is NULL"
 
 cdef:
@@ -323,8 +316,6 @@ cdef void py_elm_drag_item_container_pos(
 :param action: The drag action to be done
 
 """
-print("in drag_item_container_pos")
-
 cdef:
 evasObject o = object_from_instance(cont)
 ObjectItem item = _object_item_to_python(it)
@@ -349,7 +340,6 @@ cdef Eina_Bool py_elm_drop_item_container_cb(
 :param yposret: Position relative to item (upper (-1), middle (0), bottom 
(1)
 
 """
-print("in drop_item_container_cb")
 assert obj != NULL, "obj is NULL"
 
 cdef:

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Elementary.dnd: Fix various leftover issues

2015-12-09 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=75fa5ff2565dec7ae002b33b4f9f12171c9c

commit 75fa5ff2565dec7ae002b33b4f9f12171c9c
Author: Kai Huuhko 
Date:   Wed Dec 9 21:26:29 2015 +0200

Elementary.dnd: Fix various leftover issues
---
 efl/elementary/object.pxi   | 69 +
 examples/elementary/test_dnd.py |  2 +-
 2 files changed, 43 insertions(+), 28 deletions(-)

diff --git a/efl/elementary/object.pxi b/efl/elementary/object.pxi
index 27c91fb..5c5ddad 100644
--- a/efl/elementary/object.pxi
+++ b/efl/elementary/object.pxi
@@ -1669,19 +1669,20 @@ cdef class Object(SmartObject):
 raise RuntimeError("Could not add drop target.")
 
 def drop_target_del(self, Elm_Sel_Format fmt,
-entercb, enterdata, leavecb, leavedata, poscb, posdata, dropcb, 
dropdata):
+entercb=None, enterdata=None, leavecb=None, leavedata=None,
+poscb=None, posdata=None, dropcb=None, dropdata=None):
 """Deletes the drop target status of an object
 
-@param format The formats supported for dropping
-@param entercb The function to call when the object is entered with a 
drag
-@param enterdata The application data to pass to enterdata
-@param leavecb The function to call when the object is left with a drag
-@param leavedata The application data to pass to leavedata
-@param poscb The function to call when the object has a drag over it
-@param posdata The application data to pass to posdata
-@param dropcb The function to call when a drop has occurred
-@param dropdata The application data to pass to dropcb
-@return Returns @c EINA_TRUE, if successful, or @c EINA_FALSE if not.
+:param format: The formats supported for dropping
+:param entercb: The function to call when the object is entered with a 
drag
+:param enterdata: The application data to pass to enterdata
+:param leavecb: The function to call when the object is left with a 
drag
+:param leavedata: The application data to pass to leavedata
+:param poscb: The function to call when the object has a drag over it
+:param posdata: The application data to pass to posdata
+:param dropcb: The function to call when a drop has occurred
+:param dropdata: The application data to pass to dropcb
+:raise RuntimeError: if drop target cannot be deleted
 
 .. versionadded:: 1.17
 
@@ -1717,8 +1718,8 @@ cdef class Object(SmartObject):
 raise RuntimeError("Could not del drop target.")
 
 def drag_start(self, Elm_Sel_Format format,
-data, Elm_Xdnd_Action action, createicon, createdata,
-dragpos, dragdata, acceptcb, acceptdata, dragdone, donecbdata):
+data, Elm_Xdnd_Action action, createicon=None, createdata=None,
+dragpos=None, dragdata=None, acceptcb=None, acceptdata=None, 
dragdone=None, donecbdata=None):
 """Begins a drag given a source object
 
 :param format: The drag formats supported by the data
@@ -1742,23 +1743,37 @@ cdef class Object(SmartObject):
 .. versionadded:: 1.17
 
 """
-if not callable(createicon) \
-or not callable(dragpos) \
-or not callable(acceptcb) \
-or not callable(dragdone):
-raise TypeError("A callback passed is not callable.")
-
-create = (createicon, createdata)
-pos = (dragpos, dragdata)
-accept = (acceptcb, acceptdata)
-done = (dragdone, donecbdata)
+if createicon:
+if not callable(createicon):
+raise TypeError("A callback passed is not callable.")
+create = (createicon, createdata)
+Py_INCREF(create)
+if dragpos:
+if not callable(dragpos):
+raise TypeError("A callback passed is not callable.")
+pos = (dragpos, dragdata)
+Py_INCREF(pos)
+if acceptcb:
+if not callable(acceptcb):
+raise TypeError("A callback passed is not callable.")
+accept = (acceptcb, acceptdata)
+Py_INCREF(accept)
+if dragdone:
+if not callable(dragdone):
+raise TypeError("A callback passed is not callable.")
+done = (dragdone, donecbdata)
+Py_INCREF(done)
 
 if not elm_drag_start(self.obj, format,
 data, action,
-py_elm_drag_icon_create_cb, create,
-py_elm_drag_pos_cb, pos,
-py_elm_drag_accept_cb, accept,
-py_elm_drag_state_cb, done
+py_elm_drag_icon_create_cb if createicon 
is not None else NULL,
+create if createicon is not None else NULL,
+py_elm_drag_pos_cb if dragpos is no

[EGIT] [bindings/python/python-efl] master 01/02: api_coverage.py: Include all files in cdef search

2015-12-25 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=16f7cb1a24e93e1a52bdd02206e0e8a4e2054645

commit 16f7cb1a24e93e1a52bdd02206e0e8a4e2054645
Author: Kai Huuhko 
Date:   Thu Dec 17 06:12:40 2015 +0200

api_coverage.py: Include all files in cdef search

Fixes Elm
---
 api_coverage.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/api_coverage.py b/api_coverage.py
index f08a783..a0c988b 100755
--- a/api_coverage.py
+++ b/api_coverage.py
@@ -163,8 +163,8 @@ def get_pyapis(pxd_path, header_name, prefix):
 
 for path, dirs, files in os.walk(pxd_path):
 for f in files:
-if not f.endswith(".pxd"):
-continue
+# if not f.endswith(".pxd"):
+# continue
 open_args = (os.path.join(path, f),)
 open_kwargs = dict(mode="r")
 if sys.version_info[0] > 2:

-- 




[EGIT] [bindings/python/python-efl] master 02/02: Ecore.Exe: Add missing documentation for the Events

2015-12-25 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=6c16e2f7464e95cd6f0a26fcb4c1432baf1f97d9

commit 6c16e2f7464e95cd6f0a26fcb4c1432baf1f97d9
Author: Kai Huuhko 
Date:   Fri Dec 25 21:02:39 2015 +0200

Ecore.Exe: Add missing documentation for the Events
---
 efl/ecore/efl.ecore_exe.pxi | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/efl/ecore/efl.ecore_exe.pxi b/efl/ecore/efl.ecore_exe.pxi
index 14a3410..4f9171f 100644
--- a/efl/ecore/efl.ecore_exe.pxi
+++ b/efl/ecore/efl.ecore_exe.pxi
@@ -774,9 +774,9 @@ def exe_pipe_run(exe_cmd, int flags=0, data=None):
 cdef class EventExeAdd(Event):
 """Represents Ecore_Exe_Event_Add event from C-api.
 
-This event notifies the process created with :py:class:`Exe` was started.
+This event notifies that the process created with :py:class:`Exe` has been 
started.
 
-See property ``exe`` for ``Exe`` instance.
+:ivar Exe exe: Instance of :py:class:`Exe` that created this event.
 """
 cdef int _set_obj(self, void *o) except 0:
 cdef Ecore_Exe_Event_Add *obj
@@ -793,9 +793,14 @@ cdef class EventExeAdd(Event):
 cdef class EventExeDel(Event):
 """Represents Ecore_Exe_Event_Del from C-api.
 
-This event notifies the process created with ``Exe`` is now dead.
+This event notifies that the process created with ``Exe`` is now dead.
 
-See property ``exe`` for ``Exe`` instance.
+:ivar Exe exe: Instance of :py:class:`Exe` that created this event.
+:ivar int pid: Process ID
+:ivar int exit_code: Exit code
+:ivar int exit_signal: Exit signal
+:ivar bool exited: Has process exited
+:ivar bool signalled: Has process been signalled
 """
 cdef int _set_obj(self, void *o) except 0:
 cdef Ecore_Exe_Event_Del *obj
@@ -823,12 +828,10 @@ cdef class EventExeData(Event):
 This event is issued by :py:class:`Exe` instances created with flags that
 allow reading from either stdout or stderr.
 
-See properties:
-
-  - **exe** instance of :py:class:`Exe` that created this event.
-  - **data** the raw string buffer with binary data from child process.
-  - **size** the size of **data** (same as ``len(data)``)
-  - **lines** list of strings with all text lines
+:ivar Exe exe: Instance of :py:class:`Exe` that created this event.
+:ivar string ~EventExeData.data: The raw string buffer with binary data 
from child process.
+:ivar int ~EventExeData.size: The size of **data** (same as ``len(data)``)
+:ivar list lines: List of strings with all text lines
 """
 cdef int _set_obj(self, void *o) except 0:
 cdef Ecore_Exe_Event_Data *obj

-- 




[EGIT] [bindings/python/python-efl] master 01/01: utils.deprecated: Fix compatibility with Python 3.5

2016-01-02 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=8f2baa86b5695d4daf5de086b142a37363337a87

commit 8f2baa86b5695d4daf5de086b142a37363337a87
Author: Kai Huuhko 
Date:   Sun Jan 3 09:31:16 2016 +0200

utils.deprecated: Fix compatibility with Python 3.5
---
 efl/utils/deprecated.pyx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/efl/utils/deprecated.pyx b/efl/utils/deprecated.pyx
index a46ddd3..c06839a 100644
--- a/efl/utils/deprecated.pyx
+++ b/efl/utils/deprecated.pyx
@@ -76,12 +76,12 @@ class WRAPPER(object):
 
 def __call__(self, *args, **kwargs):
 cdef:
-object stack
+list stack
 tuple caller
 str msg
 
-stack = traceback.extract_stack()
-caller = stack[-1]
+stack = list(traceback.extract_stack())
+caller = tuple(stack[-1])
 caller_module, caller_line, caller_name, caller_code = caller
 if caller_code is not None:
 if hasattr(self.f, "__objclass__"):

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Eo: Add a private dict which can be used for callbacks etc.

2016-01-23 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=fa69908d712375ad599431eedeb7ef01bede83ff

commit fa69908d712375ad599431eedeb7ef01bede83ff
Author: Kai Huuhko 
Date:   Sat Jan 23 15:36:10 2016 +0200

Eo: Add a private dict which can be used for callbacks etc.
---
 efl/eo/efl.eo.pyx  | 1 +
 include/efl.eo.pxd | 1 +
 2 files changed, 2 insertions(+)

diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index bd38c2f..13cf9df 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -235,6 +235,7 @@ cdef class Eo(object):
 
 def __cinit__(self):
 self.data = dict()
+self.internal_data = dict()
 
 def __init__(self, *args, **kwargs):
 if type(self) is Eo:
diff --git a/include/efl.eo.pxd b/include/efl.eo.pxd
index 6d87428..3bee06f 100644
--- a/include/efl.eo.pxd
+++ b/include/efl.eo.pxd
@@ -23,6 +23,7 @@ cdef:
 cdef:
 cEo *obj
 readonly dict data
+dict internal_data
 
 int _set_obj(self, cEo *obj) except 0
 int _set_properties_from_keyword_args(self, dict kwargs) except 0

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Elementary: Use the private internal_data dict instead of abusing user data dict

2016-01-23 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=6980ffb0e44d72c3ee4db711182de9c55828cbfd

commit 6980ffb0e44d72c3ee4db711182de9c55828cbfd
Author: Kai Huuhko 
Date:   Sat Jan 23 15:55:49 2016 +0200

Elementary: Use the private internal_data dict instead of abusing user data 
dict
---
 efl/elementary/cnp_callbacks.pxi  |  8 
 efl/elementary/gengrid_widget.pxi | 10 +-
 efl/elementary/genlist_widget.pxi | 18 +-
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/efl/elementary/cnp_callbacks.pxi b/efl/elementary/cnp_callbacks.pxi
index 8c49ae7..8e6b7e4 100644
--- a/efl/elementary/cnp_callbacks.pxi
+++ b/efl/elementary/cnp_callbacks.pxi
@@ -143,7 +143,7 @@ cdef Elm_Object_Item *py_elm_xy_item_get_cb(Evas_Object 
*obj, Evas_Coord x, Evas
 ObjectItem it
 
 try:
-ret = o.data["xy_item_get_cb"](o, x, y)
+ret = o.internal_data["xy_item_get_cb"](o, x, y)
 it, xpos1, ypos1 = ret
 except Exception:
 traceback.print_exc()
@@ -321,7 +321,7 @@ cdef void py_elm_drag_item_container_pos(
 ObjectItem item = _object_item_to_python(it)
 
 try:
-o.data["drag_item_container_pos"](o, item, x, y, xposret, yposret, 
action, data if data is not NULL else None)
+o.internal_data["drag_item_container_pos"](o, item, x, y, xposret, 
yposret, action, data if data is not NULL else None)
 except Exception:
 traceback.print_exc()
 
@@ -352,7 +352,7 @@ cdef Eina_Bool py_elm_drop_item_container_cb(
 
 evdata.sel_data = ev
 
-cb = o.data["drop_item_container_cb"]
+cb = o.internal_data["drop_item_container_cb"]
 
 if data != NULL:
 cbdata = data
@@ -434,7 +434,7 @@ cdef Eina_Bool py_elm_item_container_data_get_cb(
 bint ret
 
 try:
-func = o.data["item_container_data_get_cb"]
+func = o.internal_data["item_container_data_get_cb"]
 ret = func(o, item, pyinfo)
 except Exception:
 traceback.print_exc()
diff --git a/efl/elementary/gengrid_widget.pxi 
b/efl/elementary/gengrid_widget.pxi
index a96c35d..58e7a54 100644
--- a/efl/elementary/gengrid_widget.pxi
+++ b/efl/elementary/gengrid_widget.pxi
@@ -651,9 +651,9 @@ cdef class Gengrid(Object):
 if itemgetcb is not None:
 if not callable(itemgetcb):
 raise TypeError("itemgetcb must be callable.")
-self.data["xy_item_get_cb"] = itemgetcb
+self.internal_data["xy_item_get_cb"] = itemgetcb
 
-self.data["item_container_data_get_cb"] = data_get
+self.internal_data["item_container_data_get_cb"] = data_get
 
 if not elm_drag_item_container_add(self.obj,
 tm_to_anim,
@@ -702,10 +702,10 @@ cdef class Gengrid(Object):
 if itemgetcb is not None:
 if not callable(itemgetcb):
 raise TypeError("itemgetcb must be callable.")
-self.data["xy_item_get_cb"] = itemgetcb
+self.internal_data["xy_item_get_cb"] = itemgetcb
 
-self.data["drag_item_container_pos"] = poscb
-self.data["drop_item_container_cb"] = dropcb
+self.internal_data["drag_item_container_pos"] = poscb
+self.internal_data["drop_item_container_cb"] = dropcb
 
 if not elm_drop_item_container_add(self.obj,
 format,
diff --git a/efl/elementary/genlist_widget.pxi 
b/efl/elementary/genlist_widget.pxi
index 416678b..b558f4a 100644
--- a/efl/elementary/genlist_widget.pxi
+++ b/efl/elementary/genlist_widget.pxi
@@ -723,17 +723,17 @@ cdef class Genlist(Object):
 
 """
 def __set__(self, object key):
-self.data['__filterkeyref'] = key # keep a reference for key
+self.internal_data['__filterkeyref'] = key # keep a reference for 
key
 elm_genlist_filter_set(self.obj, key if key is not None 
else NULL)
 
 def __get__(self):
-return self.data['__filterkeyref']
+return self.internal_data['__filterkeyref']
 
 def filter_set(self, key):
-self.data['__filterkeyref'] = key
+self.internal_data['__filterkeyref'] = key
 elm_genlist_filter_set(self.obj, key if key is not None else 
NULL)
 def filter_get(self):
-return self.data['__filterkeyref']
+return self.internal_data['__filterkeyref']
 
 #
 # Drag and Drop
@@ -757,9 +757,9 @@ cdef class Genlist(Object):
 if itemgetcb is not None:
 if not callable(itemgetcb):
 raise TypeError("itemgetcb must be callable.")
-self.data["xy_item_get_cb"] = itemgetcb
+self.in

[EGIT] [bindings/python/python-efl] master 02/03: Trivial todo note updates and doc fix

2016-02-02 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=caef23bb34d2183c8d9ee611a086713f084f7ed6

commit caef23bb34d2183c8d9ee611a086713f084f7ed6
Author: Kai Huuhko 
Date:   Tue Feb 2 14:11:33 2016 +0200

Trivial todo note updates and doc fix
---
 TODO|  1 +
 efl/edje/efl.edje_edit_program.pxi  |  2 +-
 efl/elementary/fileselector.pxi |  6 +++---
 efl/elementary/gengrid_item.pxi |  4 ++--
 efl/elementary/gengrid_widget.pxi   |  2 +-
 efl/elementary/genlist_widget.pxi   |  5 ++---
 efl/elementary/map.pxi  |  1 -
 efl/elementary/multibuttonentry.pxi |  6 --
 efl/elementary/notify.pxi   |  2 +-
 efl/elementary/object.pxi   |  5 ++---
 efl/elementary/transit.pxi  | 11 ++-
 efl/elementary/web.pxi  |  2 +-
 efl/eo/efl.eo.pyx   |  2 +-
 efl/evas/efl.evas_object_image.pxi  |  2 +-
 efl/utils/conversions.pyx   |  2 +-
 include/efl.evas.pxd| 12 ++--
 16 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/TODO b/TODO
index 4e41a98..3a1396e 100644
--- a/TODO
+++ b/TODO
@@ -11,6 +11,7 @@ BUGS
 - Multibuttonentry.filter_append()
 - Multibuttonentry.filterprepend()
... maybe do like is done in genlist filter_set() ??
+* API break in 
https://git.enlightenment.org/bindings/python/python-efl.git/commit/efl/elementary/label.pyx?id=9be98bb979917932cc2850a54f6e79281c871401
 , find out if it had users anywhere, remove if not
 
 Failing unit tests
 --
diff --git a/efl/edje/efl.edje_edit_program.pxi 
b/efl/edje/efl.edje_edit_program.pxi
index 32479de..e6b3161 100644
--- a/efl/edje/efl.edje_edit_program.pxi
+++ b/efl/edje/efl.edje_edit_program.pxi
@@ -50,7 +50,7 @@ cdef class Program(object):
 def run(self):
 return bool(edje_edit_program_run(self.edje.obj, self.name))
 
-# XXX TODO: add (or better convert) all this to properties
+# TODO: add (or better convert) all this to properties
 #   like is done in Part()
 def source_get(self):
 cdef const char *s
diff --git a/efl/elementary/fileselector.pxi b/efl/elementary/fileselector.pxi
index 80ea7f6..a861bfb 100644
--- a/efl/elementary/fileselector.pxi
+++ b/efl/elementary/fileselector.pxi
@@ -351,8 +351,8 @@ cdef class Fileselector(LayoutClass):
 
 """
 cb_data = (func, data)
-# TODO: This is now a ref leak. It should be stored somewhere and
-#   deleted in the remove method.
+# FIXME: This is now a ref leak. It should be stored somewhere and
+#deleted in the remove method.
 Py_INCREF(cb_data)
 
 if isinstance(filter_name, unicode): filter_name = 
PyUnicode_AsUTF8String(filter_name)
@@ -443,7 +443,7 @@ cdef class Fileselector(LayoutClass):
 self._callback_del_full("selected", _cb_string_conv, func)
 
 #
-# FIXME: This seems to be a thing that the application should handle
+# TODO: This seems to be a thing that the application should handle
 #
 #def callback_selected_invalid_add(self, func, *args, **kwargs):
 #"""The user has tried to access a path which does not exist."""
diff --git a/efl/elementary/gengrid_item.pxi b/efl/elementary/gengrid_item.pxi
index ce4b8f4..4c7cda5 100644
--- a/efl/elementary/gengrid_item.pxi
+++ b/efl/elementary/gengrid_item.pxi
@@ -298,9 +298,9 @@ cdef class GengridItem(ObjectItem):
 elm_gengrid_item_pos_get(self.item, &x, &y)
 return (x, y)
 
-# XXX TODO elm_gengrid_item_item_class_update
+# TODO: elm_gengrid_item_item_class_update
 
-# XXX TODO elm_gengrid_item_item_class_get
+# TODO: elm_gengrid_item_item_class_get
 
 property select_mode:
 """Item's select mode. Possible values are:
diff --git a/efl/elementary/gengrid_widget.pxi 
b/efl/elementary/gengrid_widget.pxi
index 58e7a54..81ad765 100644
--- a/efl/elementary/gengrid_widget.pxi
+++ b/efl/elementary/gengrid_widget.pxi
@@ -210,7 +210,7 @@ cdef class Gengrid(Object):
 return GengridItem(item_class, item_data, func, item_data)\
   .insert_before(after_item)
 
-# XXX TODO elm_gengrid_item_sorted_insert()
+# TODO: elm_gengrid_item_sorted_insert()
 
 property selected_item:
 """This returns the selected item. If multi selection is enabled
diff --git a/efl/elementary/genlist_widget.pxi 
b/efl/elementary/genlist_widget.pxi
index b558f4a..98e28b0 100644
--- a/efl/elementary/genlist_widget.pxi
+++ b/efl/elementary/genlist_widget.pxi
@@ -256,7 +256,6 @@ cdef class Genlist(Object):
 ObjectItem parent_item=None,
 int flags=ELM_GENLIST_ITEM_NONE,
 func=None
-#API XXX: *args, **kwargs

[EGIT] [bindings/python/python-efl] master 01/03: Edje: Make ExternalParam_from_ptr a C only function

2016-02-02 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=684ad779dce9125dc8ca50f6dfb015075fb4338c

commit 684ad779dce9125dc8ca50f6dfb015075fb4338c
Author: Kai Huuhko 
Date:   Tue Feb 2 14:11:08 2016 +0200

Edje: Make ExternalParam_from_ptr a C only function
---
 efl/edje/efl.edje_edit.pyx| 2 +-
 efl/edje/efl.edje_edit_part_state.pxi | 2 +-
 efl/edje/efl.edje_external.pxi| 6 ++
 include/efl.edje.pxd  | 5 -
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/efl/edje/efl.edje_edit.pyx b/efl/edje/efl.edje_edit.pyx
index d867f14..29187dc 100644
--- a/efl/edje/efl.edje_edit.pyx
+++ b/efl/edje/efl.edje_edit.pyx
@@ -23,7 +23,7 @@ from efl.utils.conversions cimport _touni, _ctouni, \
 eina_list_strings_to_python_list
 from efl.eo cimport _register_decorated_callbacks
 from efl.evas cimport Canvas
-from efl.edje cimport Edje_Part_Type, Edje
+from efl.edje cimport Edje_Part_Type, Edje, ExternalParam_from_ptr
 from efl.edje import EDJE_PART_TYPE_EXTERNAL
 
 
diff --git a/efl/edje/efl.edje_edit_part_state.pxi 
b/efl/edje/efl.edje_edit_part_state.pxi
index 0515734..f2fac28 100644
--- a/efl/edje/efl.edje_edit_part_state.pxi
+++ b/efl/edje/efl.edje_edit_part_state.pxi
@@ -528,7 +528,7 @@ cdef class State:
 # lst = edje_edit_state_external_params_list_get(self.edje.obj, 
self.part,
 #self.name, self.value)
 # while lst:
-# p = c_edje._ExternalParam_from_ptr(lst.data)
+# p = ExternalParam_from_ptr(lst.data)
 # if p is not None:
 # ret.append(p)
 # lst = lst.next
diff --git a/efl/edje/efl.edje_external.pxi b/efl/edje/efl.edje_external.pxi
index 021c509..174f43d 100644
--- a/efl/edje/efl.edje_external.pxi
+++ b/efl/edje/efl.edje_external.pxi
@@ -78,10 +78,8 @@ cdef ExternalParam 
ExternalParam_from_ptr(Edje_External_Param *param):
 p.obj = param
 return p
 
-# XXX: this should be C-only, but it would require edje_edit
-# XXX: being able to use it.
-def _ExternalParam_from_ptr(uintptr_t ptr):
-return ExternalParam_from_ptr(ptr)
+#def _ExternalParam_from_ptr(uintptr_t ptr):
+#return ExternalParam_from_ptr(ptr)
 
 
 cdef class ExternalParamInfo:
diff --git a/include/efl.edje.pxd b/include/efl.edje.pxd
index 177f52c..c87de8b 100644
--- a/include/efl.edje.pxd
+++ b/include/efl.edje.pxd
@@ -26,7 +26,7 @@ cdef extern from "Edje.h":
 cdef int EDJE_EXTERNAL_INT_UNSET
 cdef double EDJE_EXTERNAL_DOUBLE_UNSET
 cdef unsigned int EDJE_EXTERNAL_TYPE_ABI_VERSION
-
+
 
 # Enums
 #
@@ -567,3 +567,6 @@ cdef class Edje(Object):
 cdef void message_send_int_set(self, int id, data)
 cdef void message_send_float_set(self, int id, data)
 cdef message_send_set(self, int id, data)
+
+
+cdef ExternalParam ExternalParam_from_ptr(Edje_External_Param *param)
\ No newline at end of file

-- 




[EGIT] [bindings/python/python-efl] master 03/03: Elm.MultiButtonEntry: Attempt to fix leaks, add more docs

2016-02-02 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=3661a78c96a6a264f131d5b9d344248180b68c6b

commit 3661a78c96a6a264f131d5b9d344248180b68c6b
Author: Kai Huuhko 
Date:   Tue Feb 2 20:29:21 2016 +0200

Elm.MultiButtonEntry: Attempt to fix leaks, add more docs
---
 efl/elementary/multibuttonentry.pxi  | 150 +--
 efl/elementary/multibuttonentry_cdef.pxi |   4 +-
 examples/elementary/test_multibuttonentry.py |  46 +---
 3 files changed, 153 insertions(+), 47 deletions(-)

diff --git a/efl/elementary/multibuttonentry.pxi 
b/efl/elementary/multibuttonentry.pxi
index aa874bc..13c28e3 100644
--- a/efl/elementary/multibuttonentry.pxi
+++ b/efl/elementary/multibuttonentry.pxi
@@ -18,24 +18,51 @@
 
 include "multibuttonentry_cdef.pxi"
 
+class MultiButtonEntryFilterOut(Exception):
+"""An exception you may raise in an item filter callback if you wish to 
prevent addition of the item"""
+pass
+
 cdef Eina_Bool _multibuttonentry_filter_callback(Evas_Object *obj, \
-const char *item_label, void *item_data, void *data) with gil:
+char *item_label, void *item_data, void *data) with gil:
 
 cdef:
 MultiButtonEntry mbe = object_from_instance(obj)
-bint ret
-
-(callback, a, ka) = data
-
-try:
-ret = callback(mbe, _ctouni(item_label), *a, **ka)
-except Exception:
-traceback.print_exc()
-
-return ret
+object ret
+list callbacks = mbe._item_filters
+
+for func, args, kargs in callbacks:
+try:
+# raise MultiButtonEntryFilterOut -> cancels item add
+# ret is None -> no change, continue to next filter
+# ret is not None -> change label to value of ret, continue to 
next filter
+ret = func(mbe, _ctouni(item_label), *args, **kargs)
+except MultiButtonEntryFilterOut:
+#free(item_label) # FIXME: This will result in a double free, find 
out if it's bad elm documentation
+  #or wrong ref handling on our side.
+
+#item_label = NULL
+return 0
+except Exception:
+traceback.print_exc()
+continue
+
+if ret:
+if not isinstance(ret, basestring):
+EINA_LOG_DOM_WARN(PY_EFL_ELM_LOG_DOMAIN,
+"Ignoring invalid return value from MultiButtonEntry item 
filter callback!", NULL)
+continue
+if isinstance(ret, unicode): ret = PyUnicode_AsUTF8String(ret)
+#free(item_label) # FIXME: This will result in a double free, find 
out if it's bad elm documentation
+  #or wrong ref handling on our side.
+
+item_label = strdup(ret) # Elm will manage the string
+ # FIXME: This doesn't apply, why?
+
+return 1
 
 cdef char * _multibuttonentry_format_cb(int count, void *data) with gil:
-(callback, a, ka) = data
+cdef MultiButtonEntry obj = data
+(callback, a, ka) = obj.internal_data["multibuttonentry_format_cb"]
 
 try:
 s = callback(count, *a, **ka)
@@ -44,8 +71,7 @@ cdef char * _multibuttonentry_format_cb(int count, void 
*data) with gil:
 traceback.print_exc()
 return NULL
 
-# FIXME: leak here
-return strdup(s)
+return strdup(s) # Elm will manage the string
 
 
 cdef class MultiButtonEntryItem(ObjectItem):
@@ -198,6 +224,8 @@ cdef class MultiButtonEntry(Object):
 
 """
 
+cdef list _item_filters
+
 def __init__(self, evasObject parent, *args, **kwargs):
 """MultiButtonEntry(...)
 
@@ -213,6 +241,7 @@ cdef class MultiButtonEntry(Object):
 _py_elm_mbe_item_added_cb, NULL
 )
 self._set_properties_from_keyword_args(kwargs)
+self._item_filters = list()
 
 property entry:
 """The Entry object child of the multibuttonentry.
@@ -227,7 +256,10 @@ cdef class MultiButtonEntry(Object):
 return object_from_instance(elm_multibuttonentry_entry_get(self.obj))
 
 property expanded:
-"""The expanded state of the multibuttonentry.
+"""Control the multibuttonentry to expanded state.
+
+In expanded state, the complete entry will be displayed.
+Otherwise, only single line of the entry will be displayed.
 
 :type: bool
 
@@ -342,6 +374,11 @@ cdef class MultiButtonEntry(Object):
 return None
 
 property items:
+"""List of items in the multibuttonentry
+
+:type: list
+
+"""
 def __get__(self):
 return 
_object_item_list_to_python(elm_multibuttonentry_items_get(self.obj))
 
@@ -349,6 +386,11 @@ cdef class MultiButtonEntry(Object):
 

[EGIT] [bindings/python/python-efl] master 01/01: Elm.MultiButtonEntry: Fix filter callback

2016-02-02 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=523fe8ad4dc3e271586ade9972faec24a69e0a2c

commit 523fe8ad4dc3e271586ade9972faec24a69e0a2c
Author: Kai Huuhko 
Date:   Tue Feb 2 21:23:02 2016 +0200

Elm.MultiButtonEntry: Fix filter callback
---
 efl/elementary/multibuttonentry.pxi  | 31 ++--
 efl/elementary/multibuttonentry_cdef.pxi |  2 +-
 examples/elementary/test_multibuttonentry.py | 15 +++---
 3 files changed, 14 insertions(+), 34 deletions(-)

diff --git a/efl/elementary/multibuttonentry.pxi 
b/efl/elementary/multibuttonentry.pxi
index 13c28e3..8c6e272 100644
--- a/efl/elementary/multibuttonentry.pxi
+++ b/efl/elementary/multibuttonentry.pxi
@@ -18,45 +18,26 @@
 
 include "multibuttonentry_cdef.pxi"
 
-class MultiButtonEntryFilterOut(Exception):
-"""An exception you may raise in an item filter callback if you wish to 
prevent addition of the item"""
-pass
-
 cdef Eina_Bool _multibuttonentry_filter_callback(Evas_Object *obj, \
-char *item_label, void *item_data, void *data) with gil:
+const char *item_label, void *item_data, void *data) with gil:
 
 cdef:
 MultiButtonEntry mbe = object_from_instance(obj)
-object ret
+bint ret
 list callbacks = mbe._item_filters
 
 for func, args, kargs in callbacks:
 try:
-# raise MultiButtonEntryFilterOut -> cancels item add
-# ret is None -> no change, continue to next filter
-# ret is not None -> change label to value of ret, continue to 
next filter
 ret = func(mbe, _ctouni(item_label), *args, **kargs)
-except MultiButtonEntryFilterOut:
-#free(item_label) # FIXME: This will result in a double free, find 
out if it's bad elm documentation
-  #or wrong ref handling on our side.
-
-#item_label = NULL
-return 0
 except Exception:
 traceback.print_exc()
 continue
 
 if ret:
-if not isinstance(ret, basestring):
-EINA_LOG_DOM_WARN(PY_EFL_ELM_LOG_DOMAIN,
-"Ignoring invalid return value from MultiButtonEntry item 
filter callback!", NULL)
-continue
-if isinstance(ret, unicode): ret = PyUnicode_AsUTF8String(ret)
-#free(item_label) # FIXME: This will result in a double free, find 
out if it's bad elm documentation
-  #or wrong ref handling on our side.
-
-item_label = strdup(ret) # Elm will manage the string
- # FIXME: This doesn't apply, why?
+continue
+else:
+return 0 # This emulates the behavior of C code where callbacks
+ # are iterated until EINA_FALSE is returned by user
 
 return 1
 
diff --git a/efl/elementary/multibuttonentry_cdef.pxi 
b/efl/elementary/multibuttonentry_cdef.pxi
index 5b2aa34..f8b8218 100644
--- a/efl/elementary/multibuttonentry_cdef.pxi
+++ b/efl/elementary/multibuttonentry_cdef.pxi
@@ -1,6 +1,6 @@
 cdef extern from "Elementary.h":
 
-ctypedef Eina_Bool (*Elm_Multibuttonentry_Item_Filter_Cb)(Evas_Object 
*obj, char *item_label, void *item_data, void *data)
+ctypedef Eina_Bool (*Elm_Multibuttonentry_Item_Filter_Cb)(Evas_Object 
*obj, const char *item_label, void *item_data, void *data)
 ctypedef char * (*Elm_Multibuttonentry_Format_Cb)(int count, void *data)
 
 Evas_Object *elm_multibuttonentry_add(Evas_Object *parent)
diff --git a/examples/elementary/test_multibuttonentry.py 
b/examples/elementary/test_multibuttonentry.py
index 989598f..59681c4 100644
--- a/examples/elementary/test_multibuttonentry.py
+++ b/examples/elementary/test_multibuttonentry.py
@@ -6,7 +6,7 @@ from efl import elementary
 from efl.elementary import StandardWindow
 from efl.elementary import Box
 from efl.elementary import Button
-from efl.elementary import MultiButtonEntry, MultiButtonEntryFilterOut
+from efl.elementary import MultiButtonEntry
 from efl.elementary import Scroller, ELM_SCROLLER_POLICY_OFF, 
ELM_SCROLLER_POLICY_AUTO
 
 SCROLL_POLICY_VERT = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO
@@ -55,13 +55,13 @@ def cb_btn_clear2(btn, mbe):
 
 def cb_filter1(mbe, text):
 print(text)
+return True
 
 def cb_filter2(mbe, text):
-return text[:-2]
-
-def cb_filter3(mbe, text):
-print(text)
-#raise MultiButtonEntryFilterOut
+if text == "nope":
+return False
+else:
+return True
 
 def cb_print(btn, mbe):
 for i in mbe.items:
@@ -86,10 +86,9 @@ def multibuttonentry_clicked(obj, item=None):
 mbe.callback_item_selected_add(cb_item_selected)
 mbe.callback_item_clicked_add(cb_item_clicked)
 mbe.callback_item_longpressed_add(cb_item_long

[EGIT] [bindings/python/python-efl] master 01/02: Clean up cruft code

2016-02-02 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=fc987411daab68c60aa66c6ad3574426e3578ed4

commit fc987411daab68c60aa66c6ad3574426e3578ed4
Author: Kai Huuhko 
Date:   Tue Feb 2 21:37:02 2016 +0200

Clean up cruft code
---
 efl/edje/efl.edje_external.pxi |  3 ---
 efl/elementary/label.pxi   | 21 -
 2 files changed, 24 deletions(-)

diff --git a/efl/edje/efl.edje_external.pxi b/efl/edje/efl.edje_external.pxi
index 174f43d..564c414 100644
--- a/efl/edje/efl.edje_external.pxi
+++ b/efl/edje/efl.edje_external.pxi
@@ -78,9 +78,6 @@ cdef ExternalParam ExternalParam_from_ptr(Edje_External_Param 
*param):
 p.obj = param
 return p
 
-#def _ExternalParam_from_ptr(uintptr_t ptr):
-#return ExternalParam_from_ptr(ptr)
-
 
 cdef class ExternalParamInfo:
 property name:
diff --git a/efl/elementary/label.pxi b/efl/elementary/label.pxi
index 34cf742..3023e47 100644
--- a/efl/elementary/label.pxi
+++ b/efl/elementary/label.pxi
@@ -100,27 +100,6 @@ cdef class Label(LayoutClass):
 def ellipsis_get(self):
 return elm_label_ellipsis_get(self.obj)
 
-# FIXME: Why was this commented out???
-# property slide:
-# """
-#
-# .. deprecated:: 1.8
-# Use :py:attr:`slide_mode` instead.
-#
-# """
-# def __get__(self):
-# return self.slide_get()
-#
-# def __set__(self, slide):
-# self.slide_set(True if slide else False)
-#
-# @DEPRECATED("1.8", "Use :py:attr:`slide_mode` instead.")
-# def slide_set(self, bint slide):
-# elm_label_slide_mode_set(self.obj, 2 if slide else 0)
-# @DEPRECATED("1.8", "Use :py:attr:`slide_mode` instead.")
-# def slide_get(self):
-# return bool(elm_label_slide_mode_get(self.obj))
-
 property slide_duration:
 """The duration time in moving text from slide begin position to
 slide end position

-- 




[EGIT] [bindings/python/python-efl] master 02/02: Elm.FileSelector: Fix ref leak

2016-02-02 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=1189e17fe0cd159190ebb6ae9b7a7f3dc9caee0b

commit 1189e17fe0cd159190ebb6ae9b7a7f3dc9caee0b
Author: Kai Huuhko 
Date:   Tue Feb 2 21:41:37 2016 +0200

Elm.FileSelector: Fix ref leak
---
 efl/elementary/fileselector.pxi | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/efl/elementary/fileselector.pxi b/efl/elementary/fileselector.pxi
index a861bfb..77ef2d7 100644
--- a/efl/elementary/fileselector.pxi
+++ b/efl/elementary/fileselector.pxi
@@ -34,6 +34,8 @@ cdef class Fileselector(LayoutClass):
 
 """
 
+cdef list _custom_filters
+
 def __init__(self, evasObject parent, *args, **kwargs):
 """Fileselector(...)
 
@@ -45,6 +47,7 @@ cdef class Fileselector(LayoutClass):
 """
 self._set_obj(elm_fileselector_add(parent.obj))
 self._set_properties_from_keyword_args(kwargs)
+self._custom_filters = list()
 
 property is_save:
 """Enable/disable the file name entry box where the user can type
@@ -351,9 +354,7 @@ cdef class Fileselector(LayoutClass):
 
 """
 cb_data = (func, data)
-# FIXME: This is now a ref leak. It should be stored somewhere and
-#deleted in the remove method.
-Py_INCREF(cb_data)
+self._custom_filters.append(cb_data)
 
 if isinstance(filter_name, unicode): filter_name = 
PyUnicode_AsUTF8String(filter_name)
 elm_fileselector_custom_filter_append(self.obj,
@@ -373,6 +374,7 @@ cdef class Fileselector(LayoutClass):
 .. versionadded:: 1.8
 
 """
+del self._custom_filters[:]
 elm_fileselector_filters_clear(self.obj)
 
 property hidden_visible:

-- 




[EGIT] [bindings/python/python-efl] master 01/03: Elm.MultiButtonEntry: Correct documentation

2016-02-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=ba7bf818d88d3331781b055622842ef4a3943d7d

commit ba7bf818d88d3331781b055622842ef4a3943d7d
Author: Kai Huuhko 
Date:   Wed Feb 3 11:05:31 2016 +0200

Elm.MultiButtonEntry: Correct documentation
---
 efl/elementary/multibuttonentry.pxi | 92 +++--
 1 file changed, 78 insertions(+), 14 deletions(-)

diff --git a/efl/elementary/multibuttonentry.pxi 
b/efl/elementary/multibuttonentry.pxi
index 8c6e272..56e5329 100644
--- a/efl/elementary/multibuttonentry.pxi
+++ b/efl/elementary/multibuttonentry.pxi
@@ -163,6 +163,11 @@ cdef class MultiButtonEntryItem(ObjectItem):
 return self
 
 property selected:
+"""Control the selected state of an item
+
+:type: bool
+
+"""
 def __get__(self):
 return bool(elm_multibuttonentry_item_selected_get(self.item))
 
@@ -175,6 +180,11 @@ cdef class MultiButtonEntryItem(ObjectItem):
 return bool(elm_multibuttonentry_item_selected_get(self.item))
 
 property prev:
+"""Get the previous item in the multibuttonentry
+
+:type: :class:`MultiButtonEntryItem`
+
+"""
 def __get__(self):
 return 
_object_item_to_python(elm_multibuttonentry_item_prev_get(self.item))
 
@@ -182,6 +192,11 @@ cdef class MultiButtonEntryItem(ObjectItem):
 return 
_object_item_to_python(elm_multibuttonentry_item_prev_get(self.item))
 
 property next:
+"""Get the next item in the multibuttonentry
+
+:type: :class:`MultiButtonEntryItem`
+
+"""
 def __get__(self):
 return 
_object_item_to_python(elm_multibuttonentry_item_next_get(self.item))
 
@@ -239,8 +254,11 @@ cdef class MultiButtonEntry(Object):
 property expanded:
 """Control the multibuttonentry to expanded state.
 
-In expanded state, the complete entry will be displayed.
-Otherwise, only single line of the entry will be displayed.
+In expanded state the entry widget expands to accommodate all items.
+Otherwise a single line of items will be displayed with a counter for
+items that don't fit the line.
+
+.. seealso:: :meth:`format_function_set`
 
 :type: bool
 
@@ -257,6 +275,16 @@ cdef class MultiButtonEntry(Object):
 return bool(elm_multibuttonentry_expanded_get(self.obj))
 
 def item_prepend(self, label, func = None, *args, **kwargs):
+"""Prepend a new item to the multibuttonentry
+
+:param string label: The label of new item
+:param func: The callback function to be invoked when this item is 
pressed.
+:param \*args: The data to be attached for callback
+:param \*\*kwargs: The data to be attached for callback
+
+:return: :class:`MultiButtonEntryItem`
+
+"""
 cdef:
 Elm_Object_Item *item
 Evas_Smart_Cb cb = NULL
@@ -281,6 +309,16 @@ cdef class MultiButtonEntry(Object):
 return None
 
 def item_append(self, label, func = None, *args, **kwargs):
+"""Append a new item to the multibuttonentry
+
+:param string label: The label of new item
+:param func: The callback function to be invoked when this item is 
pressed.
+:param \*args: The data to be attached for callback
+:param \*\*kwargs: The data to be attached for callback
+
+:return: :class:`MultiButtonEntryItem`
+
+"""
 cdef:
 Elm_Object_Item *item
 Evas_Smart_Cb cb = NULL
@@ -305,6 +343,17 @@ cdef class MultiButtonEntry(Object):
 return None
 
 def item_insert_before(self, MultiButtonEntryItem before, label, func = 
None, *args, **kwargs):
+"""Add a new item to the multibuttonentry before the indicated object
+
+:param MultiButtonEntryItem before: The item before which to add it
+:param string label: The label of new item
+:param func: The callback function to be invoked when this item is 
pressed.
+:param \*args: The data to be attached for callback
+:param \*\*kwargs: The data to be attached for callback
+
+:return: :class:`MultiButtonEntryItem`
+
+"""
 cdef:
 Elm_Object_Item *item
 Evas_Smart_Cb cb = NULL
@@ -330,6 +379,17 @@ cdef class MultiButtonEntry(Object):
 return None
 
 def item_insert_after(self, MultiButtonEntryItem after, label, func = 
None, *args, **kwargs):
+"""Add a new item to the multibuttonentry after the indicated object
+
+:param MultiButtonEntryItem before: The item after which to add it
+:param string label: The label of new item
+:param

[EGIT] [bindings/python/python-efl] master 03/03: Update TODO

2016-02-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=9a3d441f1c5a7bdf13d95af53062991bc8a0e009

commit 9a3d441f1c5a7bdf13d95af53062991bc8a0e009
Author: Kai Huuhko 
Date:   Wed Feb 3 11:08:39 2016 +0200

Update TODO
---
 TODO | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/TODO b/TODO
index 3a1396e..52d63a4 100644
--- a/TODO
+++ b/TODO
@@ -3,15 +3,7 @@ BUGS
 
 * EdjeEdit: PartState API does not work
 * Elm.Map: overlays_show segfaults, scrollers in examples are jumpy
-* Genlist: "filter,done" event is not always fired (see the genlist_filter.py 
test)
-* Elementary: when we use custom function callbacks we usually leak some
-reference around, some examples:
-- Fileselector.custom_filter_append()
-- Multibuttonentry.format_function_set()
-- Multibuttonentry.filter_append()
-- Multibuttonentry.filterprepend()
-   ... maybe do like is done in genlist filter_set() ??
-* API break in 
https://git.enlightenment.org/bindings/python/python-efl.git/commit/efl/elementary/label.pyx?id=9be98bb979917932cc2850a54f6e79281c871401
 , find out if it had users anywhere, remove if not
+* Genlist: "filter,done" event is sometimes fired before filter callbacks are 
done (see the genlist_filter.py test)
 
 Failing unit tests
 --
@@ -32,7 +24,6 @@ TODO
 
 Elm
 ---
-* Drag-n-Drop
 * Automate compilation of the example edje files.
 * Add more examples
 * Prefs (only supports simple types, not so great for us)

-- 




[EGIT] [bindings/python/python-efl] master 02/03: Elm.Genlist: Add small optimizations for filter and state cbs

2016-02-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=d5656fdd3d2abc7e8a1503ecebd915dce819c588

commit d5656fdd3d2abc7e8a1503ecebd915dce819c588
Author: Kai Huuhko 
Date:   Wed Feb 3 11:07:27 2016 +0200

Elm.Genlist: Add small optimizations for filter and state cbs
---
 efl/elementary/genlist.pxi | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/efl/elementary/genlist.pxi b/efl/elementary/genlist.pxi
index d395297..2a2d78f 100644
--- a/efl/elementary/genlist.pxi
+++ b/efl/elementary/genlist.pxi
@@ -66,6 +66,8 @@ cdef Eina_Bool _py_elm_genlist_item_state_get(void *data, 
Evas_Object *obj, cons
 cdef:
 GenlistItem item = data
 unicode u = _ctouni(part)
+bint ret
+Genlist o
 
 func = item.item_class._state_get_func
 if func is None:
@@ -78,12 +80,14 @@ cdef Eina_Bool _py_elm_genlist_item_state_get(void *data, 
Evas_Object *obj, cons
 traceback.print_exc()
 return 0
 
-return ret if ret is not None else 0
+return ret
 
 cdef Eina_Bool _py_elm_genlist_item_filter_get(void *data, Evas_Object *obj, 
void *key) with gil:
 cdef:
 GenlistItem item = data
 object pykey = key
+bint ret
+Genlist o
 
 func = item.item_class._filter_get_func
 if func is None:
@@ -96,7 +100,7 @@ cdef Eina_Bool _py_elm_genlist_item_filter_get(void *data, 
Evas_Object *obj, voi
 traceback.print_exc()
 return 0
 
-return 1 if ret else 0
+return ret
 
 cdef void _py_elm_genlist_object_item_del(void *data, Evas_Object *obj) with 
gil:
 cdef GenlistItem item = data

-- 




[EGIT] [enlightenment/modules/edgar] master 01/01: Remove explicit link to elm

2015-04-08 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/enlightenment/modules/edgar.git/commit/?id=3133ede876345abe372920f310f66b7f155f0c2b

commit 3133ede876345abe372920f310f66b7f155f0c2b
Author: Kai Huuhko 
Date:   Wed Apr 8 23:48:30 2015 +0300

Remove explicit link to elm

Not needed with >=e18
---
 configure.ac | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 1c8af96..458a053 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,6 @@ PKG_CHECK_MODULES(E,
 
 # Explicit link to Eo
 PKG_CHECK_MODULES(EO, [eo])
-PKG_CHECK_MODULES(ELEMENTARY, [elementary])
 
 # Check for python3 and required modules
 # PKG_CHECK_MODULES(PYTHON3, [python3 >= 3.2])

-- 




[EGIT] [bindings/python/python-efl] master 01/02: Elm: Handle init and shutdown inside the module

2015-04-14 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=75f3f3b70a49072caa2e697dce30c0ecaa73552a

commit 75f3f3b70a49072caa2e697dce30c0ecaa73552a
Author: Kai Huuhko 
Date:   Wed Apr 15 00:12:03 2015 +0300

Elm: Handle init and shutdown inside the module
---
 efl/elementary/general.pyx | 114 -
 1 file changed, 61 insertions(+), 53 deletions(-)

diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index 42bea89..0ba4467 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -262,6 +262,67 @@ from efl.elementary.need cimport elm_need_sys_notify
 
 import sys
 import traceback
+import atexit
+
+
+elm_log = add_logger("efl.elementary")
+cdef int PY_EFL_ELM_LOG_DOMAIN = elm_log.eina_log_domain
+
+def init():
+"""Initialize Elementary
+
+:return int: The init counter value.
+
+This function initializes Elementary and increments a counter of the number
+of calls to it. It returns the new counter's value.
+
+"""
+EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
+"Initializing efl.elementary", NULL)
+
+# FIXME: Why are we passing the cl args to elm_init here?
+
+cdef:
+int argc, i, arg_len
+char **argv
+char *arg
+
+argc = len(sys.argv)
+argv = PyMem_Malloc(argc * sizeof(char *))
+for i in range(argc):
+t = sys.argv[i]
+if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
+arg = t
+arg_len = len(arg)
+argv[i] = PyMem_Malloc(arg_len + 1)
+memcpy(argv[i], arg, arg_len + 1)
+
+return elm_init(argc, argv)
+
+def shutdown():
+"""Shut down Elementary
+
+:return int: The init counter value.
+
+This should be called at the end of your application, just before it ceases
+to do any more processing. This will clean up any permanent resources your
+application may have allocated via Elementary that would otherwise persist.
+
+.. note::
+
+shutdown() will iterate main loop until all ecore_evas are freed. There
+is a possibility to call your ecore callbacks(timer, animator, event,
+job, and etc.) in shutdown()
+
+"""
+EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
+"Shutting down efl.elementary", NULL)
+return elm_shutdown()
+
+
+init()
+atexit.register(shutdown)
+
 
 cdef void py_elm_sys_notify_send_cb(void *data, unsigned int id):
 cdef object func, func_data
@@ -378,59 +439,6 @@ cdef class FontProperties(object):
 def __get__(self):
 return eina_list_strings_to_python_list(self.efp.styles)
 
-elm_log = add_logger("efl.elementary")
-cdef int PY_EFL_ELM_LOG_DOMAIN = elm_log.eina_log_domain
-
-def init():
-"""Initialize Elementary
-
-:return int: The init counter value.
-
-This function initializes Elementary and increments a counter of the number
-of calls to it. It returns the new counter's value.
-
-"""
-EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
-"Initializing efl.elementary", NULL)
-
-# FIXME: Why are we passing the cl args to elm_init here?
-
-cdef:
-int argc, i, arg_len
-char **argv
-char *arg
-
-argc = len(sys.argv)
-argv = PyMem_Malloc(argc * sizeof(char *))
-for i in range(argc):
-t = sys.argv[i]
-if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
-arg = t
-arg_len = len(arg)
-argv[i] = PyMem_Malloc(arg_len + 1)
-memcpy(argv[i], arg, arg_len + 1)
-
-return elm_init(argc, argv)
-
-def shutdown():
-"""Shut down Elementary
-
-:return int: The init counter value.
-
-This should be called at the end of your application, just before it ceases
-to do any more processing. This will clean up any permanent resources your
-application may have allocated via Elementary that would otherwise persist.
-
-.. note::
-
-shutdown() will iterate main loop until all ecore_evas are freed. There
-is a possibility to call your ecore callbacks(timer, animator, event,
-job, and etc.) in shutdown()
-
-"""
-EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
-"Shutting down efl.elementary", NULL)
-return elm_shutdown()
 
 def run():
 """Run Elementary's main loop

-- 




[EGIT] [bindings/python/python-efl] master 02/02: Elm: Add ecore events defined in elm_general.h

2015-04-14 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=278fe321107aa6d37e9a14ec957ed2360e09a69f

commit 278fe321107aa6d37e9a14ec957ed2360e09a69f
Author: Kai Huuhko 
Date:   Wed Apr 15 00:15:59 2015 +0300

Elm: Add ecore events defined in elm_general.h
---
 efl/elementary/general.pxd |  11 +++
 efl/elementary/general.pyx | 102 +
 examples/elementary/test.py|   2 +
 .../elementary/test_core_ecore_events_in_elm.py|  85 +
 4 files changed, 200 insertions(+)

diff --git a/efl/elementary/general.pxd b/efl/elementary/general.pxd
index 8145036..63b653d 100644
--- a/efl/elementary/general.pxd
+++ b/efl/elementary/general.pxd
@@ -46,6 +46,11 @@ cdef extern from "Elementary.h":
 
 #define
 cpdef enum:
+ELM_ECORE_EVENT_ETHUMB_CONNECT
+ELM_EVENT_CONFIG_ALL_CHANGED
+ELM_EVENT_POLICY_CHANGED
+ELM_EVENT_PROCESS_BACKGROUND
+ELM_EVENT_PROCESS_FOREGROUND
 ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED
 ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED
 
@@ -140,6 +145,12 @@ cdef extern from "Elementary.h":
 ctypedef Evas_Object *  (*Elm_Tooltip_Item_Content_Cb)  (void *data, 
Evas_Object *obj, Evas_Object *tooltip, void *item)
 
 # General
+struct _Elm_Event_Policy_Changed:
+unsigned int policy # the policy identifier
+int  new_value # value the policy had before the change
+int  old_value # new value the policy got
+ctypedef _Elm_Event_Policy_Changed Elm_Event_Policy_Changed
+
 int elm_init(int argc, char** argv)
 int elm_shutdown()
 voidelm_run() nogil
diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index 0ba4467..12e2ae6 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -333,6 +333,7 @@ cdef void py_elm_sys_notify_send_cb(void *data, unsigned 
int id):
 except Exception:
 traceback.print_exc()
 
+
 cdef class SysNotifyNotificationClosed(Event):
 
 cdef Elm_Sys_Notify_Notification_Closed *obj
@@ -364,6 +365,7 @@ cdef class SysNotifyNotificationClosed(Event):
 def __get__(self):
 return self.obj.reason
 
+
 cdef class SysNotifyActionInvoked(Event):
 
 cdef Elm_Sys_Notify_Action_Invoked *obj
@@ -395,6 +397,104 @@ cdef class SysNotifyActionInvoked(Event):
 def __get__(self):
 return _touni(self.obj.action_key)
 
+
+cdef class EthumbConnect(Event):
+cdef int _set_obj(self, void *o) except 0:
+return 1
+
+def __repr__(self):
+return "<%s()>" % (self.__class__.__name__,)
+
+_event_mapping_register(ELM_ECORE_EVENT_ETHUMB_CONNECT, EthumbConnect)
+
+def on_ethumb_connect(func, *args, **kwargs):
+"""Use this to set a handler for the ethumb connect event."""
+return EventHandler(ELM_ECORE_EVENT_ETHUMB_CONNECT, func, *args, **kwargs)
+
+
+cdef class ConfigAllChanged(Event):
+cdef int _set_obj(self, void *o) except 0:
+return 1
+
+def __repr__(self):
+return "<%s()>" % (self.__class__.__name__,)
+
+_event_mapping_register(ELM_EVENT_CONFIG_ALL_CHANGED, ConfigAllChanged)
+
+def on_config_all_changed(func, *args, **kwargs):
+"""Use this to set a handler for the config all changed event.
+
+Emitted when the application has reconfigured elementary settings due to an
+external configuration tool asking it to.
+"""
+return EventHandler(ELM_EVENT_CONFIG_ALL_CHANGED, func, *args, **kwargs)
+
+
+cdef class PolicyChanged(Event):
+
+cdef:
+public unsigned int policy
+public int new_value
+public int old_value
+
+cdef int _set_obj(self, void *o) except 0:
+cdef Elm_Event_Policy_Changed *obj
+obj = o
+self.policy = obj.policy
+self.new_value = obj.new_value
+self.old_value = obj.old_value
+return 1
+
+def __repr__(self):
+return "<%s(policy=%d, new_value=%d, old_value=%d)>" % (
+self.__class__.__name__,
+self.policy, self.new_value, self.old_value)
+
+_event_mapping_register(ELM_EVENT_POLICY_CHANGED, PolicyChanged)
+
+def on_policy_changed(func, *args, **kwargs):
+"""Use this to set a handler for the policy changed event.
+
+Emitted when any Elementary's policy value is changed."""
+return EventHandler(ELM_EVENT_POLICY_CHANGED, func, *args, **kwargs)
+
+
+cdef class ProcessBackground(Event):
+cdef int _set_obj(self, void *o) except 0:
+return 1
+
+def __repr__(self):
+return "<%s()>" % (self.__class__.__name__,)
+
+_event_mapping_register(ELM_EVENT_PROCESS_BACKGROUND, ProcessBackground)
+
+def on_process

[EGIT] [bindings/python/python-efl] master 03/03: Elm: Add forgotten versionadded

2015-04-14 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=1d5ae5fbc9d06a7c3f2f2e299daa8d4f2a2ed1eb

commit 1d5ae5fbc9d06a7c3f2f2e299daa8d4f2a2ed1eb
Author: Kai Huuhko 
Date:   Wed Apr 15 00:37:50 2015 +0300

Elm: Add forgotten versionadded
---
 efl/elementary/general.pyx | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index 301d0d7..4b1fa2c 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -452,7 +452,10 @@ cdef class EthumbConnect(Event):
 _event_mapping_register(ELM_ECORE_EVENT_ETHUMB_CONNECT, EthumbConnect)
 
 def on_ethumb_connect(func, *args, **kwargs):
-"""Use this to set a handler for the ethumb connect event."""
+"""Use this to set a handler for the ethumb connect event.
+
+.. versionadded:: 1.14
+"""
 return EventHandler(ELM_ECORE_EVENT_ETHUMB_CONNECT, func, *args, **kwargs)
 
 
@@ -470,6 +473,8 @@ def on_config_all_changed(func, *args, **kwargs):
 
 Emitted when the application has reconfigured elementary settings due to an
 external configuration tool asking it to.
+
+.. versionadded:: 1.14
 """
 return EventHandler(ELM_EVENT_CONFIG_ALL_CHANGED, func, *args, **kwargs)
 
@@ -499,7 +504,10 @@ _event_mapping_register(ELM_EVENT_POLICY_CHANGED, 
PolicyChanged)
 def on_policy_changed(func, *args, **kwargs):
 """Use this to set a handler for the policy changed event.
 
-Emitted when any Elementary's policy value is changed."""
+Emitted when any Elementary's policy value is changed.
+
+.. versionadded:: 1.14
+"""
 return EventHandler(ELM_EVENT_POLICY_CHANGED, func, *args, **kwargs)
 
 
@@ -517,6 +525,8 @@ def on_process_background(func, *args, **kwargs):
 
 Emitted when nothing is visible and the process as a whole should go into a
 background state.
+
+.. versionadded:: 1.14
 """
 return EventHandler(ELM_EVENT_PROCESS_BACKGROUND, func, *args, **kwargs)
 
@@ -535,6 +545,8 @@ def on_process_background(func, *args, **kwargs):
 
 Emitted when going from nothing being visible to at least one window being
 visible.
+
+.. versionadded:: 1.14
 """
 return EventHandler(ELM_EVENT_PROCESS_FOREGROUND, func, *args, **kwargs)
 

-- 




[EGIT] [bindings/python/python-efl] master 01/03: Elm: Add object layer enums

2015-04-14 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=0c170c5bb322ae33c981edb046043c9b411fb10e

commit 0c170c5bb322ae33c981edb046043c9b411fb10e
Author: Kai Huuhko 
Date:   Wed Apr 15 00:33:47 2015 +0300

Elm: Add object layer enums
---
 efl/elementary/general.pxd | 10 ++
 efl/elementary/general.pyx | 32 
 2 files changed, 42 insertions(+)

diff --git a/efl/elementary/general.pxd b/efl/elementary/general.pxd
index 63b653d..e38bcb0 100644
--- a/efl/elementary/general.pxd
+++ b/efl/elementary/general.pxd
@@ -55,6 +55,16 @@ cdef extern from "Elementary.h":
 ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED
 
 #enums
+cpdef enum Elm_Object_Layer:
+ELM_OBJECT_LAYER_BACKGROUND # where to place backgrounds
+ELM_OBJECT_LAYER_DEFAULT # Evas_Object default layer (and thus for 
Elementary)
+ELM_OBJECT_LAYER_FOCUS # where focus object visualization is
+ELM_OBJECT_LAYER_TOOLTIP # where to show tooltips
+ELM_OBJECT_LAYER_CURSOR # where to show cursors
+ELM_OBJECT_LAYER_LAST # last layer known by Elementary
+ctypedef enum Elm_Object_Layer:
+pass
+
 cpdef enum Elm_Policy:
 ELM_POLICY_QUIT
 ELM_POLICY_EXIT
diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index 12e2ae6..8795e56 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -52,6 +52,38 @@ Different profiles may have pre-set values for finger sizes.
 Enumerations
 
 
+.. _Elm_Object_Layer:
+
+Object layers
+-
+
+.. versionadded:: 1.14
+
+.. data:: ELM_OBJECT_LAYER_BACKGROUND
+
+where to place backgrounds
+
+.. data:: ELM_OBJECT_LAYER_DEFAULT
+
+Evas_Object default layer (and thus for Elementary)
+
+.. data:: ELM_OBJECT_LAYER_FOCUS
+
+where focus object visualization is
+
+.. data:: ELM_OBJECT_LAYER_TOOLTIP
+
+where to show tooltips
+
+.. data:: ELM_OBJECT_LAYER_CURSOR
+
+where to show cursors
+
+.. data:: ELM_OBJECT_LAYER_LAST
+
+last layer known by Elementary
+
+
 .. _Elm_Policy:
 
 Policy types

-- 




[EGIT] [bindings/python/python-efl] master 02/03: Elm: Clarify init/shutdown change

2015-04-14 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=144e28a2306377fa88a42938973fbf077c601186

commit 144e28a2306377fa88a42938973fbf077c601186
Author: Kai Huuhko 
Date:   Wed Apr 15 00:35:30 2015 +0300

Elm: Clarify init/shutdown change

With docs and test logging
---
 efl/elementary/general.pyx  | 12 
 examples/elementary/test.py |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index 8795e56..301d0d7 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -308,6 +308,12 @@ def init():
 This function initializes Elementary and increments a counter of the number
 of calls to it. It returns the new counter's value.
 
+.. versionchanged:: 1.14
+
+The Python module calls this function when it is imported so you
+should no longer have any need to call this manually. Calling it does
+not carry any penalty though.
+
 """
 EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
 "Initializing efl.elementary", NULL)
@@ -346,6 +352,12 @@ def shutdown():
 is a possibility to call your ecore callbacks(timer, animator, event,
 job, and etc.) in shutdown()
 
+.. versionchanged:: 1.14
+
+The Python module calls this function when it is exiting so you
+should no longer have any need to call this manually. Calling it does
+not carry any penalty though.
+
 """
 EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
 "Shutting down efl.elementary", NULL)
diff --git a/examples/elementary/test.py b/examples/elementary/test.py
index eebfc0f..72d8ee7 100755
--- a/examples/elementary/test.py
+++ b/examples/elementary/test.py
@@ -19,6 +19,9 @@ eolog.setLevel(logging.INFO)
 evaslog = logging.getLogger("efl.evas")
 evaslog.setLevel(logging.INFO)
 
+elmlog = logging.getLogger("efl.elementary")
+elmlog.setLevel(logging.INFO)
+
 from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, EXPAND_BOTH, FILL_BOTH
 from efl import elementary
 from efl.elementary.window import StandardWindow

-- 




[EGIT] [apps/terminology] master 01/01: L10N: Update Finnish translations

2015-04-14 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=3f5297081368deea4b801d74ad4f645573c4701e

commit 3f5297081368deea4b801d74ad4f645573c4701e
Author: Kai Huuhko 
Date:   Wed Apr 15 04:17:13 2015 +0300

L10N: Update Finnish translations
---
 po/fi.po | 266 +--
 1 file changed, 140 insertions(+), 126 deletions(-)

diff --git a/po/fi.po b/po/fi.po
index 9895d1a..d978edd 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -7,16 +7,14 @@ msgid ""
 msgstr ""
 "Project-Id-Version: enlightenment\n"
 "Report-Msgid-Bugs-To: enlightenment-de...@lists.sourceforge.net\n"
-"POT-Creation-Date: 2015-02-15 14:12+0100\n"
-"PO-Revision-Date: 2014-09-05 15:58+\n"
+"POT-Creation-Date: 2015-04-14 19:06+0300\n"
+"PO-Revision-Date: 2015-04-14 19:08+0300\n"
 "Last-Translator: Kai Huuhko \n"
 "Language-Team: Finnish \n"
 "Language: fi\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2014-10-05 12:16+\n"
-"X-Generator: Launchpad (build 17196)\n"
 
 #: src/bin/controls.c:247
 msgid "Controls"
@@ -36,9 +34,9 @@ msgstr "Jaa vaaka"
 
 #: src/bin/controls.c:277
 msgid "Miniview"
-msgstr ""
+msgstr "Pienoisnäkymä"
 
-#: src/bin/controls.c:287 src/bin/termio.c:956
+#: src/bin/controls.c:287 src/bin/termio.c:963 src/bin/termio.c:3934
 msgid "Copy"
 msgstr "Kopioi"
 
@@ -55,9 +53,8 @@ msgid "About"
 msgstr "Tietoja"
 
 #: src/bin/controls.c:315
-#, fuzzy
 msgid "Close Terminal"
-msgstr "Sulje kohdistettu pääte"
+msgstr "Sulje pääte"
 
 #: src/bin/about.c:56
 #, c-format
@@ -75,201 +72,213 @@ msgstr ""
 "%sJaetaan kahden ehdon BSD-lisenssin alaisuudessa joka on "
 "kokonaisuudessaan seuraava:%s"
 
-#: src/bin/keyin.c:530
+#: src/bin/keyin.c:543
 msgid "Scrolling"
 msgstr "Vieritys"
 
-#: src/bin/keyin.c:531
+#: src/bin/keyin.c:544
 msgid "Scroll one page up"
 msgstr "Vieritä yksi sivu ylöspäin"
 
-#: src/bin/keyin.c:532
+#: src/bin/keyin.c:545
 msgid "Scroll one page down"
 msgstr "Vieritä yksi sivu alaspäin"
 
-#: src/bin/keyin.c:533
+#: src/bin/keyin.c:546
 msgid "Scroll one line up"
 msgstr "Vieritä yksi rivi ylöspäin"
 
-#: src/bin/keyin.c:534
+#: src/bin/keyin.c:547
 msgid "Scroll one line down"
 msgstr "Vieritä yksi rivi alaspäin"
 
-#: src/bin/keyin.c:536
+#: src/bin/keyin.c:549
 msgid "Copy/Paste"
 msgstr "Kopioi/Liitä"
 
-#: src/bin/keyin.c:537
+#: src/bin/keyin.c:550
 msgid "Copy selection to Primary buffer"
 msgstr "Kopioi valinta primääripuskuriin"
 
-#: src/bin/keyin.c:538
+#: src/bin/keyin.c:551
 msgid "Copy selection to Clipboard buffer"
 msgstr "Kopioi valinta leikepöydän puskuriin"
 
-#: src/bin/keyin.c:539
+#: src/bin/keyin.c:552
 msgid "Paste Primary buffer (highlight)"
 msgstr "Liitä primääripuskuri (korostettu)"
 
-#: src/bin/keyin.c:540
+#: src/bin/keyin.c:553
 msgid "Paste Clipboard buffer (ctrl+c/v)"
 msgstr "Liitä leikepöydän puskuri (ctrl+c/v)"
 
-#: src/bin/keyin.c:542
+#: src/bin/keyin.c:555
 msgid "Splits/Tabs"
 msgstr "Jaot/välilehdet"
 
-#: src/bin/keyin.c:543
+#: src/bin/keyin.c:556
 msgid "Focus to the previous terminal"
 msgstr "Kohdista edelliseen päätteeseen"
 
-#: src/bin/keyin.c:544
+#: src/bin/keyin.c:557
 msgid "Focus to the next terminal"
 msgstr "Kohdista seuraavaan päätteeseen"
 
-#: src/bin/keyin.c:545
+#: src/bin/keyin.c:558
 msgid "Split horizontally (new below)"
 msgstr "Jaa vaakatasossa (uusi alla)"
 
-#: src/bin/keyin.c:546
+#: src/bin/keyin.c:559
 msgid "Split vertically (new on right)"
 msgstr "Jaa pystytasossa (uusi oikealla)"
 
-#: src/bin/keyin.c:547
+#: src/bin/keyin.c:560
 msgid "Create a new \"tab\""
 msgstr "Luo uusi välilehti"
 
-#: src/bin/keyin.c:548
+#: src/bin/keyin.c:561
 msgid "Close the focused terminal"
 msgstr "Sulje kohdistettu pääte"
 
-#: src/bin/keyin.c:549
+#: src/bin/keyin.c:562
 msgid "Bring up \"tab\" switcher"
 msgstr "Tuo esiin välilehtivalitsin"
 
-#: src/bin/keyin.c:550
+#: src/bin/keyin.c:563
 msgid "Switch to terminal tab 1"
 msgstr "Siirry päätevälilehdelle yksi"
 
-#: src/bin/keyin.c:551
+#: src/bin/keyin.c:564
 msgid "Switch to terminal tab 2"
 msgstr "Siirry päätevälilehdelle kaksi"
 
-#: src/bin/keyin.c:552
+#: src/bin/keyin.c:565
 msgid "Sw

[EGIT] [bindings/python/python-efl] master 01/01: Use atexit to shutdown eo, evas and ecore modules

2015-04-15 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=219ba9cdd960838dd164aa383b2233e44af5337f

commit 219ba9cdd960838dd164aa383b2233e44af5337f
Author: Kai Huuhko 
Date:   Wed Apr 15 12:02:34 2015 +0300

Use atexit to shutdown eo, evas and ecore modules

They already had a call to init in the module, thus there was a mismatch
not obvious to users.
---
 efl/ecore/efl.ecore.pyx | 4 +++-
 efl/eo/efl.eo.pyx   | 3 +++
 efl/evas/efl.evas.pyx   | 3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/efl/ecore/efl.ecore.pyx b/efl/ecore/efl.ecore.pyx
index 9e421a3..7bb1c3f 100644
--- a/efl/ecore/efl.ecore.pyx
+++ b/efl/ecore/efl.ecore.pyx
@@ -246,11 +246,12 @@ Classes
 """
 
 from libc.stdint cimport uintptr_t
-import traceback
 from efl.eo cimport Eo, PY_REFCOUNT
 from efl.utils.conversions cimport _ctouni
 from cpython cimport Py_INCREF, Py_DECREF
 
+import traceback
+import atexit
 
 
 cdef Eina_Bool _ecore_task_cb(void *data) with gil:
@@ -342,6 +343,7 @@ include "efl.ecore_file_download.pxi"
 include "efl.ecore_file_monitor.pxi"
 
 init()
+atexit.register(shutdown)
 
 
 #---
diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index 43411a4..d8cdf70 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -55,6 +55,8 @@ cdef int PY_REFCOUNT(object o):
 cdef PyObject *obj = o
 return obj.ob_refcnt
 
+import atexit
+
 ##
 
 def init():
@@ -66,6 +68,7 @@ def shutdown():
 return eo_shutdown()
 
 init()
+atexit.register(shutdown)
 
 def event_global_freeze_count_get():
 cdef int fcount = 0
diff --git a/efl/evas/efl.evas.pyx b/efl/evas/efl.evas.pyx
index 2433e28..46fe2db 100644
--- a/efl/evas/efl.evas.pyx
+++ b/efl/evas/efl.evas.pyx
@@ -965,6 +965,8 @@ from efl.utils.logger cimport add_logger
 
 cdef int PY_EFL_EVAS_LOG_DOMAIN = add_logger(__name__).eina_log_domain
 
+import atexit
+
 
 # TODO doc
 EVAS_HINT_FILL = -1.0
@@ -1189,3 +1191,4 @@ include "efl.evas_object_grid.pxi"
 
 
 init()
+atexit.register(shutdown)

-- 




[EGIT] [apps/epour] master 02/03: Use pop_alerts() instead of looping with pop_alert

2015-04-15 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=18299f202cf4105c18070673243c0015fb0302ed

commit 18299f202cf4105c18070673243c0015fb0302ed
Author: Kai Huuhko 
Date:   Wed Apr 15 14:44:03 2015 +0300

Use pop_alerts() instead of looping with pop_alert

This saves CPU cycles on a busy session.
---
 epour/session.py | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/epour/session.py b/epour/session.py
index 8164777..52471c7 100644
--- a/epour/session.py
+++ b/epour/session.py
@@ -1,7 +1,7 @@
 #
 #  Epour - A bittorrent client using EFL and libtorrent
 #
-#  Copyright 2012-2014 Kai Huuhko 
+#  Copyright 2012-2015 Kai Huuhko 
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -393,7 +393,7 @@ class AlertManager(object):
 self.timer = Timer(self.update_interval, self.update)
 
 def callback_add(self, alert_type, cb, *args, **kwargs):
-if not alert_type in self.alerts:
+if alert_type not in self.alerts:
 self.alerts[alert_type] = []
 self.alerts[alert_type].append((cb, args, kwargs))
 
@@ -405,7 +405,7 @@ class AlertManager(object):
 def signal(self, a):
 a_name = type(a).__name__
 
-if not a_name in self.alerts:
+if a_name not in self.alerts:
 self.log.debug("No handler: {} | {}".format(a_name, a))
 return
 
@@ -416,13 +416,8 @@ class AlertManager(object):
 self.log.exception("Exception while handling alerts")
 
 def update(self):
-# TODO: Use pop_alerts()
 #self.log.debug("Alerts TICK")
-while 1:
-a = self.session.pop_alert()
-if not a:
-break
-
+for a in self.session.pop_alerts():
 self.signal(a)
 
 return True

-- 




[EGIT] [apps/epour] master 03/03: Simplify the torrent add dialog

2015-04-15 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=f834a16b24e53f2a506a1fe3429a38af2c3ca081

commit f834a16b24e53f2a506a1fe3429a38af2c3ca081
Author: Kai Huuhko 
Date:   Wed Apr 15 18:03:33 2015 +0300

Simplify the torrent add dialog
---
 epour/gui/TorrentSelector.py | 146 ++-
 1 file changed, 87 insertions(+), 59 deletions(-)

diff --git a/epour/gui/TorrentSelector.py b/epour/gui/TorrentSelector.py
index df478e0..6472c0f 100644
--- a/epour/gui/TorrentSelector.py
+++ b/epour/gui/TorrentSelector.py
@@ -26,7 +26,8 @@ from libtorrent import add_torrent_params_flags_t
 
 from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
 from efl import elementary as elm
-from efl.elementary.window import StandardWindow
+from efl.elementary.window import StandardWindow, Window, ELM_WIN_DIALOG_BASIC
+from efl.elementary.background import Background
 from efl.elementary.button import Button
 from efl.elementary.box import Box
 from efl.elementary.frame import Frame
@@ -55,6 +56,7 @@ log = logging.getLogger("epour.gui")
 
 
 class TorrentSelector(StandardWindow):
+
 def __init__(self, parent, session, t_uri=None):
 StandardWindow.__init__(
 self, "epour", "Epour - Add Torrent",
@@ -64,69 +66,52 @@ class TorrentSelector(StandardWindow):
 self.add_dict = {}
 
 scrol = Scroller(
-self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH
-)
+self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
 self.resize_object_add(scrol)
 
 box = Box(
-scrol, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH
-)
+scrol, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
+align=(0.5, 0.0))
 
 scrol.content = box
 
-sf = Frame(
-box, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
-text=u"Select torrent file \u25BC", autocollapse=True
-)
-t_sel = Fileselector(
-sf, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
-expandable=False, buttons_ok_cancel=False, is_save=False
-)
-if elm.need_efreet():
-t_sel.mime_types_filter_append(
-["application/x-bittorrent"], "Torrent files")
-t_sel.mime_types_filter_append(
-["*"], "All files")
-
-if t_uri and os.path.isfile(t_uri):
-t_sel.selected = t_uri
-t_uri = None
-else:
-t_sel.path = os.path.expanduser("~")
+hbox = Box(box, size_hint_weight=EXPAND_HORIZ, 
size_hint_align=FILL_HORIZ, horizontal=True)
+box.pack_end(hbox)
+hbox.show()
 
-sf.content = t_sel
-box.pack_end(sf)
-sf.show()
-t_sel.show()
-
-m_entry = Entry(
+uri_entry = Entry(
 box, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ,
 single_line=True, scrollable=True
 )
-m_entry.part_text_set("guide", "or enter magnet URI / info hash")
+uri_entry.part_text_set("guide", "Enter file path / magnet URI / info 
hash")
+if t_uri:
+uri_entry.entry = utf8_to_markup(t_uri)
+hbox.pack_end(uri_entry)
+uri_entry.show()
+
 if t_uri:
-m_entry.entry = utf8_to_markup(t_uri)
-box.pack_end(m_entry)
-m_entry.show()
+uri_entry.entry = t_uri
+
+fsb = Button(box, text="Select torrent file")
+fsb.callback_clicked_add(lambda x: TorrentFs(self, uri_entry))
+hbox.pack_end(fsb)
+fsb.show()
 
 options = Frame(
 self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ,
-text=u"Options \u25BA", autocollapse=True, collapse=True
+text=u"Advanced Options \u25BA", collapse=True
 )
 box.pack_end(options)
 options.show()
 
-def toggler(obj1, obj2):
-obj2.collapse_go(not obj1.collapse)
-if obj1.collapse:
-obj2.text = obj2.text.replace(u"\u25BA", u"\u25BC")
-obj1.text = obj1.text.replace(u"\u25BC", u"\u25BA")
+def toggler(obj):
+if obj.collapse:
+obj.text = obj.text.replace(u"\u25BA", u"\u25BC")
 else:
-obj2.text = obj2.text.replace(u"\u25BC", u"\u25BA")
-obj1.text = obj1.text.replace(u"\u25BA", u"\u25BC")
+obj.text = obj.text.replace(u"\u25BC", u"\u25BA")
+obj.collapse_go(not obj.collapse)
 
-sf.callback_clicked_add(toggler, options)

[EGIT] [apps/epour] master 01/03: Fix error on torrent removal

2015-04-15 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=9d83e78579971827bf5081715b83a3b821ae78af

commit 9d83e78579971827bf5081715b83a3b821ae78af
Author: Kai Huuhko 
Date:   Wed Apr 15 14:25:47 2015 +0300

Fix error on torrent removal
---
 epour/session.py | 72 
 1 file changed, 31 insertions(+), 41 deletions(-)

diff --git a/epour/session.py b/epour/session.py
index 3fe99f1..8164777 100644
--- a/epour/session.py
+++ b/epour/session.py
@@ -42,13 +42,6 @@ from efl.ecore import Timer
 from xdg.BaseDirectory import save_data_path, load_data_paths
 
 
-def torrent_path_get(ihash):
-for p in load_data_paths("epour"):
-path = os.path.join(p, "{0}.torrent".format(ihash))
-if os.path.isfile(path):
-return path
-
-
 class Session(lt.session):
 def __init__(self, conf):
 self.conf = conf
@@ -121,7 +114,6 @@ class Session(lt.session):
 h = a.handle
 ihash = str(h.info_hash())
 self.log.debug("Metadata received.")
-#self.write_torrent(h)
 t_info = h.get_torrent_info()
 t = {}
 t["info"] = lt.bdecode(t_info.metadata())
@@ -255,36 +247,28 @@ class Session(lt.session):
 
 self.log.debug("List of torrents saved.")
 
-# Save fast resume data
-# for h in self.get_torrents():
-# if not h.is_valid() or not h.has_metadata():
-# continue
-# data = lt.bencode(h.write_resume_data())
-# with open(os.path.join(
-# data_dir, str(h.info_hash()) + ".fastresume"
-# ), 'wb') as f:
-# f.write(data)
-
-# self.log.debug("Fast resume data saved.")
-
-def write_torrent(self, h):
-if h is None:
-self.log.debug("Tried to write torrent while handle was empty.")
-return
+# def write_torrent(self, h):
+# if h is None:
+# self.log.debug("Tried to write torrent while handle was empty.")
+# return
 
-t_info = h.get_torrent_info()
-ihash = str(h.info_hash())
+# t_info = h.get_torrent_info()
+# ihash = str(h.info_hash())
 
-self.log.debug("Writing torrent file {}".format(ihash))
+# self.log.debug("Writing torrent file {}".format(ihash))
 
-md = lt.bdecode(t_info.metadata())
-t = {}
-t["info"] = md
-t_path = torrent_path_get(ihash)
-with open(t_path, "wb") as f:
-f.write(lt.bencode(t))
+# md = lt.bdecode(t_info.metadata())
+# t = {}
+# t["info"] = md
+
+# p = save_data_path("epour")
+# t_path = os.path.join(p, "{0}.torrent".format(ihash))
 
-return t_path
+# if t_path:
+# with open(t_path, "wb") as f:
+# f.write(lt.bencode(t))
+
+# return t_path
 
 def remove_torrent(self, h, with_data=False):
 ihash = str(h.info_hash())
@@ -307,13 +291,19 @@ class Session(lt.session):
 else:
 os.remove(fr_path)
 
-try:
-with open(torrent_path_get(ihash)):
-pass
-except IOError:
-self.log.debug("Could not remove torrent file.")
-else:
-os.remove(torrent_path_get(ihash))
+t_path = None
+for p in load_data_paths("epour"):
+t_path = os.path.join(p, "{0}.torrent".format(ihash))
+break
+
+if t_path:
+try:
+with open(t_path):
+pass
+except IOError:
+self.log.debug("Could not remove torrent file.")
+else:
+os.remove(t_path)
 
 if not hasattr(lt, "torrent_removed_alert"):
 class torrent_removed_alert(object):

-- 




[EGIT] [bindings/python/python-efl] master 02/02: Elm: Move ecore events registration to init()

2015-04-17 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=70fb839813b58c57c6bbfa13e7765ce7e89f61e1

commit 70fb839813b58c57c6bbfa13e7765ce7e89f61e1
Author: Kai Huuhko 
Date:   Fri Apr 17 11:32:50 2015 +0300

Elm: Move ecore events registration to init()

Fixes an issue with docs generation
---
 efl/elementary/__init__.py |   1 +
 efl/elementary/general.pxd |   1 +
 efl/elementary/general.pyx | 290 +
 efl/elementary/systray.pxd |   3 -
 efl/elementary/systray.pyx |  10 --
 5 files changed, 161 insertions(+), 144 deletions(-)

diff --git a/efl/elementary/__init__.py b/efl/elementary/__init__.py
index fde95b3..253abb4 100644
--- a/efl/elementary/__init__.py
+++ b/efl/elementary/__init__.py
@@ -84,6 +84,7 @@ __all__ = (
 "slideshow",
 "spinner",
 #"store",
+"systray",
 "table",
 "theme",
 "thumb",
diff --git a/efl/elementary/general.pxd b/efl/elementary/general.pxd
index e38bcb0..134a03d 100644
--- a/efl/elementary/general.pxd
+++ b/efl/elementary/general.pxd
@@ -53,6 +53,7 @@ cdef extern from "Elementary.h":
 ELM_EVENT_PROCESS_FOREGROUND
 ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED
 ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED
+ELM_EVENT_SYSTRAY_READY
 
 #enums
 cpdef enum Elm_Object_Layer:
diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index 4b1fa2c..f2a6c28 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -290,7 +290,8 @@ from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, \
 EINA_LOG_DOM_WARN, EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT
 
 from efl.ecore cimport Event, EventHandler, _event_mapping_register
-from efl.elementary.need cimport elm_need_sys_notify
+from efl.elementary.need cimport elm_need_sys_notify, elm_need_systray, \
+elm_need_ethumb
 
 import sys
 import traceback
@@ -300,82 +301,13 @@ import atexit
 elm_log = add_logger("efl.elementary")
 cdef int PY_EFL_ELM_LOG_DOMAIN = elm_log.eina_log_domain
 
-def init():
-"""Initialize Elementary
-
-:return int: The init counter value.
-
-This function initializes Elementary and increments a counter of the number
-of calls to it. It returns the new counter's value.
-
-.. versionchanged:: 1.14
-
-The Python module calls this function when it is imported so you
-should no longer have any need to call this manually. Calling it does
-not carry any penalty though.
-
-"""
-EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
-"Initializing efl.elementary", NULL)
-
-# FIXME: Why are we passing the cl args to elm_init here?
-
-cdef:
-int argc, i, arg_len
-char **argv
-char *arg
-
-argc = len(sys.argv)
-argv = PyMem_Malloc(argc * sizeof(char *))
-for i in range(argc):
-t = sys.argv[i]
-if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
-arg = t
-arg_len = len(arg)
-argv[i] = PyMem_Malloc(arg_len + 1)
-memcpy(argv[i], arg, arg_len + 1)
-
-return elm_init(argc, argv)
-
-def shutdown():
-"""Shut down Elementary
-
-:return int: The init counter value.
-
-This should be called at the end of your application, just before it ceases
-to do any more processing. This will clean up any permanent resources your
-application may have allocated via Elementary that would otherwise persist.
-
-.. note::
-
-shutdown() will iterate main loop until all ecore_evas are freed. There
-is a possibility to call your ecore callbacks(timer, animator, event,
-job, and etc.) in shutdown()
-
-.. versionchanged:: 1.14
-
-The Python module calls this function when it is exiting so you
-should no longer have any need to call this manually. Calling it does
-not carry any penalty though.
-
-"""
-EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
-"Shutting down efl.elementary", NULL)
-return elm_shutdown()
-
-
-init()
-atexit.register(shutdown)
 
+cdef class EventSystrayReady(Event):
+cdef int _set_obj(self, void *o) except 0:
+return 1
 
-cdef void py_elm_sys_notify_send_cb(void *data, unsigned int id):
-cdef object func, func_data
-func, func_data = data
-# FIXME: Is this cb called more than once? Py_DECREF if not.
-try:
-func(func_data, id)
-except Exception:
-traceback.print_exc()
+def __repr__(self):
+return "<%s()>" % (self.__class__.__name__,)
 
 
 cdef class SysNotifyNotificationClosed(Event):
@@ -449,15 +381,6 @@ cdef class EthumbConnect(Event):
 def __repr__(self):
 return "<%s()>" % (self.__class__.__name__,)
 
-_event_mapping_register(ELM_ECORE_EVENT_

[EGIT] [bindings/python/python-efl] master 01/02: Elm.Entry: Fix compile warning and doc issues

2015-04-17 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=9ffa09d72948cb86140b250afd66404305317dda

commit 9ffa09d72948cb86140b250afd66404305317dda
Author: Kai Huuhko 
Date:   Fri Apr 17 10:34:00 2015 +0300

Elm.Entry: Fix compile warning and doc issues
---
 efl/elementary/entry.pyx | 118 +--
 1 file changed, 94 insertions(+), 24 deletions(-)

diff --git a/efl/elementary/entry.pyx b/efl/elementary/entry.pyx
index cda125d..5d49562 100644
--- a/efl/elementary/entry.pyx
+++ b/efl/elementary/entry.pyx
@@ -804,12 +804,41 @@ cdef class EntryAnchorInfo(object):
 The info sent in the callback for the ``anchor,clicked`` signals emitted
 by entries.
 
-:var name: The name of the anchor, as stated in its href.
-:var button: The mouse button used to click on it.
-:var x: Anchor geometry, relative to canvas.
-:var y: Anchor geometry, relative to canvas.
-:var w: Anchor geometry, relative to canvas.
-:var h: Anchor geometry, relative to canvas.
+.. attribute:: name
+
+The name of the anchor, as stated in its href.
+
+:type: string
+
+.. attribute:: button
+
+The mouse button used to click on it.
+
+:type: :class:`~efl.elementary.button.Button`
+
+.. attribute:: x
+
+Anchor geometry, relative to canvas.
+
+:type: int
+
+.. attribute:: y
+
+Anchor geometry, relative to canvas.
+
+:type: int
+
+.. attribute:: w
+
+Anchor geometry, relative to canvas.
+
+:type: int
+
+.. attribute:: h
+
+Anchor geometry, relative to canvas.
+
+:type: int
 
 """
 cdef:
@@ -834,16 +863,50 @@ cdef object _entryanchor_conv(void *addr):
 cdef class EntryAnchorHoverInfo(object):
 """EntryAnchorHoverInfo(...)
 
-The info sent in the callback for ``anchor,clicked`` signals emitted by
-the entries.
+The info sent in the callback for ``anchor,hover,opened`` signals emitted
+by the entries.
+
+.. attribute:: anchor_info
+
+The actual anchor info.
+
+:type: :class:`EntryAnchorInfo`
 
-:var anchor_info: The actual anchor info.
-:var hover: The hover object to use for the popup.
-:var hover_parent: Geometry of the object used as parent by the hover.
-:var hover_left: Hint indicating if there's space for content on the left 
side of the hover.
-:var hover_right: Hint indicating content fits on the right side of the 
hover.
-:var hover_top: Hint indicating content fits on top of the hover.
-:var hover_bottom: Hint indicating content fits below the hover.
+.. attribute:: hover
+
+The hover object to use for the popup.
+
+:type: :class:`~efl.elementary.hover.Hover`
+
+.. attribute:: hover_parent
+
+The object used as parent by the hover.
+
+:type: :class:`~efl.eo.Eo`
+
+.. attribute:: hover_left
+
+Hint indicating if there's space for content on the left side of the 
hover.
+
+:type: bool
+
+.. attribute:: hover_right
+
+Hint indicating content fits on the right side of the hover.
+
+:type: bool
+
+.. attribute:: hover_top
+
+Hint indicating content fits on top of the hover.
+
+:type: bool
+
+.. attribute:: hover_bottom
+
+Hint indicating content fits below the hover.
+
+:type: bool
 
 """
 cdef:
@@ -855,7 +918,7 @@ cdef class EntryAnchorHoverInfo(object):
 @staticmethod
 cdef EntryAnchorHoverInfo create(Elm_Entry_Anchor_Hover_Info *addr):
 cdef EntryAnchorHoverInfo self = 
EntryAnchorHoverInfo.__new__(EntryAnchorHoverInfo)
-self.anchor_info = _entryanchor_conv(addr.anchor_info)
+self.anchor_info = _entryanchor_conv(addr.anchor_info)
 self.hover = object_from_instance(addr.hover)
 self.hover_parent = (addr.hover_parent.x, addr.hover_parent.y,
addr.hover_parent.w, addr.hover_parent.h)
@@ -908,9 +971,13 @@ cdef class Entry(LayoutClass):
 
 If there is styles in the user style stack, the properties in the
 top style of user style stack will replace the properties in current
-theme. The input style is specified in format
-``tag='property=value'`` (i.e. ``DEFAULT='font=Sans
-font_size=60'hilight=' + font_weight=Bold'``).
+theme. The input style is specified in format::
+
+tag='property=value'
+
+i.e.::
+
+DEFAULT='font=Sans font_size=60' hilight=' + font_weight=Bold'
 
 :param string style: The style user to push
 
@@ -1075,11 +1142,14 @@ cdef class Entry(LayoutClass):
 functions; The former will either not work at all, or break the correct
 functionality.
 
-IMPORTANT: Many functions may change (i.e delete and c

[EGIT] [bindings/python/python-efl] master 01/01: Elm.Systray: Fix compile

2015-04-17 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=b7040059817027a2b25a2541444fa35a2241a5d3

commit b7040059817027a2b25a2541444fa35a2241a5d3
Author: Kai Huuhko 
Date:   Fri Apr 17 14:59:11 2015 +0300

Elm.Systray: Fix compile

Here's a hint to any developer at home: CTRL-S *before* you commit.
---
 efl/elementary/systray.pxd | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/efl/elementary/systray.pxd b/efl/elementary/systray.pxd
index 7b634a5..f5b9f83 100644
--- a/efl/elementary/systray.pxd
+++ b/efl/elementary/systray.pxd
@@ -6,6 +6,9 @@ cdef extern from "Elementary.h":
 
 ctypedef Eo Elm_Systray
 
+cpdef enum:
+ELM_EVENT_SYSTRAY_READY
+
 cpdef enum _Elm_Systray_Category:
 ELM_SYSTRAY_CATEGORY_APP_STATUS
 ELM_SYSTRAY_CATEGORY_COMMUNICATIONS

-- 




[EGIT] [bindings/python/python-efl] master 02/02: Elm: Move ecore events registration out of init

2015-04-19 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=c0239f30f8bc8f4707650cedd819a9a09b00

commit c0239f30f8bc8f4707650cedd819a9a09b00
Author: Kai Huuhko 
Date:   Mon Apr 20 06:25:43 2015 +0300

Elm: Move ecore events registration out of init
---
 efl/elementary/general.pxd |  16 --
 efl/elementary/general.pyx | 121 +++--
 efl/elementary/need.pxd|  23 +
 efl/elementary/need.pyx| 111 +++--
 4 files changed, 137 insertions(+), 134 deletions(-)

diff --git a/efl/elementary/general.pxd b/efl/elementary/general.pxd
index 134a03d..56de2f7 100644
--- a/efl/elementary/general.pxd
+++ b/efl/elementary/general.pxd
@@ -93,14 +93,6 @@ cdef extern from "Elementary.h":
 ctypedef enum Elm_Policy_Throttle:
 pass
 
-cpdef enum Elm_Sys_Notify_Closed_Reason:
-ELM_SYS_NOTIFY_CLOSED_EXPIRED
-ELM_SYS_NOTIFY_CLOSED_DISMISSED
-ELM_SYS_NOTIFY_CLOSED_REQUESTED
-ELM_SYS_NOTIFY_CLOSED_UNDEFINED
-ctypedef enum Elm_Sys_Notify_Closed_Reason:
-pass
-
 cpdef enum Elm_Sys_Notify_Urgency:
 ELM_SYS_NOTIFY_URGENCY_LOW
 ELM_SYS_NOTIFY_URGENCY_NORMAL
@@ -208,14 +200,6 @@ cdef extern from "Elementary.h":
 # sys_notify.h
 ctypedef void (*Elm_Sys_Notify_Send_Cb)(void *data, unsigned int id)
 
-ctypedef struct Elm_Sys_Notify_Notification_Closed:
-unsigned int id # ID of the notification.
-Elm_Sys_Notify_Closed_Reason reason # The Reason the notification was 
closed.
-
-ctypedef struct Elm_Sys_Notify_Action_Invoked:
-unsigned int id # ID of the notification.
-char *action_key # The key of the action invoked. These match the keys 
sent over in the list of actions.
-
 void  elm_sys_notify_close(unsigned int id)
 void  elm_sys_notify_send(  unsigned int replaces_id,
 const char *icon,
diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index f2a6c28..f449785 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -290,8 +290,6 @@ from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, \
 EINA_LOG_DOM_WARN, EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT
 
 from efl.ecore cimport Event, EventHandler, _event_mapping_register
-from efl.elementary.need cimport elm_need_sys_notify, elm_need_systray, \
-elm_need_ethumb
 
 import sys
 import traceback
@@ -302,86 +300,6 @@ elm_log = add_logger("efl.elementary")
 cdef int PY_EFL_ELM_LOG_DOMAIN = elm_log.eina_log_domain
 
 
-cdef class EventSystrayReady(Event):
-cdef int _set_obj(self, void *o) except 0:
-return 1
-
-def __repr__(self):
-return "<%s()>" % (self.__class__.__name__,)
-
-
-cdef class SysNotifyNotificationClosed(Event):
-
-cdef Elm_Sys_Notify_Notification_Closed *obj
-
-cdef int _set_obj(self, void *o) except 0:
-self.obj = o
-return 1
-
-def __repr__(self):
-# TODO: int -> string for 'reason'
-return "<%s(id=%d, reason=%s)>" % \
-(type(self).__name__, self.id, self.reason)
-
-property id:
-"""ID of the notification.
-
-:type: int
-
-"""
-def __get__(self):
-return self.obj.id
-
-property reason:
-"""The Reason the notification was closed.
-
-:type: :ref:`Elm_Sys_Notify_Closed_Reason`
-
-"""
-def __get__(self):
-return self.obj.reason
-
-
-cdef class SysNotifyActionInvoked(Event):
-
-cdef Elm_Sys_Notify_Action_Invoked *obj
-
-cdef int _set_obj(self, void *o) except 0:
-self.obj = o
-return 1
-
-def __repr__(self):
-return "<%s(id=%d, action_key=%s)>" % \
-(type(self).__name__, self.id, self.action_key)
-
-property id:
-"""ID of the notification.
-
-:type: int
-
-"""
-def __get__(self):
-return self.obj.id
-
-property action_key:
-"""The key of the action invoked. These match the keys sent over in the
-list of actions.
-
-:type: string
-
-"""
-def __get__(self):
-return _touni(self.obj.action_key)
-
-
-cdef class EthumbConnect(Event):
-cdef int _set_obj(self, void *o) except 0:
-return 1
-
-def __repr__(self):
-return "<%s()>" % (self.__class__.__name__,)
-
-
 cdef class ConfigAllChanged(Event):
 cdef int _set_obj(self, void *o) except 0:
 return 1
@@ -463,39 +381,7 @@ def init():
 argv[i] = PyMem_Malloc(arg_len + 1)
 memcpy(argv[i], arg, arg_len + 1)
 
-ret = elm_init(argc, argv)
-
-if ret != 1:
-return ret
-
-

[EGIT] [bindings/python/python-efl] master 01/02: Elm.Systray: Fix compile warning

2015-04-19 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=6532ef85f6ef2118b0fcf59edbf7417ed17aceed

commit 6532ef85f6ef2118b0fcf59edbf7417ed17aceed
Author: Kai Huuhko 
Date:   Fri Apr 17 20:29:35 2015 +0300

Elm.Systray: Fix compile warning
---
 efl/elementary/systray.pyx | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/efl/elementary/systray.pyx b/efl/elementary/systray.pyx
index be57906..7368e9e 100644
--- a/efl/elementary/systray.pyx
+++ b/efl/elementary/systray.pyx
@@ -190,17 +190,17 @@ cdef class Systray(Eo):
 eo_do(self.obj, elm_obj_systray_menu_set(value.obj))
 
 def __get__(self):
-cdef cEo *value = NULL
+cdef const cEo *value = NULL
 eo_do_ret(self.obj, value, elm_obj_systray_menu_get())
-return object_from_instance(value)
+return object_from_instance(value)
 
 def menu_set(self, Eo value):
 eo_do(self.obj, elm_obj_systray_menu_set(value.obj))
 
 def menu_get(self):
-cdef cEo *value = NULL
+cdef const cEo *value = NULL
 eo_do_ret(self.obj, value, elm_obj_systray_menu_get())
-return object_from_instance(value)
+return object_from_instance(value)
 
 property att_icon_name:
 """The name of the attention icon to be used by the Status Notifier 
Item.

-- 




[EGIT] [apps/epour] master 02/03: Improve torrent data save location entry in torrent add dialog

2015-04-21 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=055a4e86a1ed1c8fdcb5c0eb9bf63bc602000ecb

commit 055a4e86a1ed1c8fdcb5c0eb9bf63bc602000ecb
Author: Kai Huuhko 
Date:   Wed Apr 22 05:06:46 2015 +0300

Improve torrent data save location entry in torrent add dialog

Use fs.path instead of fs.selected for getting the path, allows user to
enter the path in the entry widget
---
 epour/gui/TorrentSelector.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/epour/gui/TorrentSelector.py b/epour/gui/TorrentSelector.py
index 6472c0f..92176e6 100644
--- a/epour/gui/TorrentSelector.py
+++ b/epour/gui/TorrentSelector.py
@@ -129,7 +129,7 @@ class TorrentSelector(StandardWindow):
 e.show()
 
 def fs_cb(fs, key):
-self.add_dict[key] = fs.selected
+self.add_dict[key] = fs.path
 
 save_path = FsEntry(
 opt_box, size_hint_align=FILL_HORIZ, text="Save path",

-- 




[EGIT] [apps/epour] master 03/03: Add dialog: Convert flags to bool before use, disallow dups by default

2015-04-21 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=522959b225bee6b2c4096221541a151d18a9f56b

commit 522959b225bee6b2c4096221541a151d18a9f56b
Author: Kai Huuhko 
Date:   Wed Apr 22 05:31:26 2015 +0300

Add dialog: Convert flags to bool before use, disallow dups by default

Flags are converted to bool before using them as Check state since
Eina_Bool doesn't accept values >sizeof(uchar)
---
 epour/gui/TorrentSelector.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/epour/gui/TorrentSelector.py b/epour/gui/TorrentSelector.py
index 92176e6..197af88 100644
--- a/epour/gui/TorrentSelector.py
+++ b/epour/gui/TorrentSelector.py
@@ -143,6 +143,7 @@ class TorrentSelector(StandardWindow):
 self.add_dict["flags"] = \
 add_torrent_params_flags_t.flag_apply_ip_filter + \
 add_torrent_params_flags_t.flag_update_subscribe + \
+add_torrent_params_flags_t.flag_duplicate_is_error + \
 add_torrent_params_flags_t.flag_auto_managed
 
 def option_flag_cb(c, flag):
@@ -154,7 +155,7 @@ class TorrentSelector(StandardWindow):
 c = Check(
 opt_box, size_hint_align=(0.0, 0.5),
 text=" ".join(name.split("_")[1:]).capitalize(),
-state=self.add_dict["flags"] & int(flag)
+state=bool(self.add_dict["flags"] & int(flag))
 )
 c.callback_changed_add(option_flag_cb, int(flag))
 opt_box.pack_end(c)

-- 




[EGIT] [apps/epour] master 01/03: Use more xdg icon names

2015-04-21 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=59b7544370e4c7cf2531a511ab2c5f0eb470f72e

commit 59b7544370e4c7cf2531a511ab2c5f0eb470f72e
Author: Kai Huuhko 
Date:   Wed Apr 22 05:05:55 2015 +0300

Use more xdg icon names
---
 epour/gui/__init__.py | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/epour/gui/__init__.py b/epour/gui/__init__.py
index 98ddcc1..87a131e 100644
--- a/epour/gui/__init__.py
+++ b/epour/gui/__init__.py
@@ -408,9 +408,9 @@ class SessionStatus(Table):
 self.uploads_l.text = t
 self.listen_l.text = str(self.session.is_listening())
 if self.session.is_paused():
-icon = "player_pause"
+icon = "media-playback-pause"
 else:
-icon = "player_play"
+icon = "media-playback-play"
 try:
 self.ses_pause_ic.standard = icon
 except Exception as e:
@@ -482,12 +482,18 @@ class TorrentClass(GenlistItemClass):
 try:
 ic.standard = "up"
 except Exception:
-pass
+try:
+ic.standard = "arrow-up"
+except Exception:
+pass
 else:
 try:
 ic.standard = "down"
 except Exception:
-pass
+try:
+ic.standard = "arrow-down"
+except Exception:
+pass
 except RuntimeError:
 log.debug("Setting torrent ic failed")
 ic.tooltip_text_set(self.state_str[s.state])

-- 




[EGIT] [apps/epour] master 01/01: Add I18N support to gui with gettext

2015-04-21 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=8fa5289b06db4806b03d152b7b1eea4efd5380e5

commit 8fa5289b06db4806b03d152b7b1eea4efd5380e5
Author: Kai Huuhko 
Date:   Wed Apr 22 07:31:01 2015 +0300

Add I18N support to gui with gettext
---
 epour/gui/Preferences.py |  58 ++---
 epour/gui/TorrentProps.py|  32 +--
 epour/gui/TorrentSelector.py | 233 +++---
 epour/gui/Widgets.py |  12 +-
 epour/gui/__init__.py|  94 
 po/epour.pot | 555 +++
 6 files changed, 859 insertions(+), 125 deletions(-)

diff --git a/epour/gui/Preferences.py b/epour/gui/Preferences.py
index 4efeb67..322b1ee 100644
--- a/epour/gui/Preferences.py
+++ b/epour/gui/Preferences.py
@@ -94,7 +94,7 @@ class PreferencesGeneral(PreferencesDialog):
 self.session = session
 conf = session.conf
 PreferencesDialog.__init__(
-self, "Epour General Preferences")
+self, _("Epour General Preferences"))
 
 limits = Limits(self, session)
 ports = ListenPorts(self, session)
@@ -108,7 +108,7 @@ class PreferencesGeneral(PreferencesDialog):
 )
 
 completed_sel_enabled = Check(
-self, size_hint_align=ALIGN_LEFT, text="Move completed torrents",
+self, size_hint_align=ALIGN_LEFT, text=_("Move completed 
torrents"),
 )
 completed_sel_enabled.state = conf.getboolean(
 "Settings", "move_completed_enabled"
@@ -116,7 +116,7 @@ class PreferencesGeneral(PreferencesDialog):
 
 completed_sel = StorageSelector(
 self,
-"Completed torrents",
+_("Completed torrents"),
 lambda: conf.get("Settings", "move_completed_path"),
 lambda x: conf.set("Settings", "move_completed_path", x),
 size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ
@@ -145,7 +145,7 @@ class PreferencesGeneral(PreferencesDialog):
 
 chk1 = Check(self)
 chk1.size_hint_align = ALIGN_LEFT
-chk1.text = "Delete original .torrent file when added"
+chk1.text = _("Delete original .torrent file when added")
 chk1.state = conf.getboolean("Settings", "delete_original")
 chk1.callback_changed_add(lambda x: conf.set(
 "Settings", "delete_original", str(bool(chk1.state))
@@ -153,7 +153,7 @@ class PreferencesGeneral(PreferencesDialog):
 
 chk2 = Check(self)
 chk2.size_hint_align = ALIGN_LEFT
-chk2.text = "Ask for confirmation on exit"
+chk2.text = _("Ask for confirmation on exit")
 chk2.state = conf.getboolean("Settings", "confirm_exit")
 chk2.callback_changed_add(lambda x: conf.set(
 "Settings", "confirm_exit", str(bool(chk2.state))
@@ -162,7 +162,7 @@ class PreferencesGeneral(PreferencesDialog):
 chk3 = Check(self)
 chk3.size_hint_align = ALIGN_LEFT
 chk3.text = (
-"Torrents to be added from dbus or command line open a dialog")
+_("Torrents to be added from dbus or command line open a dialog"))
 chk3.state = conf.getboolean("Settings", "add_dialog_enabled")
 chk3.callback_changed_add(lambda x: conf.set(
 "Settings", "add_dialog_enabled", str(bool(chk3.state))
@@ -197,7 +197,7 @@ class StorageSelector(Frame):
 
 dlsel = FsButton(
 self, size_hint_align=FILL_HORIZ, inwin_mode=False,
-text="Change path", folder_only=True, expandable=False
+text=_("Change path"), folder_only=True, expandable=False
 )
 dlsel.path = read()
 
@@ -234,7 +234,7 @@ class ListenPorts(Frame):
 self.session = session
 
 self.size_hint_align = FILL_HORIZ
-self.text = "Listen port (range)"
+self.text = _("Listen port (range)")
 
 #port = session.listen_port()
 
@@ -273,16 +273,16 @@ class PreferencesProxy(PreferencesDialog):
 
 def __init__(self, parent, session):
 PreferencesDialog.__init__(
-self, "Epour Proxy Preferences")
+self, _("Epour Proxy Preferences"))
 
 proxies = [
-["Proxy for torrent peer connections",
+[_("Proxy for torrent peer connections"),
 session.peer_proxy, session.set_peer_proxy],
-["Proxy for torrent web seed connections",
+[_("Proxy for torrent web seed connections"),
 session.web_seed_proxy, session.set_web_seed_proxy],
-["Proxy f

[EGIT] [bindings/python/python-efl] master 02/02: Documentation: Prettify warning/note boxes, class headers

2015-04-22 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=8f68e52eccb2706e0e8ab39199cd72a4f8f22b0e

commit 8f68e52eccb2706e0e8ab39199cd72a4f8f22b0e
Author: Kai Huuhko 
Date:   Wed Apr 22 14:16:50 2015 +0300

Documentation: Prettify warning/note boxes, class headers

Sphinx 1.3 includes class constructor's signature in the class header;
reduced font size slightly to accommodate this change.
---
 doc/themes/efldoc/static/efl.css | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/doc/themes/efldoc/static/efl.css b/doc/themes/efldoc/static/efl.css
index 229104b..68d6dd3 100644
--- a/doc/themes/efldoc/static/efl.css
+++ b/doc/themes/efldoc/static/efl.css
@@ -325,7 +325,7 @@ cite, code, tt {
 code, tt {
 background-color: rgb(51,51,51); /*#f2f2f2*/
 border: 1px solid rgb(32,32,32); /*#ddd*/
-border-radius: 2px;
+border-radius: 3px;
 color: white; /*#333*/
 padding: 1px;
 }
@@ -406,8 +406,8 @@ table td, table th {
 div.admonition, div.warning {
 font-size: 0.9em;
 margin: 1em 0 1em 0;
-border: 1px solid rgb(32,32,32); /*#86989B*/
-border-radius: 2px;
+border: 1px dashed rgb(32,32,32); /*#86989B*/
+border-radius: 12px;
 background-color: rgb(51,51,51); /*#f7f7f7*/
 padding: 0;
 }
@@ -429,7 +429,7 @@ div.warning p.admonition-title {
 }
 
 div.warning {
-border: 1px solid rgb(101,16,16); /*#94*/
+border-color: rgb(101,16,16); /*#94*/
 background-color: rgb(101,51,51); /*#FFCCCF*/
 }
 
@@ -506,11 +506,15 @@ dl.class {
 }
 
 dl.class > dt {
-font-size: 20px;
+font-size: 1.2em;
 background-color: #333;
 padding: 2px;
 }
 
+dl.class > dt em {
+font-size: 0.8em;
+}
+
 dl.class dt{
 border-bottom: 1px solid #333;
 }

-- 




[EGIT] [bindings/python/python-efl] master 01/02: Documentation: Sphinx 1.3 compatibility fixes

2015-04-22 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=c3b9a5b18f4db8373b925ee3f07c0c9bc0e80ed4

commit c3b9a5b18f4db8373b925ee3f07c0c9bc0e80ed4
Author: Kai Huuhko 
Date:   Wed Apr 22 13:06:07 2015 +0300

Documentation: Sphinx 1.3 compatibility fixes
---
 doc/themes/efldoc/static/efl.css | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/themes/efldoc/static/efl.css b/doc/themes/efldoc/static/efl.css
index 369fb22..229104b 100644
--- a/doc/themes/efldoc/static/efl.css
+++ b/doc/themes/efldoc/static/efl.css
@@ -322,7 +322,7 @@ cite, code, tt {
 letter-spacing: -0.02em;
 }
 
-tt {
+code, tt {
 background-color: rgb(51,51,51); /*#f2f2f2*/
 border: 1px solid rgb(32,32,32); /*#ddd*/
 border-radius: 2px;
@@ -351,12 +351,12 @@ hr {
 margin: 2em;
 }
 
-a tt {
+a tt, a code{
 border: 0;
 color: rgb(200,200,170);
 }
 
-a tt:hover {
+a tt:hover, a code:hover{
 color: rgb(230,230,200);
 }
 

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Evas: Fix documentation

2015-04-24 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=ce58291d205749073fd0544dbe582f9de5a61268

commit ce58291d205749073fd0544dbe582f9de5a61268
Author: Kai Huuhko 
Date:   Fri Apr 24 22:24:28 2015 +0300

Evas: Fix documentation
---
 efl/evas/efl.evas.pyx |  26 +++---
 efl/evas/efl.evas_object_textgrid.pxi | 169 +-
 2 files changed, 77 insertions(+), 118 deletions(-)

diff --git a/efl/evas/efl.evas.pyx b/efl/evas/efl.evas.pyx
index 46fe2db..df557a5 100644
--- a/efl/evas/efl.evas.pyx
+++ b/efl/evas/efl.evas.pyx
@@ -914,42 +914,46 @@ Evas_Textblock_Cursor_Type
 
 .. _Evas_Textgrid_Palette:
 
-_Evas_Textgrid_Palette
--
+Textgrid Palette
+
+
+The palette to use for the foreground and background colors.
 
 .. data:: EVAS_TEXTGRID_PALETTE_NONE
 
-None.
+No palette is used.
 
 .. data:: EVAS_TEXTGRID_PALETTE_STANDARD
 
-Standard.
+Standard palette (around 16 colors).
 
 .. data:: EVAS_TEXTGRID_PALETTE_EXTENDED
 
-Extended.
+Extended palette (at max 256 colors).
 
 .. data:: EVAS_TEXTGRID_PALETTE_LAST
 
-Last.
+Ignore it.
 
 
 .. _Evas_Textgrid_Font_Style:
 
-Evas_Textgrid_Font_Style
--
+Textgrid Font Style
+---
+
+The style to give to each character of the grid.
 
 .. data:: EVAS_TEXTGRID_FONT_STYLE_NORMAL
 
-Normal.
+Normal style.
 
 .. data:: EVAS_TEXTGRID_FONT_STYLE_BOLD
 
-Bold.
+Bold style.
 
 .. data:: EVAS_TEXTGRID_FONT_STYLE_ITALIC
 
-italic.
+Oblique style.
 
 
 Module level functions
diff --git a/efl/evas/efl.evas_object_textgrid.pxi 
b/efl/evas/efl.evas_object_textgrid.pxi
index c21c0c0..9b93cc4 100644
--- a/efl/evas/efl.evas_object_textgrid.pxi
+++ b/efl/evas/efl.evas_object_textgrid.pxi
@@ -15,47 +15,6 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this Python-EFL.  If not, see <http://www.gnu.org/licenses/>.
 
-"""
-
-.. _Evas_Textgrid_Palette:
-
-.. rubric:: The palette to use for the foreground and background colors.
-
-.. data:: EVAS_TEXTGRID_PALETTE_NONE
-
-No palette is used
-
-.. data:: EVAS_TEXTGRID_PALETTE_STANDARD
-
-standard palette (around 16 colors)
-
-.. data:: EVAS_TEXTGRID_PALETTE_EXTENDED
-
-extended palette (at max 256 colors)
-
-.. data:: EVAS_TEXTGRID_PALETTE_LAST
-
-ignore it
-
-
-.. _Evas_Textgrid_Font_Style:
-
-.. rubric:: The style to give to each character of the grid.
-
-.. data:: EVAS_TEXTGRID_FONT_STYLE_NORMAL
-
-Normal style
-
-.. data:: EVAS_TEXTGRID_FONT_STYLE_BOLD
-
-Bold style
-
-.. data:: EVAS_TEXTGRID_FONT_STYLE_ITALIC
-
-Oblique style
-
-"""
-
 from libc.stdlib cimport malloc
 
 
@@ -74,9 +33,9 @@ cdef class TextgridCell(object):
 return "%s" % (self.codepoint,)
 
 def __repr__(self):
-return "%s(codepoint = %s, fg = %s, bg = %s, bold = %s, \
+return "<%s(codepoint = %s, fg = %s, bg = %s, bold = %s, \
 italic = %s, underline = %s, strikethrough = %s, \
-fg_extended = %s, bg_extended = %s, double_width = %s)" % (
+fg_extended = %s, bg_extended = %s, double_width = %s)>" % (
 type(self).__name__, self.codepoint,
 self.fg, self.bg, self.bold, self.italic,
 self.underline, self.strikethrough,
@@ -223,7 +182,7 @@ cdef class Textgrid(Object):
 :type canvas: :py:class:`~efl.evas.Canvas`
 :keyword \**kwargs: All the remaining keyword arguments are interpreted
 as properties of the instance
-
+
 """
 self._set_obj(evas_object_textgrid_add(canvas.obj))
 self._set_properties_from_keyword_args(kwargs)
@@ -231,9 +190,8 @@ cdef class Textgrid(Object):
 property size:
 """The size of the textgrid object.
 
-The number of lines **h** and the number
-of columns **w** of the textgrid object. Values
-less than or equal to 0 are ignored.
+The number of lines **h** and the number of columns **w** of the
+textgrid object. Values less than or equal to 0 are ignored.
 
 :type: (int **w**, int **h**)
 
@@ -251,13 +209,12 @@ cdef class Textgrid(Object):
 property font_source:
 """The font (source) file used on a given textgrid object.
 
-This allows the font file to be explicitly
-set for the textgrid object, overriding system lookup, which
-will first occur in the given file's contents. If
-None or an empty string is assigned, or the same font_source has 
already
-been set, or on error, this does nothing.
+This allows the font file to be explicitly set for the textgrid object,
+overriding system lookup, which will first occur in the

[EGIT] [bindings/python/python-efl] master 01/01: Emotion: Fix documentation paragraph title

2015-04-27 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=8df029d2408fa5b569cf6ac0135333db74e60ca9

commit 8df029d2408fa5b569cf6ac0135333db74e60ca9
Author: Kai Huuhko 
Date:   Tue Apr 28 02:30:58 2015 +0300

Emotion: Fix documentation paragraph title
---
 efl/emotion/efl.emotion.pyx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/efl/emotion/efl.emotion.pyx b/efl/emotion/efl.emotion.pyx
index eeb3265..809d250 100644
--- a/efl/emotion/efl.emotion.pyx
+++ b/efl/emotion/efl.emotion.pyx
@@ -17,8 +17,8 @@
 
 """
 
-:mod:`efl.edje` Module
-##
+:mod:`efl.emotion` Module
+#
 
 Classes
 ===

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Examples: Add systray test/example to the main menu

2015-04-27 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=fb34f48c9d4a4ce80b9d4543fae1e986e0483aaf

commit fb34f48c9d4a4ce80b9d4543fae1e986e0483aaf
Author: Kai Huuhko 
Date:   Tue Apr 28 03:12:16 2015 +0300

Examples: Add systray test/example to the main menu
---
 examples/elementary/test.py |  1 +
 examples/elementary/test_systray.py | 40 +++--
 2 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/examples/elementary/test.py b/examples/elementary/test.py
index 72d8ee7..e306cc0 100755
--- a/examples/elementary/test.py
+++ b/examples/elementary/test.py
@@ -237,6 +237,7 @@ items = [
 ]),
 ("System", [
 ("Notification", "test_sys_notify", "sys_notify_clicked"),
+("Systray", "test_systray", "systray_clicked"),
 ]),
 ("Text", [
 ("Label", "test_label", "label_clicked"),
diff --git a/examples/elementary/test_systray.py 
b/examples/elementary/test_systray.py
index 81feb8b..7c8791c 100644
--- a/examples/elementary/test_systray.py
+++ b/examples/elementary/test_systray.py
@@ -1,36 +1,38 @@
 #!/usr/bin/python
 
-from efl.ecore import ECORE_CALLBACK_DONE
 import efl.elementary as elm
-elm.init()
-if not elm.need_systray():
-raise SystemExit("systray support missing")
 
 from efl.elementary.window import StandardWindow
 from efl.elementary.systray import Systray, on_systray_ready
 from efl.elementary.menu import Menu
 
 
-def ready_cb(event):
-print(tray.register())
+def systray_clicked(obj, item=None):
+if not elm.need_systray():
+print("systray support not available")
+return
 
-return ECORE_CALLBACK_DONE
+win = StandardWindow("test", "systray test", size=(400, 400), autodel=True)
+if not obj:
+win.callback_delete_request_add(lambda x: elm.exit())
 
+menu = Menu(win)
+menu.item_add(None, "it works!")
 
-win = StandardWindow("test", "systray test", size=(400, 400))
-win.callback_delete_request_add(lambda x: elm.exit())
+global tray
+tray = Systray(win)
+tray.icon_name = "elementary"
+tray.att_icon_name = "elementary"
+tray.menu = menu
 
-on_systray_ready(ready_cb)
+on_systray_ready(lambda x: tray.register())
 
-menu = Menu(win)
-menu.item_add(None, "it works!")
+win.show()
 
-tray = Systray(win)
-tray.icon_name = "elementary"
-tray.att_icon_name = "elementary"
-tray.menu = menu
+if __name__ == "__main__":
+elm.init()
 
-win.show()
+systray_clicked(None)
 
-elm.run()
-elm.shutdown()
+elm.run()
+elm.shutdown()

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Evas.Textgrid: Fix memleak

2015-05-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=acf2d339691af35d1301d382920a0cb4c9ad2597

commit acf2d339691af35d1301d382920a0cb4c9ad2597
Author: Kai Huuhko 
Date:   Sun May 3 13:05:15 2015 +0300

Evas.Textgrid: Fix memleak

Had to change the type of cellrows from list to custom tuple-like type.
---
 efl/evas/efl.evas_object_textgrid.pxi | 74 ++-
 examples/elementary/test_evas_textgrid.py | 47 
 2 files changed, 72 insertions(+), 49 deletions(-)

diff --git a/efl/evas/efl.evas_object_textgrid.pxi 
b/efl/evas/efl.evas_object_textgrid.pxi
index 9b93cc4..68e579d 100644
--- a/efl/evas/efl.evas_object_textgrid.pxi
+++ b/efl/evas/efl.evas_object_textgrid.pxi
@@ -42,6 +42,14 @@ cdef class TextgridCell(object):
 self.fg_extended, self.bg_extended,
 self.double_width)
 
+@staticmethod
+cdef TextgridCell create(Evas_Textgrid_Cell *cell):
+if cell == NULL:
+raise ValueError("Invalid pointer for evas textgrid cell!")
+cdef TextgridCell ret = TextgridCell.__new__(TextgridCell)
+ret.cell = cell
+return ret
+
 property codepoint:
 """the UNICODE value of the character
 
@@ -167,6 +175,35 @@ cdef class TextgridCell(object):
 def __get__(self):
 return self.cell.double_width
 
+
+cdef class TextgridCellRow:
+
+cdef:
+Evas_Textgrid_Cell *row
+unsigned int rowsize
+
+@staticmethod
+cdef TextgridCellRow create(Evas_Textgrid_Cell *row, unsigned int rowsize):
+if row == NULL:
+raise ValueError("Invalid pointer for evas textgrid cell row!")
+cdef TextgridCellRow ret = TextgridCellRow.__new__(TextgridCellRow)
+ret.row = row
+ret.rowsize = rowsize
+return ret
+
+def __len__(self):
+return self.rowsize
+
+def __getitem__(self, x):
+if x > self.rowsize - 1:
+raise IndexError
+if x < 0:
+x = self.rowsize - x
+if x < 0:
+raise IndexError
+return TextgridCell.create(&self.row[x])
+
+
 cdef class Textgrid(Object):
 """
 
@@ -343,13 +380,13 @@ cdef class Textgrid(Object):
 def __get__(self):
 return evas_object_textgrid_supported_font_styles_get(self.obj)
 
-def cellrow_set(self, int y, list row not None):
+def cellrow_set(self, int y, TextgridCellRow row not None):
 """Set the string at the given row.
 
 :param y: The row index of the grid.
 :type y: int
 :param row: The string as a sequence of :class:`TextgridCell`.
-:type row: list
+:type row: :class:`TextgridCellRow`
 
 This method allows returning cells to the textgrid, retrieved with
 :py:meth:`cellrow_get`.
@@ -361,26 +398,14 @@ cdef class Textgrid(Object):
 :py:meth:`update_add`
 
 """
-cdef:
-TextgridCell cell
-Evas_Textgrid_Cell **crow
-int rlen = len(row)
-int i
-
-crow = malloc(rlen * sizeof(Evas_Textgrid_Cell 
*))
-
-for i in range(rlen):
-cell = row[i]
-crow[i] = cell.cell
-
-evas_object_textgrid_cellrow_set(self.obj, y, crow[0])
+evas_object_textgrid_cellrow_set(self.obj, y, row.row)
 
 def cellrow_get(self, int y):
 """Get the string at the given row.
 
 :param int y: The row index of the grid.
 :return: A list of :class:`TextgridCell`
-:rtype: list
+:rtype: :class:`TextgridCellRow`
 
 This method returns a list of cells in the line **y** of
 the textgrid object. If **y** is not between 0 and the number
@@ -393,21 +418,8 @@ cdef class Textgrid(Object):
 :py:meth:`update_add`
 
 """
-cdef:
-Evas_Textgrid_Cell *row = 
evas_object_textgrid_cellrow_get(self.obj, y)
-int i
-list ret = []
-TextgridCell cell
-
-if row == NULL:
-return None
-
-for i in range(self.size[0]):
-cell = TextgridCell.__new__(TextgridCell)
-cell.cell = &row[i]
-ret.append(cell)
-
-return ret
+return TextgridCellRow.create(
+evas_object_textgrid_cellrow_get(self.obj, y), self.size[0])
 
 def update_add(self, int x, int y, int w, int h):
 """Indicate for evas that part of a textgrid region (cells) has been 
updated.
diff --git a/examples/elementary/test_evas_textgrid.py 
b/examples/elementary/test_evas_textgrid.py
index 5fce834..8a281a8 100644
--- a/examples/elementary/test_evas_textgrid.py
+++ b/examples/elementary/test_evas_textgrid.py
@@ -5,34 +5,46 @@ from efl import evas
 from efl.evas import Textgrid, EVAS_

[EGIT] [bindings/python/python-efl] master 01/01: Small clarifications to ChangeLog

2015-05-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=a70d9c7cd46b03cb3b5bd2610b67ec26a0906ea6

commit a70d9c7cd46b03cb3b5bd2610b67ec26a0906ea6
Author: Kai Huuhko 
Date:   Sun May 3 15:09:42 2015 +0300

Small clarifications to ChangeLog
---
 ChangeLog | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7a5ce65..27296e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,9 +10,10 @@ Fixes:
 
 Improvements:
 
- * Added evas.Smart and changed elm.Object to inherit from Smart
- * Better init/shutdown management in elm, no more need to manually call
-   those functions
+ * Re-added evas.SmartObject (with incompatible API compared to the earlier
+   incarnation) and made elm.Object inherit from it.
+ * Better init/shutdown management in eo/evas/ecore/elm, no more need to
+   manually call those functions (no harm in doing that though).
 
 
 Changes:

-- 




[EGIT] [bindings/python/python-efl] master 02/02: Remove init/shutdown from elm and emotion main tests

2015-05-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=e37026ec17f20fecf91145e43f9133a3131a59a1

commit e37026ec17f20fecf91145e43f9133a3131a59a1
Author: Kai Huuhko 
Date:   Mon May 4 03:36:31 2015 +0300

Remove init/shutdown from elm and emotion main tests
---
 examples/elementary/test.py  |  2 --
 examples/emotion/test_emotion.py | 10 +-
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/examples/elementary/test.py b/examples/elementary/test.py
index e306cc0..0878178 100755
--- a/examples/elementary/test.py
+++ b/examples/elementary/test.py
@@ -309,7 +309,6 @@ def cb_filter(en, win):
 menu_create(en.text_get(), win)
 
 if __name__ == "__main__":
-elementary.init()
 win = StandardWindow("test", "Python EFL test application")
 win.callback_delete_request_add(destroy, "test1", "test2",
 str3="test3", str4="test4")
@@ -364,4 +363,3 @@ if __name__ == "__main__":
 win.resize(480, 480)
 win.show()
 elementary.run()
-elementary.shutdown()
diff --git a/examples/emotion/test_emotion.py b/examples/emotion/test_emotion.py
index 54d8cde..21ca635 100755
--- a/examples/emotion/test_emotion.py
+++ b/examples/emotion/test_emotion.py
@@ -48,7 +48,7 @@ class MovieWindow(edje.Edje):
 self.part_text_set("video_alpha_txt", "alpha 255")
 self.part_drag_value_set("video_volume", 0.0, 0.5)
 self.part_text_set("video_volume_txt", "vol 0.50")
-
+
 self.part_swallow("video_swallow", self.vid)
 self.data["moving"] = False
 self.data["resizing"] = False
@@ -365,8 +365,6 @@ def cmdline_parse():
 if __name__ == "__main__"or True:
 options, args = cmdline_parse()
 
-elementary.init()
-
 # elementary window
 win = Window("test-emotion", ELM_WIN_BASIC)
 win.title_set("python-emotion test application")
@@ -414,9 +412,3 @@ if __name__ == "__main__"or True:
 del win.data["movie_windows"]
 win.delete()
 del scene
-
-
-elementary.shutdown()
-emotion.shutdown()
-edje.shutdown()
-evas.shutdown()

-- 




[EGIT] [bindings/python/python-efl] master 01/02: Add automated init/shutdown to rest of the modules

2015-05-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=bc0f40e54c4790bd106b904eb0842fc46b42ee15

commit bc0f40e54c4790bd106b904eb0842fc46b42ee15
Author: Kai Huuhko 
Date:   Mon May 4 03:35:50 2015 +0300

Add automated init/shutdown to rest of the modules
---
 efl/ecore_x/efl.ecore_x.pyx | 5 +
 efl/edje/efl.edje.pyx   | 8 
 efl/emotion/efl.emotion.pyx | 3 +++
 efl/ethumb/efl.ethumb.pyx   | 3 +++
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/efl/ecore_x/efl.ecore_x.pyx b/efl/ecore_x/efl.ecore_x.pyx
index 4baf32b..cf0e90e 100644
--- a/efl/ecore_x/efl.ecore_x.pyx
+++ b/efl/ecore_x/efl.ecore_x.pyx
@@ -19,6 +19,8 @@
 from cpython cimport PyMem_Malloc, PyMem_Free, PyUnicode_AsUTF8String
 from efl.utils.deprecated cimport DEPRECATED
 
+import atexit
+
 
 def init(name=None):
 """Initialize the X display connection to the given display.
@@ -322,3 +324,6 @@ def cursor_free(Ecore_X_Cursor c):
 
 include "efl.ecore_x_window.pxi"
 include "efl.ecore_x_events.pxi"
+
+init()
+atexit.register(shutdown)
diff --git a/efl/edje/efl.edje.pyx b/efl/edje/efl.edje.pyx
index b9201c6..dad8ff4 100644
--- a/efl/edje/efl.edje.pyx
+++ b/efl/edje/efl.edje.pyx
@@ -30,10 +30,6 @@ Classes
 
 """
 
-
-import traceback
-import warnings
-
 from cpython cimport PyMem_Malloc, PyMem_Free, PyUnicode_AsUTF8String
 cimport libc.stdlib
 from libc.stdint cimport uintptr_t
@@ -45,6 +41,9 @@ from efl.eo cimport _object_mapping_register, 
object_from_instance, \
 from efl.utils.conversions cimport _ctouni, _touni, \
 eina_list_strings_to_python_list
 
+import traceback
+import warnings
+import atexit
 
 
 def init():
@@ -288,3 +287,4 @@ include "efl.edje_object.pxi"
 
 
 init()
+atexit.register(shutdown)
diff --git a/efl/emotion/efl.emotion.pyx b/efl/emotion/efl.emotion.pyx
index 809d250..ffe1318 100644
--- a/efl/emotion/efl.emotion.pyx
+++ b/efl/emotion/efl.emotion.pyx
@@ -41,6 +41,8 @@ from efl.utils.conversions cimport _ctouni
 from efl.evas cimport Canvas, evas_object_smart_callback_add, \
 evas_object_smart_callback_del
 
+import atexit
+
 
 cdef void _emotion_callback(void *data, Evas_Object *o, void *ei) with gil:
 cdef Emotion obj
@@ -1285,3 +1287,4 @@ _object_mapping_register("Emotion_Object", Emotion)
 
 
 init()
+atexit.register(shutdown)
diff --git a/efl/ethumb/efl.ethumb.pyx b/efl/ethumb/efl.ethumb.pyx
index 9f6f831..573f811 100644
--- a/efl/ethumb/efl.ethumb.pyx
+++ b/efl/ethumb/efl.ethumb.pyx
@@ -15,6 +15,8 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this Python-EFL.  If not, see <http://www.gnu.org/licenses/>.
 
+import atexit
+
 def init():
 return ethumb_init()
 
@@ -28,3 +30,4 @@ cdef class PyEthumb:
 
 
 init()
+atexit.register(shutdown)

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Removed init/shutdown calls from tests and examples

2015-05-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=4d73872f8ff021138cdce8869ba624d767a9

commit 4d73872f8ff021138cdce8869ba624d767a9
Author: Kai Huuhko 
Date:   Mon May 4 04:03:07 2015 +0300

Removed init/shutdown calls from tests and examples
---
 ChangeLog  |  4 +--
 TODO   |  1 -
 examples/dbus/test_dbus_spy.py | 41 ++
 examples/ecore/x/mplayer_embed.py  |  5 ++-
 examples/ecore/x/window_creation.py|  3 +-
 examples/elementary/test_3d.py |  2 --
 examples/elementary/test_access.py |  2 --
 examples/elementary/test_actionslider.py   |  2 --
 examples/elementary/test_bg.py |  2 --
 examples/elementary/test_box.py|  2 --
 examples/elementary/test_bubble.py |  2 --
 examples/elementary/test_button.py |  2 --
 examples/elementary/test_calendar.py   |  2 --
 examples/elementary/test_check.py  |  2 --
 examples/elementary/test_clock.py  |  2 --
 examples/elementary/test_cnp.py|  2 --
 examples/elementary/test_colorselector.py  |  2 --
 examples/elementary/test_config.py |  2 --
 examples/elementary/test_conform.py|  2 --
 .../elementary/test_core_ecore_events_in_elm.py|  2 --
 .../elementary/test_core_evas_canvas_callbacks.py  |  2 --
 .../elementary/test_core_evas_object_callbacks.py  |  2 --
 examples/elementary/test_core_evas_objects.py  |  2 --
 examples/elementary/test_core_evas_smart.py|  2 --
 examples/elementary/test_ctxpopup.py   |  2 --
 examples/elementary/test_cursor.py |  2 --
 examples/elementary/test_datetime.py   |  2 --
 examples/elementary/test_dayselector.py|  2 --
 examples/elementary/test_diskselector.py   |  2 --
 examples/elementary/test_dnd.py|  2 --
 examples/elementary/test_entry.py  |  2 --
 examples/elementary/test_evas_textgrid.py  |  2 --
 examples/elementary/test_external.py   |  2 --
 examples/elementary/test_fileselector.py   |  2 --
 examples/elementary/test_fileselector_button.py|  2 --
 examples/elementary/test_fileselector_entry.py |  2 --
 examples/elementary/test_flip.py   |  2 --
 examples/elementary/test_flipselector.py   |  2 --
 examples/elementary/test_floating.py   |  2 --
 examples/elementary/test_focus.py  |  2 --
 examples/elementary/test_frame.py  |  2 --
 examples/elementary/test_gengrid.py|  2 --
 examples/elementary/test_genlist.py|  2 --
 examples/elementary/test_gesture_layer.py  |  2 --
 examples/elementary/test_grid.py   |  2 --
 examples/elementary/test_hover.py  |  2 --
 examples/elementary/test_hoversel.py   |  2 --
 examples/elementary/test_icon.py   |  2 --
 examples/elementary/test_image.py  |  2 --
 examples/elementary/test_index.py  |  2 --
 examples/elementary/test_input_events.py   |  2 --
 examples/elementary/test_inwin.py  |  2 --
 examples/elementary/test_label.py  |  2 --
 examples/elementary/test_layout.py |  2 --
 examples/elementary/test_list.py   |  2 --
 examples/elementary/test_main_menu.py  |  2 --
 examples/elementary/test_map.py|  2 --
 examples/elementary/test_mapbuf.py |  2 --
 examples/elementary/test_menu.py   |  2 --
 examples/elementary/test_multibuttonentry.py   |  2 --
 examples/elementary/test_naviframe.py  |  2 --
 examples/elementary/test_notify.py |  2 --
 examples/elementary/test_panel.py  |  2 --
 examples/elementary/test_panel_scroll.py   |  2 --
 examples/elementary/test_panes.py  |  2 --
 examples/elementary/test_photo.py  |  2 --
 examples/elementary/test_photocam.py   |  2 --
 examples/elementary/test_popup.py  |  2 --
 examples/elementary/test_progressbar.py|  2 --
 examples/elementary/test_radio.py  |  2 --
 examples/elementary/test_scroller.py   |  2 --
 examples/elementary/test_segment_control.py|  2 --
 examples/elementary/test_separator.py  |  2 --
 examples/elementary/test_slider.py |  2 --
 examples/elementary/test_slideshow.py  |  2 --
 examples/elementary/test_spinner.py|  2 --
 examples/elementary/test_store.py  |  2 --
 examples/elementary

[EGIT] [bindings/python/python-efl] master 01/01: elm.Toolbar: Note earlier changes to events and update example

2015-05-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=59b2e1ee598d6c412dc496dd96e0bb529c4dd88f

commit 59b2e1ee598d6c412dc496dd96e0bb529c4dd88f
Author: Kai Huuhko 
Date:   Mon May 4 05:53:20 2015 +0300

elm.Toolbar: Note earlier changes to events and update example

See commit 61b53f24774de8690c6f1e4a8a6e55e30e514714
---
 ChangeLog   | 2 ++
 examples/elementary/test_toolbar.py | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 1dab381..8449359 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,8 @@ Changes:
 
  * elm.List.callback_highlighted_add: Added item param to func
  * elm.List.callback_unhighlighted_add: Added item param to func
+ * elm.Toolbar.callback_clicked_add: Added item param to func
+ * elm.Toolbar.callback_longpressed_add: Added item param to func
  * elm.Slideshow: item_data are now a single value, instead of args/kargs,
like is implemented in Gengrid/Genlist
 
diff --git a/examples/elementary/test_toolbar.py 
b/examples/elementary/test_toolbar.py
index 28568dd..932d8ad 100644
--- a/examples/elementary/test_toolbar.py
+++ b/examples/elementary/test_toolbar.py
@@ -46,9 +46,10 @@ def tb_4a(obj, it, ph):
 def tb_5(obj, it, ph):
 ph.file = None
 
-def cb_clicked(tb):
+def cb_clicked(tb, it):
 print("CLICKED")
 print(tb)
+print(it)
 
 def cb_item_focused(tb, item):
 print("ITEM FOCUSED")

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Examples: Fixed ecore_x and dbus examples

2015-05-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=94779d1640981bca3af79bd6ff5cd77edd138567

commit 94779d1640981bca3af79bd6ff5cd77edd138567
Author: Kai Huuhko 
Date:   Mon May 4 08:38:27 2015 +0300

Examples: Fixed ecore_x and dbus examples
---
 examples/dbus/test_dbus_spy.py  | 18 ++
 examples/ecore/x/mplayer_embed.py   |  4 ++--
 examples/ecore/x/window_creation.py |  2 +-
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/examples/dbus/test_dbus_spy.py b/examples/dbus/test_dbus_spy.py
index fb7fff2..f89b7b8 100755
--- a/examples/dbus/test_dbus_spy.py
+++ b/examples/dbus/test_dbus_spy.py
@@ -20,7 +20,9 @@ from efl.elementary.label import Label
 from efl.elementary.panes import Panes
 from efl.elementary.popup import Popup
 from efl.elementary.separator import Separator
-from efl.elementary.genlist import Genlist, GenlistItem, GenlistItemClass
+from efl.elementary.genlist import Genlist, GenlistItemClass, \
+ELM_GENLIST_ITEM_GROUP, ELM_GENLIST_ITEM_TREE, \
+ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY
 from efl.dbus_mainloop import DBusEcoreMainLoop
 
 
@@ -253,12 +255,12 @@ class NamesList(Genlist):
 
 # add private & public group items
 self.public_group = self.item_append(self.itc_g, "Public Services",
-   flags=elm.ELM_GENLIST_ITEM_GROUP)
-
self.public_group.select_mode_set(elm.ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
+   flags=ELM_GENLIST_ITEM_GROUP)
+self.public_group.select_mode_set(ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
 
 self.private_group = self.item_append(self.itc_g, "Private Services",
-   flags=elm.ELM_GENLIST_ITEM_GROUP)
-
self.private_group.select_mode_set(elm.ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
+   flags=ELM_GENLIST_ITEM_GROUP)
+self.private_group.select_mode_set(ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
 
 # populate the genlist
 self.populate()
@@ -361,8 +363,8 @@ class DetailList(Genlist):
 # objects
 for obj in recursive_introspect(bus, name, '/'):
 obj_item = self.item_append(self.itc_g, obj,
-flags=elm.ELM_GENLIST_ITEM_GROUP)
-obj_item.select_mode_set(elm.ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
+flags=ELM_GENLIST_ITEM_GROUP)
+obj_item.select_mode_set(ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
 
 # interfaces
 for iface in obj.interfaces:
@@ -371,7 +373,7 @@ class DetailList(Genlist):
   continue
 iface_item = self.item_append(self.itc, iface,
   parent_item=obj_item,
-  flags=elm.ELM_GENLIST_ITEM_TREE)
+  flags=ELM_GENLIST_ITEM_TREE)
 
 def sort_cb(self, it1, it2):
 pri1 = pri2 = 0
diff --git a/examples/ecore/x/mplayer_embed.py 
b/examples/ecore/x/mplayer_embed.py
index e1a62af..6586ad1 100644
--- a/examples/ecore/x/mplayer_embed.py
+++ b/examples/ecore/x/mplayer_embed.py
@@ -2,7 +2,7 @@
 
 import sys
 import efl.ecore
-from efl.ecore.x import Window, on_window_configure_add
+from efl.ecore_x import Window, on_window_configure_add
 from subprocess import Popen, PIPE
 
 
@@ -39,5 +39,5 @@ def on_configure(event, main_window, sub_window):
 on_window_configure_add(on_configure, main_window, sub_window)
 
 efl.ecore.fd_handler_add(
-p.stdout, efl.ecore.ECORE_FD_ALL, handle_read, p.stdout)
+p.stdout, efl.ecore_x.ECORE_FD_ALL, handle_read, p.stdout)
 efl.ecore.main_loop_begin()
diff --git a/examples/ecore/x/window_creation.py 
b/examples/ecore/x/window_creation.py
index f8275bb..5dc2268 100644
--- a/examples/ecore/x/window_creation.py
+++ b/examples/ecore/x/window_creation.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 import efl.ecore
-from efl.ecore.x import Window, on_window_configure_add
+from efl.ecore_x import Window, on_window_configure_add
 
 
 # method 1

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Bump version for 1.14.0 release

2015-05-03 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=1011cb76df9adf516be79426bbee298eb962ae3e

commit 1011cb76df9adf516be79426bbee298eb962ae3e
Author: Kai Huuhko 
Date:   Mon May 4 09:25:43 2015 +0300

Bump version for 1.14.0 release
---
 ChangeLog   | 2 +-
 api_coverage.py | 4 +---
 efl/__init__.py | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8449359..5cbe152 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
 
 ===
-2015-05-03  v1.14.0
+2015-05-04  v1.14.0
 ===
 
 Fixes:
diff --git a/api_coverage.py b/api_coverage.py
index e51624f..f08a783 100755
--- a/api_coverage.py
+++ b/api_coverage.py
@@ -55,8 +55,6 @@ params = {
 "elementary": ("efl/elementary", "Elementary", "elm"),
 }
 
-EFL_MIN_VERSION = "1.9.99"
-
 parser = argparse.ArgumentParser(
 description="Reports EFL vs. Python-EFL API functions coverage"
 )
@@ -205,7 +203,7 @@ print("")
 
 for lib in args.libs:
 
-inc_paths = pkg_config(lib, EFL_MIN_VERSION)
+inc_paths = pkg_config(lib)
 inc_path = None
 for p in inc_paths:
 if lib in p:
diff --git a/efl/__init__.py b/efl/__init__.py
index 59b4312..de34739 100644
--- a/efl/__init__.py
+++ b/efl/__init__.py
@@ -20,5 +20,5 @@
 # pre-release: "1.13.0-beta1" ( 1, 13, 0 )
 # release: "1.13.0" ( 1, 13, 0 )
 
-__version__ = "1.14.0-beta1"
+__version__ = "1.14.0"
 __version_info__ = ( 1, 14, 0 )

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Open up development for 1.15

2015-05-07 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=d571c49e6f1e01ea8d5d6c24a676742bd4befd03

commit d571c49e6f1e01ea8d5d6c24a676742bd4befd03
Author: Kai Huuhko 
Date:   Thu May 7 13:10:20 2015 +0300

Open up development for 1.15
---
 ChangeLog   | 16 +++-
 efl/__init__.py |  4 ++--
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5cbe152..7e48b13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,20 @@
+===
+2015-08-03  v1.15.0
+===
+
+Fixes:
+
+Improvements:
+
+Changes:
+
+Additions:
+
+Deprecation:
+
 
 ===
-2015-05-04  v1.14.0
+2015-05-07  v1.14.0
 ===
 
 Fixes:
diff --git a/efl/__init__.py b/efl/__init__.py
index de34739..480cbbe 100644
--- a/efl/__init__.py
+++ b/efl/__init__.py
@@ -20,5 +20,5 @@
 # pre-release: "1.13.0-beta1" ( 1, 13, 0 )
 # release: "1.13.0" ( 1, 13, 0 )
 
-__version__ = "1.14.0"
-__version_info__ = ( 1, 14, 0 )
+__version__ = "1.14.99"
+__version_info__ = ( 1, 14, 99 )

-- 




[EGIT] [website/www-content] master 01/01: Wiki page download-latest changed with summary [Bump Python-EFL version] by Kai Huuhko

2015-05-07 Thread Kai Huuhko
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=c205fb81199d808e03eaac909e1068c504954ad6

commit c205fb81199d808e03eaac909e1068c504954ad6
Author: Kai Huuhko 
Date:   Thu May 7 03:33:59 2015 -0700

Wiki page download-latest changed with summary [Bump Python-EFL version] by 
Kai Huuhko
---
 pages/download-latest.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pages/download-latest.txt b/pages/download-latest.txt
index 979671e..01bd4fa 100644
--- a/pages/download-latest.txt
+++ b/pages/download-latest.txt
@@ -3,7 +3,7 @@ efl_v = 1.14.0
 elm_v = 1.14.0
 emotion_generic_players_v = 1.14.0
 evas_generic_loaders_v= 1.14.0
-python_efl_v  = 1.13.0
+python_efl_v  = 1.14.0
 
 enlightenment_v   = 0.19.5
 terminology_v = 0.8.0

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Elm: Fix module init from embedded interpreter

2015-05-09 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=9b234a4266cd72c28cd58602896756c000cf918d

commit 9b234a4266cd72c28cd58602896756c000cf918d
Author: Kai Huuhko 
Date:   Sat May 9 20:16:45 2015 +0300

Elm: Fix module init from embedded interpreter

sys.argv doesn't exist there
---
 efl/elementary/__init__.pyx | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/efl/elementary/__init__.pyx b/efl/elementary/__init__.pyx
index c4137da..9a2a602 100644
--- a/efl/elementary/__init__.pyx
+++ b/efl/elementary/__init__.pyx
@@ -113,20 +113,20 @@ def init():
 # FIXME: Why are we passing the cl args to elm_init here?
 
 cdef:
-int argc, i, arg_len
-char **argv
+int argc = 0, i, arg_len
+char **argv = NULL
 char *arg
-int ret
-
-argc = len(sys.argv)
-argv = PyMem_Malloc(argc * sizeof(char *))
-for i in range(argc):
-t = sys.argv[i]
-if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
-arg = t
-arg_len = len(arg)
-argv[i] = PyMem_Malloc(arg_len + 1)
-memcpy(argv[i], arg, arg_len + 1)
+
+if hasattr(sys, "argv"):
+argc = len(sys.argv)
+argv = PyMem_Malloc(argc * sizeof(char *))
+for i in range(argc):
+t = sys.argv[i]
+if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
+arg = t
+arg_len = len(arg)
+argv[i] = PyMem_Malloc(arg_len + 1)
+memcpy(argv[i], arg, arg_len + 1)
 
 return elm_init(argc, argv)
 

-- 




[EGIT] [bindings/python/python-efl] python-efl-1.14 01/01: Elm: Fix module init from embedded interpreter

2015-05-09 Thread Kai Huuhko
kuuko pushed a commit to branch python-efl-1.14.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=73938af391e61985c8fa687cb571bf8cd759f4d5

commit 73938af391e61985c8fa687cb571bf8cd759f4d5
Author: Kai Huuhko 
Date:   Sat May 9 20:16:45 2015 +0300

Elm: Fix module init from embedded interpreter

sys.argv doesn't exist there
---
 efl/elementary/general.pyx | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index f449785..3584b7c 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -366,20 +366,20 @@ def init():
 # FIXME: Why are we passing the cl args to elm_init here?
 
 cdef:
-int argc, i, arg_len
-char **argv
+int argc = 0, i, arg_len
+char **argv = NULL
 char *arg
-int ret
-
-argc = len(sys.argv)
-argv = PyMem_Malloc(argc * sizeof(char *))
-for i in range(argc):
-t = sys.argv[i]
-if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
-arg = t
-arg_len = len(arg)
-argv[i] = PyMem_Malloc(arg_len + 1)
-memcpy(argv[i], arg, arg_len + 1)
+
+if hasattr(sys, "argv"):
+argc = len(sys.argv)
+argv = PyMem_Malloc(argc * sizeof(char *))
+for i in range(argc):
+t = sys.argv[i]
+if isinstance(t, unicode): t = PyUnicode_AsUTF8String(t)
+arg = t
+arg_len = len(arg)
+argv[i] = PyMem_Malloc(arg_len + 1)
+memcpy(argv[i], arg, arg_len + 1)
 
 return elm_init(argc, argv)
 

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Elm: Replace FIXME in init about argc/v with description

2015-05-09 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=3dd36bd7706090c148729531332a3441e4a8b0cd

commit 3dd36bd7706090c148729531332a3441e4a8b0cd
Author: Kai Huuhko 
Date:   Sat May 9 20:54:44 2015 +0300

Elm: Replace FIXME in init about argc/v with description
---
 efl/elementary/__init__.pyx | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/efl/elementary/__init__.pyx b/efl/elementary/__init__.pyx
index 9a2a602..2c0ca00 100644
--- a/efl/elementary/__init__.pyx
+++ b/efl/elementary/__init__.pyx
@@ -110,7 +110,10 @@ def init():
 EINA_LOG_DOM_INFO(PY_EFL_ELM_LOG_DOMAIN,
 "Initializing efl.elementary", NULL)
 
-# FIXME: Why are we passing the cl args to elm_init here?
+# argc and argv are currently used by EFL to support app restart
+# and binary relocation. These are probably not useful to us but we
+# pass the information here regardless because useful functionality
+# may be added in the future.
 
 cdef:
 int argc = 0, i, arg_len

-- 




[EGIT] [apps/epour] master 01/02: Use window mode for torrent tooltips

2015-05-16 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=8a45182cc450c25a13d7e9239b89a38721369287

commit 8a45182cc450c25a13d7e9239b89a38721369287
Author: Kai Huuhko 
Date:   Wed Apr 22 09:40:03 2015 +0300

Use window mode for torrent tooltips
---
 epour/gui/__init__.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/epour/gui/__init__.py b/epour/gui/__init__.py
index 37be299..c01309d 100644
--- a/epour/gui/__init__.py
+++ b/epour/gui/__init__.py
@@ -279,6 +279,7 @@ class MainInterface(object):
 itc = TorrentClass(self.session, "double_label")
 item = self.tlist.item_append(itc, h)
 item.tooltip_content_cb_set(self._torrent_item_tooltip_cb, h)
+item.tooltip_window_mode_set(True)
 self.torrentitems[ihash] = item
 
 def remove_torrent_item(self, info_hash):

-- 




[EGIT] [apps/epour] master 02/02: Add compatibility for lt-rb 1.0 and py3k

2015-05-16 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=cb3c4b7f6618bc6f9230945c78eceaad54a7c588

commit cb3c4b7f6618bc6f9230945c78eceaad54a7c588
Author: Kai Huuhko 
Date:   Sun May 17 02:34:25 2015 +0300

Add compatibility for lt-rb 1.0 and py3k

Beware, may remove your torrents from the app.

lt-rb >= 1.0 is now a requirement
---
 README   | 12 
 epour/Epour.py   | 14 ++
 epour/__init__.py|  2 +-
 epour/gui/TorrentProps.py|  5 +++-
 epour/gui/TorrentSelector.py |  5 ++--
 epour/gui/Widgets.py |  3 ++
 epour/gui/__init__.py| 14 +-
 epour/session.py | 65 ++--
 setup.py |  5 +---
 9 files changed, 54 insertions(+), 71 deletions(-)

diff --git a/README b/README
index 45e5a68..007012d 100644
--- a/README
+++ b/README
@@ -2,20 +2,20 @@
 REQUIREMENTS
 
 
-* libtorrent-rasterbar 0.16.0 or later, currently tested and developed with
-  version 0.16.16
+* libtorrent-rasterbar 1.0 or later, currently tested and developed with
+  version 1.0.5
 
 http://www.libtorrent.org/
 
 * Enlightenment Foundation Libraries 1.8 or later
 
-http://enlightenment.org/p.php?p=download&l=en
+https://www.enlightenment.org/download
 
-* Python Bindings for EFL 1.8 or later
+* Python-EFL 1.8 or later
 
-http://enlightenment.org/p.php?p=download&l=en
+https://www.enlightenment.org/download
 
-* Python 2.x or later
+* Python 2.6 or later, 3.2 or later
 
 http://www.python.org/
 
diff --git a/epour/Epour.py b/epour/Epour.py
index c87f310..17cb8a4 100644
--- a/epour/Epour.py
+++ b/epour/Epour.py
@@ -57,10 +57,10 @@ else:
 sys.exit()
 
 import os
-try:
-from ConfigParser import SafeConfigParser
-except ImportError:
+if sys.hexversion >= 0x03F0:
 from configparser import ConfigParser as SafeConfigParser
+else:
+from ConfigParser import SafeConfigParser
 
 import logging
 
@@ -160,8 +160,12 @@ class Epour(object):
 
 def save_conf(self):
 conf_path = os.path.join(save_config_path("epour"), "epour.conf")
-with open(conf_path, 'wb') as configfile:
-self.conf.write(configfile)
+if sys.hexversion >= 0x03F0:
+with open(conf_path, 'w') as configfile:
+self.conf.write(configfile)
+else:
+with open(conf_path, 'wb') as configfile:
+self.conf.write(configfile)
 
 def quit(self):
 session = self.session
diff --git a/epour/__init__.py b/epour/__init__.py
index 906d362..5c2c6c5 100644
--- a/epour/__init__.py
+++ b/epour/__init__.py
@@ -1 +1 @@
-__version__ = "0.6.0"
+__version__ = "0.6.9"
diff --git a/epour/gui/TorrentProps.py b/epour/gui/TorrentProps.py
index 116a231..ea10883 100644
--- a/epour/gui/TorrentProps.py
+++ b/epour/gui/TorrentProps.py
@@ -19,6 +19,9 @@
 #  MA 02110-1301, USA.
 #
 
+if "long" not in dir(__builtins__):
+long = int
+
 import cgi
 import sys
 import os
@@ -656,7 +659,7 @@ class TorrentStatus(Table):
 pass
 elif isinstance(v, lt.storage_mode_t):
 v = str(v).replace("_", " ").capitalize()
-elif isinstance(v, (int, long, basestring)):
+elif isinstance(v, (int, long, bytes, str)):
 if k in self.byte_values:
 v = intrepr(v)
 if k in self.byte_transfer_values:
diff --git a/epour/gui/TorrentSelector.py b/epour/gui/TorrentSelector.py
index 18b7cee..01142d7 100644
--- a/epour/gui/TorrentSelector.py
+++ b/epour/gui/TorrentSelector.py
@@ -241,14 +241,13 @@ always used.'''
 single_line=True, scrollable=True
 )
 uri_entry.part_text_set("guide", _("Enter torrent file path / magnet 
URI / info hash"))
+
 if t_uri:
 uri_entry.entry = utf8_to_markup(t_uri)
+
 hbox.pack_end(uri_entry)
 uri_entry.show()
 
-if t_uri:
-uri_entry.entry = t_uri
-
 fsb = Button(box, text=_("Select file"))
 fsb.callback_clicked_add(lambda x: TorrentFs(self, uri_entry))
 hbox.pack_end(fsb)
diff --git a/epour/gui/Widgets.py b/epour/gui/Widgets.py
index 6e6a178..7aa0f06 100644
--- a/epour/gui/Widgets.py
+++ b/epour/gui/Widgets.py
@@ -16,6 +16,9 @@ EXPAND_HORIZ = EVAS_HINT_EXPAND, 0.0
 FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
 FILL_HORIZ = EVAS_HINT_FILL, 0.5
 
+if "xrange" not in dir(__builtins__):
+xrange = range
+
 
 def chunker(seq, size):
 return (seq[pos:pos + size] for pos in xrange(0, len(seq), size))
diff --git a/epour/gui/__init__.py b/epour/gui/__init__.py
index c01309d..e16c77c 100644
--- a/epour/gui/__init__.py
+++ b/epour/gui/__init__.py
@@ -23,7 +23,10 @@ import cgi
 import l

[EGIT] [bindings/python/python-efl] master 01/01: Follow recent changes in Eo

2015-06-01 Thread Kai Huuhko
kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=37930f389d31c40a6ec90a6c154ffa574ad96ce7

commit 37930f389d31c40a6ec90a6c154ffa574ad96ce7
Author: Kai Huuhko 
Date:   Mon Jun 1 17:59:47 2015 +0300

Follow recent changes in Eo
---
 efl/eo/efl.eo.pyx  | 2 +-
 efl/evas/efl.evas_object_smart.pxi | 2 +-
 include/efl.c_eo.pxd   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index d8cdf70..bd38c2f 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -259,7 +259,7 @@ cdef class Eo(object):
 assert obj != NULL, "Cannot set a NULL object"
 
 self.obj = obj
-eo_do(self.obj, eo_key_data_set("python-eo", self, NULL))
+eo_do(self.obj, eo_key_data_set("python-eo", self))
 eo_do(self.obj,
 eo_event_callback_add(EO_EV_DEL, _eo_event_del_cb, self))
 Py_INCREF(self)
diff --git a/efl/evas/efl.evas_object_smart.pxi 
b/efl/evas/efl.evas_object_smart.pxi
index c6287c9..e74948c 100644
--- a/efl/evas/efl.evas_object_smart.pxi
+++ b/efl/evas/efl.evas_object_smart.pxi
@@ -704,7 +704,7 @@ cdef class SmartObject(Object):
 assert obj != NULL, "Cannot set a NULL object"
 
 self.obj = obj
-eo_do(self.obj, eo_key_data_set("python-eo", self, NULL))
+eo_do(self.obj, eo_key_data_set("python-eo", self))
 evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE,
obj_free_cb, self)
 Py_INCREF(self)
diff --git a/include/efl.c_eo.pxd b/include/efl.c_eo.pxd
index bc80e62..11cb094 100644
--- a/include/efl.c_eo.pxd
+++ b/include/efl.c_eo.pxd
@@ -103,7 +103,7 @@ cdef extern from "Eo.h":
 void *eo_do_ret(Eo *obj, ...)
 const Eo_Class *eo_base_class_get()
 
-void  eo_key_data_set(const char *key, const void *data, 
eo_key_data_free_func free_func)
+void  eo_key_data_set(const char *key, const void *data)
 void *eo_key_data_get(const char *key)
 void  eo_key_data_del(const char *key)
 

--