Ejemplo n.º 1
0
if len(sys.argv) != 3:
	exit(0)

username = sys.argv[1]
password = sys.argv[2]

api = colruyt.ColruytAPI(username, password)
scanner = barcode.BarcodeScanner(800, 600)
display = display.Display()

ip = get_ip_address("eth0")

while True:
	try:
		display.show_message("your ip is %s" % (ip))
		# scan for a barcode
		image = scanner.scan()
		for symbol in image:
			# barcodes found
			print "decoded %s symbol, %s" % (symbol.type, symbol.data)
			try:
				# look up the product using its barcode
				response = api.search(symbol.data)

				print "Looking up product with %s barcode %s: %s" % (symbol.type, symbol.data, response["status"]["meaning"])

				productId = response["data"]["searchResults"][0]["list"][0]["id"]
				productBrand = response["data"]["searchResults"][0]["list"][0]["brand"]
				productDescription = response["data"]["searchResults"][0]["list"][0]["description"]
				productImagePath = response["data"]["searchResults"][0]["list"][0]["overviewImage"]
Ejemplo n.º 2
0
if len(sys.argv) != 3:
    exit(0)

username = sys.argv[1]
password = sys.argv[2]

api = colruyt.ColruytAPI(username, password)
scanner = barcode.BarcodeScanner(800, 600)
display = display.Display()

ip = get_ip_address("eth0")

while True:
    try:
        display.show_message("your ip is %s" % (ip))
        # scan for a barcode
        image = scanner.scan()
        for symbol in image:
            # barcodes found
            print "decoded %s symbol, %s" % (symbol.type, symbol.data)
            try:
                # look up the product using its barcode
                response = api.search(symbol.data)

                print "Looking up product with %s barcode %s: %s" % (
                    symbol.type, symbol.data, response["status"]["meaning"])

                productId = response["data"]["searchResults"][0]["list"][0][
                    "id"]
                productBrand = response["data"]["searchResults"][0]["list"][0][
Ejemplo n.º 3
0
    return socket.inet_ntoa(fcntl.ioctl(s.fileno(), 0x8915, struct.pack("256s", ifname[:15]))[20:24])  # SIOCGIFADDR


if len(sys.argv) != 3:
    exit(0)

username = sys.argv[1]
password = sys.argv[2]

api = colruyt.ColruytAPI(username, password)
display = display.Display()
ip = get_ip_address("eth0")

while True:
    try:
        display.show_message("your ip is %s" % (ip))
        barcode = sys.stdin.readline()
        barcode = barcode.strip()
        try:
            response = api.search(barcode)
            print "zoeken van product met barcode %s: %s" % (barcode, response["status"]["meaning"])

            productId = response["data"]["searchResults"][0]["list"][0]["id"]
            productBrand = response["data"]["searchResults"][0]["list"][0]["brand"]
            productDescription = response["data"]["searchResults"][0]["list"][0]["description"]
            productImagePath = response["data"]["searchResults"][0]["list"][0]["overviewImage"]
            price = response["data"]["searchResults"][0]["list"][0]["price"]

            image = api.get_product_image(productImagePath)
            if image is not None:
                display.show_product(image, productBrand, productDescription, price)
Ejemplo n.º 4
0
            struct.pack('256s', ifname[:15]))[20:24])


if len(sys.argv) != 3:
    exit(0)

username = sys.argv[1]
password = sys.argv[2]

api = colruyt.ColruytAPI(username, password)
display = display.Display()
ip = get_ip_address("eth0")

while True:
    try:
        display.show_message("your ip is %s" % (ip))
        barcode = sys.stdin.readline()
        barcode = barcode.strip()
        try:
            response = api.search(barcode)
            print "zoeken van product met barcode %s: %s" % (
                barcode, response["status"]["meaning"])

            productId = response["data"]["searchResults"][0]["list"][0]["id"]
            productBrand = response["data"]["searchResults"][0]["list"][0][
                "brand"]
            productDescription = response["data"]["searchResults"][0]["list"][
                0]["description"]
            productImagePath = response["data"]["searchResults"][0]["list"][0][
                "overviewImage"]
            price = response["data"]["searchResults"][0]["list"][0]["price"]