diff --git a/slither/__init__.py b/slither/__init__.py index c2f3860..cbc20dc 100644 --- a/slither/__init__.py +++ b/slither/__init__.py @@ -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 @@ -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): @@ -165,6 +165,7 @@ def play(self): pass raise e return sound +# Why is this here? slitherSound = Sound() def setup(caption=sys.argv[0]):