Skip to content

Commit 4b8789c

Browse files
committed
Forcing change to python3 and force change on title
1 parent 34ac9b4 commit 4b8789c

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

v3/bottle_server.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
# compatibility from 2.x to 3.x Ii was running from /v3/).
1414

1515
from bottle import route, get, request, run, template, static_file
16-
import StringIO # NB: don't use cStringIO since it doesn't support unicode!!!
16+
#import StringIO # NB: don't use cStringIO since it doesn't support unicode!!!
17+
import io
1718
import json
1819
import pg_logger
1920
import urllib
20-
import urllib2
21+
#import urllib2
2122
import os
2223

2324
# dummy routes for testing only
@@ -39,15 +40,15 @@ def index(filepath):
3940

4041
@get('/exec')
4142
def get_exec():
42-
out_s = StringIO.StringIO()
43+
out_s = io.StringIO()
4344

4445
def json_finalizer(input_code, output_trace):
4546
ret = dict(code=input_code, trace=output_trace)
4647
json_output = json.dumps(ret, indent=None)
4748
out_s.write(json_output)
4849

4950
options = json.loads(request.query.options_json)
50-
51+
print(request.query.user_script)
5152
pg_logger.exec_script_str_local(request.query.user_script,
5253
request.query.raw_input_json,
5354
options['cumulative_mode'],
@@ -107,8 +108,8 @@ def submit_matrix_problem():
107108
values = {'user_script' : script}
108109

109110
data = urllib.urlencode(values)
110-
req = urllib2.Request(url, data)
111-
response = urllib2.urlopen(req)
111+
req = urllib.request.Request(url, data)
112+
response = urllib.request.urlopen(req)
112113
the_page = response.read()
113114
return the_page
114115

v3/js/pytutor.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,15 @@ ExecutionVisualizer.prototype.render = function() {
554554

555555
if (this.params.editCodeBaseURL) {
556556
// kinda kludgy
557-
var pyVer = '2'; // default
557+
var pyVer = '3'; // default
558558
if (this.params.lang === 'js') {
559559
pyVer = 'js';
560560
} else if (this.params.lang === 'ts') {
561561
pyVer = 'ts';
562562
} else if (this.params.lang === 'java') {
563563
pyVer = 'java';
564-
} else if (this.params.lang === 'py3') {
565-
pyVer = '3';
564+
} else if (this.params.lang === 'py2') {
565+
pyVer = '2';
566566
} else if (this.params.lang === 'c') {
567567
pyVer = 'c';
568568
} else if (this.params.lang === 'cpp') {
@@ -590,7 +590,7 @@ ExecutionVisualizer.prototype.render = function() {
590590
} else if (this.params.lang === 'java') {
591591
this.domRoot.find('#langDisplayDiv').html('Java');
592592
} else if (this.params.lang === 'py2') {
593-
this.domRoot.find('#langDisplayDiv').html('Python 2.7');
593+
this.domRoot.find('#langDisplayDiv').html('Python 3.3');
594594
} else if (this.params.lang === 'py3') {
595595
this.domRoot.find('#langDisplayDiv').html('Python 3.3');
596596
} else if (this.params.lang === 'c') {

0 commit comments

Comments
 (0)