Skip to content

Commit

Permalink
[processing] fixed ‘add script from file’ tool
Browse files Browse the repository at this point in the history
(cherry picked from commit 4d62566)
  • Loading branch information
volaya authored and jef-n committed May 27, 2015
1 parent 11ebf21 commit 1c059c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/plugins/processing/script/AddScriptFromFileAction.py
Expand Up @@ -27,6 +27,8 @@

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
from processing.script.WrongScriptException import WrongScriptException
Expand All @@ -45,13 +47,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

0 comments on commit 1c059c7

Please sign in to comment.