|
@@ -34,11 +34,10 @@ |
|
|
import subprocess |
|
|
from processing.core.ProcessingConfig import ProcessingConfig |
|
|
from processing.core.ProcessingLog import ProcessingLog |
|
|
from processing.core.ProcessingUtils import ProcessingUtils |
|
|
from processing.tools.system import * |
|
|
import logging |
|
|
import xml.etree.ElementTree as ET |
|
|
import traceback |
|
|
from processing.core.QGisLayers import QGisLayers |
|
|
import qgis.core |
|
|
import PyQt4.QtGui |
|
|
|
|
@@ -56,15 +55,15 @@ def otbPath(): |
|
|
if folder == None: |
|
|
folder = "" |
|
|
#try to configure the path automatically |
|
|
if ProcessingUtils.isMac(): |
|
|
if isMac(): |
|
|
testfolder = os.path.join(str(QgsApplication.prefixPath()), "bin") |
|
|
if os.path.exists(os.path.join(testfolder, "otbcli")): |
|
|
folder = testfolder |
|
|
else: |
|
|
testfolder = "/usr/local/bin" |
|
|
if os.path.exists(os.path.join(testfolder, "otbcli")): |
|
|
folder = testfolder |
|
|
elif ProcessingUtils.isWindows(): |
|
|
elif isWindows(): |
|
|
testfolder = os.path.dirname(str(QgsApplication.prefixPath())) |
|
|
testfolder = os.path.dirname(testfolder) |
|
|
testfolder = os.path.join(testfolder, "bin") |
|
@@ -83,15 +82,15 @@ def otbLibPath(): |
|
|
if folder == None: |
|
|
folder ="" |
|
|
#try to configure the path automatically |
|
|
if ProcessingUtils.isMac(): |
|
|
if isMac(): |
|
|
testfolder = os.path.join(str(QgsApplication.prefixPath()), "lib/otb/applications") |
|
|
if os.path.exists(testfolder): |
|
|
folder = testfolder |
|
|
else: |
|
|
testfolder = "/usr/local/lib/otb/applications" |
|
|
if os.path.exists(testfolder): |
|
|
folder = testfolder |
|
|
elif ProcessingUtils.isWindows(): |
|
|
elif isWindows(): |
|
|
testfolder = os.path.dirname(str(QgsApplication.prefixPath())) |
|
|
testfolder = os.path.join(testfolder, "orfeotoolbox") |
|
|
testfolder = os.path.join(testfolder, "applications") |
|
|