Add parameter "hole_dD" to .buildArgParser()

This commit is contained in:
SuksAE 2022-05-15 10:23:14 +02:00 committed by GitHub
parent 1bb4b8c0c3
commit 363b474b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -433,6 +433,11 @@ class Boxes:
self.argparser.add_argument( self.argparser.add_argument(
"--hi", action="store", type=float, default=default, "--hi", action="store", type=float, default=default,
help="inner height of inner walls in mm (unless outside selected)(leave to zero for same as outer walls)") help="inner height of inner walls in mm (unless outside selected)(leave to zero for same as outer walls)")
elif arg == "hole_dD":
if default is None: default = "3.5:6.5"
self.argparser.add_argument(
"--hole_dD", action="store", type=argparseSections, default=default,
help="mounting hole diameter (shaft:head) in mm [\U0001F6C8](https://florianfesti.github.io/boxes/html/usermanual.html#mounting-holes)")
elif arg == "bottom_edge": elif arg == "bottom_edge":
if default is None: default = "h" if default is None: default = "h"
self.argparser.add_argument( self.argparser.add_argument(

View File

@ -50,12 +50,11 @@ class BinTray(Boxes):
def __init__(self): def __init__(self):
Boxes.__init__(self) Boxes.__init__(self)
self.buildArgParser("sx", "sy", "h", "outside") self.buildArgParser("sx", "sy", "h", "outside", "hole_dD")
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=0.5) self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=0.5)
self.argparser.add_argument( self.argparser.add_argument(
"--front", action="store", type=float, default=0.4, "--front", action="store", type=float, default=0.4,
help="fraction of bin height covert with slope") help="fraction of bin height covert with slope")
self.argparser.add_argument("--hole_dD", action="store", type=argparseSections, default="3.5:6.5", help="mounting hole diameter (shaft:head) in mm [\U0001F6C8](https://florianfesti.github.io/boxes/html/usermanual.html#mounting-holes)")
def xSlots(self): def xSlots(self):
posx = -0.5 * self.thickness posx = -0.5 * self.thickness

View File

@ -48,7 +48,7 @@ When turned by 90°, it can be also used to create a bottle holder."""
self.addSettingsArgs(edges.FingerJointSettings) self.addSettingsArgs(edges.FingerJointSettings)
# remove cli params you do not need # remove cli params you do not need
self.buildArgParser("h") self.buildArgParser("h", "hole_dD")
# Add non default cli params if needed (see argparse std lib) # Add non default cli params if needed (see argparse std lib)
self.argparser.add_argument( self.argparser.add_argument(
"--depth", action="store", type=float, default=100, "--depth", action="store", type=float, default=100,
@ -63,8 +63,6 @@ When turned by 90°, it can be also used to create a bottle holder."""
"--upright", action="store", type=boolarg, default=True, "--upright", action="store", type=boolarg, default=True,
help="stack lights upright (or side by side)") help="stack lights upright (or side by side)")
self.argparser.add_argument("--hole_dD", action="store", type=argparseSections, default="3.5:6.5", help="mounting hole diameter (shaft:head) in mm [\U0001F6C8](https://florianfesti.github.io/boxes/html/usermanual.html#mounting-holes)")
def backCB(self): def backCB(self):
t = self.thickness t = self.thickness
for i in range(1, self.n): for i in range(1, self.n):