oqtopus 0.1.21__tar.gz → 0.1.23__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 (51) hide show
  1. {oqtopus-0.1.21 → oqtopus-0.1.23}/PKG-INFO +2 -2
  2. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/core/package_prepare_task.py +15 -9
  3. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/main_dialog.py +19 -7
  4. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/module_selection_widget.py +3 -2
  5. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/module_widget.py +6 -2
  6. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/oqtopus_plugin.py +8 -0
  7. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/utils/plugin_utils.py +11 -3
  8. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus.egg-info/PKG-INFO +2 -2
  9. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus.egg-info/requires.txt +1 -1
  10. {oqtopus-0.1.21 → oqtopus-0.1.23}/requirements.txt +1 -1
  11. {oqtopus-0.1.21 → oqtopus-0.1.23}/LICENSE +0 -0
  12. {oqtopus-0.1.21 → oqtopus-0.1.23}/README.md +0 -0
  13. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/__init__.py +0 -0
  14. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/core/module.py +0 -0
  15. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/core/module_asset.py +0 -0
  16. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/core/module_package.py +0 -0
  17. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/core/modules_config.py +0 -0
  18. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/__init__.py +0 -0
  19. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/about_dialog.py +0 -0
  20. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/database_connection_widget.py +0 -0
  21. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/database_create_dialog.py +0 -0
  22. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/database_duplicate_dialog.py +0 -0
  23. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/logs_widget.py +0 -0
  24. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/parameters_groupbox.py +0 -0
  25. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/plugin_widget.py +0 -0
  26. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/project_widget.py +0 -0
  27. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/gui/settings_dialog.py +0 -0
  28. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/oqtopus.py +0 -0
  29. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/__init__.py +0 -0
  30. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/about_dialog.ui +0 -0
  31. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/database_connection_widget.ui +0 -0
  32. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/database_create_dialog.ui +0 -0
  33. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/database_duplicate_dialog.ui +0 -0
  34. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/logs_widget.ui +0 -0
  35. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/main_dialog.ui +0 -0
  36. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/module_selection_widget.ui +0 -0
  37. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/module_widget.ui +0 -0
  38. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/plugin_widget.ui +0 -0
  39. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/project_widget.ui +0 -0
  40. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/ui/settings_dialog.ui +0 -0
  41. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/utils/__init__.py +0 -0
  42. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/utils/qt_utils.py +0 -0
  43. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/utils/tmmtlogging.py +0 -0
  44. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus/utils/translation.py +0 -0
  45. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus.egg-info/SOURCES.txt +0 -0
  46. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus.egg-info/dependency_links.txt +0 -0
  47. {oqtopus-0.1.21 → oqtopus-0.1.23}/oqtopus.egg-info/top_level.txt +0 -0
  48. {oqtopus-0.1.21 → oqtopus-0.1.23}/pyproject.toml +0 -0
  49. {oqtopus-0.1.21 → oqtopus-0.1.23}/setup.cfg +0 -0
  50. {oqtopus-0.1.21 → oqtopus-0.1.23}/tests/__init__.py +0 -0
  51. {oqtopus-0.1.21 → oqtopus-0.1.23}/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.21
3
+ Version: 0.1.23
4
4
  Summary: A QGIS module manager
5
5
  Author-email: Damiano Lombardi <damiano@opengis.ch>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -347,7 +347,7 @@ Requires-Python: >=3.8
347
347
  Description-Content-Type: text/markdown
348
348
  License-File: LICENSE
349
349
  Requires-Dist: pgserviceparser<3.0.0,>=2.4.0
350
- Requires-Dist: pum<2.0.0,>=1.1.13
350
+ Requires-Dist: pum<2.0.0,>=1.1.14
351
351
  Requires-Dist: PyYAML
352
352
  Requires-Dist: pydantic>=2.0
353
353
  Requires-Dist: psycopg<4.0.0,>=3.1.0
@@ -24,21 +24,23 @@ class PackagePrepareTask(QThread):
24
24
  super().__init__(parent)
25
25
 
26
26
  self.module_package = None
27
+ self.from_zip_file = None
27
28
 
28
29
  self.__destination_directory = None
