Skip to content
Permalink
Browse files

[pyqgis-console] avoids IndexError when attempts to run unselected co…

…de by keybinding Ctrl+E
  • Loading branch information
slarosa committed Aug 30, 2013
1 parent 4db6396 commit b99d51d7cdd76bc87f350b3efae8b3505179724d
Showing with 11 additions and 10 deletions.
  1. +11 −10 python/console/console_sci.py
@@ -514,16 +514,17 @@ def dropEvent(self, e):

def insertFromDropPaste(self, textDP):
pasteList = unicode(textDP).splitlines()
for line in pasteList[:-1]:
cleanLine = line.replace(">>> ", "").replace("... ", "")
self.insert(unicode(cleanLine))
self.move_cursor_to_end()
self.runCommand(unicode(self.currentCommand()))
if pasteList[-1] != "":
line = pasteList[-1]
cleanLine = line.replace(">>> ", "").replace("... ", "")
self.insert(unicode(cleanLine))
self.move_cursor_to_end()
if pasteList:
for line in pasteList[:-1]:
cleanLine = line.replace(">>> ", "").replace("... ", "")
self.insert(unicode(cleanLine))
self.move_cursor_to_end()
self.runCommand(unicode(self.currentCommand()))
if pasteList[-1] != "":
line = pasteList[-1]
cleanLine = line.replace(">>> ", "").replace("... ", "")
self.insert(unicode(cleanLine))
self.move_cursor_to_end()

def insertTextFromFile(self, listOpenFile):
for line in listOpenFile[:-1]:

0 comments on commit b99d51d

Please sign in to comment.
You can’t perform that action at this time.