MCPcopy Create free account
hub / github.com/brain-workshop/brainworkshop / select

Method select

brainworkshop.py:2390–2404  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2388 update_all_labels()
2389
2390 def select(self):
2391 Menu.select(self)
2392 for c in ('1', '2'):
2393 if not [v for k,v in self.values.items() if (k.startswith(c) and v and not isinstance(v, Cycler))]:
2394 options = list(resourcepaths['sounds'])
2395 options.remove('operations')
2396 i = 0
2397 if self.selpos == 0:
2398 i = random.randint(1, len(options)-1)
2399 elif self.selpos==len(options)+1:
2400 i = random.randint(len(options)+2, 2*len(options))
2401 elif self.selpos > len(options)+1:
2402 i = len(options)+1
2403 self.values[self.options[i]] = True
2404 self.update_labels()
2405
2406# this class controls the field.
2407# the field is the grid on which the squares appear

Callers

nothing calls this directly

Calls 2

selectMethod · 0.45
update_labelsMethod · 0.45

Tested by

no test coverage detected