Skip to content

Commit 429fe96

Browse files
authored
Update some docs and fix lint issue (#202)
* Update docs, comments and typings Add link to dev builds bump beta version Update flake8 checks "fix" typing issue caused by PyQt6 incorrect callable * Slight build improvement
1 parent 5e31a82 commit 429fe96

File tree

11 files changed

+641
-559
lines changed

11 files changed

+641
-559
lines changed

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ This program can be used to automatically start, split, and reset your preferred
1919
## DOWNLOAD AND OPEN
2020

2121
- Download the [latest version](/../../releases/latest)
22+
- You can also check out the [latest dev builds](/../../actions/workflows/lint-and-build.yml?query=event%3Apush+is%3Asuccess) (requires a GitHub account)
23+
<!-- (If you don't have a GitHub account, you can try [nightly.link](https://nightly.link/Toufool/AutoSplit/workflows/lint-and-build/dev)) -->
2224

2325
### Compatibility
2426

@@ -64,7 +66,7 @@ Refer to the [build instructions](build%20instructions.md) if you'd like to buil
6466
- L2 Norm: This method should be fine to use for most cases. It finds the difference between each pixel, squares it, sums it over the entire image and takes the square root. This is very fast but is a problem if your image is high frequency. Any translational movement or rotation can cause similarity to be very different.
6567
- Histograms: An explanation on Histograms comparison can be found [here](https://mpatacchiola.github.io/blog/2016/11/12/the-simplest-classifier-histogram-intersection.html). This is a great method to use if you are using several masked images.
6668
> This algorithm is particular reliable when the colour is a strong predictor of the object identity. The histogram intersection [...] is robust to occluding objects in the foreground.
67-
- Perceptual Hash: An explanation on pHash comparison can be found [here](http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html). It is highly recommended to NOT use pHash if you use masked images. It is very inaccurate.
69+
- Perceptual Hash: An explanation on pHash comparison can be found [here](http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html). It is highly recommended to NOT use pHash if you use masked images, or it'll be very inaccurate.
6870

6971
#### Capture Method
7072

@@ -82,12 +84,11 @@ Refer to the [build instructions](build%20instructions.md) if you'd like to buil
8284
It can record OpenGL and Hardware Accelerated windows.
8385
About 10-15x slower than BitBlt. Not affected by window size.
8486
overlapping windows will show up and can't record across displays.
85-
- **Force Full Content Rendering** (very slow, can affect rendering pipeline)
87+
- **Force Full Content Rendering** (very slow, can affect rendering)
8688
Uses BitBlt behind the scene, but passes a special flag to PrintWindow to force rendering the entire desktop.
8789
About 10-15x slower than BitBlt based on original window size and can mess up some applications' rendering pipelines.
8890
- **Video Capture Device**
8991
Uses a Video Capture Device, like a webcam, virtual cam, or capture card.
90-
There are currently performance issues, but it might be more convenient.
9192
If you want to use this with OBS' Virtual Camera, use the [Virtualcam plugin](https://github.com/Avasam/obs-virtual-cam/releases) instead.
9293

9394
#### Capture Device
@@ -173,7 +174,7 @@ If this option is disabled, when the reset hotkey is hit, the reset button is pr
173174

174175
### How to Create a Masked Image
175176

176-
Masked images are very useful if only a certain part of the capture region is consistent (for example, consistent text on the screen, but the background is always different). Histogram or L2 norm comparison is recommended if you use any masked images. It is highly recommended that you do NOT use pHash comparison if you use any masked images, as it is very inaccurate.
177+
Masked images are very useful if only a certain part of the capture region is consistent (for example, consistent text on the screen, but the background is always different). Histogram or L2 norm comparison is recommended if you use any masked images. It is highly recommended that you do NOT use pHash comparison if you use any masked images, or it'll be very inaccurate.
177178

178179
The best way to create a masked image is to set your capture region as the entire game screen, take a screenshot, and use a program like [paint.net](https://www.getpaint.net/) to "erase" (make transparent) everything you don't want the program to compare. More on creating images with transparency using paint.net can be found in [this tutorial](https://www.youtube.com/watch?v=v53kkUYFVn8). For visualization, here is what the capture region compared to a masked split image looks like if you would want to split on "Shine Get!" text in Super Mario Sunshine:
179180

@@ -230,7 +231,8 @@ The AutoSplit LiveSplit Component will directly connect AutoSplit with LiveSplit
230231
Still need help?
231232

232233
- [Open an issue](../../issues)
233-
- Join the [AutoSplit Discord](https://discord.gg/Qcbxv9y)
234+
- Join the [AutoSplit Discord
235+
![AutoSplit Discord](https://badgen.net/discord/members/Qcbxv9y)](https://discord.gg/Qcbxv9y)
234236

235237
## Credits
236238

res/settings.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ This is a great method to use if you are using several masked images.
208208
Perceptual Hash:
209209
An explanation on pHash comparison can be found here
210210
http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
211-
It is highly recommended to NOT use pHash if you use masked images. It is very inaccurate.</string>
211+
It is highly recommended to NOT use pHash if you use masked images, or it'll be very inaccurate.</string>
212212
</property>
213213
<item>
214214
<property name="text">

scripts/build.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ $arguments = @(
77
'--icon=res/icon.ico',
88
'--splash=res/splash.png')
99

10-
Start-Process pyinstaller -Wait -ArgumentList "$arguments `"$PSScriptRoot/../src/AutoSplit.py`""
10+
pyinstaller $arguments "$PSScriptRoot/../src/AutoSplit.py"

scripts/requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ flake8-bugbear
1414
flake8-class-attributes-order
1515
flake8-comprehensions>=3.8 # flake8 v5 support
1616
flake8-datetimez
17+
flake8-noqa>=1.3.0 # flake8 v6 support
1718
flake8-pyi>=22.11.0 # flake8 v6 support
1819
flake8-simplify
1920
pep8-naming

scripts/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ toml
2828
# Build and compile resources
2929
pyinstaller>=5.5 # Python 3.11 support
3030
pyinstaller-hooks-contrib>=2022.9 # opencv-python 4.6 support. Changes for pywintypes and comtypes
31-
PySide6>=6.4.0.1 # Python 3.11 support
31+
PySide6-Essentials>=6.4.0.1 # Python 3.11 support
3232
#
3333
# https://peps.python.org/pep-0508/#environment-markers
3434
#

src/AutoSplit.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,13 @@ def __init__(self, parent: QWidget | None = None): # pylint: disable=too-many-s
149149
self.action_about_qt_for_python.triggered.connect(about_qt_for_python)
150150
self.action_check_for_updates.triggered.connect(lambda: check_for_updates(self))
151151
self.action_settings.triggered.connect(lambda: open_settings(self))
152-
self.action_save_profile.triggered.connect(lambda: user_profile.save_settings(self))
153-
self.action_save_profile_as.triggered.connect(lambda: user_profile.save_settings_as(self))
152+
# PyQt6 typing is wrong
153+
self.action_save_profile.triggered.connect(
154+
lambda: user_profile.save_settings(self), # pyright: ignore[reportGeneralTypeIssues]
155+
)
156+
self.action_save_profile_as.triggered.connect(
157+
lambda: user_profile.save_settings_as(self), # pyright: ignore[reportGeneralTypeIssues]
158+
)
154159
self.action_load_profile.triggered.connect(lambda: user_profile.load_settings(self))
155160

156161
# Shortcut context can't be set through the designer because of a bug in pyuic6 that generates invalid code

src/capture_method/WindowsGraphicsCaptureMethod.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def close(self, autosplit: AutoSplit):
6565
# OSError: The application called an interface that was marshalled for a different thread
6666
# This still seems to close the session and prevent the following hard crash in LiveSplit
6767
# pylint: disable=line-too-long
68-
# "AutoSplit.exe <process started at 00:05:37.020 has terminated with 0xc0000409 (EXCEPTION_STACK_BUFFER_OVERRUN)>" # noqa E501
68+
# "AutoSplit.exe <process started at 00:05:37.020 has terminated with 0xc0000409 (EXCEPTION_STACK_BUFFER_OVERRUN)>" # noqa: E501
6969
pass
7070
self.session = None
7171

src/capture_method/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def get(self, __key: CaptureMethodEnum):
160160
)
161161
CAPTURE_METHODS[CaptureMethodEnum.PRINTWINDOW_RENDERFULLCONTENT] = CaptureMethodInfo(
162162
name="Force Full Content Rendering",
163-
short_description="very slow, can affect rendering pipeline",
163+
short_description="very slow, can affect rendering",
164164
description=(
165165
"\nUses BitBlt behind the scene, but passes a special flag "
166166
"\nto PrintWindow to force rendering the entire desktop. "
@@ -175,7 +175,6 @@ def get(self, __key: CaptureMethodEnum):
175175
description=(
176176
"\nUses a Video Capture Device, like a webcam, virtual cam, or capture card. "
177177
"\nYou can select one below. "
178-
"\nThere are currently performance issues, but it might be more convenient. "
179178
"\nIf you want to use this with OBS' Virtual Camera, use the Virtualcam plugin instead "
180179
"\nhttps://github.com/Avasam/obs-virtual-cam/releases"
181180
),
@@ -212,7 +211,8 @@ def get_input_device_resolution(index: int):
212211

213212

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

217217
async def get_camera_info(index: int, device_name: str):
218218
backend = ""

src/menu_bar.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from capture_method import (
1515
CAPTURE_METHODS, CameraInfo, CaptureMethodEnum, change_capture_method, get_all_video_capture_devices,
1616
)
17-
from gen import about, design, resources_rc, settings as settings_ui, update_checker # noqa F401
17+
from gen import about, design, resources_rc, settings as settings_ui, update_checker # noqa: F401
1818
from hotkeys import HOTKEYS, Hotkey, set_hotkey
1919
from utils import (
2020
AUTOSPLIT_VERSION, FIRST_WIN_11_BUILD, GITHUB_REPOSITORY, WINDOWS_BUILD_NUMBER, decimal, fire_and_forget,
@@ -211,7 +211,10 @@ def __set_readme_link(self):
211211
# HACK: This is a workaround because custom_image_settings_info_label
212212
# simply will not open links with a left click no matter what we tried.
213213
self.readme_link_button.clicked.connect(
214-
lambda: webbrowser.open(f"https://github.com/{GITHUB_REPOSITORY}#readme"),
214+
# PyQt6 typing is wrong
215+
lambda: webbrowser.open( # pyright: ignore[reportGeneralTypeIssues]
216+
f"https://github.com/{GITHUB_REPOSITORY}#readme",
217+
),
215218
)
216219
self.readme_link_button.setStyleSheet("border: 0px; background-color:rgba(0,0,0,0%);")
217220

src/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,5 @@ def title(self):
174174

175175
# Shared strings
176176
# Check `excludeBuildNumber` during workflow dispatch build generate a clean version number
177-
AUTOSPLIT_VERSION = "2.0.0-beta.1" + (f"-{AUTOSPLIT_BUILD_NUMBER}" if AUTOSPLIT_BUILD_NUMBER else "")
177+
AUTOSPLIT_VERSION = "2.0.0-beta.3" + (f"-{AUTOSPLIT_BUILD_NUMBER}" if AUTOSPLIT_BUILD_NUMBER else "")
178178
GITHUB_REPOSITORY = AUTOSPLIT_GITHUB_REPOSITORY

0 commit comments

Comments
 (0)