-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_resource_path.py
30 lines (21 loc) · 1.02 KB
/
get_resource_path.py
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
"""
This file is part of the PetalVault password manager distribution. See <https://github.com/F33RNI/PetalVault>.
Copyright (C) 2024 Fern Lane
This program is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program.
If not, see <http://www.gnu.org/licenses/>.
"""
import os
def get_resource_path(filename_: str) -> str:
"""Converts local file path to absolute path
(For proper resources loading using pyinstaller)
Args:
filename_ (str): local file path
Returns:
str: absolute file path
"""
return os.path.abspath(os.path.join(os.path.dirname(__file__), filename_))