Skip to content

Commit 3334068

Browse files
author
volayaf
committed
fixed 6048 and 5952
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@314 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
1 parent 7a5ca2d commit 3334068

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

src/sextante/core/GeoAlgorithm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def getOutputValue(self, name):
246246

247247
def getAsCommand(self):
248248
'''Returns the command that would run this same algorithm from the console.
249-
Should return null if the algorithm can be run from the console.'''
249+
Should return null if the algorithm cannot be run from the console.'''
250250
s="Sextante.runalg(\"" + self.commandLineName() + "\","
251251
for param in self.parameters:
252252
s+=param.getValueAsCommandLineParameter() + ","

src/sextante/core/Sextante.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,15 @@ def runAlgorithm(algOrName, onFinish, *args):
292292
except:
293293
print ("Unable to execute algorithm\n" + msg)
294294
return
295-
295+
296296
SextanteLog.addToLog(SextanteLog.LOG_ALGORITHM, alg.getAsCommand())
297297

298298
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
299299
if SextanteConfig.getSetting(SextanteConfig.USE_THREADS) and onFinish:
300300
algEx = AlgorithmExecutor(alg)
301301
progress = QProgressDialog()
302302
progress.setWindowTitle(alg.name)
303-
progress.setLabelText("Executing %s..." % alg.name)
303+
progress.setLabelText("Executing %s..." % alg.name)
304304
def finish():
305305
QApplication.restoreOverrideCursor()
306306
onFinish(alg)
@@ -325,6 +325,7 @@ def cancel():
325325
UnthreadedAlgorithmExecutor.runalg(alg, SilentProgress())
326326
if onFinish:
327327
onFinish(alg)
328+
QApplication.restoreOverrideCursor()
328329
return alg
329330

330331
@staticmethod

src/sextante/core/SextanteLog.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,26 @@ def logFilename():
2828

2929
@staticmethod
3030
def addToLog(msgtype, msg):
31-
try: #it seems that this fails sometimes depending on the msg added:
31+
#try: #it seems that this fails sometimes depending on the msg added:
3232
#To avoid it stopping the normal functioning of the algorithm,
3333
#we catch all errors, assuming that is better to miss some log info
3434
#that breaking the algorithm.
3535
if isinstance(msg, list):
3636
a = "|".join(m.strip("\n") for m in msg)
37-
text = unicode(a)
37+
text = a
3838
else:
39-
text = unicode(msg).replace("\n", "|")
39+
text = msg.replace("\n", "|")
4040
line = msgtype + "|" + datetime.datetime.now().strftime("%a %b %d %Y %H:%M:%S") + "|" + text + "\n"
41-
logfile = codecs.open(SextanteLog.logFilename(), "a", encoding='utf-8')
41+
logfile = open(SextanteLog.logFilename(), "a")
42+
#logfile = codecs.open(SextanteLog.logFilename(), "a", encoding='utf-8')
4243
logfile.write(line)
4344
logfile.close()
4445
if msgtype==SextanteLog.LOG_ALGORITHM:
4546
algname = text[len("Sextante.runalg(\""):]
4647
algname = algname[:algname.index("\"")]
4748
if algname not in SextanteLog.recentAlgs:
4849
SextanteLog.recentAlgs.append(algname)
49-
except:
50+
#except:
5051
pass
5152

5253

@@ -57,7 +58,8 @@ def getLogEntries():
5758
algorithms=[]
5859
warnings=[]
5960
info=[]
60-
lines = codecs.open(SextanteLog.logFilename(), encoding='utf-8')
61+
#lines = codecs.open(SextanteLog.logFilename(), encoding='utf-8')
62+
lines = open(SextanteLog.logFilename())
6163
line = lines.readline()
6264
while line != "":
6365
line = line.strip("\n").strip()

src/sextante/grass/description/v.random.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Vector (v.*)
44
ParameterNumber|n|Number of points to be created|None|None|100
55
ParameterNumber|zmin|Minimum z height for 3D output|None|None|0.0
66
ParameterNumber|zmax|Maximum z height for 3D output|None|None|0.0
7-
ParameterTableField|column|Column for Z values|z
8-
ParameterBoolean|-z|Create 3D output|False
9-
ParameterBoolean|-d|Use drand48() function instead of rand()|False
7+
ParameterString|column|Column for Z values|z
8+
*ParameterBoolean|-d|Use drand48() function instead of rand()|False
109
OutputVector|output|Name for output vector map
1110

0 commit comments

Comments
 (0)