mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-18 21:09:41 +02:00
work in progress
This commit is contained in:
parent
c204384cb3
commit
99a6960a13
8 changed files with 40 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1 @@
|
||||||
pandorabox.log
|
pandora-box.log
|
||||||
|
|
19
images/images.py
Executable file
19
images/images.py
Executable 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
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
BIN
images/pandora-box2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 764 KiB |
BIN
images/pandora-box3.png
Normal file
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
BIN
images/pandora-box4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
|
@ -1,5 +1,8 @@
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
|
|
||||||
|
; Curses mode (full text)
|
||||||
|
CURSES = False
|
||||||
|
|
||||||
; Set USB_AUTO_MOUNT to true is if the OS mount automaticaly mount USB keys
|
; Set USB_AUTO_MOUNT to true is if the OS mount automaticaly mount USB keys
|
||||||
USB_AUTO_MOUNT = True
|
USB_AUTO_MOUNT = True
|
||||||
|
|
19
pandora-box.py
Normal file → Executable file
19
pandora-box.py
Normal file → Executable file
|
@ -24,6 +24,7 @@ USB_AUTO_MOUNT = False
|
||||||
PANDORA_ROOT_URL = "http://127.0.0.1:6100"
|
PANDORA_ROOT_URL = "http://127.0.0.1:6100"
|
||||||
FAKE_SCAN = False
|
FAKE_SCAN = False
|
||||||
QUARANTINE = False
|
QUARANTINE = False
|
||||||
|
CURSES = True
|
||||||
|
|
||||||
""" read configuration file """
|
""" read configuration file """
|
||||||
def config():
|
def config():
|
||||||
|
@ -40,6 +41,8 @@ def config():
|
||||||
# Quarantine
|
# Quarantine
|
||||||
QUARANTINE = config['DEFAULT']['QUARANTINE'].lower()=="true"
|
QUARANTINE = config['DEFAULT']['QUARANTINE'].lower()=="true"
|
||||||
QUARANTINE_FOLDER = config['DEFAULT']['QUARANTINE_FOLDER']
|
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
|
size /= 1024.0
|
||||||
return f"{size:.{decimal_places}f}{unit}"
|
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"""
|
"""Initialise curses"""
|
||||||
|
@ -190,7 +205,7 @@ def init_log():
|
||||||
log_win = curses.newwin(curses.LINES-20, curses.COLS, 20, 0)
|
log_win = curses.newwin(curses.LINES-20, curses.COLS, 20, 0)
|
||||||
log_win.border(0)
|
log_win.border(0)
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
filename='pandorabox.log',
|
filename='pandora-box.log',
|
||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
format='%(asctime)s - %(message)s',
|
format='%(asctime)s - %(message)s',
|
||||||
datefmt='%m/%d/%y %H:%M'
|
datefmt='%m/%d/%y %H:%M'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue