Skip to content

Commit 6f4af3a

Browse files
committed
Merge branch 'camera-capture-split-cam-option' into More-capture-options
2 parents c889f50 + 2cb3068 commit 6f4af3a

17 files changed

+439
-810
lines changed

.github/workflows/lint-and-build.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
python-version: ["3.8", "3.9", "3.10"]
29+
python-version: ["3.9", "3.10"]
3030
steps:
3131
- name: Checkout ${{ github.repository }}/${{ github.ref }}
32-
uses: actions/checkout@v2
32+
uses: actions/checkout@v3
3333
- name: Set up Node
34-
uses: actions/setup-node@v2
34+
uses: actions/setup-node@v3
3535
- name: Set up Python ${{ matrix.python-version }}
36-
uses: actions/setup-python@v2
36+
uses: actions/setup-python@v4
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939
- name: Install dependencies
@@ -42,6 +42,7 @@ jobs:
4242
pip install wheel
4343
pip install -r "scripts/requirements.txt"
4444
npm install -g pyright
45+
npm list -g pyright
4546
- run: scripts/compile_resources.bat
4647
- name: Analysing the code with ${{ github.job }}
4748
run: pyright --warnings
@@ -50,12 +51,12 @@ jobs:
5051
strategy:
5152
fail-fast: false
5253
matrix:
53-
python-version: ["3.8", "3.9", "3.10"]
54+
python-version: ["3.9", "3.10"]
5455
steps:
5556
- name: Checkout ${{ github.repository }}/${{ github.ref }}
56-
uses: actions/checkout@v2
57+
uses: actions/checkout@v3
5758
- name: Set up Python ${{ matrix.python-version }}
58-
uses: actions/setup-python@v2
59+
uses: actions/setup-python@v4
5960
with:
6061
python-version: ${{ matrix.python-version }}
6162
- name: Install dependencies
@@ -71,12 +72,12 @@ jobs:
7172
strategy:
7273
fail-fast: false
7374
matrix:
74-
python-version: ["3.8", "3.9", "3.10"]
75+
python-version: ["3.9", "3.10"]
7576
steps:
7677
- name: Checkout ${{ github.repository }}/${{ github.ref }}
77-
uses: actions/checkout@v2
78+
uses: actions/checkout@v3
7879
- name: Set up Python ${{ matrix.python-version }}
79-
uses: actions/setup-python@v2
80+
uses: actions/setup-python@v4
8081
with:
8182
python-version: ${{ matrix.python-version }}
8283
- name: Install dependencies
@@ -92,12 +93,12 @@ jobs:
9293
strategy:
9394
fail-fast: false
9495
matrix:
95-
python-version: ["3.8", "3.9", "3.10"]
96+
python-version: ["3.9", "3.10"]
9697
steps:
9798
- name: Checkout ${{ github.repository }}/${{ github.ref }}
98-
uses: actions/checkout@v2
99+
uses: actions/checkout@v3
99100
- name: Set up Python ${{ matrix.python-version }}
100-
uses: actions/setup-python@v2
101+
uses: actions/setup-python@v4
101102
with:
102103
python-version: ${{ matrix.python-version }}
103104
- name: Install dependencies
@@ -113,12 +114,12 @@ jobs:
113114
strategy:
114115
fail-fast: false
115116
matrix:
116-
python-version: ["3.8", "3.9", "3.10"]
117+
python-version: ["3.9", "3.10"]
117118
steps:
118119
- name: Checkout ${{ github.repository }}/${{ github.ref }}
119-
uses: actions/checkout@v2
120+
uses: actions/checkout@v3
120121
- name: Set up Python ${{ matrix.python-version }}
121-
uses: actions/setup-python@v2
122+
uses: actions/setup-python@v4
122123
with:
123124
python-version: ${{ matrix.python-version }}
124125
- name: Install dependencies
@@ -128,7 +129,7 @@ jobs:
128129
pip install -r "scripts/requirements.txt"
129130
- run: scripts/build.bat
130131
- name: Upload Build Artifact
131-
uses: actions/upload-artifact@v2
132+
uses: actions/upload-artifact@v3
132133
with:
133134
name: AutoSplit (Python ${{ matrix.python-version }})
134135
path: dist/AutoSplit.exe

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ reportUnknownMemberType = "none"
4545
# https://github.com/PyCQA/pylint/blob/main/examples/pylintrc
4646
# https://pylint.pycqa.org/en/latest/technical_reference/features.html
4747
[tool.pylint.REPORTS]
48-
# Just like default but any error will make drop to 9 or less. warning and conventions are worth more
49-
evaluation = "10.0 - error - ((float((warning + convention) * 10 + refactor ) / statement) * 10)"
48+
# Just like default but any error, warning or convention will make drop to 9 or less. refactor are worth more
49+
evaluation = "10.0 - error - warning - convention - ((10 * refactor) / statement) * 10"
5050
[tool.pylint.MASTER]
5151
fail-under = 9.0
5252
# https://pylint.pycqa.org/en/latest/technical_reference/extensions.html
@@ -97,6 +97,9 @@ max-locals = 15
9797
max-complexity = 15
9898
# At least same as max-complexity
9999
max-branches = 15
100+
# https://github.com/PyCQA/pep8-naming/issues/164
101+
# OR doesn't fit CaptureMethodMeta
102+
valid-classmethod-first-arg = "self"
100103
# https://pylint.pycqa.org/en/latest/user_guide/options.html#naming-styles
101104
module-naming-style = "any"
102105
# Can't make private class with PascalCase
@@ -120,6 +123,8 @@ disable = [
120123
"R0801",
121124
# False positives with PyQt .connect
122125
"no-value-for-parameter",
126+
# Not as long as we support Python 3.9
127+
"consider-alternative-union-syntax",
123128
]
124129

