Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-12-23 20:12:00 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-12-23 20:12:00 (GMT)
commit80456eeceaf4a6f300367dd91378c732e74d8665 (patch)
tree9b5d3e32484a10fd197e3b6c0de31c452bf59fee /plugins
parent96bf5de0e36a8c761d84268911d75dfd07b2c0cf (diff)
don't update labels unless update_labels == True
Diffstat (limited to 'plugins')
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index 606a632..183c4ac 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -1059,7 +1059,8 @@ bullets'))
'KP_Right': 3}[self.tw.keypress]
except KeyError:
self.tw.lc.keyboard = 0
- self.tw.lc.update_label_value('keyboard', self.tw.lc.keyboard)
+ if self.tw.lc.update_values:
+ self.tw.lc.update_label_value('keyboard', self.tw.lc.keyboard)
self.tw.keypress = ''
def _prim_list(self, blklist):
@@ -1130,10 +1131,11 @@ bullets'))
if len(self.tw.lc.heap) == 0:
raise logoerror("#emptyheap")
else:
- if len(self.tw.lc.heap) == 1:
- self.tw.lc.update_label_value('pop')
- else:
- self.tw.lc.update_label_value('pop', self.tw.lc.heap[-2])
+ if self.tw.lc.update_values:
+ if len(self.tw.lc.heap) == 1:
+ self.tw.lc.update_label_value('pop')
+ else:
+ self.tw.lc.update_label_value('pop', self.tw.lc.heap[-2])
return self.tw.lc.heap.pop(-1)
def _prim_print(self, n, flag):
@@ -1178,7 +1180,8 @@ bullets'))
def _prim_push(self, val):
""" Push value onto FILO """
self.tw.lc.heap.append(val)
- self.tw.lc.update_label_value('pop', val)
+ if self.tw.lc.update_values:
+ self.tw.lc.update_label_value('pop', val)
def _prim_readpixel(self):
""" Read r, g, b, a from the canvas and push b, g, r to the stack """
@@ -1363,13 +1366,15 @@ bullets'))
color """
r, g, b, a = self.tw.canvas.get_pixel()
color_index = self.tw.canvas.get_color_index(r, g, b)
- self.tw.lc.update_label_value('see', color_index)
+ if self.tw.lc.update_values:
+ self.tw.lc.update_label_value('see', color_index)
return color_index
def _prim_setscale(self, scale):
""" Set the scale used by the show block """
self.tw.lc.scale = scale
- self.tw.lc.update_label_value('scale', scale)
+ if self.tw.lc.update_values:
+ self.tw.lc.update_label_value('scale', scale)
def _prim_show(self, string, center=False):
""" Show is the general-purpose media-rendering block. """
@@ -1455,7 +1460,8 @@ bullets'))
""" Number of seconds since program execution has started or
clean (prim_clear) block encountered """
elapsed_time = int(time() - self.tw.lc.start_time)
- self.tw.lc.update_label_value('time', elapsed_time)
+ if self.tw.lc.update_values:
+ self.tw.lc.update_label_value('time', elapsed_time)
return elapsed_time
def _prim_hideblocks(self):