Skip to content
Permalink
Browse files

fixed 6048 and 5952

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@314 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf
volayaf committed Jul 26, 2012
1 parent 7a5ca2d commit 333406821c3055eedabc01cc1728ba2b2ea6d3e5
@@ -246,7 +246,7 @@ def getOutputValue(self, name):

def getAsCommand(self):
'''Returns the command that would run this same algorithm from the console.
Should return null if the algorithm can be run from the console.'''
Should return null if the algorithm cannot be run from the console.'''
s="Sextante.runalg(\"" + self.commandLineName() + "\","
for param in self.parameters:
s+=param.getValueAsCommandLineParameter() + ","
@@ -292,15 +292,15 @@ def runAlgorithm(algOrName, onFinish, *args):
except:
print ("Unable to execute algorithm\n" + msg)
return

SextanteLog.addToLog(SextanteLog.LOG_ALGORITHM, alg.getAsCommand())

QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
if SextanteConfig.getSetting(SextanteConfig.USE_THREADS) and onFinish:
algEx = AlgorithmExecutor(alg)
progress = QProgressDialog()
progress.setWindowTitle(alg.name)
progress.setLabelText("Executing %s..." % alg.name)
progress.setLabelText("Executing %s..." % alg.name)
def finish():
QApplication.restoreOverrideCursor()
onFinish(alg)
@@ -325,6 +325,7 @@ def cancel():
UnthreadedAlgorithmExecutor.runalg(alg, SilentProgress())
if onFinish:
onFinish(alg)
QApplication.restoreOverrideCursor()
return alg

@staticmethod
@@ -28,25 +28,26 @@ def logFilename():

@staticmethod
def addToLog(msgtype, msg):
try: #it seems that this fails sometimes depending on the msg added:
#try: #it seems that this fails sometimes depending on the msg added:
#To avoid it stopping the normal functioning of the algorithm,
#we catch all errors, assuming that is better to miss some log info
#that breaking the algorithm.
if isinstance(msg, list):
a = "|".join(m.strip("\n") for m in msg)
text = unicode(a)
text = a
else:
text = unicode(msg).replace("\n", "|")
text = msg.replace("\n", "|")
line = msgtype + "|" + datetime.datetime.now().strftime("%a %b %d %Y %H:%M:%S") + "|" + text + "\n"
logfile = codecs.open(SextanteLog.logFilename(), "a", encoding='utf-8')
logfile = open(SextanteLog.logFilename(), "a")
#logfile = codecs.open(SextanteLog.logFilename(), "a", encoding='utf-8')
logfile.write(line)
logfile.close()
if msgtype==SextanteLog.LOG_ALGORITHM:
algname = text[len("Sextante.runalg(\""):]
algname = algname[:algname.index("\"")]
if algname not in SextanteLog.recentAlgs:
SextanteLog.recentAlgs.append(algname)
except:
#except:
pass


@@ -57,7 +58,8 @@ def getLogEntries():
algorithms=[]
warnings=[]
info=[]
lines = codecs.open(SextanteLog.logFilename(), encoding='utf-8')
#lines = codecs.open(SextanteLog.logFilename(), encoding='utf-8')
lines = open(SextanteLog.logFilename())
line = lines.readline()
while line != "":
line = line.strip("\n").strip()
@@ -4,8 +4,7 @@ Vector (v.*)
ParameterNumber|n|Number of points to be created|None|None|100
ParameterNumber|zmin|Minimum z height for 3D output|None|None|0.0
ParameterNumber|zmax|Maximum z height for 3D output|None|None|0.0
ParameterTableField|column|Column for Z values|z
ParameterBoolean|-z|Create 3D output|False
ParameterBoolean|-d|Use drand48() function instead of rand()|False
ParameterString|column|Column for Z values|z
*ParameterBoolean|-d|Use drand48() function instead of rand()|False
OutputVector|output|Name for output vector map

0 comments on commit 3334068

Please sign in to comment.
You can’t perform that action at this time.