1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-25 08:19:41 +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

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'