Skip to content
Permalink
Browse files
[processing] fixed ‘add script from file’ tool
(cherry picked from commit 4d62566)
  • Loading branch information
volaya authored and jef-n committed May 27, 2015
1 parent 11ebf21 commit 1c059c7bd04a6076743d268c677d5a6c3f499c66
Showing with 4 additions and 3 deletions.
  1. +4 −3 python/plugins/processing/script/AddScriptFromFileAction.py
@@ -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
@@ -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,

0 comments on commit 1c059c7

Please sign in to comment.