|
|
|
@ -14,6 +14,13 @@ binding_accept = [ord('l'), ord(' '), ord('\n')]
|
|
|
|
|
binding_back = [ord('h'), ord('q'), curses.KEY_BACKSPACE]
|
|
|
|
|
binding_exit = [ord('Q')]
|
|
|
|
|
|
|
|
|
|
def build_description(base_dir, desc_path):
|
|
|
|
|
rel_path = desc_path.relative_to(base_dir)
|
|
|
|
|
parts = list(rel_path.parts[:-1])
|
|
|
|
|
parts.append(rel_path.stem)
|
|
|
|
|
parts = [part.replace('_', ' ') for part in parts]
|
|
|
|
|
return ' - '.join(parts)
|
|
|
|
|
|
|
|
|
|
def show_pictures(files):
|
|
|
|
|
files = list(files) # copy list
|
|
|
|
|
files.insert(0, '/usr/bin/imvr')
|
|
|
|
@ -74,11 +81,7 @@ def main():
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
# build description if requested
|
|
|
|
|
if args.desc_path is not None:
|
|
|
|
|
rel_path = args.desc_path.relative_to(args.dir)
|
|
|
|
|
parts = list(rel_path.parts[:-1])
|
|
|
|
|
parts.append(rel_path.stem)
|
|
|
|
|
parts = [part.replace('_', ' ') for part in parts]
|
|
|
|
|
print(str(' - '.join(parts)))
|
|
|
|
|
print(build_description(args.dir, args.desc_path))
|
|
|
|
|
return
|
|
|
|
|
# run menus in protective mode if kiosk mode is enabled
|
|
|
|
|
def run():
|
|
|
|
|