Skip to content

Commit

Permalink
Fix pep8 :D
Browse files Browse the repository at this point in the history
  • Loading branch information
kcsaff committed Sep 1, 2016
1 parent 7737ba5 commit e2b0321
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions sappho/particle.py
Expand Up @@ -39,9 +39,12 @@
import random


#import pygame
class pygame:
BLEND_RGBA_MULT = 8
try:
import pygame
except ImportError:
# This allows our particle tests to run even if pygame won't :D
class pygame:
BLEND_RGBA_MULT = 8


# The biggest number less than infinity-plus-one
Expand Down Expand Up @@ -611,7 +614,7 @@ def _calculate_tint(self, particle):
if remainder > 0:
tint = tuple([
int(a * (1 - remainder) + b * remainder)
for a, b in zip(self.tints[floor], self.tints[floor+1])
for a, b in zip(self.tints[floor], self.tints[floor + 1])
])
else:
tint = self.tints[floor]
Expand Down
4 changes: 3 additions & 1 deletion tests/test_particle.py
Expand Up @@ -188,7 +188,9 @@ class TestPhysicsJitter(unittest.TestCase):
def test_jitter(self):
# Jitter cycles between +1 & -1 times time delta
jitter_iter = itertools.cycle((1, -1))
jitter = lambda dt: dt * next(jitter_iter)

def jitter(dt):
return dt * next(jitter_iter)

physics = particle.PhysicsJitter(y=2, jitter=jitter)
p = particle.Particle(0, 0)
Expand Down

0 comments on commit e2b0321

Please sign in to comment.