normalize whitespace
This commit is contained in:
parent
ce94a1fc18
commit
94a0f2b94b
@ -98,7 +98,7 @@ class Escpos(object):
|
|||||||
# GS v 0, raster format bit image
|
# GS v 0, raster format bit image
|
||||||
density_byte = (0 if high_density_horizontal else 1) + (0 if high_density_vertical else 2)
|
density_byte = (0 if high_density_horizontal else 1) + (0 if high_density_vertical else 2)
|
||||||
header = GS + b"v0" + six.int2byte(density_byte) + self._int_low_high(im.width_bytes, 2) +\
|
header = GS + b"v0" + six.int2byte(density_byte) + self._int_low_high(im.width_bytes, 2) +\
|
||||||
self._int_low_high(im.height, 2)
|
self._int_low_high(im.height, 2)
|
||||||
self._raw(header + im.to_raster_format())
|
self._raw(header + im.to_raster_format())
|
||||||
|
|
||||||
if impl == "graphics":
|
if impl == "graphics":
|
||||||
@ -328,7 +328,7 @@ class Escpos(object):
|
|||||||
function_type = 'B'
|
function_type = 'B'
|
||||||
else:
|
else:
|
||||||
raise BarcodeTypeError((
|
raise BarcodeTypeError((
|
||||||
"Barcode type '{bc} is not valid").format(bc=bc))
|
"Barcode type '{bc} is not valid").format(bc=bc))
|
||||||
|
|
||||||
bc_types = BARCODE_TYPES[function_type.upper()]
|
bc_types = BARCODE_TYPES[function_type.upper()]
|
||||||
if bc.upper() not in bc_types.keys():
|
if bc.upper() not in bc_types.keys():
|
||||||
|
@ -62,8 +62,8 @@ class Encoder(object):
|
|||||||
encoding = CodePages.get_encoding_name(encoding)
|
encoding = CodePages.get_encoding_name(encoding)
|
||||||
if not encoding in self.codepages:
|
if not encoding in self.codepages:
|
||||||
raise ValueError((
|
raise ValueError((
|
||||||
'Encoding "{}" cannot be used for the current profile. '
|
'Encoding "{}" cannot be used for the current profile. '
|
||||||
'Valid encodings are: {}'
|
'Valid encodings are: {}'
|
||||||
).format(encoding, ','.join(self.codepages.keys())))
|
).format(encoding, ','.join(self.codepages.keys())))
|
||||||
return encoding
|
return encoding
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user