kuuko pushed a commit to branch master. http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=29259e670e55a83fe12e56c61487c4161e52f24b
commit 29259e670e55a83fe12e56c61487c4161e52f24b Author: Kai Huuhko <[email protected]> Date: Wed Oct 2 20:28:16 2013 +0300 Elementary: Clean up cruft from the transit test and add it to test.py --- examples/elementary/test.py | 3 ++- examples/elementary/test_transit.py | 19 ++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/examples/elementary/test.py b/examples/elementary/test.py index 8d49e93..4009efd 100755 --- a/examples/elementary/test.py +++ b/examples/elementary/test.py @@ -65,6 +65,7 @@ items = [ ("Transit Blend", "test_transit", "transit5_clicked"), ("Transit Fade", "test_transit", "transit6_clicked"), ("Transit Resizable", "test_transit", "transit7_clicked"), + ("Transit Custom", "test_transit", "transit8_clicked"), ("Transit Chain", "test_transit", "transit9_clicked"), ]), ("Entries", [ @@ -180,7 +181,7 @@ items = [ def selected_cb(o, mod, func): - exec("from " +mod + " import " + func + "\n" + func + "(o)") + exec("from {0} import {1}; {1}(o)".format(mod, func)) def menu_create(search, win): tbx.clear() diff --git a/examples/elementary/test_transit.py b/examples/elementary/test_transit.py index 6e713e2..5c3040e 100644 --- a/examples/elementary/test_transit.py +++ b/examples/elementary/test_transit.py @@ -22,21 +22,15 @@ class CustomEffect(TransitCustomEffect): self.to_h = to_h - from_h def transition_cb(effect, transit, progress): - if not effect: return - elist = [] - - custom_effect = effect - objs = transit.objects - if progress < 0.5: - h = custom_effect.fr_h + (custom_effect.to_h * progress * 2) - w = custom_effect.fr_w + h = effect.fr_h + (effect.to_h * progress * 2) + w = effect.fr_w else: - h = custom_effect.fr_h + custom_effect.to_h - w = custom_effect.fr_w + \ - (custom_effect.to_w * (progress - 0.5) * 2) + h = effect.fr_h + effect.to_h + w = effect.fr_w + \ + (effect.to_w * (progress - 0.5) * 2) - for obj in objs: + for obj in transit.objects: obj.resize(w, h) def end_cb(effect, transit): @@ -352,7 +346,6 @@ def transit8_clicked(obj, item=None): trans = Transit() trans.auto_reverse = True trans.tween_mode = ELM_TRANSIT_TWEEN_MODE_DECELERATE - #effect_context = _custom_context_new(150, 150, 50, 50) trans.object_add(bt) trans.effect_add(CustomEffect(150, 150, 50, 50)) trans.duration = 5.0 --
