YouTubeDownloader v1.1.2
YouTube content downloader
Loading...
Searching...
No Matches
app.py
Go to the documentation of this file.
1"""!
2********************************************************************************
3@file app.py
4@brief Application entry file
5********************************************************************************
6"""
7
8# autopep8: off
9import sys
10import os
11import logging
12
13sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
14from Source.Controller.main_window import MainWindow # pylint: disable=wrong-import-position
15from Source.version import __title__, __version__ # pylint: disable=wrong-import-position
16from Source.Util.app_data import ICON_APP # pylint: disable=wrong-import-position
17from Source.Util.colored_log import init_console_logging # pylint: disable=wrong-import-position
18# autopep8: on
19
20log = logging.getLogger(__title__)
21
22
23def start_application() -> MainWindow:
24 """!
25 @brief Start application
26 @return windows and application object
27 """
28 # Set custom application id to show correct icon instead of Python in the task bar
29 try:
30 from ctypes import windll # only exists on windows. # pylint: disable=import-outside-toplevel
31 app_id = __title__ + "." + __version__
32 log.debug("Setting explicit app user model id: %s", app_id)
33 windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id)
34 except ImportError:
35 pass
36
37 window = MainWindow()
38
39 window.iconbitmap(ICON_APP)
40
41 return window
42
43
44if __name__ == "__main__":
45 init_console_logging(logging.WARNING)
46 o_window = start_application()
47 o_window.mainloop()
Class for YouTube download GUI.
MainWindow start_application()
Start application.
Definition app.py:23