Fix some typing errors for python 3.8
This commit is contained in:
parent
3f7d8b10e2
commit
c9b9ab6814
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
|
@ -26,10 +26,10 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Set up Python 3.9
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
python-version: 3.8
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import json
|
||||
from logging import getLogger
|
||||
from typing import Tuple
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, QUrl
|
||||
from PyQt5.QtGui import QDesktopServices
|
||||
from PyQt5.QtWidgets import QWidget
|
||||
from legendary.core import LegendaryCore
|
||||
|
||||
from legendary.core import LegendaryCore
|
||||
from rare.ui.components.dialogs.login.browser_login import Ui_BrowserLogin
|
||||
from rare.utils.extra_widgets import IndicatorLineEdit
|
||||
|
||||
|
@ -37,7 +38,7 @@ class BrowserLogin(QWidget, Ui_BrowserLogin):
|
|||
return self.sid_edit.is_valid
|
||||
|
||||
@staticmethod
|
||||
def text_changed(text) -> tuple[bool, str]:
|
||||
def text_changed(text) -> Tuple[bool, str]:
|
||||
if text:
|
||||
text = text.strip()
|
||||
if text.startswith("{") and text.endswith("}"):
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import os.path
|
||||
import platform
|
||||
import re
|
||||
from logging import getLogger
|
||||
from typing import Tuple
|
||||
|
||||
from PyQt5.QtWidgets import QSizePolicy, QWidget, QFileDialog, QMessageBox
|
||||
|
||||
|
@ -61,7 +60,7 @@ class LegendarySettings(QWidget, Ui_LegendarySettings):
|
|||
self.locale_layout.addWidget(self.locale_edit)
|
||||
|
||||
@staticmethod
|
||||
def locale_chck(text: str) -> tuple[bool, str]:
|
||||
def locale_chck(text: str) -> Tuple[bool, str]:
|
||||
if text:
|
||||
if re.match("^[a-zA-Z]{2,3}_[a-zA-Z]{2,3}$", text):
|
||||
language, country = text.split("_")
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import io
|
||||
import os
|
||||
from typing import Callable
|
||||
from logging import getLogger
|
||||
from typing import Callable, Tuple
|
||||
|
||||
import PIL
|
||||
from PIL import Image
|
||||
from PyQt5.QtCore import Qt, QCoreApplication, QRect, QSize, QPoint, pyqtSignal
|
||||
from PyQt5.QtGui import QMovie, QPixmap, QFontMetrics
|
||||
from PyQt5.QtWidgets import QLayout, QStyle, QSizePolicy, QLabel, QFileDialog, QHBoxLayout, QWidget, QPushButton, \
|
||||
QStyleOptionTab, QStylePainter, QTabBar, QLineEdit, QToolButton, QTabWidget
|
||||
QStyleOptionTab, QStylePainter, QTabBar, QLineEdit, QToolButton
|
||||
from qtawesome import icon
|
||||
|
||||
from rare import resources_path, cache_dir
|
||||
|
@ -130,7 +130,7 @@ class IndicatorLineEdit(QWidget):
|
|||
def __init__(self,
|
||||
text: str = "",
|
||||
ph_text: str = "",
|
||||
edit_func: Callable[[str], tuple[bool, str]] = None,
|
||||
edit_func: Callable[[str], Tuple[bool, str]] = None,
|
||||
save_func: Callable[[str], None] = None,
|
||||
horiz_policy: QSizePolicy = QSizePolicy.Expanding,
|
||||
parent=None):
|
||||
|
@ -196,7 +196,7 @@ class PathEdit(IndicatorLineEdit):
|
|||
type_filter: str = "",
|
||||
name_filter: str = "",
|
||||
ph_text: str = "",
|
||||
edit_func: Callable[[str], tuple[bool, str]] = None,
|
||||
edit_func: Callable[[str], Tuple[bool, str]] = None,
|
||||
save_func: Callable[[str], None] = None,
|
||||
horiz_policy: QSizePolicy = QSizePolicy.Expanding,
|
||||
parent=None):
|
||||
|
|
Loading…
Reference in a new issue