# Buttons # ================================================================ btn_save = Button(master, text='Save configuration', command=configuration_save) btn_save.grid(row=2, column=0, sticky=W + E + N + S) btn_quit = Button(master, text='Exit', command=curry(sys.exit, 0)) btn_quit.grid(row=2, column=1, sticky=W + E + N + S) # ================================================================ # Fill list # ================================================================ for mod in pymt_modules.list(): e_modules_list.insert(END, mod) for opt in pymt_config.options('modules'): index = eval(c_modules.get()).index(opt) e_modules_list.selection_set(index) for device_id in pymt_config.options('input'): line = pymt_config.get('input', device_id) t = '%s=%s' % (str(device_id), str(line)) e_input_list.insert(END, t) e_input_list.selection_set(eval(c_input.get()).index(t)) # ================================================================ # Load configuration # ================================================================ try: mainloop() finally:
# ================================================================ # Buttons # ================================================================ btn_save = Button(master, text='Save configuration', command=configuration_save) btn_save.grid(row=2, column=0, sticky=W+E+N+S) btn_quit = Button(master, text='Exit', command=curry(sys.exit, 0)) btn_quit.grid(row=2, column=1, sticky=W+E+N+S) # ================================================================ # Fill list # ================================================================ for mod in pymt_modules.list(): e_modules_list.insert(END, mod) for opt in pymt_config.options('modules'): index = eval(c_modules.get()).index(opt) e_modules_list.selection_set(index) for device_id in pymt_config.options('input'): line = pymt_config.get('input', device_id) t = '%s=%s' % (str(device_id), str(line)) e_input_list.insert(END, t) e_input_list.selection_set(eval(c_input.get()).index(t)) # ================================================================ # Load configuration # ================================================================ try: mainloop() finally:
e_input_ip.grid(row=0, column=1) e_input_port.grid(row=1, column=1) # ================================================================ # Buttons # ================================================================ btn_save = Button(master, text='Save configuration', command=configuration_save) btn_save.grid(row=2, column=0, sticky=W+E+N+S) btn_quit = Button(master, text='Exit', command=curry(sys.exit, 0)) btn_quit.grid(row=2, column=1, sticky=W+E+N+S) # ================================================================ # Fill list # ================================================================ for mod in pymt_modules.list(): e_modules_list.insert(END, mod) for opt in pymt_config.options('modules'): index = eval(c_modules.get()).index(opt) e_modules_list.selection_set(index) # ================================================================ # Load configuration # ================================================================ try: mainloop() finally: pass