Handle weekend data from QT yet again

kivy_mainline_and_py3.8
Tyler Goodlet 2018-12-23 21:26:57 -05:00
parent de4fab873b
commit a7fb55179c
1 changed files with 13 additions and 9 deletions

View File

@ -81,6 +81,7 @@ _kv = (f'''
# this is currently used for expiry cells on the options chain # this is currently used for expiry cells on the options chain
background_color: {_i3_rgba} if self.click_toggle else {_black_rgba} background_color: {_i3_rgba} if self.click_toggle else {_black_rgba}
# must be set to allow 'plain bg colors' since default texture is grey # must be set to allow 'plain bg colors' since default texture is grey
# but right now is only set for option chain expiry buttons
# background_normal: '' # background_normal: ''
# spacing: 0, 0 # spacing: 0, 0
# padding: 3, 3 # padding: 3, 3
@ -165,8 +166,8 @@ class Cell(Button):
self.row = None self.row = None
self.is_header = is_header self.is_header = is_header
# def on_press(self, value=None): def on_press(self, value=None):
# self.row.on_press() self.row.on_press()
class HeaderCell(Cell): class HeaderCell(Cell):
@ -352,13 +353,16 @@ class Row(ButtonBehavior, HoverBehavior, GridLayout):
fgreen = colorcode('forestgreen') fgreen = colorcode('forestgreen')
red = colorcode('red2') red = colorcode('red2')
for key, val in record.items(): for key, val in record.items():
# logic for cell text coloring: up-green, down-red last = self.get_field(key)
if self._last_record[key] < val: color = gray
color = fgreen try:
elif self._last_record[key] > val: # logic for cell text coloring: up-green, down-red
color = red if last < val:
else: color = fgreen
color = gray elif last > val:
color = red
except TypeError:
log.warn(f"wtf QT {val} is not regular?")
cell = self.get_cell(key) cell = self.get_cell(key)
# some displayable fields might have specifically # some displayable fields might have specifically