Skip to content

Commit

Permalink
ENH: remove useless QApplication and prefer to use QGIS_PREFIX_PATH
Browse files Browse the repository at this point in the history
(cherry picked from commit 82f2726)
  • Loading branch information
grizonnetm authored and alexbruy committed May 24, 2017
1 parent 1bcaca3 commit e6ca7f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions python/plugins/processing/algs/otb/maintenance/OTBHelper.py
Expand Up @@ -693,10 +693,10 @@ def create_html_description():
if __name__ == "__main__":
# Prepare the environment
from qgis.core import QgsApplication
from qgis.PyQt.QtWidgets import QApplication
app = QApplication([])
QgsApplication.setPrefixPath("/usr", True)

app = QgsApplication([], True)
QgsApplication.initQgis()

# Prepare processing framework
from processing.core.Processing import Processing
Processing.initialize()
Expand All @@ -717,4 +717,3 @@ def create_html_description():

# Exit applications
QgsApplication.exitQgis()
QApplication.exit()
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/otb/maintenance/README
Expand Up @@ -18,9 +18,10 @@ export LD_LIBRARY_PATH=/path/to/OTB/install/lib/:$LD_LIBRARY_PATH

Set QGIS environment
---------------------
export QGIS_PREFIX_PATH=/path/to/QGIS/install
export PYTHONPATH=:/usr/share/qgis/python/plugins:~/.qgis2/python/plugins:$PYTHONPATH
# Set LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/path/to/QGIS/install/lib/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$QGIS_PREFIX_PATH/lib/:$LD_LIBRARY_PATH
# Add maintenance folder to python path
export PYTHONPATH=/path/to/QGIS/src/python/plugins/processing/algs/otb/maintenance:$PYTHONPATH

Expand Down

0 comments on commit e6ca7f1

Please sign in to comment.