@@ -349,14 +349,17 @@ def runScriptCode(self):
349
349
else :
350
350
try :
351
351
p = subprocess .Popen (['python' , filename ], shell = False , stdin = subprocess .PIPE , stderr = subprocess .PIPE , stdout = subprocess .PIPE )
352
- output = p .stderr .read ()
353
-
354
- if output :
352
+ traceback = p .stderr .read ()
353
+ out = p . stdout . read ()
354
+ if traceback :
355
355
print "## %s" % datetime .datetime .now ()
356
356
print "## Script error: %s" % name
357
- sys .stderr .write (output )
357
+ sys .stderr .write (traceback )
358
+ else :
359
+ print "## %s" % datetime .datetime .now ()
360
+ print "## Script executed successfully: %s" % name
361
+ sys .stdout .write (out )
358
362
del p
359
-
360
363
#execfile(unicode(filename))
361
364
except IOError , error :
362
365
print 'Cannot execute file %s. Error: %s' % (filename , error .strerror )
@@ -434,7 +437,6 @@ def save(self):
434
437
return
435
438
msgText = QCoreApplication .translate ('PythonConsole' ,
436
439
'Script was correctly saved.' )
437
- self .pc .updateTabListScript (self .path , action = 'append' )
438
440
self .pc .callWidgetMessageBarEditor (msgText )
439
441
# Rename the original file, if it exists
440
442
overwrite = os .path .exists (self .path )
@@ -451,7 +453,8 @@ def save(self):
451
453
fN = self .path .split ('/' )[- 1 ]
452
454
self .mw .setTabTitle (self , fN )
453
455
self .newEditor .setModified (False )
454
-
456
+ self .pc .updateTabListScript (self .path , action = 'append' )
457
+
455
458
def changeFont (self ):
456
459
self .newEditor .refreshLexerProperties ()
457
460
0 commit comments