125130
[tool.pylint.TYPECHECK]

res/settings.ui

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>289</width>
10-
<height>572</height>
10+
<height>621</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -19,13 +19,13 @@
1919
<property name="minimumSize">
2020
<size>
2121
<width>289</width>
22-
<height>572</height>
22+
<height>621</height>
2323
</size>
2424
</property>
2525
<property name="maximumSize">
2626
<size>
2727
<width>289</width>
28-
<height>572</height>
28+
<height>621</height>
2929
</size>
3030
</property>
3131
<property name="cursor">
@@ -46,7 +46,7 @@
4646
<x>10</x>
4747
<y>180</y>
4848
<width>271</width>
49-
<height>131</height>
49+
<height>181</height>
5050
</rect>
5151
</property>
5252
<property name="title">
@@ -138,12 +138,41 @@
138138
<string>Capture method:</string>
139139
</property>
140140
</widget>
141+
<widget class="QLabel" name="capture_device_label">
142+
<property name="geometry">
143+
<rect>
144+
<x>6</x>
145+
<y>126</y>
146+
<width>151</width>
147+
<height>16</height>
148+
</rect>
149+
</property>
150+
<property name="text">
151+
<string>Capture device:</string>
152+
</property>
153+
</widget>
154+
<widget class="QComboBox" name="capture_device_combobox">
155+
<property name="enabled">
156+
<bool>false</bool>
157+
</property>
158+
<property name="geometry">
159+
<rect>
160+
<x>6</x>
161+
<y>148</y>
162+
<width>251</width>
163+
<height>22</height>
164+
</rect>
165+
</property>
166+
<property name="placeholderText">
167+
<string>Scanning for existing devices...</string>
168+
</property>
169+
</widget>
141170
</widget>
142171
<widget class="QGroupBox" name="image_settings_groupbox">
143172
<property name="geometry">
144173
<rect>
145174
<x>10</x>
146-
<y>320</y>
175+
<y>370</y>
147176
<width>271</width>
148177
<height>241</height>
149178
</rect>

scripts/compile_resources.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cd "%~dp0.."
2-
md .\src\gen
2+
@ if not exist .\src\gen (
3+
md .\src\gen
4+
)
35
pyuic6 ".\res\about.ui" -o ".\src\gen\about.py"
46
pyuic6 ".\res\design.ui" -o ".\src\gen\design.py"
57
pyuic6 ".\res\settings.ui" -o ".\src\gen\settings.py"

scripts/install.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
py -m pip install wheel --upgrade
2-
py -m pip install -r "%~p0requirements.txt" --upgrade
3-
npm install -g pyright@latest
2+
py -m pip install -r "%~p0requirements.txt"
43
CALL "%~p0compile_resources.bat"
4+
CALL npm install -g pyright@latest
5+
CALL npm list -g pyright

scripts/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Requirements file for AutoSplit
22
#
3-
# Python: CPython 3.8+
3+
# Python: CPython 3.9+
44
#
55
# Usage: .\scripts\install.bat
66
#
@@ -10,8 +10,8 @@
1010
# Creating AutoSplit.exe with PyInstaller: .\scripts\build.bat
1111
#
1212
# Dependencies:
13-
numpy>=1.22.0rc1
14-
opencv-python>=4.5.4
13+
numpy>=1.22.0rc1,<1.23
14+
opencv-python-headless>=4.5.4,<4.6
1515
PyQt6>=6.2.1
1616
PySide6
1717
ImageHash
@@ -34,7 +34,7 @@ flake8-pyi
3434
flake8-quotes
3535
flake8-isort
3636
pylint>=2.13
37-
git+https://github.com/Avasam/pywin32-stubs.git#egg=pywin32-stubs # https://github.com/kaluluosi/pywin32-stubs/pull/4
37+
pywin32-stubs>=0.1.6
3838
simplejson
3939
types-simplejson>=3.17.2
4040
types-requests

0 commit comments

Comments
 (0)