pathByEnum util added

This commit is contained in:
Makrellka 2022-05-26 19:22:51 +02:00
parent 52bfb06608
commit bf4d4aaeaa
2 changed files with 14 additions and 0 deletions

View File

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

14
util/PathByEnum.py Normal file
View File

@ -0,0 +1,14 @@
from random import random
class PathByEnum:
def get_random_path(self, item):
if item == 1:
a = str(random.randint(1, 10))
return "item_images/door/drzwi" + a + ".jpg"
if item == 2:
a = str(random.randint(1, 10))
return "item_images/refrigerator/lodowka" + a + ".jpg"
if item == 3:
a = str(random.randint(1, 10))
return "item_images/shelf/polka" + a + ".jpg"