oqtopus 0.1.15__tar.gz → 0.1.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {oqtopus-0.1.15 → oqtopus-0.1.16}/PKG-INFO +1 -1
  2. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/project_widget.py +60 -72
  3. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/project_widget.ui +4 -1
  4. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus.egg-info/PKG-INFO +1 -1
  5. {oqtopus-0.1.15 → oqtopus-0.1.16}/LICENSE +0 -0
  6. {oqtopus-0.1.15 → oqtopus-0.1.16}/README.md +0 -0
  7. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/__init__.py +0 -0
  8. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/core/module.py +0 -0
  9. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/core/module_asset.py +0 -0
  10. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/core/module_package.py +0 -0
  11. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/core/modules_config.py +0 -0
  12. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/core/package_prepare_task.py +0 -0
  13. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/__init__.py +0 -0
  14. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/about_dialog.py +0 -0
  15. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/database_connection_widget.py +0 -0
  16. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/database_create_dialog.py +0 -0
  17. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/database_duplicate_dialog.py +0 -0
  18. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/logs_widget.py +0 -0
  19. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/main_dialog.py +0 -0
  20. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/module_selection_widget.py +4 -4
  21. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/module_widget.py +0 -0
  22. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/parameters_groupbox.py +0 -0
  23. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/gui/settings_dialog.py +0 -0
  24. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/oqtopus.py +0 -0
  25. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/oqtopus_plugin.py +0 -0
  26. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/__init__.py +0 -0
  27. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/about_dialog.ui +0 -0
  28. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/database_connection_widget.ui +0 -0
  29. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/database_create_dialog.ui +0 -0
  30. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/database_duplicate_dialog.ui +0 -0
  31. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/logs_widget.ui +0 -0
  32. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/main_dialog.ui +0 -0
  33. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/module_selection_widget.ui +0 -0
  34. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/module_widget.ui +0 -0
  35. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/ui/settings_dialog.ui +0 -0
  36. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/utils/__init__.py +0 -0
  37. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/utils/plugin_utils.py +0 -0
  38. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/utils/qt_utils.py +0 -0
  39. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/utils/tmmtlogging.py +0 -0
  40. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus/utils/translation.py +0 -0
  41. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus.egg-info/SOURCES.txt +0 -0
  42. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus.egg-info/dependency_links.txt +0 -0
  43. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus.egg-info/requires.txt +0 -0
  44. {oqtopus-0.1.15 → oqtopus-0.1.16}/oqtopus.egg-info/top_level.txt +0 -0
  45. {oqtopus-0.1.15 → oqtopus-0.1.16}/pyproject.toml +0 -0
  46. {oqtopus-0.1.15 → oqtopus-0.1.16}/setup.cfg +0 -0
  47. {oqtopus-0.1.15 → oqtopus-0.1.16}/tests/__init__.py +0 -0
  48. {oqtopus-0.1.15 → oqtopus-0.1.16}/tests/test_plugin_load.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oqtopus
3
- Version: 0.1.15
3
+ Version: 0.1.16
4
4
  Summary: A QGIS module manager
5
5
  Author-email: Damiano Lombardi <damiano@opengis.ch>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -1,11 +1,13 @@
1
1
  import os
2
2
  import shutil
3
3
 
4
+ from qgis.PyQt.QtCore import QUrl
5
+ from qgis.PyQt.QtGui import QDesktopServices
4
6
  from qgis.PyQt.QtWidgets import QFileDialog, QMessageBox, QWidget
5
7
 
6
8
  from ..core.module_package import ModulePackage
7
- from ..utils.plugin_utils import PluginUtils
8
- from ..utils.qt_utils import CriticalMessageBox, QtUtils
9
+ from ..utils.plugin_utils import PluginUtils, logger
10
+ from ..utils.qt_utils import QtUtils
9
11
 
10
12
  DIALOG_UI = PluginUtils.get_ui_class("project_widget.ui")
11
13
 
@@ -35,41 +37,40 @@ class ProjectWidget(QWidget, DIALOG_UI):
35
37
  QtUtils.setFontItalic(self.project_info_label, True)
36
38
  return
37
39
 
38
- # Search for QGIS project file in self.__package_dir
39
- project_file_dir = os.path.join(asset_project.package_dir, "project")
40
-
41
40
  # Check if the directory exists
