Hi all,<br>I am not sure if this is the rigth place to ask!<br><br>I created a small console to execute python command by using Qscintilla <br>python bindings but something doesnt work with MIME data.<br><br>My code is:<br>
<br>def fromMimeData(self, source):<br> if source.hasText():<br> pasteList = QStringList()<br> pasteList = source.text().split("\n")<br> if (len(pasteList) > 1):<br> self.move_cursor_to_end()<br>
for line in pasteList[:-1]:<br> self.append(line)<br> self.move_cursor_to_end()<br> self.runCommand(unicode(self.currentCommand()))<br> self.append(unicode(pasteList[-1]))<br>
self.move_cursor_to_end()<br><br>First question: when I paste some text in console and run command I get:<br><br>TypeError: invalid result type from PythonEdit.fromMimeData()<br><br>How I can avoid it?<br><br>
Second question: If in my console I typed some text ( e.g def blablabla(self): ) and then<br>I want edit it by replacing "self" with "source" by using paste command, the pasted text<br>is placed at the end of the current line and not between brace getting the following result:<br>
<br>def blablabla(self):source<br><br>Any idea on how I can solve it?<br><br>Regards, <br><br>- SL<br><br>-- <br>Salvatore Larosa<br>linkedIn: <a href="http://linkedin.com/in/larosasalvatore" target="_blank">http://linkedin.com/in/larosasalvatore</a><br>
twitter: @lrssvt<br>skype: s.larosa<br>IRC: lrssvt on freenode<br><br>