Skip to content

Commit 2bb9e9a

Browse files
Fix icon location bugs
1 parent a47b819 commit 2bb9e9a

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

fpcurator.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def toggle_console():
3939
import datetime
4040
import functools
4141
import pyperclip
42+
import pathlib
4243
import googletrans
4344
import qfile
4445
import glob
@@ -222,8 +223,8 @@ def toggle_console():
222223
# This uuid uniquely defines fpcurator. (there is a 0 on the end after the text)
223224
UUID = '51be8a01-3307-4103-8913-c2f70e64d83'
224225

225-
TITLE = "fpcurator v1.6.1"
226-
ABOUT = "Created by Zach K - v1.6.1"
226+
TITLE = "fpcurator v1.6.2"
227+
ABOUT = "Created by Zach K - v1.6.2"
227228
VER = 6
228229

229230
SITES_FOLDER = "sites"
@@ -283,7 +284,16 @@ def __init__(self):
283284
self.minsize(695, 650)
284285
self.title(TITLE)
285286

286-
self.iconphoto(True, tk.PhotoImage(file="icon.png"))
287+
try:
288+
filepath = pathlib.Path(__file__)
289+
icons = [*filepath.parent.glob("**/icon.png")]
290+
if len(icons) > 0:
291+
self.iconphoto(True, tk.PhotoImage(file=icons[0]))
292+
else:
293+
self.iconphoto(True, tk.PhotoImage(file="icon.png"))
294+
except Exception as e:
295+
fpclib.debug('Could not find fpcurator icon', 1, pre='[ERR] ')
296+
287297
self.protocol("WM_DELETE_WINDOW", self.exit_window)
288298

289299
# Cross-window variables

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fpcurator"
3-
version = "1.6.1"
3+
version = "1.6.2"
44
description = "fpcurator is a Python and fpclib powered tool for downloading urls, auto-generating curations, bulk searching for already curated games, and listing tags/platforms/games/animations for Flashpoint."
55
authors = ["mathgeniuszach <huntingmanzach@gmail.com>"]
66
readme = "README.md"

scripts/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ def update_defs():
3333
def build():
3434
clean()
3535
os.system(f'pyinstaller fpcurator.py --onedir' + #' --upx-dir=upx' +
36-
f' --add-data="icon.png{os.pathsep}icon.png"' +
36+
f' --add-data="icon.png{os.pathsep}."' +
3737
f' --add-data="{tkinter.__path__[0]}{os.pathsep}tkinter"' +
3838
f' --add-data="{tkinterweb.__path__[0]}{os.pathsep}tkinterweb"' +
3939
f' --add-data="{PIL.__path__[0]}{os.pathsep}PIL"')
4040

4141
def clean():
4242
rmpycache()
43+
rm(PROJECT_DIR / "fpcurator.spec")
4344
rm(PROJECT_DIR / "build")
4445
rm(PROJECT_DIR / "dist")

0 commit comments

Comments
 (0)