comparison components/container.py @ 66:58d58bf2e567

Fixed syntax error in container.py.
author KarstenBock@gmx.net
date Wed, 21 Sep 2011 16:11:06 +0200
parents e856b604b650
children 180cbd2b5da8
comparison
equal deleted inserted replaced
65:e856b604b650 66:58d58bf2e567
69 if type(slot_or_type) == int: 69 if type(slot_or_type) == int:
70 if len(container.children) >= (slot_or_type + 1): 70 if len(container.children) >= (slot_or_type + 1):
71 return container.children[slot_or_type] 71 return container.children[slot_or_type]
72 else: 72 else:
73 for item in container.children: 73 for item in container.children:
74 if child and if child.type == slot_or_type: 74 if child and child.type == slot_or_type:
75 return child 75 return child
76 76
77 return None 77 return None
78 78
79 def remove_item(container, slot_or_type): 79 def remove_item(container, slot_or_type):
84 container.children[slot_or_type] = None 84 container.children[slot_or_type] = None
85 item.container = None 85 item.container = None
86 item.slot = -1 86 item.slot = -1
87 else: 87 else:
88 for item in container.children: 88 for item in container.children:
89 if child and if child.type == slot_or_type: 89 if child and child.type == slot_or_type:
90 container.children[child.slot] = None 90 container.children[child.slot] = None
91 child.container = None 91 child.container = None
92 child.slot = -1 92 child.slot = -1
93 93
94 def take_item(container, slot_or_type): 94 def take_item(container, slot_or_type):