Client/main.py

27 lines
854 B
Python
Raw Normal View History

2022-02-02 01:43:38 +01:00
from gui.MainWindow import *
from controller.MainWindowController import *
from controller.AppController import *
from model.Protocol import *
import sys
import os.path
2022-02-02 01:43:38 +01:00
2022-02-01 21:30:30 +01:00
if __name__ == '__main__':
2022-02-02 01:43:38 +01:00
parser = Protocol()
app_controller = AppController(parser)
window_controller = MainWindowController(parser, app_controller)
window = MainWindow(window_controller)
if os.path.isfile('./ca.crt'):
print("[main] Found ca.crt")
app_controller.ssl_ca_path('./ca.crt')
if len(sys.argv) > 1:
window.host.set(sys.argv[1])
if len(sys.argv) > 2:
window.port.set(int(sys.argv[2]))
if len(sys.argv) > 3:
window.login.set(sys.argv[3])
if len(sys.argv) > 4:
window.passw.set(sys.argv[4])
if len(sys.argv) > 5:
window.tls.set(sys.argv[5] == 'tls')
2022-02-02 01:43:38 +01:00
window.start_main_loop()