style(examples) fix style issues in Python examples (#2880)
Removes all semicolons at line endings in the Python examples.
This commit is contained in:
@@ -25,24 +25,24 @@ def draw_part_event_cb(e):
|
||||
table = lv.table(lv.scr_act())
|
||||
|
||||
# Fill the first column
|
||||
table.set_cell_value(0, 0, "Name");
|
||||
table.set_cell_value(1, 0, "Apple");
|
||||
table.set_cell_value(2, 0, "Banana");
|
||||
table.set_cell_value(3, 0, "Lemon");
|
||||
table.set_cell_value(4, 0, "Grape");
|
||||
table.set_cell_value(5, 0, "Melon");
|
||||
table.set_cell_value(6, 0, "Peach");
|
||||
table.set_cell_value(7, 0, "Nuts");
|
||||
table.set_cell_value(0, 0, "Name")
|
||||
table.set_cell_value(1, 0, "Apple")
|
||||
table.set_cell_value(2, 0, "Banana")
|
||||
table.set_cell_value(3, 0, "Lemon")
|
||||
table.set_cell_value(4, 0, "Grape")
|
||||
table.set_cell_value(5, 0, "Melon")
|
||||
table.set_cell_value(6, 0, "Peach")
|
||||
table.set_cell_value(7, 0, "Nuts")
|
||||
|
||||
# Fill the second column
|
||||
table.set_cell_value(0, 1, "Price");
|
||||
table.set_cell_value(1, 1, "$7");
|
||||
table.set_cell_value(2, 1, "$4");
|
||||
table.set_cell_value(3, 1, "$6");
|
||||
table.set_cell_value(4, 1, "$2");
|
||||
table.set_cell_value(5, 1, "$5");
|
||||
table.set_cell_value(6, 1, "$1");
|
||||
table.set_cell_value(7, 1, "$9");
|
||||
table.set_cell_value(0, 1, "Price")
|
||||
table.set_cell_value(1, 1, "$7")
|
||||
table.set_cell_value(2, 1, "$4")
|
||||
table.set_cell_value(3, 1, "$6")
|
||||
table.set_cell_value(4, 1, "$2")
|
||||
table.set_cell_value(5, 1, "$5")
|
||||
table.set_cell_value(6, 1, "$1")
|
||||
table.set_cell_value(7, 1, "$9")
|
||||
|
||||
# Set a smaller height to the table. It'll make it scrollable
|
||||
table.set_height(200)
|
||||
|
||||
@@ -16,15 +16,15 @@ def draw_event_cb(e):
|
||||
if chk:
|
||||
rect_dsc.bg_color = lv.theme_get_color_primary(obj)
|
||||
else:
|
||||
rect_dsc.bg_color = lv.palette_lighten(lv.PALETTE.GREY,2)
|
||||
rect_dsc.bg_color = lv.palette_lighten(lv.PALETTE.GREY, 2)
|
||||
|
||||
rect_dsc.radius = lv.RADIUS.CIRCLE
|
||||
|
||||
sw_area = lv.area_t()
|
||||
sw_area.x1 = dsc.draw_area.x2 - 50;
|
||||
sw_area.x2 = sw_area.x1 + 40;
|
||||
sw_area.y1 = dsc.draw_area.y1 + dsc.draw_area.get_height() // 2 - 10
|
||||
sw_area.y2 = sw_area.y1 + 20;
|
||||
sw_area.x1 = dsc.draw_area.x2 - 50
|
||||
sw_area.x2 = sw_area.x1 + 40
|
||||
sw_area.y1 = dsc.draw_area.y1 + dsc.draw_area.get_height() // 2 - 10
|
||||
sw_area.y2 = sw_area.y1 + 20
|
||||
lv.draw_rect(sw_area, dsc.clip_area, rect_dsc)
|
||||
|
||||
rect_dsc.bg_color = lv.color_white()
|
||||
@@ -35,8 +35,8 @@ def draw_event_cb(e):
|
||||
else:
|
||||
sw_area.x1 += 2
|
||||
sw_area.x2 = sw_area.x1 + 16
|
||||
sw_area.y1 += 2;
|
||||
sw_area.y2 -= 2;
|
||||
sw_area.y1 += 2
|
||||
sw_area.y2 -= 2
|
||||
lv.draw_rect(sw_area, dsc.clip_area, rect_dsc)
|
||||
|
||||
def change_event_cb(e):
|
||||
@@ -60,7 +60,7 @@ def change_event_cb(e):
|
||||
gc.enable()
|
||||
gc.collect()
|
||||
mem_free = gc.mem_free()
|
||||
print("mem_free: ",mem_free)
|
||||
print("mem_free: ", mem_free)
|
||||
t = ticks_ms()
|
||||
print("ticks: ", t)
|
||||
table = lv.table(lv.scr_act())
|
||||
@@ -78,7 +78,7 @@ table.remove_style(None, lv.PART.ITEMS | lv.STATE.PRESSED)
|
||||
for i in range(ITEM_CNT):
|
||||
table.set_cell_value(i, 0, "Item " + str(i+1))
|
||||
|
||||
table.align(lv.ALIGN.CENTER, 0, -20);
|
||||
table.align(lv.ALIGN.CENTER, 0, -20)
|
||||
|
||||
# Add an event callback to to apply some custom drawing
|
||||
table.add_event_cb(draw_event_cb, lv.EVENT.DRAW_PART_END, None)
|
||||
@@ -93,4 +93,3 @@ label.set_text(str(ITEM_CNT) + " items were created in " + str(elaps) + " ms\n u
|
||||
#label.set_text(str(ITEM_CNT) + " items were created in " + str(elaps) + " ms")
|
||||
|
||||
label.align(lv.ALIGN.BOTTOM_MID, 0, -10)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user