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