Skip to content

Commit 64f69a1

Browse files
committed
Ruff v0.1.7 format --preview acceptable formatting
1 parent 9e9db69 commit 64f69a1

File tree

8 files changed

+20
-19
lines changed

8 files changed

+20
-19
lines changed

Diff for: src/AutoSplit.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def __similarity_threshold_loop(self, number_of_split_images: int, dummy_splits_
670670
self.previous_image_button.setEnabled(self.split_image_number != 0)
671671
if not self.is_auto_controlled:
672672
# If its the last non-dummy split image and last loop number, disable the skip split button
673-
self.skip_split_button.setEnabled(dummy_splits_array[self.split_image_number:].count(False) > 1)
673+
self.skip_split_button.setEnabled(dummy_splits_array[self.split_image_number :].count(False) > 1)
674674
self.undo_split_button.setEnabled(self.split_image_number != 0)
675675
QApplication.processEvents()
676676

@@ -909,10 +909,10 @@ def exit_program() -> NoReturn:
909909
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No | QMessageBox.StandardButton.Cancel,
910910
)
911911

912-
if (
913-
(warning is QMessageBox.StandardButton.Yes and user_profile.save_settings(self))
914-
or warning is QMessageBox.StandardButton.No
915-
):
912+
if warning is QMessageBox.StandardButton.Yes:
913+
if user_profile.save_settings(self):
914+
exit_program()
915+
elif warning is QMessageBox.StandardButton.No:
916916
exit_program()
917917

918918
# Fallthrough case: Prevent program from closing.

Diff for: src/capture_method/VideoCaptureDeviceCaptureMethod.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def get_frame(self):
138138
y = min(selection["y"], image.shape[ImageShape.Y] - 1)
139139
x = min(selection["x"], image.shape[ImageShape.X] - 1)
140140
image = image[
141-
y: y + selection["height"],
142-
x: x + selection["width"],
141+
y : y + selection["height"],
142+
x : x + selection["width"],
143143
]
144144
self.last_converted_frame = cv2.cvtColor(image, cv2.COLOR_BGR2BGRA)
145145
return self.last_converted_frame

Diff for: src/capture_method/WindowsGraphicsCaptureMethod.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ async def coroutine():
125125
image = np.frombuffer(cast(bytes, reference), dtype=np.uint8)
126126
image.shape = (self.size.height, self.size.width, BGRA_CHANNEL_COUNT)
127127
image = image[
128-
selection["y"]: selection["y"] + selection["height"],
129-
selection["x"]: selection["x"] + selection["width"],
128+
selection["y"] : selection["y"] + selection["height"],
129+
selection["x"] : selection["x"] + selection["width"],
130130
]
131131
self.last_converted_frame = image
132132
return image

Diff for: src/error_messages.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Error messages."""
2+
23
import os
34
import signal
45
import sys

Diff for: src/split_parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def flags_from_filename(filename: str):
141141

142142
for flag_str in flags_str:
143143
match flag_str.upper():
144-
case "D":
144+
case "D":
145145
flags |= DUMMY_FLAG
146146
case "B":
147147
flags |= BELOW_FLAG

Diff for: src/user_profile.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,12 @@ def load_check_for_updates_on_open(autosplit: "AutoSplit"):
202202
value = cast(
203203
bool,
204204
QtCore.QSettings(
205-
"AutoSplit", "Check For Updates On Open",
205+
"AutoSplit",
206+
"Check For Updates On Open",
206207
).value(
207-
"check_for_updates_on_open", True, type=bool,
208+
"check_for_updates_on_open",
209+
True,
210+
type=bool,
208211
),
209212
)
210213
autosplit.action_check_for_updates_on_open.setChecked(value)
@@ -214,7 +217,9 @@ def set_check_for_updates_on_open(design_window: design.Ui_MainWindow, value: bo
214217
"""Sets the "Check For Updates On Open" QSettings value and the checkbox state."""
215218
design_window.action_check_for_updates_on_open.setChecked(value)
216219
QtCore.QSettings(
217-
"AutoSplit", "Check For Updates On Open",
220+
"AutoSplit",
221+
"Check For Updates On Open",
218222
).setValue(
219-
"check_for_updates_on_open", value,
223+
"check_for_updates_on_open",
224+
value,
220225
)

Diff for: typings/cv2/mat_wrapper/__init__.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ from _typeshed import Unused
66
__all__: list[str] = []
77
_NDArray: TypeAlias = np.ndarray[float, np.dtype[np.generic]]
88

9-
109
class Mat(_NDArray):
1110
wrap_channels: bool | None
1211

Diff for: typings/multiprocessing/connection.pyi

-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ from _typeshed import ReadableBuffer
88
_T1 = TypeVar("_T1")
99
_T2 = TypeVar("_T2")
1010

11-
1211
class _ConnectionBase(Generic[_T1, _T2]):
1312
def __init__(self, handle: SupportsIndex, readable: bool = True, writable: bool = True) -> None: ...
1413
@property
@@ -26,18 +25,15 @@ class _ConnectionBase(Generic[_T1, _T2]):
2625
def recv(self) -> _T2: ...
2726
def poll(self, timeout: float | None = 0.0) -> bool: ...
2827
def __enter__(self) -> Self: ...
29-
3028
def __exit__(
3129
self,
3230
exc_type: type[BaseException] | None,
3331
exc_value: BaseException | None,
3432
exc_tb: TracebackType | None,
3533
) -> None: ...
3634

37-
3835
class Connection(_ConnectionBase[_T1, _T2]): ...
3936

40-
4137
if sys.platform == "win32":
4238
class PipeConnection(_ConnectionBase[_T1, _T2]): ...
4339
def Pipe(duplex=True) -> tuple[PipeConnection[_T1, _T2], PipeConnection[_T2, _T1]]: ...

0 commit comments

Comments
 (0)