Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-03-14 17:57:18 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-03-14 17:57:18 (GMT)
commit72d2773d8db074e28a9d4780572d35e7e43d3ee6 (patch)
treebc0a6be0a311c0b48d13da72c91fec78666cb333
parentcfddb51aa207270384ce50cd5c7508be10457e48 (diff)
more robust connection checking
-rw-r--r--talogo.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/talogo.py b/talogo.py
index 99c2725..666f9c3 100644
--- a/talogo.py
+++ b/talogo.py
@@ -512,16 +512,17 @@ class LogoCode:
return ['%nothing%']
else:
return ['%nothing%']
- for i in range(1, len(blk.connections)):
- b = blk.connections[i]
- dock = blk.docks[i]
- if len(dock)>4: # There could be a '(', ')', '[' or ']'.
- for c in dock[4]:
- code.append(c)
- if b is not None:
- code.extend(self.blocks_to_code(b))
- elif blk.docks[i][0] not in ['flow', 'unavailable']:
- code.append('%nothing%')
+ if blk.connections is not None and len(blk.connections) > 0:
+ for i in range(1, len(blk.connections)):
+ b = blk.connections[i]
+ dock = blk.docks[i]
+ if len(dock)>4: # There could be a '(', ')', '[' or ']'.
+ for c in dock[4]:
+ code.append(c)
+ if b is not None:
+ code.extend(self.blocks_to_code(b))
+ elif blk.docks[i][0] not in ['flow', 'unavailable']:
+ code.append('%nothing%')
return code
def setup_cmd(self, string):