Skip to content

Commit 82f2726

Browse files
committed
ENH: remove useless QApplication and prefer to use QGIS_PREFIX_PATH
1 parent b88d92d commit 82f2726

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

python/plugins/processing/algs/otb/maintenance/OTBHelper.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,10 @@ def create_html_description():
695695
if __name__ == "__main__":
696696
# Prepare the environment
697697
from qgis.core import QgsApplication
698-
from qgis.PyQt.QtWidgets import QApplication
699-
app = QApplication([])
700-
QgsApplication.setPrefixPath("/usr", True)
698+
699+
app = QgsApplication([], True)
701700
QgsApplication.initQgis()
701+
702702
# Prepare processing framework
703703
from processing.core.Processing import Processing
704704
Processing.initialize()
@@ -719,4 +719,3 @@ def create_html_description():
719719

720720
# Exit applications
721721
QgsApplication.exitQgis()
722-
QApplication.exit()

python/plugins/processing/algs/otb/maintenance/README

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ export LD_LIBRARY_PATH=/path/to/OTB/install/lib/:$LD_LIBRARY_PATH
1818

1919
Set QGIS environment
2020
---------------------
21+
export QGIS_PREFIX_PATH=/path/to/QGIS/install
2122
export PYTHONPATH=:/usr/share/qgis/python/plugins:~/.qgis2/python/plugins:$PYTHONPATH
2223
# Set LD_LIBRARY_PATH
23-
export LD_LIBRARY_PATH=/path/to/QGIS/install/lib/:$LD_LIBRARY_PATH
24+
export LD_LIBRARY_PATH=$QGIS_PREFIX_PATH/lib/:$LD_LIBRARY_PATH
2425
# Add maintenance folder to python path
2526
export PYTHONPATH=/path/to/QGIS/src/python/plugins/processing/algs/otb/maintenance:$PYTHONPATH
2627

0 commit comments

Comments
 (0)