-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Okay, folks, I manage to make a very rudimentary GUI for this #21 version of fvid
import PySimpleGUI as sg
import os
import sys
class MissingArgument(Exception):
pass
layout = [
[sg.Button('Password', key='popup_pass', size=(20, 1))],
[sg.Button('File to de/encode', key='popup_file', size=(20, 1))],
[sg.Radio('Encoding', 1, enable_events=True, default=True, key='R1'), sg.Radio('Decoding',1, enable_events=True, key='R2')],
[sg.Button('Start', key='start', size=(20, 1))],
]
window = sg.Window('Simple fvid GUI', layout, font='a 16')
password = None
line = None
while True: # Event Loop
event, values = window.Read()
if event in [None ,'Exit']:
break
if event == 'popup_pass':
password = sg.popup_get_text('Password', password_char='*')
if event == 'popup_file':
fname = sg.popup_get_file('File to open')
try:
fname2 = os.path.basename(fname)
except:
pass
if event == 'start':
try:
fname = fname + ' '
except:
raise MissingArgument('You need a file to en/decrypt.')
if password:
pwd = '-p ' + password
else:
pwd = ''
part1 = 'python -m fvid -i ' + fname
if values['R1'] == True:
part2 = '-e ' + pwd + ' -o ' + fname2 + '_encoded.mp4'
else:
part2 = '-d ' + pwd
line = part1 + part2
break
if line:
# if sys.platform == 'win32':
# os.system('cls')
# else:
# os.system('clear')
print('Command:', line)
os.system(line)
window.Close()Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
