|
|
|
@ -6,6 +6,12 @@ import subprocess
|
|
|
|
|
import sys
|
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
|
|
text_closed_pictures = "Gehe zurück ..."
|
|
|
|
|
text_load_pictures = "Bilder werden geladen ..."
|
|
|
|
|
text_no_pictures_found = "Hier sind leider noch keine Bilder drinnen."
|
|
|
|
|
|
|
|
|
|
wait_no_pictures_found = 5 # seconds
|
|
|
|
|
|
|
|
|
|
indicator = "➤"
|
|
|
|
|
|
|
|
|
|
binding_up = [ord('k'), curses.KEY_UP]
|
|
|
|
@ -37,7 +43,14 @@ def show_pictures(files):
|
|
|
|
|
|
|
|
|
|
def search_pictures(out, path):
|
|
|
|
|
files = sorted([str(f) for f in path.iterdir() if f.is_file() and f.suffix.lower() in ['.png', '.jpg', '.jpeg', '.gif']])
|
|
|
|
|
return show_pictures(files)
|
|
|
|
|
if len(files) <= 0:
|
|
|
|
|
out(text_no_pictures_found)
|
|
|
|
|
sleep(wait_no_pictures_found)
|
|
|
|
|
return True
|
|
|
|
|
out(text_load_pictures)
|
|
|
|
|
ret = show_pictures(files)
|
|
|
|
|
out(text_closed_pictures)
|
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
|
def show_select(win, base_dir, path):
|
|
|
|
|
if not path.is_dir():
|
|
|
|
|