Skip to content

Commit

Permalink
Merge pull request #127 from Avasam/SplitImage-as-class
Browse files Browse the repository at this point in the history
Split image as class
  • Loading branch information
Toufool authored Dec 6, 2021
2 parents b2e4e2a + e1e77ea commit 1663465
Show file tree
Hide file tree
Showing 17 changed files with 573 additions and 912 deletions.
5 changes: 4 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ color=always
max-line-length=120
; Auto generated
exclude=src/gen/
ignores=Y015
; Linebreak before binary operator
; Allow default value other than "..."
; Allow imports at the bottom of file
ignore=W503,Y015,E402
per-file-ignores=
; Quotes
__init__.pyi:Q000
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r "scripts/requirements.txt"
npm install -g pyright
- run: scripts/compile_resources.bat
Expand All @@ -59,6 +60,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r "scripts/requirements.txt"
- run: scripts/compile_resources.bat
- name: Analysing the code with ${{ job.name }}
Expand All @@ -78,6 +80,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r "scripts/requirements.txt"
- run: scripts/compile_resources.bat
- name: Analysing the code with ${{ job.name }}
Expand All @@ -97,6 +100,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r "scripts/requirements.txt"
- run: scripts/compile_resources.bat
- name: Analysing the code with ${{ job.name }}
Expand All @@ -116,5 +120,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r "scripts/requirements.txt"
- run: scripts/build.bat
- name: Upload Build Artifact
uses: actions/upload-artifact@v2
with:
name: AutoSplit (Python ${{ matrix.python-version }})
path: dist/AutoSplit.exe
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ extension-pkg-allow-list = ["PyQt6", "win32ui"]
[tool.pylint.FORMAT]
max-line-length = 120

[tool.pylint.DESIGN]
max-attributes = 15

[tool.pylint.'MESSAGES CONTROL']
# Same as SonarLint
max-complexity = 15
# At least same as max-complexity
max-branches = 15
# https://pylint.pycqa.org/en/latest/user_guide/options.html#naming-styles
module-naming-style = "any"
Expand Down
33 changes: 21 additions & 12 deletions res/design.ui
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@
</property>
</widget>
<widget class="QPushButton" name="reset_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>500</x>
Expand All @@ -205,6 +208,9 @@
</property>
</widget>
<widget class="QPushButton" name="undo_split_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>494</x>
Expand All @@ -221,6 +227,9 @@
</property>
</widget>
<widget class="QPushButton" name="skip_split_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>560</x>
Expand Down Expand Up @@ -254,15 +263,15 @@
<rect>
<x>5</x>
<y>225</y>
<width>53</width>
<height>21</height>
<width>54</width>
<height>23</height>
</rect>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Max FPS</string>
<string>Avg. FPS</string>
</property>
</widget>
<widget class="QLabel" name="fps_label">
Expand Down Expand Up @@ -653,7 +662,7 @@
<widget class="QLabel" name="fps_value_label">
<property name="geometry">
<rect>
<x>58</x>
<x>60</x>
<y>225</y>
<width>26</width>
<height>20</height>
Expand Down Expand Up @@ -727,7 +736,7 @@
<string>FPS Limit:</string>
</property>
</widget>
<widget class="QDoubleSpinBox" name="fps_limit_spinbox">
<widget class="QSpinBox" name="fps_limit_spinbox">
<property name="geometry">
<rect>
<x>62</x>
Expand All @@ -739,20 +748,20 @@
<property name="prefix">
<string/>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="minimum">
<double>30.000000000000000</double>
<number>30</number>
</property>
<property name="maximum">
<double>5000.000000000000000</double>
<number>5000</number>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
<number>1</number>
</property>
<property name="value">
<double>60.000000000000000</double>
<number>60</number>
</property>
<property name="decimals" stdset="0">
<number>0</number>
</property>
</widget>
<widget class="QLabel" name="current_split_image_file_label">
Expand Down
1 change: 1 addition & 0 deletions scripts/compile_resources.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cd "%~dp0.."
md .\src\gen
pyuic6 ".\res\about.ui" -o ".\src\gen\about.py"
pyuic6 ".\res\design.ui" -o ".\src\gen\design.py"
pyuic6 ".\res\update_checker.ui" -o ".\src\gen\update_checker.py"
Expand Down
11 changes: 5 additions & 6 deletions src/AutoControlledWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,22 @@ def run(self):
self.autosplit.show_error_signal.emit(error_messages.stdin_lost)
break
# TODO: "AutoSplit Integration" needs to call this and wait instead of outright killing the app.
# TODO: See if we can also get LiveSplit to wait on Exit in "AutoSplit Integration"
# For now this can only used in a Development environment
if line == "kill":
self.autosplit.closeEvent()
break
if line == "start":
self.autosplit.start_suto_splitter()
self.autosplit.start_auto_splitter()
elif line in {"split", "skip"}:
self.autosplit.start_skip_split()
self.autosplit.skip_split_signal.emit()
elif line == "undo":
self.autosplit.start_undo_split()
self.autosplit.undo_split_signal.emit()
elif line == "reset":
self.autosplit.start_reset()
self.autosplit.reset_signal.emit()
elif line.startswith("settings"):
# Allow for any split character between "settings" and the path
self.autosplit.load_settings_file_path = line[9:]
settings.load_settings(self.autosplit, load_settings_from_livesplit=True)
# TODO: Not yet implemented in AutoSplit Integration
# elif line == 'pause':
# self.start_pause()
# self.pause_signal.emit()
Loading

0 comments on commit 1663465

Please sign in to comment.