From 5456986f98fed99e7fb5ee599bb9467238390fcc Mon Sep 17 00:00:00 2001 From: DevilXD <4180725+DevilXD@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:19:25 +0200 Subject: [PATCH] Change minimum Python version to 3.10 --- README.md | 1 + cache.py | 1 + gui.py | 2 +- utils.py | 12 +----------- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8a8a26d..89ba166 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Every several seconds, the application pretends to watch a particular stream by ### Notes: +- Requires Python 3.10 or higher. - Make sure to keep your cookies file safe, as the authorization information it stores can give another person access to your Twitch account. - Successfully logging into your Twitch account in the application, may cause Twitch to send you a "New Login" notification email. This is normal - you can verify that it comes from your own IP address. The application uses the Twitch's SmartTV account linking process, so the detected browser during the login should signify that as well. - The time remaining timer always countdowns a single minute and then stops - it is then restarted only after the application redetermines the remaining time. This "redetermination" can happen as early as at 10 seconds in a minute remaining, and as late as 20 seconds after the timer reaches zero (especially when finishing mining a drop), but is generally only an approximation and does not represent nor affect actual mining speed. The time variations are due to Twitch sometimes not reporting drop progress at all, or reporting progress for the wrong drop - these cases have all been accounted for in the application though. diff --git a/cache.py b/cache.py index f33cbb1..e87b1c0 100644 --- a/cache.py +++ b/cache.py @@ -1,4 +1,5 @@ from __future__ import annotations + import asyncio from datetime import datetime, timedelta, timezone diff --git a/gui.py b/gui.py index 22d13d4..599f7b2 100644 --- a/gui.py +++ b/gui.py @@ -1043,7 +1043,7 @@ class TrayIcon: def __init__(self, manager: GUIManager, master: ttk.Widget): self._manager = manager - self.icon: pystray.Icon | None = None + self.icon: pystray.Icon | None = None # type: ignore self._icon_images: dict[str, Image_module.Image] = { "pickaxe": Image_module.open(resource_path("icons/pickaxe.ico")), "active": Image_module.open(resource_path("icons/active.ico")), diff --git a/utils.py b/utils.py index a95fa37..257674e 100644 --- a/utils.py +++ b/utils.py @@ -19,9 +19,7 @@ from contextlib import suppress from functools import cached_property from datetime import datetime, timezone from collections import abc, OrderedDict -from typing import ( - Any, Literal, MutableSet, Callable, Generic, Mapping, TypeVar, cast, TYPE_CHECKING -) +from typing import Any, Literal, MutableSet, Callable, Generic, Mapping, TypeVar, ParamSpec, cast import yarl from PIL.ImageTk import PhotoImage @@ -31,14 +29,6 @@ from constants import JsonType, IS_PACKAGED from exceptions import ExitRequest, ReloadRequest from constants import _resource_path as resource_path # noqa -if TYPE_CHECKING: - from typing_extensions import ParamSpec -else: - # stub it - class ParamSpec: - def __init__(*args, **kwargs): - pass - _T = TypeVar("_T") # type _D = TypeVar("_D") # default