diff --git a/escpos/constants.py b/escpos/constants.py index ca6efb7..9315395 100644 --- a/escpos/constants.py +++ b/escpos/constants.py @@ -132,29 +132,29 @@ BARCODE_WIDTH = GS + 'w' # Barcode Width [2-6] _SET_BARCODE_TYPE = lambda m: GS + 'k' + m # Barcodes for type A -BARCODE_A_UPC_A = _SET_BARCODE_TYPE('\x00') # Barcode type UPC-A -BARCODE_A_UPC_E = _SET_BARCODE_TYPE('\x01') # Barcode type UPC-E -BARCODE_A_EAN13 = _SET_BARCODE_TYPE('\x02') # Barcode type EAN13 -BARCODE_A_EAN8 = _SET_BARCODE_TYPE('\x03') # Barcode type EAN8 -BARCODE_A_CODE39 = _SET_BARCODE_TYPE('\x04') # Barcode type CODE39 -BARCODE_A_ITF = _SET_BARCODE_TYPE('\x05') # Barcode type ITF -BARCODE_A_NW7 = _SET_BARCODE_TYPE('\x06') # Barcode type NW7 +BARCODE_A_UPC_A = _SET_BARCODE_TYPE(chr(0)) # Barcode type UPC-A +BARCODE_A_UPC_E = _SET_BARCODE_TYPE(chr(1)) # Barcode type UPC-E +BARCODE_A_EAN13 = _SET_BARCODE_TYPE(chr(2)) # Barcode type EAN13 +BARCODE_A_EAN8 = _SET_BARCODE_TYPE(chr(3)) # Barcode type EAN8 +BARCODE_A_CODE39 = _SET_BARCODE_TYPE(chr(4)) # Barcode type CODE39 +BARCODE_A_ITF = _SET_BARCODE_TYPE(chr(5)) # Barcode type ITF +BARCODE_A_NW7 = _SET_BARCODE_TYPE(chr(6)) # Barcode type NW7 # Barcodes for type B -BARCODE_B_UPC_A = _SET_BARCODE_TYPE('\x65') # Barcode type UPC-A -BARCODE_B_UPC_E = _SET_BARCODE_TYPE('\x66') # Barcode type UPC-E -BARCODE_B_EAN13 = _SET_BARCODE_TYPE('\x67') # Barcode type EAN13 -BARCODE_B_EAN8 = _SET_BARCODE_TYPE('\x68') # Barcode type EAN8 -BARCODE_B_CODE39 = _SET_BARCODE_TYPE('\x69') # Barcode type CODE39 -BARCODE_B_ITF = _SET_BARCODE_TYPE('\x70') # Barcode type ITF -BARCODE_B_NW7 = _SET_BARCODE_TYPE('\x71') # Barcode type NW7 -BARCODE_B_CODE93 = _SET_BARCODE_TYPE('\x72') # Barcode type CODE93 -BARCODE_B_CODE128 = _SET_BARCODE_TYPE('\x73') # Barcode type CODE128 -BARCODE_B_GS1_128 = _SET_BARCODE_TYPE('\x74') # Barcode type GS1_128 -BARCODE_B_GS1_DATABAR_OMNI = _SET_BARCODE_TYPE('\x75') # Barcode type GS1 DataBar Omnidirectional -BARCODE_B_GS1_DATABAR_TRUNC = _SET_BARCODE_TYPE('\x76') # Barcode type GS1 DataBar Truncated -BARCODE_B_GS1_DATABAR_LIM = _SET_BARCODE_TYPE('\x77') # Barcode type GS1 DataBar Limited -BARCODE_B_GS1_DATABAR_EXP = _SET_BARCODE_TYPE('\x78') # Barcode type GS1 DataBar Expanded +BARCODE_B_UPC_A = _SET_BARCODE_TYPE(chr(65)) # Barcode type UPC-A +BARCODE_B_UPC_E = _SET_BARCODE_TYPE(chr(66)) # Barcode type UPC-E +BARCODE_B_EAN13 = _SET_BARCODE_TYPE(chr(67)) # Barcode type EAN13 +BARCODE_B_EAN8 = _SET_BARCODE_TYPE(chr(68)) # Barcode type EAN8 +BARCODE_B_CODE39 = _SET_BARCODE_TYPE(chr(69)) # Barcode type CODE39 +BARCODE_B_ITF = _SET_BARCODE_TYPE(chr(70)) # Barcode type ITF +BARCODE_B_NW7 = _SET_BARCODE_TYPE(chr(71)) # Barcode type NW7 +BARCODE_B_CODE93 = _SET_BARCODE_TYPE(chr(72)) # Barcode type CODE93 +BARCODE_B_CODE128 = _SET_BARCODE_TYPE(chr(73)) # Barcode type CODE128 +BARCODE_B_GS1_128 = _SET_BARCODE_TYPE(chr(74)) # Barcode type GS1_128 +BARCODE_B_GS1_DATABAR_OMNI = _SET_BARCODE_TYPE(chr(75)) # Barcode type GS1 DataBar Omnidirectional +BARCODE_B_GS1_DATABAR_TRUNC = _SET_BARCODE_TYPE(chr(76)) # Barcode type GS1 DataBar Truncated +BARCODE_B_GS1_DATABAR_LIM = _SET_BARCODE_TYPE(chr(77)) # Barcode type GS1 DataBar Limited +BARCODE_B_GS1_DATABAR_EXP = _SET_BARCODE_TYPE(chr(78)) # Barcode type GS1 DataBar Expanded # Constants to be used when the user is calling the function. All uppercase. BARCODE_TYPE_A = {