Show More
@@ -15,7 +15,6 b'' | |||||
15 | # Stdlib |
|
15 | # Stdlib | |
16 | import inspect |
|
16 | import inspect | |
17 | import io |
|
17 | import io | |
18 | import json |
|
|||
19 | import os |
|
18 | import os | |
20 | import re |
|
19 | import re | |
21 | import sys |
|
20 | import sys | |
@@ -140,6 +139,8 b' class CodeMagics(Magics):' | |||||
140 | print e.args[0] |
|
139 | print e.args[0] | |
141 | return |
|
140 | return | |
142 |
|
141 | |||
|
142 | from urllib2 import urlopen # Deferred import | |||
|
143 | import json | |||
143 | post_data = json.dumps({ |
|
144 | post_data = json.dumps({ | |
144 | "description": opts.get('d', "Pasted from IPython"), |
|
145 | "description": opts.get('d', "Pasted from IPython"), | |
145 | "public": True, |
|
146 | "public": True, | |
@@ -150,7 +151,6 b' class CodeMagics(Magics):' | |||||
150 | } |
|
151 | } | |
151 | }).encode('utf-8') |
|
152 | }).encode('utf-8') | |
152 |
|
153 | |||
153 | from urllib2 import urlopen # Deferred import |
|
|||
154 | response = urlopen("https://api.github.com/gists", post_data) |
|
154 | response = urlopen("https://api.github.com/gists", post_data) | |
155 | response_data = json.loads(response.read().decode('utf-8')) |
|
155 | response_data = json.loads(response.read().decode('utf-8')) | |
156 | return response_data['html_url'] |
|
156 | return response_data['html_url'] |
General Comments 0
You need to be logged in to leave comments.
Login now