Skip to content

Commit 6b68a31

Browse files
authored
Add QML reader plugin and adapt to new plugin mechanism (#12)
* add files * got qml working * flake8 and use new plugins list mechanism * README and disable pylint for now * show error earlier * lock pylint version * pylint
1 parent fd207ce commit 6b68a31

File tree

12 files changed

+218
-19
lines changed

12 files changed

+218
-19
lines changed

.github/workflows/python-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
shell: bash -l {0}
1616
run: |
1717
sudo apt-get install libegl1 libglu1-mesa
18-
conda install pylint flake8 gdal pyside6 tuiview
18+
conda install pylint=3.3.9 flake8 gdal pyside6 tuiview
1919
- name: Test Build
2020
shell: bash -l {0}
2121
run: |

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include tuiview_plugins/qml_reader/qgis_qml_icon.svg

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# A collection of TuiView plugins #
22

3-
**Note this branch is for TuiView 1.3.x**
3+
**Note this branch is for TuiView 1.3.6 and layer**
44

55
For TuiView 1.2.x see the [qt5 branch](https://github.com/ubarsc/tuiview-plugins/tree/qt5).
66

7+
For TuiView 1.3.0 to 1.3.5 see the [TuiView 1.3.0 to 1.3.5 branch](https://github.com/ubarsc/tuiview-plugins/tree/tuiview_1.3.0-1.3.5)
8+
79
These plugins extend TuiView functionality. Mainly as an example of how to build plugins, but hopefully do a few useful things also.
810

911

tuiview_plugins/collect_shapefile/collect_shapefile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from tuiview.viewerwidget import VIEWER_TOOL_POLYGON, VIEWER_TOOL_NONE
2727
from tuiview.viewerwidget import VIEWER_TOOL_QUERY, VIEWER_TOOL_POLYLINE
2828
from PySide6.QtCore import QObject
29-
from PySide6.QtWidgets import QFileDialog, QApplication
29+
from PySide6.QtWidgets import QFileDialog
3030
from PySide6.QtGui import QAction
3131
from osgeo import ogr
3232
from osgeo import osr
@@ -226,5 +226,5 @@ def action(actioncode, viewer):
226226
handler = CollectShapefile(viewer)
227227

228228
# make sure the object isn't garbage collected
229-
app = QApplication.instance()
230-
app.savePluginHandler(handler)
229+
viewer.plugins.append(handler)
230+

tuiview_plugins/gps_marker/gps_marker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def action(actioncode, viewer):
201201
handler = GPSMarker(viewer)
202202

203203
# make sure the object isn't garbage collected
204-
app = QApplication.instance()
205-
app.savePluginHandler(handler)
204+
viewer.plugins.append(handler)
205+
206206

207207

tuiview_plugins/location_broadcast/location_broadcast.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import time
2727
from tuiview import pluginmanager
2828
from PySide6.QtCore import QObject
29-
from PySide6.QtWidgets import QApplication
3029

3130
TMPDIR = os.getenv('TMP', '/tmp')
3231
if sys.platform == 'win32':
@@ -81,5 +80,4 @@ def action(actioncode, viewer):
8180
viewer.viewwidget.geolinkMove.connect(handler.onNewLocation)
8281

8382
# make sure the object isn't garbage collected
84-
app = QApplication.instance()
85-
app.savePluginHandler(handler)
83+
viewer.plugins.append(handler)

tuiview_plugins/qml_reader/__init__.py

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)