-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.py
More file actions
executable file
·38 lines (28 loc) · 1001 Bytes
/
client.py
File metadata and controls
executable file
·38 lines (28 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5 import QtWidgets
from encode import binary_encode, encrypt, mlt3_line_encode
from gui import GraphicalUserInterface
from communication import Communication as conn
class Sender(GraphicalUserInterface):
def __init__(self):
self.windows_title = "Sender"
self.table_header_label = "Dados enviados"
self.main_label = "Sender - Equipe Minecraft"
self.button_label = "Enviar"
self.buttom_action = self.send_and_update
super().__init__()
def send_and_update(self):
msg = self.tabelaValores.item(0, 0).text()
encrypted = encrypt(msg)
binary = binary_encode(encrypted)
signal = mlt3_line_encode(binary)
self.update_gui(msg, binary, signal)
conn.send(signal)
def main():
app = QtWidgets.QApplication(sys.argv)
Sender()
sys.exit(app.exec_())
if __name__ == '__main__':
main()