1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-18 12:59:40 +02:00

work in progress

This commit is contained in:
dbarzin 2022-06-28 17:52:32 +02:00
parent c204384cb3
commit 99a6960a13
8 changed files with 40 additions and 3 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
pandorabox.log
pandora-box.log

19
images/images.py Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/python3
# display all images and reset
import os
import time
format = "1020x600"
#format = "1920x1080"
images = ["pandora-box1.png", "pandora-box2.png", "pandora-box3.png", "pandora-box4.png"]
for image in images :
os.system("convert -resize %s -background black -gravity center -extent %s %s bgra:/dev/fb0" % (format,format,image))
time.sleep(1)
os.system("reset")

BIN
images/pandora-box1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

BIN
images/pandora-box2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 KiB

BIN
images/pandora-box3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
images/pandora-box4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View file

@ -1,5 +1,8 @@
[DEFAULT]
; Curses mode (full text)
CURSES = False
; Set USB_AUTO_MOUNT to true is if the OS mount automaticaly mount USB keys
USB_AUTO_MOUNT = True

19
pandora-box.py Normal file → Executable file
View file

@ -24,6 +24,7 @@ USB_AUTO_MOUNT = False
PANDORA_ROOT_URL = "http://127.0.0.1:6100"
FAKE_SCAN = False
QUARANTINE = False
CURSES = True
""" read configuration file """
def config():
@ -40,6 +41,8 @@ def config():
# Quarantine
QUARANTINE = config['DEFAULT']['QUARANTINE'].lower()=="true"
QUARANTINE_FOLDER = config['DEFAULT']['QUARANTINE_FOLDER']
# Curses
CURSES = config['DEFAULT']['CURSES'].lower()=="true"
# ----------------------------------------------------------
@ -51,8 +54,20 @@ def human_readable_size(size, decimal_places=1):
size /= 1024.0
return f"{size:.{decimal_places}f}{unit}"
# -----------------------------------------------------------
# Screen
# Image Screen
# -----------------------------------------------------------
def display_image(status):
if status=="WAIT":
elif status=="WORK":
elif status=="OK":
elif status=="BAD":
else
# -----------------------------------------------------------
# CURSES Screen
# -----------------------------------------------------------
"""Initialise curses"""
@ -190,7 +205,7 @@ def init_log():
log_win = curses.newwin(curses.LINES-20, curses.COLS, 20, 0)
log_win.border(0)
logging.basicConfig(
filename='pandorabox.log',
filename='pandora-box.log',
level=logging.INFO,
format='%(asctime)s - %(message)s',
datefmt='%m/%d/%y %H:%M'