@@ -92,11 +92,11 @@ def main():
92
92
dest = "square_size" , type = float )
93
93
parser .add_argument ("-R" , "--radius_rate" , help = "circles_radius = square_size/radius_rate" , default = "5.0" ,
94
94
action = "store" , dest = "radius_rate" , type = float )
95
- parser .add_argument ("-w" , "--page_width" , help = "page width in units" , default = "216" , action = "store" ,
95
+ parser .add_argument ("-w" , "--page_width" , help = "page width in units" , default = argparse . SUPPRESS , action = "store" ,
96
96
dest = "page_width" , type = float )
97
- parser .add_argument ("-h" , "--page_height" , help = "page height in units" , default = "279" , action = "store" ,
98
- dest = "page_width " , type = float )
99
- parser .add_argument ("-a" , "--page_size" , help = "page size, supersedes -h -w arguments " , default = "A4" , action = "store" ,
97
+ parser .add_argument ("-h" , "--page_height" , help = "page height in units" , default = argparse . SUPPRESS , action = "store" ,
98
+ dest = "page_height " , type = float )
99
+ parser .add_argument ("-a" , "--page_size" , help = "page size, superseded if -h and -w are set " , default = "A4" , action = "store" ,
100
100
dest = "page_size" , choices = ["A0" , "A1" , "A2" , "A3" , "A4" , "A5" ])
101
101
args = parser .parse_args ()
102
102
@@ -111,12 +111,16 @@ def main():
111
111
units = args .units
112
112
square_size = args .square_size
113
113
radius_rate = args .radius_rate
114
- page_size = args .page_size
115
- # page size dict (ISO standard, mm) for easy lookup. format - size: [width, height]
116
- page_sizes = {"A0" : [840 , 1188 ], "A1" : [594 , 840 ], "A2" : [420 , 594 ], "A3" : [297 , 420 ], "A4" : [210 , 297 ],
117
- "A5" : [148 , 210 ]}
118
- page_width = page_sizes [page_size .upper ()][0 ]
119
- page_height = page_sizes [page_size .upper ()][1 ]
114
+ if 'page_width' and 'page_height' in args :
115
+ page_width = args .page_width
116
+ page_height = args .page_height
117
+ else :
118
+ page_size = args .page_size
119
+ # page size dict (ISO standard, mm) for easy lookup. format - size: [width, height]
120
+ page_sizes = {"A0" : [840 , 1188 ], "A1" : [594 , 840 ], "A2" : [420 , 594 ], "A3" : [297 , 420 ], "A4" : [210 , 297 ],
121
+ "A5" : [148 , 210 ]}
122
+ page_width = page_sizes [page_size ][0 ]
123
+ page_height = page_sizes [page_size ][1 ]
120
124
pm = PatternMaker (columns , rows , output , units , square_size , radius_rate , page_width , page_height )
121
125
# dict for easy lookup of pattern type
122
126
mp = {"circles" : pm .make_circles_pattern , "acircles" : pm .make_acircles_pattern ,
0 commit comments