1
0
Fork 0
mirror of synced 2024-06-02 10:44:40 +12:00

Fix some typing errors for python 3.8

This commit is contained in:
Dummerle 2021-10-10 22:08:31 +02:00
parent 3f7d8b10e2
commit c9b9ab6814
4 changed files with 11 additions and 11 deletions

View file

@ -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

View file

@ -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("}"):

View file

@ -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("_")

View file

@ -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):