2
0
forked from s444420/AL-2020
AL-2020/assigning.py

19 lines
451 B
Python
Raw Permalink Normal View History

import os
from codes_recognizer.rocognizer import recognizer
2020-06-09 21:57:37 +02:00
def assigning(product_code_path, shelfs):
c = None
code = recognizer(product_code_path)
2020-06-09 21:57:37 +02:00
print(code)
product_color = str(code[0]) + str(code[1])
print(product_color)
for shelf in shelfs:
2020-06-09 21:57:37 +02:00
if shelf.color == product_color:
shelf.add_product(code)
2020-06-09 21:57:37 +02:00
c = shelf.get_field()
print("Product", product_code_path, "is on", c)
return c