29
30
 
30
31
  self.__canceled = False
31
32
  self.lastError = None
32
33
 
33
- def startFromZip(self, zip_file: str):
34
-
35
- self.module_package = None
34
+ def startFromZip(self, module_package, zip_file: str):
35
+ self.module_package = module_package
36
+ self.from_zip_file = zip_file
36
37
 
37
38
  self.__canceled = False
38
39
  self.start()
39
40
 
40
41
  def startFromModulePackage(self, module_package):
41
42
  self.module_package = module_package
43
+ self.from_zip_file = None
42
44
 
43
45
  self.__canceled = False
44
46
  self.start()
@@ -55,9 +57,10 @@ class PackagePrepareTask(QThread):
55
57
  if self.module_package is None:
56
58
  raise Exception(self.tr("No module version provided."))
57
59
 
58
- self.__destination_directory = self.__prepareDestinationDirectory()
60
+ self.__destination_directory = self.__prepare_destination_directory()
61
+ logger.info(f"Destination directory: {self.__destination_directory}")
59
62
 
60
- self.__download_module_assets(self.module_package)
63
+ self.__prepare_module_assets(self.module_package)
61
64
  self.lastError = None
62
65
 
63
66
  except Exception as e:
@@ -65,7 +68,7 @@ class PackagePrepareTask(QThread):
65
68
  logger.critical(f"Package prepare task error: {e}")
66
69
  self.lastError = e
67
70
 
