Fixed app icon error; created .pkg
This commit is contained in:
parent
d99c5d2f23
commit
4fea9596f9
1 changed files with 127 additions and 6 deletions
|
|
@ -52,6 +52,20 @@ def save_json_file(filepath, data, raw=False):
|
|||
json.dump(data, f, sort_keys=True, indent=None if raw else 2)
|
||||
except Exception as error:
|
||||
raise error
|
||||
|
||||
def get_icon_file():
|
||||
"""Attempts to return a valid icon file."""
|
||||
if os.name == "nt":
|
||||
path = ""
|
||||
try:
|
||||
path = sys._MEIPASS # For PyInstaller
|
||||
except Exception:
|
||||
path = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
return pathlib.Path(path).parent.parent / "icon.ico"
|
||||
else:
|
||||
path = os.path.dirname(os.path.abspath(__file__))
|
||||
return pathlib.Path(path).parent.parent / "icon.svg"
|
||||
|
||||
def parse_dir(path="", ignore_mkdir=False):
|
||||
"""Converts and creates a directory (can be full file path)."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue