snakeware

Python-based Linux distro for x86-64 and RPi
git clone git://squid-tech.com/snakeware.git
Log | Files | Refs | README

commit 28a3e68d38d38703faae18b9c9e0502a81e70b63
parent 01e7b2b0b2ba4b8bdc2d435a0f1057a14170b502
Author: Josh Moore <jxm5210@g.rit.edu>
Date:   Sat, 30 May 2020 00:27:27 -0400

Merge pull request #9 from karx1/master

Don't fetch op by index every time
Diffstat:
Msnakewm/apps/tools/snakecalc/calc.py | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/snakewm/apps/tools/snakecalc/calc.py b/snakewm/apps/tools/snakecalc/calc.py @@ -35,7 +35,8 @@ class SnakeCalc(pygame_gui.elements.UIWindow): # generate calculator buttons for i in range(len(self.OPS)): - if self.OPS[i] == 'x': + op = self.OPS[i] + if op == 'x': # skip placeholder ops continue @@ -45,10 +46,10 @@ class SnakeCalc(pygame_gui.elements.UIWindow): 40 + int(i / 4) * self.BSIZE[1]), self.BSIZE ), - text='.' if self.OPS[i] == 'p' else self.OPS[i], + text='.' if op == 'p' else op, manager=manager, container=self, - object_id='#op-' + self.OPS[i] + object_id='#op-' + op ) def process_event(self, event):