Skip to content

Commit 037f601

Browse files
committedFeb 25, 2013
[sextante] fixed wrong import
1 parent b1e7bf2 commit 037f601

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed
 

‎python/plugins/sextante/saga/SagaUtils.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
* *
1717
***************************************************************************
1818
"""
19-
from sextante.core.SextanteVectorWriter import SextanteVectorWriter
20-
from sextante.core.QGisLayers import QGisLayers
21-
import sextante
2219

2320
__author__ = 'Victor Olaya'
2421
__date__ = 'August 2012'
@@ -27,13 +24,17 @@
2724
__revision__ = '$Format:%H$'
2825

2926
import os
30-
from sextante.core.SextanteUtils import SextanteUtils
27+
import stat
28+
import traceback
3129
import subprocess
30+
from sextante.core.SextanteUtils import SextanteUtils
3231
from sextante.core.SextanteConfig import SextanteConfig
3332
from sextante.core.SextanteLog import SextanteLog
34-
import stat
3533
from qgis.core import *
3634
from PyQt4.QtCore import *
35+
from sextante.core.SextanteVectorWriter import SextanteVectorWriter
36+
from sextante.core.QGisLayers import QGisLayers
37+
3738

3839
class SagaUtils:
3940

@@ -147,12 +148,15 @@ def checkSagaIsInstalled(cls):
147148
outFeat.setAttributes(attrs)
148149
writer.addFeature(outFeat)
149150
del writer.writer
150-
del writer
151-
result = sextante.runalg("saga:thiessenpolygons", filename, None)
151+
del writer
152+
from sextante.core.Sextante import runalg
153+
result = runalg("saga:thiessenpolygons", filename, None)
152154
if not os.path.exists(result['POLYGONS']):
153155
return "It seems that SAGA is not correctly installed in your system.\nPlease install it before running SAGA algorithms."
154156
except:
155-
return "It seems that SAGA is not correctly installed in your system.\nPlease install it before running SAGA algorithms."
157+
s = traceback.format_exc()
158+
return "Error while checking SAGA installation. SAGA might not be correctly configured.\n" + s;
159+
156160

157161
settings.setValue("/SextanteQGIS/SagaInstalled", True)
158162

0 commit comments

Comments
 (0)
Please sign in to comment.