Skip to content

Commit

Permalink
[processing] fixed ‘add script from file’ tool
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed May 21, 2015
1 parent a58085b commit 4d62566
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/processing/script/AddScriptFromFileAction.py
Expand Up @@ -28,6 +28,7 @@
import os

from PyQt4.QtGui import QFileDialog, QIcon, QMessageBox
from PyQt4.QtCore import QSettings, QFileInfo

from processing.script.ScriptAlgorithm import ScriptAlgorithm
from processing.gui.ToolboxAction import ToolboxAction
Expand All @@ -50,13 +51,12 @@ def execute(self):
settings = QSettings()
lastDir = settings.value('Processing/lastScriptsDir', '')
filename = QFileDialog.getOpenFileName(self.toolbox,
self.tr('Script files', 'AddScriptFromFileAction'), None,
self.tr('Script files', 'AddScriptFromFileAction'), lastDir,
self.tr('Script files (*.py *.PY)', 'AddScriptFromFileAction'))
if filename:
try:
settings.setValue('Processing/lastScriptsDir',
QFileInfo(fileName).absoluteDir().absolutePath())

QFileInfo(filename).absoluteDir().absolutePath())
script = ScriptAlgorithm(filename)
except WrongScriptException:
QMessageBox.warning(self.toolbox,
Expand Down

1 comment on commit 4d62566

@luipir
Copy link
Contributor

@luipir luipir commented on 4d62566 May 21, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;)

Please sign in to comment.