Skip to content

Commit

Permalink
Update some typing
Browse files Browse the repository at this point in the history
"fix" typing issue caused by PyQt6 incorrect callable
  • Loading branch information
Avasam committed Mar 3, 2023
1 parent 743e48a commit 4744c6f
Show file tree
Hide file tree
Showing 6 changed files with 629 additions and 548 deletions.
1 change: 1 addition & 0 deletions scripts/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ flake8-bugbear
flake8-class-attributes-order
flake8-comprehensions>=3.8 # flake8 v5 support
flake8-datetimez
flake8-noqa>=1.3.0 # flake8 v6 support
flake8-pyi>=22.11.0 # flake8 v6 support
flake8-simplify
pep8-naming
Expand Down
9 changes: 7 additions & 2 deletions src/AutoSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,13 @@ def __init__(self, parent: QWidget | None = None): # pylint: disable=too-many-s
self.action_about_qt_for_python.triggered.connect(about_qt_for_python)
self.action_check_for_updates.triggered.connect(lambda: check_for_updates(self))
self.action_settings.triggered.connect(lambda: open_settings(self))
self.action_save_profile.triggered.connect(lambda: user_profile.save_settings(self))
self.action_save_profile_as.triggered.connect(lambda: user_profile.save_settings_as(self))
# PyQt6 typing is wrong
self.action_save_profile.triggered.connect(
lambda: user_profile.save_settings(self), # pyright: ignore[reportGeneralTypeIssues]
)
self.action_save_profile_as.triggered.connect(
lambda: user_profile.save_settings_as(self), # pyright: ignore[reportGeneralTypeIssues]
)
self.action_load_profile.triggered.connect(lambda: user_profile.load_settings(self))

# Shortcut context can't be set through the designer because of a bug in pyuic6 that generates invalid code
Expand Down
2 changes: 1 addition & 1 deletion src/capture_method/WindowsGraphicsCaptureMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def close(self, autosplit: AutoSplit):
# OSError: The application called an interface that was marshalled for a different thread
# This still seems to close the session and prevent the following hard crash in LiveSplit
# pylint: disable=line-too-long
# "AutoSplit.exe <process started at 00:05:37.020 has terminated with 0xc0000409 (EXCEPTION_STACK_BUFFER_OVERRUN)>" # noqa E501
# "AutoSplit.exe <process started at 00:05:37.020 has terminated with 0xc0000409 (EXCEPTION_STACK_BUFFER_OVERRUN)>" # noqa: E501
pass
self.session = None

Expand Down
3 changes: 2 additions & 1 deletion src/capture_method/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ def get_input_device_resolution(index: int):


async def get_all_video_capture_devices() -> list[CameraInfo]:
named_video_inputs = FilterGraph().get_input_devices()
# TODO: Fix partially Unknown list upstream
named_video_inputs: list[str] = FilterGraph().get_input_devices()

async def get_camera_info(index: int, device_name: str):
backend = ""
Expand Down
7 changes: 5 additions & 2 deletions src/menu_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from capture_method import (
CAPTURE_METHODS, CameraInfo, CaptureMethodEnum, change_capture_method, get_all_video_capture_devices,
)
from gen import about, design, resources_rc, settings as settings_ui, update_checker # noqa F401
from gen import about, design, resources_rc, settings as settings_ui, update_checker # noqa: F401
from hotkeys import HOTKEYS, Hotkey, set_hotkey
from utils import (
AUTOSPLIT_VERSION, FIRST_WIN_11_BUILD, GITHUB_REPOSITORY, WINDOWS_BUILD_NUMBER, decimal, fire_and_forget,
Expand Down Expand Up @@ -211,7 +211,10 @@ def __set_readme_link(self):
# HACK: This is a workaround because custom_image_settings_info_label
# simply will not open links with a left click no matter what we tried.
self.readme_link_button.clicked.connect(
lambda: webbrowser.open(f"https://github.com/{GITHUB_REPOSITORY}#readme"),
# PyQt6 typing is wrong
lambda: webbrowser.open( # pyright: ignore[reportGeneralTypeIssues]
f"https://github.com/{GITHUB_REPOSITORY}#readme",
),
)
self.readme_link_button.setStyleSheet("border: 0px; background-color:rgba(0,0,0,0%);")

Expand Down
Loading

0 comments on commit 4744c6f

Please sign in to comment.