Skip to content

Commit a313077

Browse files
author
Philip Guo
committed
getting ready for demo release
1 parent 6128268 commit a313077

3 files changed

Lines changed: 28 additions & 10 deletions

File tree

‎v3/js/opt-frontend.js‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2929

3030
// Pre-reqs: pytutor.js and jquery.ba-bbq.min.js should be imported BEFORE this file
3131

32-
var backend_script = 'exec'; // URL of backend script, which must eventually call pg_logger.py
32+
33+
// backend scripts to execute (Python 2 and 3 variants, if available)
34+
var python2_backend_script = 'web_exec_py2.py';
35+
var python3_backend_script = 'web_exec_py3.py';
36+
37+
// uncomment below if you're running on Google App Engine using the built-in app.yaml
38+
//var python2_backend_script = 'exec';
39+
//var python3_backend_script = null;
3340

3441
var appMode = 'edit'; // 'edit' or 'visualize'
3542

@@ -157,6 +164,20 @@ $(document).ready(function() {
157164

158165
$("#executeBtn").attr('disabled', false);
159166
$("#executeBtn").click(function() {
167+
168+
var backend_script = null;
169+
if ($('#pythonVersionSelector').val() == '2') {
170+
backend_script = python2_backend_script;
171+
}
172+
else if ($('#pythonVersionSelector').val() == '3') {
173+
backend_script = python3_backend_script;
174+
}
175+
176+
if (!backend_script) {
177+
alert('Error: This server is not configured to run Python ' + $('#pythonVersionSelector').val());
178+
return;
179+
}
180+
160181
$('#executeBtn').html("Please wait ... processing your code");
161182
$('#executeBtn').attr('disabled', true);
162183
$("#pyOutputPane").hide();

‎v3/tutor.html‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,21 @@
164164
<button id="genUrlBtn" class="smallBtn" type="button">Generate URL</button> <input type="text" id="urlOutput" size="90"/>
165165
</p>
166166

167-
<p>To report a bug, click the 'Generate URL' button, paste the URL along
168-
with a brief error description in an email, and then send an email to
169-
philip@pgbovine.net</p>
167+
<p>To report a bug (or suggestion), click the 'Generate URL' button,
168+
paste the URL along with a brief error description in an email, and then
169+
send an email to philip@pgbovine.net</p>
170170

171171
<p>
172172

173173
Online Python Tutor supports <a
174174
href="http://www.python.org/doc/2.7/">Python 2.7</a> and <a
175175
href="http://www.python.org/doc/3.2/">Python 3.2</a> with limited module
176176
imports and no file I/O. It is designed for teaching programming, not
177-
for running or debugging production code.
177+
for running or debugging production code. The code is open source on <a
178+
href="https://github.com/pgbovine/OnlinePythonTutor/">GitHub</a>.
178179

179180
</p>
180181

181-
<p style="margin-top: 8px;"/>
182-
Check out the <a
183-
href="https://github.com/pgbovine/OnlinePythonTutor/">GitHub</a>
184-
repository and send bug reports, feedback, and suggestions to philip@pgbovine.net
185182

186183
<p style="margin-top: 8px;"/>
187184
Copyright &copy; 2010-2012 <a href="http://www.pgbovine.net/">Philip Guo</a>. All rights reserved.

‎v3/web_exec.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
# set to true if you want to log queries in DB_FILE
22-
LOG_QUERIES = True
22+
LOG_QUERIES = False
2323

2424
if LOG_QUERIES:
2525
import os, datetime, create_log_db, sqlite3

0 commit comments

Comments
 (0)