How to use the escpos.helpers.is_value_in function in escpos

To help you get started, we’ve selected a few escpos examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github base4sistemas / pyescpos / escpos / impl / epson.py View on Github external
def _code128_impl(self, data, **kwargs):
        codeset = kwargs.get('codeset', barcode.CODE128_A)
        if not is_value_in(barcode.CODE128_CODESETS, codeset):
            raise ValueError('Unknown Code 128 code set: {!r}'.format(codeset))

        encoded_data = '{{{0}{1}'.format(codeset, data) # {<data>
        commands = barcode.gs_k_barcode(barcode.CODE128, encoded_data, **kwargs)
        for cmd in commands:
            self.device.write(cmd)

        time.sleep(0.25) # wait for barcode to be printed
        return self.device.read()
</data>
github base4sistemas / pyescpos / escpos / barcode.py View on Github external
                lambda v: is_value_in(QRCODE_ERROR_CORRECTION_LEVELS, v),
    }
github base4sistemas / pyescpos / escpos / barcode.py View on Github external
                lambda v: is_value_in(BARCODE_WIDTHS, v),
github base4sistemas / pyescpos / escpos / barcode.py View on Github external
                lambda v: is_value_in(QRCODE_MODULE_SIZES, v),
github base4sistemas / pyescpos / escpos / barcode.py View on Github external
                lambda v: is_value_in(BARCODE_HRI_POSITIONING, v),
    }