Skip to content

Commit d839d78

Browse files
author
Philip Guo
committed
bah
1 parent 8ae34b4 commit d839d78

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎v3/opt-ipy.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#
2626
# python opt-ipy-server.py
2727
#
28-
# 2. Load this URL in your browser: http://localhost:8888/
28+
# 2. Load this URL in your browser:
29+
#
30+
# http://localhost:8888/
2931
#
3032
# 3. Start the IPython shell in this directory by running:
3133
#
@@ -39,6 +41,10 @@
3941
# IPython shell, it should immediately be visualized in your browser.
4042

4143

44+
# If you're hosting the server remotely, then change this address:
45+
POST_ADDR = "http://localhost:8888/post"
46+
47+
4248
import os, sys, urllib2, json
4349
import pg_logger
4450

@@ -115,7 +121,7 @@ def opt_pre_run_code_hook(self):
115121

116122
trace_json = self.meta.opt_history.run_str(last_cmd)
117123
#print trace_json
118-
urllib2.urlopen("http://localhost:8888/post", trace_json)
124+
urllib2.urlopen(POST_ADDR, trace_json)
119125

120126

121127
# clear global namespace and reset history
@@ -136,7 +142,7 @@ def opt_clear(self, params):
136142
ip.meta.opt_history = OptHistory() # just create a new one!
137143

138144
empty_msg = dict(code='', trace=[])
139-
urllib2.urlopen("http://localhost:8888/post", json.dumps(empty_msg))
145+
urllib2.urlopen(POST_ADDR, json.dumps(empty_msg))
140146

141147

142148
def load_ipython_extension(ipython):

0 commit comments

Comments
 (0)