File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ usage: printlabel.py [-h] [-u] [-l] [-s] [-c] [-i FILE_NAME] [-M FILE_NAME] [-R
37
37
[--fill-color FILL] [--stroke-fill STROKE_FILL]
38
38
[--stroke-width STROKE_WIDTH] [--text-size MILLIMETERS]
39
39
[--white-level NUMBER] [--threshold NUMBER]
40
- COM_PORT FONT_NAME TEXT_TO_PRINT
40
+ COM_PORT FONT_NAME TEXT_TO_PRINT [TEXT_TO_PRINT ...]
41
41
42
42
positional arguments:
43
43
COM_PORT Printer COM port.
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ def set_args():
27
27
p .add_argument (
28
28
'text_to_print' ,
29
29
metavar = 'TEXT_TO_PRINT' ,
30
+ nargs = '+' ,
30
31
help = 'Text to be printed. UTF8 characters are accepted.'
31
32
)
32
33
p .add_argument (
@@ -235,11 +236,10 @@ def main():
235
236
font_size = 0
236
237
font_height = 0
237
238
print_border = (height_of_the_image - height_of_the_printable_area ) / 2
238
- if args .text_to_print :
239
+ text = " " .join (args .text_to_print )
240
+ if text :
239
241
if args .unicode :
240
- text = args .text_to_print .encode ().decode ('unicode_escape' )
241
- else :
242
- text = args .text_to_print
242
+ text = text .encode ().decode ('unicode_escape' )
243
243
stop = False
244
244
while font_height != height_of_the_printable_area :
245
245
if font_height > height_of_the_printable_area :
You can’t perform that action at this time.
0 commit comments