Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[processing] add open script action to script editor
- Loading branch information
Showing
3 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4c24666
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the openScript function, should there be logic to handle the case where a user cancels out of the "Open script" dialog? Currently, the returned value from QFileDialog.getOpenFileName(...) is handed directly to self.filename, but if the user canceled out of the "Open script" dialog, then that returned value is an empty string (u''), which caused me to experience a python error a few lines down when attempting to open self.filename (which, in this case, would now be an empty string).
(Sorry for the comment here; I would have used the main QGIS Redmine bug tracker to report this, but the OSGeo account creation tool is down for maintenance today. Also, sorry for not just providing a proposed fix for this...there are probably multiple ways to resolve this, and I'm not confident about which approach would be more consistent with the rest of this plugin....try / except error handling, versus just putting some conditional logic to check the value returned from the file picker dialog before passing to self.filename?)