示例#1
0
文件: test.py 项目: zilnuken/python
def decodeFile(fileName):
    results = dbr.decodeFile(fileName, config.barcodeTypes)

    for result in results:
        print("barcode format: " + result[0])
        print("barcode value: " +
              bytearray.fromhex(result[1]).decode('latin-1'))
示例#2
0
def decodeFile(fileName):
    formats = 0x3FF | 0x2000000 | 0x8000000 | 0x4000000  # 1D, QRCODE, PDF417, DataMatrix
    results = dbr.decodeFile(fileName, formats, 'CUSTOM')

    for result in results:
        print("barcode format: " + result[0])
        print("barcode value: " + result[1])
示例#3
0
def upload(request):
    if request.method == 'POST':
        uploadedFile = handle_uploaded_file(request.FILES['RemoteFile'],
                                            str(request.FILES['RemoteFile']))
        results = dbr.decodeFile(uploadedFile)
        return HttpResponse(results)

    return HttpResponse("Failed")
示例#4
0
    def readBarcode(self, filename):
        dbr.initLicense("Your License")
        results = dbr.decodeFile(filename, 0x3FF | 0x2000000 | 0x4000000 | 0x8000000 | 0x10000000)

        out = ''
        index = 0
        for result in results:
            out += "Index: " + str(index) + "\n"
            out += "Barcode format: " + result[0] + '\n'
            out += "Barcode value: " + result[1] + '\n'
            out += '-----------------------------------\n'
            index += 1

        self.results.setText(out)
示例#5
0
def decodeFile(fileName):
    results = dbr.decodeFile(fileName, config.barcodeTypes)

    for result in results:
        print("barcode format: " + result[0])
        print("barcode value: " + result[1])