python fixed mypy errors

This commit is contained in:
Wiktor Mazur
2020-03-17 18:23:11 +01:00
parent a0bb3ac1fb
commit de68e5a57c
16 changed files with 58 additions and 64 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
from PySide2.QtWidgets import QMessageBox
from PySide2.QtWidgets import QMessageBox # type: ignore
text = """
+8 -8
View File
@@ -1,14 +1,14 @@
import sys
import functools
from PySide2 import QtGui
from PySide2.QtCore import Qt
from PySide2.QtCore import QTimer
from PySide2.QtWidgets import QComboBox
from PySide2.QtWidgets import QHBoxLayout
from PySide2.QtWidgets import QPushButton
from PySide2.QtWidgets import QVBoxLayout
from PySide2.QtWidgets import QWidget
from PySide2 import QtGui # type: ignore
from PySide2.QtCore import Qt # type: ignore
from PySide2.QtCore import QTimer # type: ignore
from PySide2.QtWidgets import QComboBox # type: ignore
from PySide2.QtWidgets import QHBoxLayout # type: ignore
from PySide2.QtWidgets import QPushButton # type: ignore
from PySide2.QtWidgets import QVBoxLayout # type: ignore
from PySide2.QtWidgets import QWidget # type: ignore
from ... import engine
@@ -1,6 +1,6 @@
from PySide2.QtWidgets import QPushButton
from PySide2 import QtGui
from PySide2.QtWidgets import QPushButton # type: ignore
from PySide2 import QtGui # type: ignore
from ....utils import assets
from ....stats.list_item import PlayerListItem
@@ -1 +1 @@
from .list import List as List
from .list import ListItemView
@@ -3,22 +3,22 @@ import collections
import functools
import re
from typing import List
from PIL import Image, ImageQt
from PIL import Image, ImageQt # type: ignore
from PySide2 import QtCore
from PySide2 import QtGui
from PySide2.QtCore import Qt
from PySide2.QtGui import QStandardItem
from PySide2.QtGui import QStandardItemModel
from PySide2.QtWidgets import QApplication
from PySide2.QtWidgets import QComboBox
from PySide2.QtWidgets import QHBoxLayout
from PySide2.QtWidgets import QLabel
from PySide2.QtWidgets import QListView
from PySide2.QtWidgets import QMessageBox
from PySide2.QtWidgets import QProgressBar
from PySide2.QtWidgets import QPushButton
from PySide2.QtWidgets import QVBoxLayout
from PySide2 import QtCore # type: ignore
from PySide2 import QtGui # type: ignore
from PySide2.QtCore import Qt # type: ignore
from PySide2.QtGui import QStandardItem # type: ignore
from PySide2.QtGui import QStandardItemModel # type: ignore
from PySide2.QtWidgets import QApplication # type: ignore
from PySide2.QtWidgets import QComboBox # type: ignore
from PySide2.QtWidgets import QHBoxLayout # type: ignore
from PySide2.QtWidgets import QLabel # type: ignore
from PySide2.QtWidgets import QListView # type: ignore
from PySide2.QtWidgets import QMessageBox # type: ignore
from PySide2.QtWidgets import QProgressBar # type: ignore
from PySide2.QtWidgets import QPushButton # type: ignore
from PySide2.QtWidgets import QVBoxLayout # type: ignore
from .....stats.list_item import PlayerListItem
from .....utils import assets
@@ -91,7 +91,7 @@ def player_icon(weapon):
return None
class List(QListView):
class ListItemView(QListView):
class Item(QtGui.QStandardItem):
def __init__(self, player, parent):
QtGui.QStandardItem .__init__(self)
@@ -3,22 +3,14 @@
from typing import Callable
from PySide2.QtWidgets import QHBoxLayout
# from PySide2.QtWidgets import QPushButton
from PySide2.QtWidgets import QVBoxLayout
# from PySide2.QtWidgets import QLabel
# from PySide2 import QtGui
# from PySide2 import QtCore
from PySide2.QtWidgets import QComboBox
from PySide2.QtWidgets import QWidget
from PySide2.QtWidgets import QHBoxLayout # type: ignore
from PySide2.QtWidgets import QVBoxLayout # type: ignore
from PySide2.QtWidgets import QComboBox # type: ignore
from PySide2.QtWidgets import QWidget # type: ignore
from ....stats.list_item import PlayerListItem
from .list_view import List
from .list_view import ListItemView
from .stats_type import StatsType
from .player_stats import PlayerStats
from .copy_button import CopyButton
@@ -68,7 +60,7 @@ class ModeBasedListView(QWidget):
self.session_bar = SessionBar(clipboard)
self.layout.addWidget(self.session_bar)
self.list_view = List()
self.list_view = ListItemView()
self.layout.addWidget(self.list_view)
self.setLayout(self.layout)
@@ -1,8 +1,8 @@
import datetime
from PySide2.QtWidgets import QLabel
from PySide2 import QtGui
from PySide2 import QtCore
from PySide2.QtWidgets import QLabel # type: ignore
from PySide2 import QtGui # type: ignore
from PySide2 import QtCore # type: ignore
from src.utils import assets, number
from src.stats.list_item import PlayerListItem
@@ -1,8 +1,8 @@
from typing import Callable
from PySide2.QtWidgets import QPushButton
from PySide2 import QtGui
from PySide2.QtWidgets import QPushButton # type: ignore
from PySide2 import QtGui # type: ignore
from ....utils import assets
from ....stats.list_item import PlayerListItem