Skip to content

Commit

Permalink
Fix icon location bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mathgeniuszach committed Apr 30, 2024
1 parent a47b819 commit 2bb9e9a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
16 changes: 13 additions & 3 deletions fpcurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def toggle_console():
import datetime
import functools
import pyperclip
import pathlib
import googletrans
import qfile
import glob
Expand Down Expand Up @@ -222,8 +223,8 @@ def toggle_console():
# This uuid uniquely defines fpcurator. (there is a 0 on the end after the text)
UUID = '51be8a01-3307-4103-8913-c2f70e64d83'

TITLE = "fpcurator v1.6.1"
ABOUT = "Created by Zach K - v1.6.1"
TITLE = "fpcurator v1.6.2"
ABOUT = "Created by Zach K - v1.6.2"
VER = 6

SITES_FOLDER = "sites"
Expand Down Expand Up @@ -283,7 +284,16 @@ def __init__(self):
self.minsize(695, 650)
self.title(TITLE)

self.iconphoto(True, tk.PhotoImage(file="icon.png"))
try:
filepath = pathlib.Path(__file__)
icons = [*filepath.parent.glob("**/icon.png")]
if len(icons) > 0:
self.iconphoto(True, tk.PhotoImage(file=icons[0]))
else:
self.iconphoto(True, tk.PhotoImage(file="icon.png"))
except Exception as e:
fpclib.debug('Could not find fpcurator icon', 1, pre='[ERR] ')

self.protocol("WM_DELETE_WINDOW", self.exit_window)

# Cross-window variables
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fpcurator"
version = "1.6.1"
version = "1.6.2"
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."
authors = ["mathgeniuszach <[email protected]>"]
readme = "README.md"
Expand Down
3 changes: 2 additions & 1 deletion scripts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ def update_defs():
def build():
clean()
os.system(f'pyinstaller fpcurator.py --onedir' + #' --upx-dir=upx' +
f' --add-data="icon.png{os.pathsep}icon.png"' +
f' --add-data="icon.png{os.pathsep}."' +
f' --add-data="{tkinter.__path__[0]}{os.pathsep}tkinter"' +
f' --add-data="{tkinterweb.__path__[0]}{os.pathsep}tkinterweb"' +
f' --add-data="{PIL.__path__[0]}{os.pathsep}PIL"')

def clean():
rmpycache()
rm(PROJECT_DIR / "fpcurator.spec")
rm(PROJECT_DIR / "build")
rm(PROJECT_DIR / "dist")

0 comments on commit 2bb9e9a

Please sign in to comment.