From 18a50f72447c28c82c6283d51ab52e9b153836bc Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Tue, 26 Jan 2010 04:41:46 +0000 Subject: fixed most of the project-loading problems --- (limited to 'talogo.py') diff --git a/talogo.py b/talogo.py index 68f7f38..ed2b194 100644 --- a/talogo.py +++ b/talogo.py @@ -63,21 +63,27 @@ class logoerror(Exception): return repr(self.value) def run_blocks(lc, blk, blocks, run_flag): + print "run blocks: %s" % (blk.name) + for b in blocks: + if b is None: + print " None" + else: + print " %s" % b.name # user-defined stacks for x in lc.stacks.keys(): - lc.stacks[x]= None + lc.stacks[x] = None # two built-in stacks lc.stacks['stack1'] = None lc.stacks['stack2'] = None for b in blocks: - if b.name=='def action 1': - lc.stacks['stack1']= readline(lc,blocks_to_code(lc, b)) + if b.name == 'def action 1': + lc.stacks['stack1'] = readline(lc,blocks_to_code(lc, b)) if b.name=='def action 2': - lc.stacks['stack2']= readline(lc,blocks_to_code(lc, b)) - if b.name=='def action': + lc.stacks['stack2'] = readline(lc,blocks_to_code(lc, b)) + if b.name == 'def action': if (b.connections[1] is not None): - text=b.connections[1].spr.labels[0] - lc.stacks['stack3'+text]= readline(lc,blocks_to_code(lc, b)) + text = b.connections[1].spr.labels[0] + lc.stacks['stack3'+text] = readline(lc,blocks_to_code(lc, b)) code = blocks_to_code(lc, blk) if run_flag is True: print "code: %s" % (code) -- cgit v0.9.1