forked from SivWatt/LOL_report_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimages.py
23 lines (21 loc) · 817 Bytes
/
images.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from PIL import Image
import os
from os import listdir
# class for storing images
class MatchingImages:
def __init__(self, cwd):
path = os.path.join(cwd, 'image')
self.checkbox = Image.open(os.path.join(path, 'checkbox.PNG'))
self.commentText = Image.open(os.path.join(path, 'comment.PNG'))
self.cancelButton = Image.open(os.path.join(path, 'cancel.PNG'))
self.reportConfirm = Image.open(os.path.join(path, 'reportConfirm.PNG'))
self.reportButtons = MatchingImages.loadImageFromFolder(os.path.join(path, 'reportIcon'))
self.gameModeIcons = MatchingImages.loadImageFromFolder(os.path.join(path, 'GameModeIcon'))
@staticmethod
def loadImageFromFolder(path):
files = listdir(path)
images = []
for i in files:
im = Image.open(os.path.join(path, i))
images.append(im)
return images