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

Method update_labels

brainworkshop.py:2004–2029  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2002 return str(x)
2003
2004 def update_labels(self):
2005 for l in self.labels: l.text = 'Hello, bug!'
2006
2007 markerpos = self.selpos - self.disppos
2008 i = 0
2009 di = self.disppos
2010 if not di == 0: # displacement of i
2011 self.labels[i].text = '...'
2012 i += 1
2013 ending = int(di + self.pagesize < len(self.options))
2014 while i < self.pagesize-ending and i+self.disppos < len(self.options):
2015 k = self.options[i+di]
2016 if k == 'Blank line':
2017 self.labels[i].text = ''
2018 elif k in self.values.keys() and not self.values[k] == None:
2019 v = self.values[k]
2020 self.labels[i].text = '%s:%7s' % (self.names[k].ljust(52), self.textify(v))
2021 else:
2022 self.labels[i].text = self.names[k]
2023 i += 1
2024 if ending:
2025 self.labels[i].text = '...'
2026 w, h, cs = window.width, window.height, self.choicesize
2027 self.marker.vertices = [w//10, int((h*8)/10 - markerpos*(cs*3/2) + cs/2),
2028 w//9, int((h*8)/10 - markerpos*(cs*3/2)),
2029 w//10, int((h*8)/10 - markerpos*(cs*3/2) - cs/2)]
2030
2031 def move_selection(self, steps, relative=True):
2032 # FIXME: pageup/pagedown can occasionally cause "Hello bug!" to be displayed

Callers 6

__init__Method · 0.95
move_selectionMethod · 0.95
selectMethod · 0.95
update_labelsMethod · 0.45
selectMethod · 0.45
selectMethod · 0.45

Calls 1

textifyMethod · 0.95

Tested by

no test coverage detected