Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test that dependent plugins are located after their dependencies in m…
…PythonUtils->pluginList(), which will be the order used to load Python plugins to QGIS
- Loading branch information
1 parent
c1dcb2c
commit 9020ac5
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/testdata/test_plugin_path/dependent_plugin_1/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from PyQt5.QtWidgets import QAction | ||
|
||
|
||
def classFactory(iface): | ||
return DependentPlugin1(iface) | ||
|
||
|
||
class DependentPlugin1: | ||
def __init__(self, iface): | ||
self.iface = iface | ||
|
||
def initGui(self): | ||
self.action = QAction('Go!', self.iface.mainWindow()) | ||
self.action.triggered.connect(self.run) | ||
self.iface.addToolBarIcon(self.action) | ||
|
||
def unload(self): | ||
self.iface.removeToolBarIcon(self.action) | ||
del self.action | ||
|
||
def run(self): | ||
pass |
7 changes: 7 additions & 0 deletions
7
tests/testdata/test_plugin_path/dependent_plugin_1/metadata.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[general] | ||
name=Dependent plugin 1 | ||
description=A dependent plugin | ||
version=1.0 | ||
qgisMinimumVersion=3.0 | ||
author=Germán Carrillo | ||
plugin_dependencies=plugin path test |
22 changes: 22 additions & 0 deletions
22
tests/testdata/test_plugin_path/dependent_plugin_2/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from PyQt5.QtWidgets import QAction | ||
|
||
|
||
def classFactory(iface): | ||
return DependentPlugin2(iface) | ||
|
||
|
||
class DependentPlugin2: | ||
def __init__(self, iface): | ||
self.iface = iface | ||
|
||
def initGui(self): | ||
self.action = QAction('Go!', self.iface.mainWindow()) | ||
self.action.triggered.connect(self.run) | ||
self.iface.addToolBarIcon(self.action) | ||
|
||
def unload(self): | ||
self.iface.removeToolBarIcon(self.action) | ||
del self.action | ||
|
||
def run(self): | ||
pass |
7 changes: 7 additions & 0 deletions
7
tests/testdata/test_plugin_path/dependent_plugin_2/metadata.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[general] | ||
name=Dependent plugin 2 | ||
description=Yet another dependent plugin | ||
version=1.0 | ||
qgisMinimumVersion=3.0 | ||
author=Germán Carrillo | ||
plugin_dependencies=Dependent plugin 1 |