Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 28
28
import os
29
29
30
30
from PyQt4 .QtGui import QFileDialog , QIcon , QMessageBox
31
+ from PyQt4 .QtCore import QSettings , QFileInfo
31
32
32
33
from processing .script .ScriptAlgorithm import ScriptAlgorithm
33
34
from processing .gui .ToolboxAction import ToolboxAction
@@ -50,13 +51,12 @@ def execute(self):
50
51
settings = QSettings ()
51
52
lastDir = settings .value ('Processing/lastScriptsDir' , '' )
52
53
filename = QFileDialog .getOpenFileName (self .toolbox ,
53
- self .tr ('Script files' , 'AddScriptFromFileAction' ), None ,
54
+ self .tr ('Script files' , 'AddScriptFromFileAction' ), lastDir ,
54
55
self .tr ('Script files (*.py *.PY)' , 'AddScriptFromFileAction' ))
55
56
if filename :
56
57
try :
57
58
settings .setValue ('Processing/lastScriptsDir' ,
58
- QFileInfo (fileName ).absoluteDir ().absolutePath ())
59
-
59
+ QFileInfo (filename ).absoluteDir ().absolutePath ())
60
60
script = ScriptAlgorithm (filename )
61
61
except WrongScriptException :
62
62
QMessageBox .warning (self .toolbox ,
0 commit comments