Show More
@@ -267,14 +267,18 b' class CodeMagics(Magics):' | |||
|
267 | 267 | print(e.args[0]) |
|
268 | 268 | return |
|
269 | 269 | |
|
270 |
post_data = urlencode( |
|
|
271 | "title": opts.get('d', "Pasted from IPython"), | |
|
270 | post_data = urlencode( | |
|
271 | { | |
|
272 | "title": opts.get("d", "Pasted from IPython"), | |
|
272 | 273 | "syntax": "python", |
|
273 | "content": code | |
|
274 | }).encode('utf-8') | |
|
274 | "content": code, | |
|
275 | } | |
|
276 | ).encode("utf-8") | |
|
275 | 277 | |
|
276 |
request = Request( |
|
|
277 | headers={"User-Agent": "IPython v{}".format(version)}) | |
|
278 | request = Request( | |
|
279 | "http://dpaste.com/api/v2/", | |
|
280 | headers={"User-Agent": "IPython v{}".format(version)}, | |
|
281 | ) | |
|
278 | 282 | response = urlopen(request, post_data) |
|
279 | 283 | return response.headers.get('Location') |
|
280 | 284 |
General Comments 0
You need to be logged in to leave comments.
Login now