68
- def __prepareDestinationDirectory(self):
71
+ def __prepare_destination_directory(self):
69
72
  """
70
73
  Prepare the destination directory for the module package.
71
74
  This method creates a temporary directory for the package.
@@ -81,10 +84,13 @@ class PackagePrepareTask(QThread):
81
84
 
82
85
  return destination_directory
83
86
 
84
- def __download_module_assets(self, module_package):
87
+ def __prepare_module_assets(self, module_package):
88
+
89
+ # Download the source or use from zip
90
+ zip_file = self.from_zip_file or self.__download_module_asset(
91
+ module_package.download_url, "source.zip"
92
+ )
85
93
 
86
- # Download the source
87
- zip_file = self.__download_module_asset(module_package.download_url, "source.zip")
88
94
  module_package.source_package_zip = zip_file
89
95
  package_dir = self.__extract_zip_file(zip_file)
90
96
  module_package.source_package_dir = package_dir
@@ -53,10 +53,12 @@ DIALOG_UI = PluginUtils.get_ui_class("main_dialog.ui")
53
53
 
54
54
  class MainDialog(QDialog, DIALOG_UI):
55
55
 
56
- def __init__(self, modules_config_path, parent=None):
56
+ def __init__(self, modules_config_path, about_dialog_cls=None, parent=None):
57
57
  QDialog.__init__(self, parent)
58
58
  self.setupUi(self)
59
59
 
60
+ self.__about_dialog_cls = about_dialog_cls or AboutDialog
61
+
60
62
  self.buttonBox.rejected.connect(self.__closeDialog)
61
63
  self.buttonBox.helpRequested.connect(self.__helpRequested)
62
64
 
@@ -94,14 +96,24 @@ class MainDialog(QDialog, DIALOG_UI):
94
96
  # Settings action
95
97
  settings_action = QAction(self.tr("Settings"), self)
96
98
  settings_action.triggered.connect(self.__open_settings_dialog)
99
+ self.menubar.addAction(settings_action)
100
+
101
+ # Help menu
102
+ help_menu = self.menubar.addMenu(self.tr("Help"))
103
+
104
+ # Documentation action
105
+ documentation_action = QAction(
106
+ PluginUtils.get_plugin_icon("help.svg"), self.tr("Documentation"), self
107
+ )
108
+ documentation_action.triggered.connect(PluginUtils.open_documentation)
109
+ help_menu.addAction(documentation_action)
97
110
 
98
111
  # About action
99
- about_action = QAction(self.tr("About"), self)
112
+ about_action = QAction(
113
+ PluginUtils.get_plugin_icon("oqtopus-logo.png"), self.tr("About"), self
114
+ )
100
115
  about_action.triggered.connect(self.__show_about_dialog)
101
-
102
- # Add actions to menubar
103
- self.menubar.addAction(settings_action)
104
- self.menubar.addAction(about_action)
116
+ help_menu.addAction(about_action)
105
117
 
106
118
  self.__moduleSelectionWidget.signal_loadingStarted.connect(
107
119
  self.__moduleSelection_loadingStarted
@@ -136,7 +148,7 @@ class MainDialog(QDialog, DIALOG_UI):
136
148
  dlg.exec()
137
149
 
138
150
  def __show_about_dialog(self):
139
- dialog = AboutDialog(self)
151
+ dialog = self.__about_dialog_cls(self)
140
152
  dialog.exec()
141
153
 
142
154
  def __moduleSelection_loadingStarted(self):
@@ -129,7 +129,7 @@ class ModuleSelectionWidget(QWidget, DIALOG_UI):
129
129
  return
130
130
 
131
131
  if self.__current_module_package.type == self.__current_module_package.Type.FROM_ZIP:
132
- self.module_zippackage_groupBox.setVisible(True)
132
+ self.module_zipPackage_groupBox.setVisible(True)
133
133
  return
134
134
  else:
135
135
  self.module_zipPackage_groupBox.setVisible(False)
@@ -182,7 +182,7 @@ class ModuleSelectionWidget(QWidget, DIALOG_UI):
182
182
  self.__packagePrepareTask.cancel()
183
183
  self.__packagePrepareTask.wait()
184
184
 
185
- self.__packagePrepareTask.startFromZip(filename)
185
+ self.__packagePrepareTask.startFromZip(self.__current_module_package, filename)
186
186
 
187
187
  self.signal_loadingStarted.emit()
188
188
  self.module_progressBar.setVisible(True)
@@ -316,6 +316,7 @@ class ModuleSelectionWidget(QWidget, DIALOG_UI):
316
316
  repository=self.__current_module.repository,
317
317
  json_payload=None,
318
318
  type=ModulePackage.Type.FROM_ZIP,
319
+ name="from_zip",
319
320
  ),
320
321
  )
321
322
 
@@ -49,7 +49,7 @@ class ModuleWidget(QWidget, DIALOG_UI):
49
49
  CriticalMessageBox(
50
50
  self.tr("Error"),
51
51
  self.tr(
52
- f"The selected file '{self.__current_module_package.source_package_zip}' does not contain a valid package directory."
52
+ f"The selected file '{self.__current_module_package.source_package_zip}' doesn't contain a valid package directory."
53
53
  ),
54
54
  None,
55
55
  self,
@@ -62,7 +62,7 @@ class ModuleWidget(QWidget, DIALOG_UI):
62
62
  CriticalMessageBox(
63
63
  self.tr("Error"),
64
64
  self.tr(
65
- f"The selected file '{self.__current_module_package.source_package_zip}' does not contain a valid .pum.yaml file."
65
+ f"The selected file '{self.__current_module_package.source_package_zip}' doesn't contain a valid .pum.yaml file."
66
66
  ),
67
67
  None,
68
68
  self,
@@ -140,6 +140,7 @@ class ModuleWidget(QWidget, DIALOG_UI):
140
140
  roles=self.db_parameters_CreateAndGrantRoles_checkBox.isChecked(),
141
141
  grant=self.db_parameters_CreateAndGrantRoles_checkBox.isChecked(),
142
142
  beta_testing=beta_testing,
143
+ commit=False,
143
144
  )
144
145
 
145
146
  if self.db_demoData_checkBox.isChecked():
@@ -149,6 +150,9 @@ class ModuleWidget(QWidget, DIALOG_UI):
149
150
  name=demo_data_name,
150
151
  parameters=parameters,
151
152
  )
153
+
154
+ self.__database_connection.commit()
155
+
152
156
  except Exception as exception:
153
157
  CriticalMessageBox(
154
158
  self.tr("Error"), self.tr("Can't install the module:"), exception, self
@@ -123,6 +123,7 @@ class OqtopusPlugin:
123
123
  text=self.tr("Show &main dialog"),
124
124
  callback=self.show_main_dialog,
125
125
  parent=self.iface.mainWindow(),
126
+ add_to_toolbar=True,
126
127
  )
127
128
  self.add_action(
128
129
  icon_path=None,
@@ -131,6 +132,13 @@ class OqtopusPlugin:
131
132
  parent=self.iface.mainWindow(),
132
133
  add_to_toolbar=False,
133
134
  )
135
+ self.add_action(
136
+ icon_path=PluginUtils.get_plugin_icon_path("help.svg"),
137
+ text=self.tr("Help"),
138
+ callback=PluginUtils.open_documentation,
139
+ parent=self.iface.mainWindow(),
140
+ add_to_toolbar=False,
141
+ )
134
142
  self.add_action(
135
143
  icon_path=PluginUtils.get_plugin_icon_path("oqtopus-logo.png"),
136
144
  text=self.tr("&About"),
@@ -46,6 +46,8 @@ class PluginUtils:
46
46
  COLOR_GREEN = QColor(12, 167, 137)
47
47
  COLOR_WARNING = QColor(255, 165, 0)
48
48
 
49
+ DOCUMENTATION_URL = "https://opengisch.github.io/oqtopus/"
50
+
49
51
  @staticmethod
50
52
  def plugin_root_path():
51
53
  """
