mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
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
This commit is contained in:
parent
0d53fc7ee5
commit
91f7365911
@ -272,9 +272,12 @@ class PythonEdit(QTextEdit, code.InteractiveInterpreter):
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user