Skip to content

Commit

Permalink
chore: simplify return
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotzbua authored and florianfesti committed Mar 30, 2024
1 parent e669fa7 commit 677d9a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
13 changes: 5 additions & 8 deletions boxes/generators/cardbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,17 @@ def fingerholedepth(self):
def boxhight(self):
if self.outside:
return self.h - 3 * self.thickness
else:
return self.h
return self.h
@property
def boxwidth(self):
return (len(self.sx) + 1) * self.thickness + sum(self.sx)
@property
def boxdepth(self):
if not self.outside:
if self.openingdirection == 'right':
return self.y + 2 * self.thickness
else:
return self.y
else:
if self.outside:
return self.y - 2 * self.thickness
if self.openingdirection == 'right':
return self.y + 2 * self.thickness
return self.y

def divider_bottom(self):
t = self.thickness
Expand Down
8 changes: 3 additions & 5 deletions boxes/generators/frontpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
from boxes import *


def str_to_bool(s):
if (s.lower() in ['true', '1', 't', 'y', 'yes', 'yeah', 'yup', 'certainly', 'uh-huh']):
return True
else:
return False
def str_to_bool(s: str) -> bool:
return s.lower() in ('true', '1', 't', 'y', 'yes', 'yeah', 'yup', 'certainly', 'uh-huh')


class FrontPanel(Boxes):
"""Mounting Holes and cutouts for all your holy needs."""
Expand Down

0 comments on commit 677d9a8

Please sign in to comment.