Skip to content

Commit

Permalink
GridfinityTrayLayout: Add input parameter to pass layout file on the …
Browse files Browse the repository at this point in the history
…command line
  • Loading branch information
florianfesti committed Apr 1, 2024
1 parent 7c0ab2b commit b4517a9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion boxes/generators/gridfinitytraylayout.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import argparse

import boxes
from boxes import Boxes, lids, restore
from boxes.Color import Color
Expand Down Expand Up @@ -37,7 +39,14 @@ def __init__(self) -> None:
self.argparser.add_argument("--countx", type=int, default=5, help="split x into this many grid sections. 0 means same as --nx")
self.argparser.add_argument("--county", type=int, default=3, help="split y into this many grid sections. 0 means same as --ny")
self.argparser.add_argument("--margin", type=float, default=0.75, help="Leave this much total margin on the outside, in mm")
self.argparser.add_argument("--layout", type=str, help="You can hand edit this before generating", default="\n");
if self.UI == "web":
self.argparser.add_argument("--layout", type=str, help="You can hand edit this before generating", default="\n");
else:
self.argparser.add_argument(
"--input", action="store", type=argparse.FileType('r'),
default="traylayout.txt",
help="layout file")
self.layout = None

def generate_layout(self):
layout = ''
Expand Down

0 comments on commit b4517a9

Please sign in to comment.