Skip to content

Commit

Permalink
[pyqgis-console] fix sharing snippets code via codepad
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed May 1, 2013
1 parent 36e613a commit d8fd259
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions python/console/console_editor.py
Expand Up @@ -345,18 +345,13 @@ def objectListEditor(self):
else:
listObj.show()
self.parent.pc.objectListButton.setChecked(True)

def codepad(self):
import urllib2, urllib
listText = self.selectedText().split('\n')
getCmd = []
for strLine in listText:
if strLine != "":
#if s[0:3] in (">>>", "..."):
# filter for special command (_save,_clear) and comment
if strLine[4] != "_" and strLine[:2] != "##":
strLine.replace(">>> ", "").replace("... ", "")
getCmd.append(unicode(strLine))
getCmd.append(unicode(strLine))
pasteText= u"\n".join(getCmd)
url = 'http://codepad.org'
values = {'lang' : 'Python',
Expand Down

0 comments on commit d8fd259

Please sign in to comment.