Skip to content

Commit 12fa1d5

Browse files
authored
Merge pull request #14 from ChocoScaff/fileListApp
fix
2 parents 0526b43 + ad05372 commit 12fa1d5

File tree

2 files changed

+9
-42
lines changed

2 files changed

+9
-42
lines changed

fileListApp.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,24 @@ def load_files(self, folder):
8787
def load_thumbnail(self, file_path):
8888
try:
8989
image = None
90+
base_path = os.path.dirname(os.path.abspath(__file__))
91+
9092
if file_path.endswith(".vtf"):
91-
image = Image.open(os.path.join("icons", "VTFEdit.png"))
93+
image = Image.open(os.path.join(base_path, "icons", "VTFEdit.png"))
9294
elif file_path.endswith(".mdl"):
93-
image = Image.open(os.path.join("icons", "hlmv.png"))
95+
image = Image.open(os.path.join(base_path, "icons", "hlmv.png"))
9496
elif file_path.endswith(".tga"):
9597
image = Image.open(file_path)
9698
elif file_path.endswith(".vmf"):
97-
image = Image.open(os.path.join("icons", "hammer.png"))
99+
image = Image.open(os.path.join(base_path, "icons", "hammer.png"))
98100
elif file_path.endswith(".vcd"):
99-
image = Image.open(os.path.join("icons", "hlposer.png"))
101+
image = Image.open(os.path.join(base_path, "icons", "hlposer.png"))
100102
elif file_path.endswith(".bsp"):
101-
image = Image.open(os.path.join("icons", "source.png"))
103+
image = Image.open(os.path.join(base_path, "icons", "source.png"))
102104
elif os.path.isdir(file_path):
103-
image = Image.open(os.path.join("icons", "fileexplorer.png"))
105+
image = Image.open(os.path.join(base_path, "icons", "fileexplorer.png"))
104106
elif file_path.endswith(".txt") or file_path.endswith(".res") or file_path.endswith(".vmt") or file_path.endswith(".qc") or file_path.endswith(".smd"):
105-
image = Image.open(os.path.join("icons", "txt.png"))
107+
image = Image.open(os.path.join(base_path, "icons", "txt.png"))
106108

107109
if image:
108110
image.thumbnail((50, 50))

openSLN.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)