From 363b474b46ae1e36117e7f5d1fb980abd6182d13 Mon Sep 17 00:00:00 2001 From: SuksAE <101243305+SuksAE@users.noreply.github.com> Date: Sun, 15 May 2022 10:23:14 +0200 Subject: [PATCH] Add parameter "hole_dD" to .buildArgParser() --- boxes/__init__.py | 5 +++++ boxes/generators/bintray.py | 3 +-- boxes/generators/trafficlight.py | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/boxes/__init__.py b/boxes/__init__.py index ec65246..775fc49 100755 --- a/boxes/__init__.py +++ b/boxes/__init__.py @@ -433,6 +433,11 @@ class Boxes: self.argparser.add_argument( "--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)") + 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": if default is None: default = "h" self.argparser.add_argument( diff --git a/boxes/generators/bintray.py b/boxes/generators/bintray.py index bf32901..113a6cf 100644 --- a/boxes/generators/bintray.py +++ b/boxes/generators/bintray.py @@ -50,12 +50,11 @@ class BinTray(Boxes): def __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.argparser.add_argument( "--front", action="store", type=float, default=0.4, 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): posx = -0.5 * self.thickness diff --git a/boxes/generators/trafficlight.py b/boxes/generators/trafficlight.py index fe5a658..b16b1b0 100644 --- a/boxes/generators/trafficlight.py +++ b/boxes/generators/trafficlight.py @@ -48,7 +48,7 @@ When turned by 90°, it can be also used to create a bottle holder.""" self.addSettingsArgs(edges.FingerJointSettings) # 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) self.argparser.add_argument( "--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, 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): t = self.thickness for i in range(1, self.n):