@@ -81,6 +81,11 @@ def url_open(url):
81
81
82
82
return s
83
83
84
+ def show_description (active ):
85
+ if active :
86
+ text .text (packages [options .selected_index ()]["description" ])
87
+ ugfx .flush ()
88
+
84
89
options = ugfx .List (0 ,0 ,int (ugfx .width ()/ 2 ),ugfx .height ())
85
90
86
91
f = url_open ("https://badge.sha2017.org/eggs/list/json" )
@@ -92,14 +97,6 @@ def url_open(url):
92
97
for package in packages :
93
98
options .add_item ("%s rev. %s" % (package ["name" ], package ["revision" ]))
94
99
95
- ugfx .set_lut (ugfx .LUT_FULL )
96
- ugfx .flush ()
97
-
98
- def show_description (active ):
99
- if active :
100
- text .text (packages [options .selected_index ()]["description" ])
101
- ugfx .flush ()
102
-
103
100
def woezel_it (active ):
104
101
if active :
105
102
ugfx .clear (ugfx .BLACK )
@@ -124,11 +121,13 @@ def start_app(pushed):
124
121
125
122
ugfx .input_attach (ugfx .BTN_START , start_app )
126
123
127
- ugfx .input_attach (ugfx .JOY_LEFT , lambda x : ugfx .flush ())
128
- ugfx .input_attach (ugfx .JOY_RIGHT , lambda x : ugfx .flush ())
124
+ ugfx .input_attach (ugfx .JOY_LEFT , lambda pushed : ugfx .flush () if pushed else 0 )
125
+ ugfx .input_attach (ugfx .JOY_RIGHT , lambda pushed : ugfx .flush () if pushed else 0 )
129
126
130
127
text = ugfx .Textbox (int (ugfx .width ()/ 2 ),0 , int (ugfx .width ()/ 2 ), ugfx .height ())
131
128
129
+ show_description (True )
130
+
131
+ ugfx .set_lut (ugfx .LUT_FULL )
132
132
ugfx .flush ()
133
- time .sleep (0.2 )
134
133
ugfx .set_lut (ugfx .LUT_FASTER )
0 commit comments