Created
October 15, 2014 15:14
-
-
Save 20Mhz/22d19a4ffab084f4f1b1 to your computer and use it in GitHub Desktop.
LE Optimizer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import ui | |
def editRow(sender): | |
'@type sender: ui.TableView' | |
idx = sender.selected_row | |
v["OutView"].text = str(idx) | |
rows = listLE.items | |
rows.pop(idx) | |
rows.insert(idx,v["nField"].text) | |
v["OutView"].text = str(rows) | |
sender.reload() | |
def nFieldOk_action(sender): | |
'@type sender: ui.Button' | |
n = v["nField"].text | |
v["OutView"].text = 'Number of Stages is ' + n | |
table = v["LE_Table"] | |
rows = [] | |
for i in range(0,int(n)): | |
rows.append('1') | |
global listLE | |
listLE = ui.ListDataSource(rows) | |
table.data_source = listLE | |
table.reload() | |
v['label1'].text = 'Set LE' | |
def Opt_action(sender): | |
'@type sender: ui.Button' | |
rows = listLE.items | |
v = ui.load_view("LE Optimizer") | |
if ui.get_screen_size()[1] >= 768: | |
# iPad | |
v.present('popover') | |
else: | |
# iPhone | |
v.present(orientations=['portrait']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment