diff options
author | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-09-19 09:09:52 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-09-19 09:09:52 (GMT) |
commit | 0b335e486ba09a528e10583e6a082c96dc376503 (patch) | |
tree | ad002a11d9f9fbb303360e56f93adb8a69d40188 /src | |
parent | f92b65039fd587818cd131ab676eafaf944a1621 (diff) |
Don't use multiple statements on a single line.
Diffstat (limited to 'src')
-rw-r--r-- | src/view/home/favoriteslayout.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/view/home/favoriteslayout.py b/src/view/home/favoriteslayout.py index fb748c3..0391288 100644 --- a/src/view/home/favoriteslayout.py +++ b/src/view/home/favoriteslayout.py @@ -335,7 +335,8 @@ class SunflowerLayout(RingLayout): def adjust_index(self, i): """Skip floret indices which end up outside the desired bounding box.""" for idx in self.skipped_indices: - if i < idx: break + if i < idx: + break i += 1 return i @@ -396,9 +397,12 @@ class BoxLayout(RingLayout): def cos_d(d): while d < 0: d += 360 - if d < 45: return 1 - if d < 135: return (90 - d) / 45. - if d < 225: return -1 + if d < 45: + return 1 + if d < 135: + return (90 - d) / 45. + if d < 225: + return -1 return cos_d(360 - d) # mirror around 180 cos = lambda r: cos_d(math.degrees(r)) @@ -437,8 +441,10 @@ class TriangleLayout(RingLayout): def cos_d(d): while d < -90: d += 360 - if d <= 30: return (d + 90) / 120. - if d <= 90: return (90 - d) / 60. + if d <= 30: + return (d + 90) / 120. + if d <= 90: + return (90 - d) / 60. return -cos_d(180 - d) # mirror around 90 sqrt_3 = math.sqrt(3) @@ -446,8 +452,10 @@ class TriangleLayout(RingLayout): def sin_d(d): while d < -90: d += 360 - if d <= 30: return ((d + 90) / 120.) * sqrt_3 - 1 - if d <= 90: return sqrt_3 - 1 + if d <= 30: + return ((d + 90) / 120.) * sqrt_3 - 1 + if d <= 90: + return sqrt_3 - 1 return sin_d(180 - d) # mirror around 90 cos = lambda r: cos_d(math.degrees(r)) |