Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions slither/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def deleteCostumeByName(self, name):

def deleteCostumeByNumber(self, number):
'''Delete a costume by number.'''
if number < len(self.costumes.keys()):
if number < len(self.costumes):
costumeName = self.costumes.keys()[number]
self.deleteCostumeByName(costumeName) # TODO: Fix this stupid "get name from number" thing

Expand All @@ -74,9 +74,9 @@ def costumeNumber(self):

@costumeNumber.setter
def costumeNumber(self, val):
if val < len(self.costumes.keys()): # TODO: use mod to wrap around
self.costumeName = list(self.costumes.keys())[val]
self._costumeNumber = val
val = val % len(self.costumes)
self.costumeName = list(self.costumes.keys())[val]
self._costumeNumber = val

@property
def costumeName(self):
Expand Down Expand Up @@ -165,6 +165,7 @@ def play(self): pass
raise e
return sound

# Why is this here?
slitherSound = Sound()

def setup(caption=sys.argv[0]):
Expand Down