Skip to content

Commit 83ec9e8

Browse files
authored
Merge branch 'mathoudebine:main' into main
2 parents 80712e7 + c61f58c commit 83ec9e8

11 files changed

+379
-13
lines changed

.github/workflows/lint-flake8.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint with flake8
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint-flake8:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Python 3.x
15+
uses: actions/setup-python@v3
16+
with:
17+
python-version: '3.x'
18+
19+
- name: Display Python version
20+
run: python -c "import sys; print(sys.version)"
21+
22+
- name: Install flake8
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install flake8
26+
27+
- name: Lint with flake8
28+
run: |
29+
# stop the build if there are Python syntax errors or undefined names
30+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
31+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
32+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Simple program (Linux)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
simple-program:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.7", "3.8", "3.9", "3.10"]
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install -r requirements.txt
26+
27+
- name: Run simple-program.py during 20 seconds
28+
run: |
29+
# For tests there is no real HW: use simulated LCD mode
30+
sed -i 's/^REVISION.*$/REVISION=\"SIMU\"/g' simple-program.py
31+
32+
# Run the program for 20s
33+
python3 simple-program.py > output.log 2>&1 &
34+
sleep 20
35+
36+
- name: Check output for errors
37+
run: |
38+
echo "######## Output : ########"
39+
cat output.log
40+
41+
if grep -qi "error" output.log; then
42+
echo "Program failed to run, see output above"
43+
false
44+
elif grep -qi "traceback" output.log; then
45+
echo "Program failed to run, see output above"
46+
false
47+
elif grep -qi "exception" output.log; then
48+
echo "Program failed to run, see output above"
49+
false
50+
fi
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Simple program (MacOS)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
simple-program:
7+
8+
runs-on: macos-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.7", "3.8", "3.9", "3.10"]
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install -r requirements.txt
26+
27+
- name: Run simple-program.py during 20 seconds
28+
run: |
29+
# For tests there is no real HW: use simulated LCD mode
30+
sed -i "" "s|^REVISION.*$|REVISION=\"SIMU\"|g" simple-program.py
31+
32+
# Run the program for 20s
33+
python3 simple-program.py > output.log 2>&1 &
34+
sleep 20
35+
36+
- name: Check output for errors
37+
run: |
38+
echo "######## Output : ########"
39+
cat output.log
40+
41+
if grep -qi "error" output.log; then
42+
echo "Program failed to run, see output above"
43+
false
44+
elif grep -qi "traceback" output.log; then
45+
echo "Program failed to run, see output above"
46+
false
47+
elif grep -qi "exception" output.log; then
48+
echo "Program failed to run, see output above"
49+
false
50+
fi
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Simple program (Windows)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
simple-program:
7+
8+
runs-on: windows-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.7", "3.8", "3.9", "3.10"]
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install -r requirements.txt
26+
27+
- name: Run simple-program.py during 20 seconds
28+
run: |
29+
# For tests there is no real HW: use simulated LCD mode
30+
(Get-Content simple-program.py) -replace "^REVISION.*$","REVISION=`"SIMU`"" | Set-Content simple-program.py
31+
32+
# Run the program for 20s
33+
Start-Process -NoNewWindow python3 simple-program.py -RedirectStandardOutput output.log -RedirectStandardError error.log
34+
sleep 20
35+
add-content output.log (get-content error.log)
36+
37+
- name: Check output for errors
38+
run: |
39+
echo "######## Output : ########"
40+
cat output.log
41+
42+
$SEL = Select-String -Path output.log -Pattern "error"
43+
if ($SEL -ne $null)
44+
{
45+
throw "Program failed to run, see output above"
46+
}
47+
$SEL = Select-String -Path output.log -Pattern "traceback"
48+
if ($SEL -ne $null)
49+
{
50+
throw "Program failed to run, see output above"
51+
}
52+
$SEL = Select-String -Path output.log -Pattern "exception"
53+
if ($SEL -ne $null)
54+
{
55+
throw "Program failed to run, see output above"
56+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: System monitor (Linux)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
system-monitor:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.7", "3.8", "3.9", "3.10"]
14+
theme: [ "3.5inchTheme2", "Cyberpunk", "Landscape6Grid", "Terminal", "bash-dark-green" ]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install -r requirements.txt
27+
28+
- name: Configure system monitor
29+
run: |
30+
# For tests there is no real HW: use simulated LCD mode
31+
sed -i "/REVISION:/c\ REVISION: SIMU" config.yaml
32+
33+
# Setup selected theme in config.yaml
34+
echo "Using theme ${{ matrix.theme }}"
35+
sed -i "/THEME:/c\ THEME: ${{ matrix.theme }}" config.yaml
36+
37+
- name: Run system monitor for 20 seconds
38+
run: |
39+
python3 main.py > output.log 2>&1 &
40+
sleep 20
41+
42+
- name: Check output for errors
43+
run: |
44+
echo "######## Output : ########"
45+
cat output.log
46+
47+
if grep -qi "error" output.log; then
48+
echo "Program failed to run, see output above"
49+
false
50+
elif grep -qi "traceback" output.log; then
51+
echo "Program failed to run, see output above"
52+
false
53+
elif grep -qi "exception" output.log; then
54+
echo "Program failed to run, see output above"
55+
false
56+
fi
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: System monitor (MacOS)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
system-monitor:
7+
8+
runs-on: macos-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.7", "3.8", "3.9", "3.10"]
14+
theme: [ "3.5inchTheme2", "Cyberpunk", "Landscape6Grid", "Terminal", "bash-dark-green" ]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install -r requirements.txt
27+
28+
- name: Configure system monitor
29+
run: |
30+
# For tests there is no real HW: use simulated LCD mode
31+
sed -i "" "s|^ REVISION.*$| REVISION: SIMU|g" config.yaml
32+
33+
# Setup selected theme in config.yaml
34+
echo "Using theme ${{ matrix.theme }}"
35+
sed -i "" "s|^ THEME.*$| THEME: ${{ matrix.theme }}|g" config.yaml
36+
37+
- name: Run system monitor for 20 seconds
38+
run: |
39+
python3 main.py > output.log 2>&1 &
40+
sleep 20
41+
42+
- name: Check output for errors
43+
run: |
44+
echo "######## Output : ########"
45+
cat output.log
46+
47+
if grep -qi "error" output.log; then
48+
echo "Program failed to run, see output above"
49+
false
50+
elif grep -qi "traceback" output.log; then
51+
echo "Program failed to run, see output above"
52+
false
53+
elif grep -qi "exception" output.log; then
54+
echo "Program failed to run, see output above"
55+
false
56+
fi
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: System monitor (Windows)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
system-monitor:
7+
8+
runs-on: windows-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.7", "3.8", "3.9", "3.10"]
14+
theme: [ "3.5inchTheme2", "Cyberpunk", "Landscape6Grid", "Terminal", "bash-dark-green" ]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install -r requirements.txt
27+
28+
- name: Configure system monitor
29+
run: |
30+
# For tests there is no real HW: use simulated LCD mode
31+
(Get-Content config.yaml) -replace "^ REVISION.*$"," REVISION: SIMU" | Set-Content config.yaml
32+
33+
# Setup selected theme in config.yaml
34+
echo "Using theme ${{ matrix.theme }}"
35+
(Get-Content config.yaml) -replace "^ THEME.*$"," THEME: ${{ matrix.theme }}" | Set-Content config.yaml
36+
37+
- name: Run system monitor for 20 seconds
38+
run: |
39+
Start-Process -NoNewWindow python3 main.py -RedirectStandardOutput output.log -RedirectStandardError error.log
40+
sleep 20
41+
add-content output.log (get-content error.log)
42+
43+
- name: Check output for errors
44+
run: |
45+
echo "######## Output : ########"
46+
cat output.log
47+
48+
$SEL = Select-String -Path output.log -Pattern "error"
49+
if ($SEL -ne $null)
50+
{
51+
throw "Program failed to run, see output above"
52+
}
53+
$SEL = Select-String -Path output.log -Pattern "traceback"
54+
if ($SEL -ne $null)
55+
{
56+
throw "Program failed to run, see output above"
57+
}
58+
$SEL = Select-String -Path output.log -Pattern "exception"
59+
if ($SEL -ne $null)
60+
{
61+
throw "Program failed to run, see output above"
62+
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
### ⚠️ DISCLAIMER - PLEASE READ ⚠️
44

5-
This project is **not affiliated, associated, authorized, endorsed by, or in any way officially connected with Turing brand**, or any of its subsidiaries, affiliates, manufacturers or sellers of the Turing products. All product and company names are the registered trademarks of their original owners.
5+
This project is **not affiliated, associated, authorized, endorsed by, or in any way officially connected with Turing or XuanFang brands**, or any of its subsidiaries, affiliates, manufacturers or sellers of the Turing / XuanFang products. All product and company names are the registered trademarks of their original owners.
66

7-
This project is an open-source alternative software, not the USBMonitor.exe original software for the Turing smart screen. There will be no support for the USBMonitor.exe software.
7+
This project is an open-source alternative software, NOT the USBMonitor.exe or ExtendScreen.exe original software for the Turing/XuanFang smart screen (even if some themes have been reused from original software). **Please do not open issues for USBMonitor.exe/ExtendScreen.exe here**, instead you can use the official forum here: http://discuz.turzx.com/
88

99
---
1010

@@ -45,7 +45,7 @@ Some themes are already included for a quick start!
4545
* Auto detect comm port. No longer need to hard set it, or if it changes on you then the config is wrong.
4646

4747
Screenshots from the latest version using included themes:
48-
<img src="res/docs/Theme3.5Inch.jpg" height="400" /> <img src="res/docs/ThemeTerminal.jpg" height="400" /> <img src="res/docs/ThemeCyberpunk.png" height="400" /> <img src="res/docs/ThemeLandscape6Grid.jpg" width="400" />
48+
<img src="res/docs/Theme3.5Inch.jpg" height="400" /> <img src="res/docs/ThemeTerminal.jpg" height="400" /> <img src="res/docs/ThemeCyberpunk.png" height="400" /> <img src="res/docs/ThemeBashDarkGreen.png" height="400" /> <img src="res/docs/ThemeLandscape6Grid.jpg" width="400" />
4949

5050
### [> Themes creation/edition](https://github.com/mathoudebine/turing-smart-screen-python/wiki/System-monitor-:-themes)
5151

0 commit comments

Comments
 (0)