AlfredoSequeida / AlfredoSequeida/fvid

GUI

Aperta
#22 19 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Python
Stelle
360
Fork
41
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Okay, folks, I manage to make a very rudimentary GUI for this https://github.com/AlfredoSequeida/fvid/pull/21 version of fvid

![](https://i.imgur.com/onobbdr.png)

```python
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()
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.