42
- if not os.path.exists(project_file_dir):
41
+ if not os.path.exists(asset_project.package_dir):
43
42
  self.project_info_label.setText(
44
- self.tr(f"Project directory '{project_file_dir}' does not exist.")
43
+ self.tr(f"Project directory '{asset_project.package_dir}' does not exist.")
45
44
  )
46
45
  QtUtils.setForegroundColor(self.project_info_label, PluginUtils.COLOR_WARNING)
47
46
  QtUtils.setFontItalic(self.project_info_label, True)
48
47
  return
49
48
 
50
- self.__project_file = None
51
- for root, dirs, files in os.walk(project_file_dir):
49
+ project_file = None
50
+ for root, dirs, files in os.walk(asset_project.package_dir):
52
51
  for file in files:
53
52
  if file.endswith(".qgz") or file.endswith(".qgs"):
54
- self.__project_file = os.path.join(root, file)
53
+ project_file = os.path.join(root, file)
55
54
  break
56
55
 
57
- if self.__project_file:
56
+ if project_file:
58
57
  break
59
58
 
60
- if self.__project_file is None:
59
+ if project_file is None:
61
60
  self.project_info_label.setText(
62
- self.tr(f"No QGIS project file (.qgz or .qgs) found into {project_file_dir}."),
61
+ self.tr(
62
+ f"No QGIS project file (.qgz or .qgs) found into {asset_project.package_dir}."
63
+ ),
63
64
  )
64
65
  QtUtils.setForegroundColor(self.project_info_label, PluginUtils.COLOR_WARNING)
65
- QtUtils.setFontItalic(self.db_database_label, True)
66
+ QtUtils.setFontItalic(self.project_info_label, True)
66
67
  return
67
68
 
69
+ QtUtils.resetForegroundColor(self.project_info_label)
70
+ QtUtils.setFontItalic(self.project_info_label, False)
68
71
  self.project_info_label.setText(
69
- self.tr(self.__project_file),
72
+ f"<a href='file://{asset_project.package_dir}'>{asset_project.package_dir}</a>",
70
73
  )
71
- QtUtils.setForegroundColor(self.project_info_label, PluginUtils.COLOR_GREEN)
72
- QtUtils.setFontItalic(self.db_database_label, False)
73
74
 
74
75
  def __projectInstallClicked(self):
75
76
 
@@ -81,15 +82,7 @@ class ProjectWidget(QWidget, DIALOG_UI):
81
82
  )
82
83
  return
83
84
 
84
- if self.module_package_comboBox.currentData() is None:
85
- QMessageBox.warning(
86
- self,
87
- self.tr("Error"),
88
- self.tr("Please select a module version first."),
89
- )
90
- return
91
-
92
- asset_project = self.module_package_comboBox.currentData().asset_project
85
+ asset_project = self.__current_module_package.asset_project
93
86
  if asset_project is None:
94
87
  QMessageBox.warning(
95
88
  self,
@@ -98,46 +91,6 @@ class ProjectWidget(QWidget, DIALOG_UI):
98
91
  )
99
92
  return
100
93
 
