def build_panel(descr): # # Sanity check # if (not descr) or descr[0] <> 'panel': raise panel_error, 'panel description must start with "panel"' # if debug: show_panel('', descr) # # Create an empty panel # panel = pnl.mkpanel() # # Assign panel attributes # assign_members(panel, descr[1:], ['al'], '') # # Look for actuator list # al = getattrlist(descr, 'al') # # The order in which actuators are created is important # because of the endgroup() operator. # Unfortunately the Panel Editor outputs the actuator list # in reverse order, so we reverse it here. # al = reverse(al) # for a in al: act, name = build_actuator(a) act.addact(panel) if name: stmt = 'panel.' + name + ' = act' exec stmt + '\n' if is_endgroup(a): panel.endgroup() sub_al = getattrlist(a, 'al') if sub_al: build_subactuators(panel, act, sub_al) # return panel
def build_panel(descr): if not descr or descr[0] != 'panel': raise panel_error, 'panel description must start with "panel"' if debug: show_panel('', descr) panel = pnl.mkpanel() assign_members(panel, descr[1:], ['al'], '') al = getattrlist(descr, 'al') al = reverse(al) for a in al: act, name = build_actuator(a) act.addact(panel) if name: stmt = 'panel.' + name + ' = act' exec stmt + '\n' if is_endgroup(a): panel.endgroup() sub_al = getattrlist(a, 'al') if sub_al: build_subactuators(panel, act, sub_al) return panel
def build_panel(descr): if not descr or descr[0] != "panel": raise panel_error, 'panel description must start with "panel"' if debug: show_panel("", descr) panel = pnl.mkpanel() assign_members(panel, descr[1:], ["al"], "") al = getattrlist(descr, "al") al = reverse(al) for a in al: act, name = build_actuator(a) act.addact(panel) if name: stmt = "panel." + name + " = act" exec stmt + "\n" if is_endgroup(a): panel.endgroup() sub_al = getattrlist(a, "al") if sub_al: build_subactuators(panel, act, sub_al) return panel
# Module 'panel'