@@ -68,27 +68,26 @@ def append_img(x, y) -> None:
68
68
objects .append (IMAGES .format (filename = x , name = y ))
69
69
70
70
options = {}
71
- if True :
72
- bcode = get_barcode (codename , code )
71
+ bcode = get_barcode (codename , code )
72
+ if codename .startswith ("i" ):
73
+ options ["center_text" ] = False
74
+ else :
75
+ options ["center_text" ] = True
76
+ filename = bcode .save (os .path .join (TESTPATH , codename ), options = options )
77
+ print (f"Code: { bcode .name } , Input: { code } , Output: { bcode .get_fullcode ()} " )
78
+ append (os .path .basename (filename ), bcode .name )
79
+ if ImageWriter is not None :
80
+ bcodec = get_barcode_class (codename )
81
+ bcode = bcodec (code , writer = ImageWriter ())
82
+ opts = {}
73
83
if codename .startswith ("i" ):
74
- options ["center_text" ] = False
84
+ opts ["center_text" ] = False
75
85
else :
76
- options ["center_text" ] = True
77
- filename = bcode .save (os .path .join (TESTPATH , codename ), options = options )
78
- print (f"Code: { bcode .name } , Input: { code } , Output: { bcode .get_fullcode ()} " )
79
- append (os .path .basename (filename ), bcode .name )
80
- if ImageWriter is not None :
81
- bcodec = get_barcode_class (codename )
82
- bcode = bcodec (code , writer = ImageWriter ())
83
- opts = {}
84
- if codename .startswith ("i" ):
85
- opts ["center_text" ] = False
86
- else :
87
- opts ["center_text" ] = True
88
- filename = bcode .save (os .path .join (TESTPATH , codename ), options = opts )
89
- append_img (os .path .basename (filename ), bcode .name )
90
- else :
91
- objects .append (NO_PIL )
86
+ opts ["center_text" ] = True
87
+ filename = bcode .save (os .path .join (TESTPATH , codename ), options = opts )
88
+ append_img (os .path .basename (filename ), bcode .name )
89
+ else :
90
+ objects .append (NO_PIL )
92
91
93
92
94
93
@pytest .fixture (scope = "module" )
0 commit comments