101
- package_dir = asset_project.package_dir
102
- if package_dir is None:
103
- CriticalMessageBox(
104
- self.tr("Error"), self.tr("No valid package directory available."), None, self
105
- ).exec()
106
- return
107
-
108
- # Search for QGIS project file in package_dir
109
- project_file_dir = os.path.join(package_dir, "project")
110
-
111
- # Check if the directory exists
112
- if not os.path.exists(project_file_dir):
113
- CriticalMessageBox(
114
- self.tr("Error"),
115
- self.tr(f"Project directory '{project_file_dir}' does not exist."),
116
- None,
117
- self,
118
- ).exec()
119
- return
120
-
121
- self.__project_file = None
122
- for root, dirs, files in os.walk(project_file_dir):
123
- print(f"Searching for QGIS project file in {root}: {files}")
124
- for file in files:
125
- if file.endswith(".qgz") or file.endswith(".qgs"):
126
- self.__project_file = os.path.join(root, file)
127
- break
128
-
129
- if self.__project_file:
130
- break
131
-
132
- if self.__project_file is None:
133
- CriticalMessageBox(
134
- self.tr("Error"),
135
- self.tr(f"No QGIS project file (.qgz or .qgs) found into {project_file_dir}."),
136
- None,
137
- self,
138
- ).exec()
139
- return
140
-
141
94
  install_destination = QFileDialog.getExistingDirectory(
142
95
  self,
143
96
  self.tr("Select installation directory"),
@@ -148,15 +101,22 @@ class ProjectWidget(QWidget, DIALOG_UI):
148
101
  if not install_destination:
149
102
  return
150
103
 
151
- # Copy the project file to the selected directory
104
+ # Copy the project files to the selected directory
152
105
  try:
153
- shutil.copy(self.__project_file, install_destination)
106
+ # Copy all files from assset_project to install_destination
107
+ for item in os.listdir(asset_project.package_dir):
108
+ source_path = os.path.join(asset_project.package_dir, item)
109
+ destination_path = os.path.join(install_destination, item)
110
+
111
+ if os.path.isdir(source_path):
112
+ shutil.copytree(source_path, destination_path, dirs_exist_ok=True)
113
+ else:
114
+ shutil.copy2(source_path, destination_path)
115
+
154
116
  QMessageBox.information(
155
117
  self,
156
118
  self.tr("Project installed"),
157
- self.tr(
158
- f"Project file '{self.__project_file}' has been copied to '{install_destination}'."
159
- ),
119
+ self.tr(f"Project files have been copied to '{install_destination}'."),
160
120
  )
161
121
  except Exception as e:
162
122
  QMessageBox.critical(
@@ -167,4 +127,32 @@ class ProjectWidget(QWidget, DIALOG_UI):
167
127
  return
168
128
 
169
129
  def __projectSeeChangelogClicked(self):
170
- self.__seeChangeLogClicked()
130
+ if self.__current_module_package is None:
131
+ QMessageBox.warning(
132
+ self,
133
+ self.tr("Can't open changelog"),
134
+ self.tr("Please select a module and version first."),
135
+ )
136
+ return
137
+
138
+ if self.__current_module_package.type == ModulePackage.Type.FROM_ZIP:
139
+ QMessageBox.warning(
140
+ self,
141
+ self.tr("Can't open changelog"),
142
+ self.tr("Changelog is not available for Zip packages."),
143
+ )
144
+ return
145
+
146
+ if self.__current_module_package.html_url is None:
147
+ QMessageBox.warning(
148
+ self,
149
+ self.tr("Can't open changelog"),
150
+ self.tr(
151
+ f"Changelog not available for version '{self.__current_module_package.display_name()}'."
152
+ ),
153
+ )
154
+ return
155
+
156
+ changelog_url = self.__current_module_package.html_url
157
+ logger.info(f"Opening changelog URL: {changelog_url}")
158
+ QDesktopServices.openUrl(QUrl(changelog_url))
@@ -26,8 +26,11 @@
26
26
  <property name="text">
27
27
  <string>-</string>
28
28
  </property>
29
+ <property name="openExternalLinks">
30
+ <bool>true</bool>
31
+ </property>
29
32
  <property name="textInteractionFlags">
30
- <set>Qt::NoTextInteraction</set>
33
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
31
34
  </property>
32
35
  </widget>
33
36
  </item>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oqtopus
3
- Version: 0.1.15
3
+ Version: 0.1.16
4
4
  Summary: A QGIS module manager
5
5
  Author-email: Damiano Lombardi <damiano@opengis.ch>
6
6
  License: GNU GENERAL PUBLIC LICENSE
File without changes
File without changes
File without changes
@@ -213,19 +213,19 @@ class ModuleSelectionWidget(QWidget, DIALOG_UI):
213
213
  self.module_information_label.setText(loading_text)
214
214
 
215
215
  def __seeChangeLogClicked(self):
216
- if self.__current_module_package.type == ModulePackage.Type.FROM_ZIP:
216
+ if self.__current_module_package is None:
217
217
  QMessageBox.warning(
218
218
  self,
219
219
  self.tr("Can't open changelog"),
220
- self.tr("Changelog is not available for Zip packages."),
220
+ self.tr("Please select a module and version first."),
221
221
  )
222
222
  return
223
223
 
224
- if self.__current_module_package is None:
224
+ if self.__current_module_package.type == ModulePackage.Type.FROM_ZIP:
225
225
  QMessageBox.warning(
226
226
  self,
227
227
  self.tr("Can't open changelog"),
228
- self.tr("Please select a module and version first."),
228
+ self.tr("Changelog is not available for Zip packages."),
229
229
  )
230
230
  return
231
231
 
File without changes
File without changes
File without changes
File without changes