def loaded(self, event): if self.auto: self.client.register(self.client.config.get('connection', '_id')) return self.layout.remove_widget(self.connecting_label) del self.connecting_label self.dropdown = DropDown() for stage in sorted(self.client.meteor.find('stages'), key=lambda x: x['title']): self.dropdown.add_widget(Label(text = stage['title'], size_hint_y = None, height = 40)) seen = [] for minion in sorted(self.client.meteor.find('minions', selector = {'stage': stage['_id'], 'type': 'media'}), key=lambda x: x['title']): # workaround for python-meteor bug if not minion['stage'] == stage['_id']: continue if minion['_id'] in seen: continue else: seen.append(minion['_id']) button = Button(text = minion['title'], size_hint_y = None, height = 30) button.minion_id = minion['_id'] button.bind(on_press = self.do_register) self.dropdown.add_widget(button) self.dropdown_button = Button(text = 'Select Minion') self.dropdown_button.bind(on_release = self.dropdown.open) self.layout.add_widget(self.dropdown_button) self.auto_checkbox = CheckBox() self.auto_label = Label(text = 'Connect automatically on start') self.layout.add_widget(self.auto_checkbox) self.layout.add_widget(self.auto_label)