Skip to content
Permalink
Browse files
Python console: do not run the last line of the pasted code.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15585 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Mar 23, 2011
1 parent e4ac6e9 commit fc7ca1709e97c7bd172cf3dddca28684f4f551b1
Showing with 6 additions and 3 deletions.
  1. +6 −3 python/console.py
@@ -272,9 +272,12 @@ def insertFromMimeData(self, source):
if source.hasText():
pasteList = QStringList()
pasteList = source.text().split("\n")
for line in pasteList:
self.insertPlainText(line)
self.runCommand(unicode(line))
# with multi-line text also run the commands
for line in pasteList[:-1]:
self.insertPlainText(line)
self.runCommand(unicode(line))
# last line: only paste the text, do not run it
self.insertPlainText(unicode(pasteList[-1]))

def entered(self):
self.cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor)

0 comments on commit fc7ca17

Please sign in to comment.