Skip to content

Commit

Permalink
Small CI update
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Apr 6, 2023
1 parent 1dd2146 commit 7682adc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
branches:
- main
- master
- dev*
paths:
- "**.py"
- "**.ui"
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"warning": "Warning",
"info": "Information"
},
"pylint.importStrategy": "fromEnvironment",
// Use the new Flake8 extension instead
"python.linting.flake8Enabled": false,
// Partial codes don't work yet: https://github.com/microsoft/vscode-flake8/issues/7
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ recursive = true
aggressive = 3
ignore = [
"E124", # Closing bracket may not match multi-line method invocation style (enforced by add-trailing-comma)
"E70" # Allow ... on same line as def
"E70", # Allow ... on same line as def
]

# https://github.com/microsoft/pyright/blob/main/docs/configuration.md#sample-pyprojecttoml-file
Expand All @@ -17,7 +17,7 @@ enableTypeIgnoreComments = false
# Extra strict
reportImplicitStringConcatenation = "error"
reportCallInDefaultInitializer = "error"
reportMissingSuperCall = "none" # False positives on base classes
reportMissingSuperCall = "none" # False positives on base classes
reportPropertyTypeMismatch = "error"
reportUninitializedInstanceVariable = "error"
reportUnnecessaryTypeIgnoreComment = "error"
Expand Down Expand Up @@ -146,3 +146,4 @@ line_length = 120
combine_as_imports = true
include_trailing_comma = true
multi_line_output = 5
skip_glob = "src/gen/**"
7 changes: 6 additions & 1 deletion src/AutoSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@
)

CHECK_FPS_ITERATIONS = 10
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = 2

# Needed when compiled, along with the custom hook-requests PyInstaller hook
os.environ["REQUESTS_CA_BUNDLE"] = certifi.where()
myappid = f"Toufool.AutoSplit.v{AUTOSPLIT_VERSION}"
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
# qt.qpa.window: SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) failed: COM error 0x5: Access is denied. # noqa: E501 # pylint: disable=line-too-long
# ctypes.windll.user32.SetProcessDpiAwarenessContext(2)


class AutoSplit(QMainWindow, design.Ui_MainWindow): # pylint: disable=too-many-instance-attributes
Expand Down Expand Up @@ -682,6 +685,8 @@ def __similarity_threshold_loop(self, number_of_split_images: int, dummy_splits_

QTest.qWait(wait_delta_ms)

return False

def __pause_loop(self, stop_time: float, message: str):
"""
Wait for a certain time and show the timer to the user.
Expand Down Expand Up @@ -858,7 +863,7 @@ def closeEvent(self, event: QtGui.QCloseEvent | None = None):
Exit safely when closing the window
"""

def exit_program():
def exit_program() -> NoReturn:
if self.update_auto_control:
self.update_auto_control.terminate()
self.capture_method.close(self)
Expand Down
4 changes: 2 additions & 2 deletions src/error_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
import traceback
from types import TracebackType
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, NoReturn

from PySide6 import QtCore, QtWidgets

Expand Down Expand Up @@ -185,7 +185,7 @@ def excepthook(exception_type: type[BaseException], exception: BaseException, _t
return excepthook


def handle_top_level_exceptions(exception: Exception):
def handle_top_level_exceptions(exception: Exception) -> NoReturn:
message = f"AutoSplit encountered an unrecoverable exception and will likely now close. {CREATE_NEW_ISSUE_MESSAGE}"
# Print error to console if not running in executable
if FROZEN:
Expand Down

0 comments on commit 7682adc

Please sign in to comment.