From 643085fdce70b253c39a8664d62eb71bb58b92c0 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 31 Jan 2010 21:17:08 +0000 Subject: more cleanup --- diff --git a/constants.py b/constants.py index 73b67f4..1566ecc 100644 --- a/constants.py +++ b/constants.py @@ -365,7 +365,7 @@ DEFAULTS = { # Blocks that can interchange strings and numbers for their arguments # STRING_OR_NUMBER_ARGS = ['plus2', 'equal', 'less', 'greater', - 'template1', 'template2', 'template3', + 'template1', 'template2', 'template7', 'template4', 'template6', 'list', 'nop', 'print', 'stack', 'hat'] diff --git a/talogo.py b/talogo.py index b7633b0..f1d9a42 100644 --- a/talogo.py +++ b/talogo.py @@ -100,9 +100,6 @@ def blocks_to_code(lc, blk): if blk is None: return ['%nothing%'] code = [] - print blk.name - print blk.docks - print blk.connections dock = blk.docks[0] if len(dock)>4: code.append(dock[4]) @@ -115,7 +112,6 @@ def blocks_to_code(lc, blk): except ValueError: code.append(float(ord(blk.values[0][0]))) elif blk.name=='string' or blk.name=='title': - print "%s %s" % (blk.name, blk.values[0]) if type(blk.values[0]) == float or type(blk.values[0]) == int: if int(blk.values[0]) == blk.values[0]: blk.values[0] = int(blk.values[0]) @@ -834,7 +830,6 @@ def show_bullets(lc, title, sarray): lc.tw.canvas.settextsize(lc.bullet_height) y -= int(lc.title_height*2*lc.tw.lead) # leave some space below the title for s in sarray: - print "bullet: %s" % (s) lc.tw.canvas.setxy(x, y) show(lc, s) y -= int(lc.bullet_height*2*lc.tw.lead) diff --git a/taproject.py b/taproject.py index b72f154..978ded8 100644 --- a/taproject.py +++ b/taproject.py @@ -180,10 +180,13 @@ def load_block(tw, b): else: values = [] + if OLD_NAMES.has_key(btype): + btype = OLD_NAMES[btype] + blk = block.Block(tw.block_list, tw.sprite_list, btype, b[2]+tw.canvas.cx, b[3]+tw.canvas.cy, 'block', values) - # Some blocks get a skin. + # Some blocks t a skin. if btype == 'nop': if tw.nop == 'pythonloaded': blk.spr.set_image(tw.media_shapes['pythonon'], 1, 17, 8) @@ -195,6 +198,10 @@ def load_block(tw, b): blk.expand_in_y(value) elif btype == 'hspace': blk.expand_in_x(value) + elif btype == 'list': + for i in range(len(b[4])-4): + dy = blk.add_arg() + elif btype in BOX_STYLE_MEDIA and blk.values[0] is not None: if btype == 'audio' or btype == 'description': blk.spr.set_image(tw.media_shapes[btype+'on'], 1, 37, 6) diff --git a/tawindow.py b/tawindow.py index 198547d..556488e 100644 --- a/tawindow.py +++ b/tawindow.py @@ -721,7 +721,6 @@ class TurtleArtWindow(): else: newleft = '' elif keyname == 'Home': - print "saw a %s" % (keyname) oldright = oldleft+oldright newleft = '' elif keyname == 'Left': @@ -846,7 +845,6 @@ class TurtleArtWindow(): self._select_category(spr) elif spr.type == 'category': r,g,b,a = spr.get_pixel((x, y)) - # print "%s %s %s %s" % (r,g,b,a) if (r == 255 and g == 0) or g == 255: self._hide_palette() return True @@ -1104,7 +1102,6 @@ class TurtleArtWindow(): Run stack """ def _run_stack(self, blk): - # self.block_list.print_list('block') if blk is None: return self.lc.ag = None @@ -1196,16 +1193,6 @@ class TurtleArtWindow(): """ Debugging tools """ - def _print_spr_list(self, spr_list): - s = "" - for spr in spr_list: - if spr == None: - s+="None" - else: - s+=self.block_list.spr_to_block(spr).name - s += " " - return s - def _print_blk_list(self, blk_list): s = "" for blk in blk_list: -- cgit v0.9.1