print some long info via less

This commit is contained in:
localhost_frssoft 2023-06-14 01:52:06 +03:00
parent 821769f47b
commit 9ec77975e5

View file

@ -11,8 +11,7 @@ from src.fw_recents import list_fav_or_history
import src.settings as settings
import src.mpv_control
import json
import sys
import time
import os
from shlex import quote
from loguru import logger
from pyfzf.pyfzf import FzfPrompt
@ -122,21 +121,22 @@ Insert token from "Access token" here''')
current_instance.select_instance(instance)
if selected == 'Donate':
print('Support instance message:')
print(support_message)
input()
os.system(f'less <<EOF\nSupport instance message:\n{support_message}')
if selected == 'About instance':
about_instance_info = []
for i in ins_settings:
k, v = i.get('verbose_name'), i.get('value')
print(f'{k}: {v}')
print('|||||Some stats:')
about_instance_info.append(f'{k}: {v}')
about_instance_info.append('|||||Some stats:')
for k, v in ins_nodeinfo['metadata']['usage'].items():
print(f'{k}: {v}')
about_instance_info.append(f'{k}: {v}')
for k, v in ins_nodeinfo['metadata']['library'].items():
print(f'{k}: {v}')
about_instance_info.append(f'{k}: {v}')
for k, v in ins_nodeinfo['usage'].items():
print(f'{k}: {v}')
input()
about_instance_info.append(f'{k}: {v}')
about_instance_info = '\n'.join(about_instance_info)
os.system(f'less <<EOF\n{about_instance_info}')
del about_instance_info
if selected == 'Player':
src.mpv_control.player_menu(
storage=src.mpv_control.player_fw_storage.storage)