Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified requirements.txt
Binary file not shown.
12 changes: 11 additions & 1 deletion src/app/core/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
import platform

from PyQt5.QtCore import QFile, QIODevice
from pkg_resources import resource_filename
from importlib.resources import files as _resource_files

from app.data.models import Device
from app.helpers.tools import Singleton, json_to_dict


def resource_filename(package: str, resource: str) -> str:
"""Return a filesystem path to a resource bundled inside a package.

Standard-library replacement for ``pkg_resources.resource_filename``,
which is unavailable once setuptools 81+ drops the ``pkg_resources``
package. Uses ``importlib.resources`` (available since Python 3.9).
"""
return str(_resource_files(package).joinpath(resource))


class Application(metaclass=Singleton):
__version__ = '1.4.0'
__author__ = 'Azat Aldeshov'
Expand Down