Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refacto: move shortcuts related code into specific subpkg #324

Merged
Merged
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
2 changes: 1 addition & 1 deletion builder/pyinstaller_build_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
[
"--add-data=LICENSE:.",
"--add-data=README.md:.",
f"--add-data={package_folder.joinpath('profiles/shortcut_freedesktop.template/').resolve()}:profiles/",
f"--add-data={package_folder.joinpath('shortcuts/shortcut_freedesktop.template').resolve()}:profiles/",
f"--log-level={getenv('PYINSTALLER_LOG_LEVEL', 'WARN')}",
f"--name={output_filename}",
"--noconfirm",
Expand Down
2 changes: 1 addition & 1 deletion builder/pyinstaller_build_ubuntu.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
[
"--add-data=LICENSE:.",
"--add-data=README.md:.",
f"--add-data={package_folder.joinpath('profiles/shortcut_freedesktop.template/').resolve()}:profiles/",
f"--add-data={package_folder.joinpath('shortcuts/shortcut_freedesktop.template').resolve()}:profiles/",
f"--log-level={getenv('PYINSTALLER_LOG_LEVEL', 'WARN')}",
f"--name={output_filename}",
"--noconfirm",
Expand Down
2 changes: 1 addition & 1 deletion qgis_deployment_toolbelt/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def valid_shortcut_name(self, shortcut_name: str) -> bool:
# ########## Main ##################
# ##################################

OS_CONFIG: dict = {
OS_CONFIG: dict[str, OSConfiguration] = {
"darwin": OSConfiguration(
name_python="darwin",
names_alter=["apple", "mac", "macos"],
Expand Down
2 changes: 1 addition & 1 deletion qgis_deployment_toolbelt/jobs/job_shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from qgis_deployment_toolbelt.__about__ import __title__, __version__
from qgis_deployment_toolbelt.constants import OS_CONFIG, get_qdt_working_directory
from qgis_deployment_toolbelt.jobs.generic_job import GenericJob
from qgis_deployment_toolbelt.profiles import ApplicationShortcut
from qgis_deployment_toolbelt.profiles.qdt_profile import QdtProfile
from qgis_deployment_toolbelt.shortcuts import ApplicationShortcut

# #############################################################################
# ########## Globals ###############
Expand Down
1 change: 0 additions & 1 deletion qgis_deployment_toolbelt/profiles/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
# submodules
from .local_git_handler import LocalGitHandler # noqa: F401
from .remote_git_handler import RemoteGitHandler # noqa: F401
from .shortcuts import ApplicationShortcut # noqa: F401
4 changes: 4 additions & 0 deletions qgis_deployment_toolbelt/shortcuts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! python3 # noqa: E265

# submodules
from .shortcuts import ApplicationShortcut # noqa: F401
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def freedesktop_create(self) -> tuple[Path | None, Path | None]:
logger.debug(f"Using shortcut template in Python mode: {template_shortcut}")
else:
template_shortcut = Path(getattr(sys, "_MEIPASS", sys.executable)).joinpath(
"profiles/shortcut_freedesktop.template"
"shortcuts/shortcut_freedesktop.template"
)
logger.debug(
f"Using shortcut template in packaged mode: {template_shortcut}"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from sys import platform as opersys

# project
from qgis_deployment_toolbelt.profiles.shortcuts import ApplicationShortcut
from qgis_deployment_toolbelt.shortcuts import ApplicationShortcut

# ############################################################################
# ########## Classes #############
Expand Down