Small GUI internals cleanup

This commit is contained in:
DevilXD committed 2022-03-09 11:06:43 +01:00
1 parent 5b04907d33
commit 2bddd68af2
2 files changed
+15 -14

No files matched your search

+8
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
import os
import sys
import random
import string
import asyncio
@@ -28,6 +30,12 @@ logger = logging.getLogger("TwitchDrops")
NONCE_CHARS = string.ascii_letters + string.digits
def resource_path(relative_path):
"""Get absolute path to resource, works for dev and for PyInstaller"""
base_path = getattr(sys, "_MEIPASS", os.path.dirname(os.path.abspath(__file__)))
return os.path.join(base_path, relative_path)
def timestamp(string: str) -> datetime:
return datetime.strptime(string, "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)