YouTubeDownloader v1.1.2
YouTube content downloader
Loading...
Searching...
No Matches
Source.Util.app_data Namespace Reference

Classes

class  ETheme
 Available application themes. More...
 

Functions

str resource_path (str s_relative_path)
 Returns the absolute path to a resource given by a relative path depending on the environment (EXE or Python)
 

Variables

str ICON_APP = resource_path(ICON_APP_PATH)
 
str ICON_APP_FAVICON_PATH = "Resources/favicon.ico"
 
str ICON_APP_PATH = "Resources/app.ico"
 
 log = logging.getLogger(__title__)
 

Detailed Description


Function Documentation

◆ resource_path()

str resource_path ( str s_relative_path)

Returns the absolute path to a resource given by a relative path depending on the environment (EXE or Python)

Parameters
s_relative_path: the relative path to a file or directory
Returns
absolute path to the resource

Definition at line 18 of file app_data.py.

18def resource_path(s_relative_path: str) -> str:
19 """!
20 @brief Returns the absolute path to a resource given by a relative path depending on the environment (EXE or Python)
21 @param s_relative_path : the relative path to a file or directory
22 @return absolute path to the resource
23 """
24 if hasattr(sys, "_MEIPASS"):
25 # PyInstaller creates a temp folder and stores path in _MEIPASS
26 s_base_path = sys._MEIPASS
27 else:
28 s_base_path = os.path.abspath("../")
29 s_resource_path = os.path.join(s_base_path, s_relative_path)
30 log.debug("Resource Path (relative %s): %s", s_relative_path, s_resource_path)
31 return s_resource_path
32
33
34# Files and Paths

Variable Documentation

◆ ICON_APP

str ICON_APP = resource_path(ICON_APP_PATH)

Definition at line 37 of file app_data.py.

◆ ICON_APP_FAVICON_PATH

str ICON_APP_FAVICON_PATH = "Resources/favicon.ico"

Definition at line 36 of file app_data.py.

◆ ICON_APP_PATH

str ICON_APP_PATH = "Resources/app.ico"

Definition at line 35 of file app_data.py.

◆ log

log = logging.getLogger(__title__)

Definition at line 15 of file app_data.py.