mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-19 05:19:40 +02:00
code quality
This commit is contained in:
parent
ccf1a9b31c
commit
ed789fb9e8
8 changed files with 37 additions and 44 deletions
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
|
@ -17,7 +17,6 @@ jobs:
|
||||||
uses: py-actions/flake8@v2
|
uses: py-actions/flake8@v2
|
||||||
with:
|
with:
|
||||||
ignore: "BLK100"
|
ignore: "BLK100"
|
||||||
exclude: "tests/*"
|
|
||||||
max-line-length: "128"
|
max-line-length: "128"
|
||||||
path: "."
|
path: "."
|
||||||
plugins: "flake8-bugbear==22.1.11 flake8-black"
|
plugins: "flake8-bugbear==22.1.11 flake8-black"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import pyudev
|
import pyudev
|
||||||
import psutil
|
import psutil
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@ -11,4 +10,3 @@ os.system("convert -resize 1024x600 -background black -gravity center -extent 10
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
os.system("convert -resize 1024x600 -background black -gravity center -extent 1024x600 image2.png bgra:/dev/fb0")
|
os.system("convert -resize 1024x600 -background black -gravity center -extent 1024x600 image2.png bgra:/dev/fb0")
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
import os;
|
import os
|
||||||
|
|
||||||
|
|
||||||
def waitMouseClick():
|
def waitMouseClick():
|
||||||
mouse = open("/dev/input/mice", "rb")
|
mouse = open("/dev/input/mice", "rb")
|
||||||
down = False;
|
down = False
|
||||||
while True:
|
while True:
|
||||||
buf = mouse.read(3)
|
buf = mouse.read(3)
|
||||||
if ((buf[0] & 0x1) == 1):
|
if ((buf[0] & 0x1) == 1):
|
||||||
down = True
|
down = True
|
||||||
if (((buf[0] & 0x1) == 0) and down):
|
if (((buf[0] & 0x1) == 0) and down):
|
||||||
break;
|
break
|
||||||
mouse.close()
|
mouse.close()
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
os.system("killall fim")
|
os.system("killall fim")
|
||||||
os.system("fim -qa image1.png 2>/dev/null &")
|
os.system("fim -qa image1.png 2>/dev/null &")
|
||||||
|
@ -19,4 +21,3 @@ while True:
|
||||||
os.system("killall fim")
|
os.system("killall fim")
|
||||||
os.system("fim -qa image2.png 2>/dev/null &")
|
os.system("fim -qa image2.png 2>/dev/null &")
|
||||||
waitMouseClick()
|
waitMouseClick()
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
def waitMouseClick():
|
def waitMouseClick():
|
||||||
mouse = open("/dev/input/mice", "rb")
|
mouse = open("/dev/input/mice", "rb")
|
||||||
down = False;
|
down = False
|
||||||
while True:
|
while True:
|
||||||
buf = mouse.read(3)
|
buf = mouse.read(3)
|
||||||
if ((buf[0] & 0x1) == 1):
|
if ((buf[0] & 0x1) == 1):
|
||||||
down = True
|
down = True
|
||||||
if (((buf[0] & 0x1) == 0) and down):
|
if (((buf[0] & 0x1) == 0) and down):
|
||||||
break;
|
break
|
||||||
mouse.close()
|
mouse.close()
|
||||||
|
|
||||||
waitMouseClick()
|
|
||||||
|
|
||||||
|
waitMouseClick()
|
||||||
|
|
|
@ -26,8 +26,5 @@ while loading <= 100:
|
||||||
time.sleep(0.03)
|
time.sleep(0.03)
|
||||||
updateBar(loading)
|
updateBar(loading)
|
||||||
loading += 3
|
loading += 3
|
||||||
|
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
#curses.endwin()
|
|
||||||
curses.flushinp()
|
curses.flushinp()
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
import os;
|
import os
|
||||||
|
|
||||||
|
|
||||||
def waitMouseClick():
|
def waitMouseClick():
|
||||||
mouse = open("/dev/input/mice", "rb")
|
mouse = open("/dev/input/mice", "rb")
|
||||||
down = False;
|
down = False
|
||||||
while True:
|
while True:
|
||||||
buf = mouse.read(3)
|
buf = mouse.read(3)
|
||||||
if ((buf[0] & 0x1) == 1):
|
if ((buf[0] & 0x1) == 1):
|
||||||
down = True
|
down = True
|
||||||
if (((buf[0] & 0x1) == 0) and down):
|
if (((buf[0] & 0x1) == 0) and down):
|
||||||
break;
|
break
|
||||||
mouse.close()
|
mouse.close()
|
||||||
|
|
||||||
|
|
||||||
os.system("fim *.png -qa -c 'while(1){display;sleep 1;next;}' </dev/null 2>/dev/null &")
|
os.system("fim *.png -qa -c 'while(1){display;sleep 1;next;}' </dev/null 2>/dev/null &")
|
||||||
waitMouseClick()
|
waitMouseClick()
|
||||||
os.system("killall -s 9 fim")
|
os.system("killall -s 9 fim")
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
#
|
|
||||||
|
|
||||||
def waitMouseClick():
|
def waitMouseClick():
|
||||||
print("wait mouse click")
|
print("wait mouse click")
|
||||||
mouse = open("/dev/input/mice", "rb")
|
mouse = open("/dev/input/mice", "rb")
|
||||||
down = False;
|
down = False
|
||||||
while True:
|
while True:
|
||||||
buf = mouse.read(3)
|
buf = mouse.read(3)
|
||||||
if ((buf[0] & 0x1) == 1):
|
if ((buf[0] & 0x1) == 1):
|
||||||
down = True
|
down = True
|
||||||
if (((buf[0] & 0x1) == 0) and down):
|
if (((buf[0] & 0x1) == 0) and down):
|
||||||
break;
|
break
|
||||||
mouse.close()
|
mouse.close()
|
||||||
|
|
||||||
|
|
||||||
def loop(state):
|
def loop(state):
|
||||||
print('loop ' + state)
|
print('loop ' + state)
|
||||||
match state:
|
match state:
|
||||||
|
@ -33,9 +33,6 @@ def loop(state):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# The client code.
|
# The client code.
|
||||||
|
|
||||||
state = "START"
|
state = "START"
|
||||||
while (state != "STOP"):
|
while (state != "STOP"):
|
||||||
state = loop(state)
|
state = loop(state)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue