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@15585 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Mar 23, 2011
1 parent 0d53fc7 commit 91f7365911ebbc61d37dc0f2dbd89ef097e607ea
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 91f7365

Please sign in to comment.