@@ -95,8 +97,11 @@ class PluginUtils:
95
97
  return ini_text.value("version")
96
98
 
97
99
  @staticmethod
98
- def init_logger():
99
- PluginUtils.logsDirectory = f"{PluginUtils.plugin_root_path()}/logs"
100
+ def init_logger(logs_directory=None):
101
+ if logs_directory is not None:
102
+ PluginUtils.logsDirectory = logs_directory
103
+ else:
104
+ PluginUtils.logsDirectory = f"{PluginUtils.plugin_root_path()}/logs"
100
105
 
101
106
  directory = QDir(PluginUtils.logsDirectory)
102
107
  if not directory.exists():
@@ -121,7 +126,6 @@ class PluginUtils:
121
126
 
122
127
  @staticmethod
123
128
  def open_logs_folder():
124
- print(f"Opening logs folder {PluginUtils.logsDirectory}")
125
129
  QDesktopServices.openUrl(QUrl.fromLocalFile(PluginUtils.logsDirectory))
126
130
 
127
131
  @staticmethod
@@ -150,6 +154,10 @@ class PluginUtils:
150
154
  headers["Authorization"] = f"token {token}"
151
155
  return headers
152
156
 
157
+ @staticmethod
158
+ def open_documentation():
159
+ QDesktopServices.openUrl(QUrl(PluginUtils.DOCUMENTATION_URL))
160
+
153
161
 
154
162
  class LoggingBridge(logging.Handler, QObject):
155
163
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oqtopus
3
- Version: 0.1.21
3
+ Version: 0.1.23
4
4
  Summary: A QGIS module manager
5
5
  Author-email: Damiano Lombardi <damiano@opengis.ch>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -347,7 +347,7 @@ Requires-Python: >=3.8
347
347
  Description-Content-Type: text/markdown
348
348
  License-File: LICENSE
349
349
  Requires-Dist: pgserviceparser<3.0.0,>=2.4.0
350
- Requires-Dist: pum<2.0.0,>=1.1.13
350
+ Requires-Dist: pum<2.0.0,>=1.1.14
351
351
  Requires-Dist: PyYAML
352
352
  Requires-Dist: pydantic>=2.0
353
353
  Requires-Dist: psycopg<4.0.0,>=3.1.0
@@ -1,5 +1,5 @@
1
1
  pgserviceparser<3.0.0,>=2.4.0
2
- pum<2.0.0,>=1.1.13
2
+ pum<2.0.0,>=1.1.14
3
3
  PyYAML
4
4
  pydantic>=2.0
5
5
  psycopg<4.0.0,>=3.1.0
@@ -1,5 +1,5 @@
1
1
  pgserviceparser>=2.4.0,<3.0.0
2
- pum>=1.1.13,<2.0.0
2
+ pum>=1.1.14,<2.0.0
3
3
  PyYAML
4
4
  pydantic >=2.0
5
5
  psycopg>=3.1.0,<4.0.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes