1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-18 21:09:41 +02:00

code quality

This commit is contained in:
dbarzin 2023-02-25 18:59:41 +01:00
parent ccf1a9b31c
commit ed789fb9e8
8 changed files with 37 additions and 44 deletions

View file

@ -17,7 +17,6 @@ jobs:
uses: py-actions/flake8@v2
with:
ignore: "BLK100"
exclude: "tests/*"
max-line-length: "128"
path: "."
plugins: "flake8-bugbear==22.1.11 flake8-black"

View file

@ -1,5 +1,4 @@
#!/usr/bin/python3
import pyudev
import psutil
import time

View file

@ -1,5 +1,4 @@
#!/usr/bin/python3
import os
import time
@ -11,4 +10,3 @@ os.system("convert -resize 1024x600 -background black -gravity center -extent 10
time.sleep(1)
os.system("convert -resize 1024x600 -background black -gravity center -extent 1024x600 image2.png bgra:/dev/fb0")
time.sleep(1)

View file

@ -1,17 +1,19 @@
#!/usr/bin/python3
import os;
import os
def waitMouseClick():
mouse = open("/dev/input/mice", "rb")
down = False;
down = False
while True:
buf = mouse.read(3)
if ((buf[0] & 0x1) == 1):
down = True
if (((buf[0] & 0x1) == 0) and down):
break;
break
mouse.close()
while True:
os.system("killall fim")
os.system("fim -qa image1.png 2>/dev/null &")
@ -19,4 +21,3 @@ while True:
os.system("killall fim")
os.system("fim -qa image2.png 2>/dev/null &")
waitMouseClick()

View file

@ -2,14 +2,14 @@
def waitMouseClick():
mouse = open("/dev/input/mice", "rb")
down = False;
down = False
while True:
buf = mouse.read(3)
if ((buf[0] & 0x1) == 1):
down = True
if (((buf[0] & 0x1) == 0) and down):
break;
break
mouse.close()
waitMouseClick()
waitMouseClick()

View file

@ -26,8 +26,5 @@ while loading <= 100:
time.sleep(0.03)
updateBar(loading)
loading += 3
time.sleep(1)
#curses.endwin()
curses.flushinp()

View file

@ -1,17 +1,19 @@
#!/usr/bin/python3
import os;
import os
def waitMouseClick():
mouse = open("/dev/input/mice", "rb")
down = False;
down = False
while True:
buf = mouse.read(3)
if ((buf[0] & 0x1) == 1):
down = True
if (((buf[0] & 0x1) == 0) and down):
break;
break
mouse.close()
os.system("fim *.png -qa -c 'while(1){display;sleep 1;next;}' </dev/null 2>/dev/null &")
waitMouseClick()
os.system("killall -s 9 fim")

View file

@ -1,18 +1,18 @@
#!/usr/bin/python3
#
def waitMouseClick():
print("wait mouse click")
mouse = open("/dev/input/mice", "rb")
down = False;
down = False
while True:
buf = mouse.read(3)
if ((buf[0] & 0x1) == 1):
down = True
if (((buf[0] & 0x1) == 0) and down):
break;
break
mouse.close()
def loop(state):
print('loop ' + state)
match state:
@ -33,9 +33,6 @@ def loop(state):
if __name__ == "__main__":
# The client code.
state = "START"
while (state != "STOP"):
state = loop(state)