This repository has been archived on 2023-11-29. You can view files and clone it, but cannot push or open issues or pull requests.
WebPicDownloader/main.py

54 lines
1.8 KiB
Python

import os
from controller.HomeController import HomeController
from controller.InfoController import InfoController
from controller.MainController import MainController
from controller.Frames import Frames
from model.WebPicDownloader import WebPicDownloader
from view.HomeView import HomeView
from view.InfoView import InfoView
from view.MainWindow import MainWindow
def get_config() -> dict:
return {
'app_name': "WebPicDownloader",
'app_folder': os.getcwd(),
'app_version': "1.0.0" # This version must match with the version.txt at root
}
if __name__ == '__main__':
"""
WebPicDownloader is a program developed and maintened by EndMove under Apache 2.0 License. Stealing code is a crime !
Disclamer : The developer of this application can in no way be held responsible if his application is used for illegal purposes.
@author Jérémi Nihart / EndMove
@link https://git.endmove.eu/EndMove/WebPicDownloader
@version 1.0.0
@since 2022-08-30
"""
# configuration
config = get_config()
# Create utli/model
webpic = WebPicDownloader(path=config.get('app_folder'), asynchrone=True)
# Create app controllers
main_controller = MainController(config)
home_controller = HomeController(main_controller, webpic)
info_controller = InfoController(main_controller)
# Create app views
main_window = MainWindow(main_controller)
home_view = HomeView(main_window, home_controller)
info_controller = InfoView(main_window, info_controller)
# Add views to main window
main_window.add_view(Frames.Home, home_view)
main_window.add_view(Frames.Info, info_controller)
# Choose the launching view
main_window.show_frame(Frames.Home)
# Start main windows looping (launch program)
main_window.mainloop()