summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2013-04-20 21:04:47 +0000
committerKai Huuhko <kai.huuhko@gmail.com>2013-04-22 20:20:21 +0300
commit1753d43b7d874182e67f6844145995548c9e4138 (patch)
tree3351c49d6846567005e7ccd3068aa3791dc973bf
parentf38a3145d1bb8e59183b7ae59a9265edd852749b (diff)
Elementary: Add some magic to examples so it imports the individual
tests on demand.
-rwxr-xr-xexamples/elementary/test.py274
-rw-r--r--examples/elementary/test_floating.py2
-rw-r--r--examples/elementary/test_genlist.py13
3 files changed, 103 insertions, 186 deletions
diff --git a/examples/elementary/test.py b/examples/elementary/test.py
index 29844ec..49e55cc 100755
--- a/examples/elementary/test.py
+++ b/examples/elementary/test.py
@@ -15,234 +15,160 @@ from efl.elementary.check import Check
15from efl.elementary.entry import Entry 15from efl.elementary.entry import Entry
16from efl.elementary.scroller import Scroller 16from efl.elementary.scroller import Scroller
17 17
18
19from test_3d import evas3d_clicked
20from test_actionslider import actionslider_clicked
21from test_bg import bg_plain_clicked, bg_image_clicked
22from test_box import box_vert_clicked, box_vert2_clicked, box_horiz_clicked
23from test_box import box_layout_clicked, box_transition_clicked
24from test_bubble import bubble_clicked
25from test_button import buttons_clicked
26from test_calendar import calendar_clicked
27from test_check import check_clicked
28from test_clock import clock_clicked
29from test_colorselector import colorselector_clicked
30from test_config import config_clicked
31from test_conform import conformant_clicked, conformant2_clicked
32from test_core_evas_object_callbacks import core_evas_object_callbacks_clicked
33from test_core_evas_canvas_callbacks import core_evas_canvas_callbacks_clicked
34from test_core_evas_objects import core_evas_objects_clicked
35from test_ctxpopup import ctxpopup_clicked
36from test_cursor import cursor_clicked, cursor2_clicked, cursor3_clicked
37from test_datetime import datetime_clicked
38from test_dayselector import dayselector_clicked
39from test_diskselector import diskselector_clicked
40from test_entry import entry_clicked, entry_scrolled_clicked, entry_anchor_clicked
41from test_external import edje_external_button_clicked, edje_external_pbar_clicked, \
42 edje_external_scroller_clicked, edje_external_slider_clicked, edje_external_video_clicked
43from test_fileselector import fileselector_clicked, fileselector_button_clicked, \
44 fileselector_entry_clicked
45from test_flip import flip_clicked, flip_interactive_clicked
46from test_flipselector import flipselector_clicked
47from test_floating import floating_clicked
48from test_frame import frame_clicked
49from test_gengrid import gengrid_clicked
50from test_genlist import genlist_clicked, genlist2_clicked, genlist3_clicked, \
51 genlist4_clicked, genlist5_clicked, genlist10_clicked, genlist15_clicked
52from test_grid import grid_clicked
53from test_hover import hover_clicked, hover2_clicked
54from test_hoversel import hoversel_clicked
55from test_icon import icon_clicked, icon_transparent_clicked
56from test_index import index_clicked
57from test_inwin import inner_window_clicked
58from test_label import label_clicked
59from test_layout import layout_clicked
60from test_list import list_clicked, list2_clicked, list3_clicked
61from test_mapbuf import mapbuf_clicked
62from test_map import map_clicked
63from test_map2 import map_overlays_clicked
64from test_map3 import map_route_clicked
65from test_menu import menu_clicked
66from test_multibuttonentry import multibuttonentry_clicked
67from test_naviframe import naviframe_clicked
68from test_notify import notify_clicked
69from test_panel import panel_clicked
70from test_panes import panes_clicked
71from test_photo import photo_clicked
72from test_popup import popup_clicked
73from test_progressbar import progressbar_clicked
74from test_radio import radio_clicked
75from test_scroller import scroller_clicked
76from test_segment_control import segment_control_clicked
77from test_separator import separator_clicked
78from test_slideshow import slideshow_clicked
79from test_spinner import spinner_clicked
80from test_table import table_clicked
81from test_thumb import thumb_clicked
82from test_toolbar import toolbar_clicked
83from test_tooltip import tooltip_clicked
84from test_transit import transit_clicked, transit2_clicked, transit3_clicked, \
85 transit4_clicked, transit5_clicked, transit6_clicked, transit7_clicked, \
86 transit9_clicked
87from test_video import video_clicked
88from test_web import web_clicked
89from test_win import window_states_clicked
90
91
92items = [ 18items = [
93 ("Core Libs", [ 19 ("Core Libs", [
94 ("Evas Objects", core_evas_objects_clicked), 20 ("Evas Objects", "test_core_evas_objects", "core_evas_objects_clicked"),
95 ("Evas Canvas Callbacks", core_evas_canvas_callbacks_clicked), 21 ("Evas Canvas Callbacks", "test_core_evas_canvas_callbacks", "core_evas_canvas_callbacks_clicked"),
96 ("Evas Object Callbacks", core_evas_object_callbacks_clicked), 22 ("Evas Object Callbacks", "test_core_evas_object_callbacks", "core_evas_object_callbacks_clicked"),
97 ]), 23 ]),
98 ("3D", [ 24 ("3D", [
99 ("Evas Map 3D", evas3d_clicked), 25 ("Evas Map 3D", "test_3d", "evas3d_clicked"),
100 ]), 26 ]),
101 ("Booleans", [ 27 ("Booleans", [
102 ("Checks", check_clicked), 28 ("Checks", "test_check", "check_clicked"),
103 # ("Toggles", toggles_clicked),TODO make a toggle with check 29 # ("Toggles", toggles_clicked),TODO make a toggle with check
104 ]), 30 ]),
105 ("Boundaries", [ 31 ("Boundaries", [
106 ("Bubble", bubble_clicked), 32 ("Bubble", "test_bubble", "bubble_clicked"),
107 ("Separator", separator_clicked), 33 ("Separator", "test_separator", "separator_clicked"),
108 ]), 34 ]),
109 ("Buttons", [ 35 ("Buttons", [
110 ("Buttons", buttons_clicked), 36 ("Buttons", "test_button", "buttons_clicked"),
111 ]), 37 ]),
112 ("Containers", [ 38 ("Containers", [
113 ("Box Horiz", box_horiz_clicked), 39 ("Box Horiz", "test_box", "box_horiz_clicked"),
114 ("Box Vert", box_vert_clicked), 40 ("Box Vert", "test_box", "box_vert_clicked"),
115 ("Box Vert2", box_vert2_clicked), 41 ("Box Vert2", "test_box", "box_vert2_clicked"),
116 ("Box Layout", box_layout_clicked), 42 ("Box Layout", "test_box", "box_layout_clicked"),
117 ("Box Layout Transition", box_transition_clicked), 43 ("Box Layout Transition", "test_box", "box_transition_clicked"),
118 ("Table", table_clicked), 44 ("Table", "test_table", "table_clicked"),
119 ("Layout", layout_clicked), 45 ("Layout", "test_layout", "layout_clicked"),
120 ("Grid", grid_clicked), 46 ("Grid", "test_grid", "grid_clicked"),
121 ("Frame", frame_clicked), 47 ("Frame", "test_frame", "frame_clicked"),
122 ]), 48 ]),
123 ("Cursors", [ 49 ("Cursors", [
124 ("Cursor", cursor_clicked), 50 ("Cursor", "test_cursor", "cursor_clicked"),
125 ("Cursor2", cursor2_clicked), 51 ("Cursor2", "test_cursor", "cursor2_clicked"),
126 ("Cursor3", cursor3_clicked), 52 ("Cursor3", "test_cursor", "cursor3_clicked"),
127 ]), 53 ]),
128 ("Dividers", [ 54 ("Dividers", [
129 ("Panel", panel_clicked), 55 ("Panel", "test_panel", "panel_clicked"),
130 ("Panes", panes_clicked), 56 ("Panes", "test_panes", "panes_clicked"),
131 ]), 57 ]),
132 ("Effects", [ 58 ("Effects", [
133 ("Flip", flip_clicked), 59 ("Flip", "test_flip", "flip_clicked"),
134 ("Flip Interactive", flip_interactive_clicked), 60 ("Flip Interactive", "test_flip", "flip_interactive_clicked"),
135 ("Transit", transit_clicked), 61 ("Transit", "test_transit", "transit_clicked"),
136 ("Transit Resize", transit2_clicked), 62 ("Transit Resize", "test_transit", "transit2_clicked"),
137 ("Transit Flip", transit3_clicked), 63 ("Transit Flip", "test_transit", "transit3_clicked"),
138 ("Transit Zoom", transit4_clicked), 64 ("Transit Zoom", "test_transit", "transit4_clicked"),
139 ("Transit Blend", transit5_clicked), 65 ("Transit Blend", "test_transit", "transit5_clicked"),
140 ("Transit Fade", transit6_clicked), 66 ("Transit Fade", "test_transit", "transit6_clicked"),
141 ("Transit Resizable", transit7_clicked), 67 ("Transit Resizable", "test_transit", "transit7_clicked"),
142 ("Transit Chain", transit9_clicked), 68 ("Transit Chain", "test_transit", "transit9_clicked"),
143 ]), 69 ]),
144 ("Entries", [ 70 ("Entries", [
145 ("Entry", entry_clicked), 71 ("Entry", "test_entry", "entry_clicked"),
146 ("Entry Scrolled", entry_scrolled_clicked), 72 ("Entry Scrolled", "test_entry", "entry_scrolled_clicked"),
147 ("Entry Anchor", entry_anchor_clicked), 73 ("Entry Anchor", "test_entry", "entry_anchor_clicked"),
148 ("MultiButtonEntry", multibuttonentry_clicked), 74 ("MultiButtonEntry", "test_multibuttonentry", "multibuttonentry_clicked"),
149 ]), 75 ]),
150 ("Edje External", [ 76 ("Edje External", [
151 ("Ext Button", edje_external_button_clicked), 77 ("Ext Button", "test_external", "edje_external_button_clicked"),
152 ("Ext ProgressBar", edje_external_pbar_clicked), 78 ("Ext ProgressBar", "test_external", "edje_external_pbar_clicked"),
153 ("Ext Scroller", edje_external_scroller_clicked), 79 ("Ext Scroller", "test_external", "edje_external_scroller_clicked"),
154 ("Ext Slider", edje_external_slider_clicked), 80 ("Ext Slider", "test_external", "edje_external_slider_clicked"),
155 ("Ext Video", edje_external_video_clicked), 81 ("Ext Video", "test_external", "edje_external_video_clicked"),
156 ]), 82 ]),
157 ("Geographic", [ 83 ("Geographic", [
158 ("Map", map_clicked), 84 ("Map", "test_map", "map_clicked"),
159 ("Map Overlay", map_overlays_clicked), 85 ("Map Overlay", "test_map2", "map_overlays_clicked"),
160 ("Map Route", map_route_clicked), 86 ("Map Route", "test_map3", "map_route_clicked"),
161 ]), 87 ]),
162 ("Images", [ 88 ("Images", [
163 ("Icon", icon_clicked), 89 ("Icon", "test_icon", "icon_clicked"),
164 ("Icon Transparent", icon_transparent_clicked), 90 ("Icon Transparent", "test_icon", "icon_transparent_clicked"),
165 ("Photo", photo_clicked), 91 ("Photo", "test_photo", "photo_clicked"),
166 ("Slideshow", slideshow_clicked), 92 ("Slideshow", "test_slideshow", "slideshow_clicked"),
167 ("Thumb", thumb_clicked), 93 ("Thumb", "test_thumb", "thumb_clicked"),
168 ("Video", video_clicked), 94 ("Video", "test_video", "video_clicked"),
169 ]), 95 ]),
170 ("Lists", [ 96 ("Lists", [
171 ("List", list_clicked), 97 ("List", "test_list", "list_clicked"),
172 ("List 2", list2_clicked), 98 ("List 2", "test_list", "list2_clicked"),
173 ("List 3", list3_clicked), 99 ("List 3", "test_list", "list3_clicked"),
174 ("Genlist", genlist_clicked), 100 ("Genlist", "test_genlist", "genlist_clicked"),
175 ("Genlist 2", genlist2_clicked), 101 ("Genlist 2", "test_genlist", "genlist2_clicked"),
176 ("Genlist Group", genlist3_clicked), 102 ("Genlist Group", "test_genlist", "genlist3_clicked"),
177 ("Genlist Sorted", genlist4_clicked), 103 ("Genlist Sorted", "test_genlist", "genlist4_clicked"),
178 ("Genlist Iteration", genlist5_clicked), 104 ("Genlist Iteration", "test_genlist", "genlist5_clicked"),
179 ("Genlist Decorate Item Mode", genlist10_clicked), 105 ("Genlist Decorate Item Mode", "test_genlist", "genlist10_clicked"),
180 ("Genlist Decorate All Mode", genlist15_clicked), 106 ("Genlist Decorate All Mode", "test_genlist", "genlist15_clicked"),
181 ("Gengrid", gengrid_clicked), 107 ("Gengrid", "test_gengrid", "gengrid_clicked"),
182 ]), 108 ]),
183 ("Miscellaneous", [ 109 ("Miscellaneous", [
184 ("Configuration", config_clicked), 110 ("Configuration", "test_config", "config_clicked"),
185 ("Floating Objects", floating_clicked), 111 ("Floating Objects", "test_floating", "floating_clicked"),
186 ]), 112 ]),
187 ("Naviframe", [ 113 ("Naviframe", [
188 ("Naviframe", naviframe_clicked), 114 ("Naviframe", "test_naviframe", "naviframe_clicked"),
189 ]), 115 ]),
190 ("Popups", [ 116 ("Popups", [
191 ("Hover", hover_clicked), 117 ("Hover", "test_hover", "hover_clicked"),
192 ("Hover 2", hover2_clicked), 118 ("Hover 2", "test_hover", "hover2_clicked"),
193 ("Notify", notify_clicked), 119 ("Notify", "test_notify", "notify_clicked"),
194 ("Tooltip", tooltip_clicked), 120 ("Tooltip", "test_tooltip", "tooltip_clicked"),
195 ("Ctxpopup", ctxpopup_clicked), 121 ("Ctxpopup", "test_ctxpopup", "ctxpopup_clicked"),
196 ("Popup", popup_clicked), 122 ("Popup", "test_popup", "popup_clicked"),
197 ]), 123 ]),
198 ("Range Values", [ 124 ("Range Values", [
199 ("Spinner", spinner_clicked), 125 ("Spinner", "test_spinner", "spinner_clicked"),
200 ("Progressbar", progressbar_clicked), 126 ("Progressbar", "test_progressbar", "progressbar_clicked"),
201 ]), 127 ]),
202 ("Scroller", [ 128 ("Scroller", [
203 ("Scroller", scroller_clicked), 129 ("Scroller", "test_scroller", "scroller_clicked"),
204 ]), 130 ]),
205 ("Selectors", [ 131 ("Selectors", [
206 ("Action Slider", actionslider_clicked), 132 ("Action Slider", "test_actionslider", "actionslider_clicked"),
207 ("Color Selector", colorselector_clicked), 133 ("Color Selector", "test_colorselector", "colorselector_clicked"),
208 ("Day Selector", dayselector_clicked), 134 ("Day Selector", "test_dayselector", "dayselector_clicked"),
209 ("Disk Selector", diskselector_clicked), 135 ("Disk Selector", "test_diskselector", "diskselector_clicked"),
210 ("Flip Selector", flipselector_clicked), 136 ("Flip Selector", "test_flipselector", "flipselector_clicked"),
211 ("File Selector", fileselector_clicked), 137 ("File Selector", "test_fileselector", "fileselector_clicked"),
212 ("Fileselector button", fileselector_button_clicked), 138 ("Fileselector button", "test_fileselector", "fileselector_button_clicked"),
213 ("Fileselector entry", fileselector_entry_clicked), 139 ("Fileselector entry", "test_fileselector", "fileselector_entry_clicked"),
214 ("Hoversel", hoversel_clicked), 140 ("Hoversel", "test_hoversel", "hoversel_clicked"),
215 ("Index", index_clicked), 141 ("Index", "test_index", "index_clicked"),
216 ("Menu", menu_clicked), 142 ("Menu", "test_menu", "menu_clicked"),
217 ("Radios", radio_clicked), 143 ("Radios", "test_radio", "radio_clicked"),
218 ("Segment Control", segment_control_clicked), 144 ("Segment Control", "test_segment_control", "segment_control_clicked"),
219 ]), 145 ]),
220 ("Standardization", [ 146 ("Standardization", [
221 ("Conformant", conformant_clicked), 147 ("Conformant", "test_conform", "conformant_clicked"),
222 ("Conformant 2", conformant2_clicked), 148 ("Conformant 2", "test_conform", "conformant2_clicked"),
223 ]), 149 ]),
224 ("Stored Surface Buffer", [ 150 ("Stored Surface Buffer", [
225 ("Launcher", mapbuf_clicked), 151 ("Launcher", "test_mapbuf", "mapbuf_clicked"),
226 ]), 152 ]),
227 ("Text", [ 153 ("Text", [
228 ("Label", label_clicked), 154 ("Label", "test_label", "label_clicked"),
229 ]), 155 ]),
230 ("Times & Dates", [ 156 ("Times & Dates", [
231 ("Calendar", calendar_clicked), 157 ("Calendar", "test_calendar", "calendar_clicked"),
232 ("Clock", clock_clicked), 158 ("Clock", "test_clock", "clock_clicked"),
233 ("Datetime", datetime_clicked), 159 ("Datetime", "test_datetime", "datetime_clicked"),
234 ]), 160 ]),
235 ("Toolbars", [ 161 ("Toolbars", [
236 ("Toolbar", toolbar_clicked), 162 ("Toolbar", "test_toolbar", "toolbar_clicked"),
237 ]), 163 ]),
238 ("Web", [ 164 ("Web", [
239 ("Web", web_clicked), 165 ("Web", "test_web", "web_clicked"),
240 ]), 166 ]),
241 ("Window / Background", [ 167 ("Window / Background", [
242 ("Bg Plain", bg_plain_clicked), 168 ("Bg Plain", "test_bg", "bg_plain_clicked"),
243 ("Bg Image", bg_image_clicked), 169 ("Bg Image", "test_bg", "bg_image_clicked"),
244 ("InnerWindow", inner_window_clicked), 170 ("InnerWindow", "test_inwin", "inner_window_clicked"),
245 ("Window States", window_states_clicked), 171 ("Window States", "test_win", "window_states_clicked"),
246 ]) 172 ])
247 ] 173 ]
248 174
@@ -269,7 +195,7 @@ def menu_create(search, win):
269 if (search == None) or (test[0].lower().find(search.lower()) > -1): 195 if (search == None) or (test[0].lower().find(search.lower()) > -1):
270 bt = Button(win) 196 bt = Button(win)
271 bt.text = test[0] 197 bt.text = test[0]
272 bt.callback_clicked_add(test[1]) 198 bt.callback_clicked_add(lambda o, y = test[1], z = test[2]: exec("from " + y + " import " + z + "\n" + z + "(o)"))
273 bt.show() 199 bt.show()
274 tbx2.pack_end(bt) 200 tbx2.pack_end(bt)
275 cnt += 1 201 cnt += 1
diff --git a/examples/elementary/test_floating.py b/examples/elementary/test_floating.py
index 3def0ea..363be8c 100644
--- a/examples/elementary/test_floating.py
+++ b/examples/elementary/test_floating.py
@@ -46,7 +46,7 @@ def floating_clicked(obj):
46 gl.show() 46 gl.show()
47 47
48 for i in range(20): 48 for i in range(20):
49 GenlistItem(ItemClass(), None, ELM_GENLIST_ITEM_NONE, gl_sel_cb, i).append_to(gl) 49 GenlistItem(ItemClass(), i, None, ELM_GENLIST_ITEM_NONE, gl_sel_cb, i).append_to(gl)
50 50
51 win.size = 480, 800 51 win.size = 480, 800
52 win.show() 52 win.show()
diff --git a/examples/elementary/test_genlist.py b/examples/elementary/test_genlist.py
index d012b30..503a19c 100644
--- a/examples/elementary/test_genlist.py
+++ b/examples/elementary/test_genlist.py
@@ -720,18 +720,9 @@ def genlist15_clicked(obj, item=None):
720 720
721 721
722if __name__ == "__main__": 722if __name__ == "__main__":
723 def destroy(obj):
724 elementary.exit()
725
726 elementary.init() 723 elementary.init()
727 win = Window("test", elementary.ELM_WIN_BASIC) 724 win = StandardWindow("test", "python-elementary test application")
728 win.title_set("python-elementary test application") 725 win.callback_delete_request_add(lambda o: elementary.exit())
729 win.callback_delete_request_add(destroy)
730
731 bg = Background(win)
732 win.resize_object_add(bg)
733 bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
734 bg.show()
735 726
736 box0 = Box(win) 727 box0 = Box(win)
737 box0.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 728 box0.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)