Skip to content

Commit c804853

Browse files
committed
Update how to run locallly for developers
1 parent 8c90ef6 commit c804853

File tree

1 file changed

+44
-28
lines changed

1 file changed

+44
-28
lines changed

docs/GlowScriptDocs/local.html

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,51 +35,67 @@ <h1 class="Heading-1"> <font color="#0000A0">Running locally</font></h1>
3535
</div>
3636
<div class="Normal">
3737
<p class="Normal">When internet access is missing or poor, you may find it useful to run locally, independent of the internet. At <a href="https://vpython.org"><strong>vpython.org</strong></a>, in the section on using VPython without installing software, see the instructions for how to use GlowScript without an internet connection. Before going offline, use the download options at glowscript.org to get local copies of your programs.</p>
38-
<p class="Normal">Another option is to install Python and the VPython 7 module. At <a href="https://vpython.org"><strong>vpython.org</strong></a> see the section on using VPython with installed Python. As long as you don't import Python modules other than vpython, you will also be able to run the program at glowscript.org without having to make changes.</p>
38+
<p class="Normal">Another option is to install Python and the VPython 7 module. At <a href="https://vpython.org"><strong>vpython.org</strong></a> see the section on using VPython with installed Python. As long as you don't import Python modules other than vpython, you will also be able to run the program at glowscript.org without having to make changes. </p>
3939
<p class="Normal"><strong>* For developers</strong><br />
4040
If you want to be able to contribute to developing GlowScript, here are the (rather complex) steps required to be able to run locally with changes that you make to the GlowScript code, almost all of which is written in JavaScript (there is also some Python server code and some html code).</p>
4141
<p class="Normal"><strong>* Read an overview of the VPython architecture</strong><br />
4242
See <a href="https://vpython.org/contents/VPythonArchitecture.pdf" target="_blank">https://vpython.org/contents/VPythonArchitecture.pdf</a></p>
43-
<p class="Normal"><strong>* Install Python 2.7 (python.org).</strong> Google App Engine currently requires Python 2.7</p>
43+
<p class="Normal"><strong>* Install Python 2.7 (python.org).</strong> Google App Engine currently requires Python 2.7 </p>
44+
<p class="Normal"><strong>* Download the GlowScript source files</strong><br />
45+
At the glowscript repository on GitHub, <a href="https://github.com/vpython/glowscript" target="_blank">https://github.com/vpython/glowscript</a>, clone the repository, or click on &quot;Download ZIP&quot; and unpack the zip file into a new folder named glowscript. On Linux, place this folder parallel to the google_appengine folder. </p>
46+
<p class="Normal"><strong>* Install the Google Cloud SDK for Python</strong><br />
47+
At <a href="https://developers.google.com/appengine/downloads" target="_blank"><strong>developers.google.com/appengine/downloads</strong></a>. Choose Standard environment Python for your platform. Next, if you have not already installed the Google Cloud SDK (&quot;Software Development Kit&quot;), do this:<br>
48+
1)
49+
If you do not already have Pythnon 2.7 installed, click the Download button for &quot;Install Python version 2.7&quot;.<br>
50+
2)
51+
click the Download button for &quot;Install and initialize Google Cloud SDK&quot;.<br>
52+
3)
53+
In a command-line terminal, execute the gcloud statement.<br>
54+
4) If you intend to use GitHub, click &quot;Download and Install Git&quot;.<br>
55+
<br>
56+
If you had already installed the Google Cloud SDK, follow the instructions on the page for updating it. </p>
57+
<p class="Normal"><strong>* Using gcloud with Google App Engine</strong><br>
58+
At
59+
<a href="https://cloud.google.com/appengine/docs/python/" target="_blank"><strong>cloud.google.com/appengine/docs/python</strong></a> choose the Standard environment Python 2 Docs. Presumably you have already installed the Cloud SDK; follow the rest of the instructions, except that you need not install Git if you don't intend to use GitHub. You do need to execute &quot;gcloud components install app-engine-python&quot; to add Google App Engine support to the Cloud SDK.<br>
60+
<br>
61+
To run GlowScript, execute dev_appserver.py /..../glowscript/app.yaml, where the location of the GlowScript code is at /..../glowscript (on Windows, use backslashes instead of slashes). This starts up the Google App Engine machinery. Open a browser tab and enter &quot;localhost:8080&quot; to run.</p>
62+
<p class="Normal"><strong>* Testing your changes</strong><br />
63+
Suppose the current version of GlowScript is 2.7. Change the version number in a program to 2.8dev; that is, 0.1 greater than the current 2.7, plus dev. When you run the program, it will use your latest JavaScript changes. If you make further changes to the JavaScript code, just reload the program edit page to get the latest changes. <br />
64+
<br />
65+
If you want to remake/update the existing version 2.7, or create a new version 2.8, see MakingNewVersion.txt in the docs folder of the GlowScript GitHub repository. Note that use of the build program requires that there be an appropriate version of node in the build-tools folder.<br />
66+
<br />
67+
It is very useful to insert console.log(....) at critical points in the JavaScript code, which will generate output to the web page that is viewable if you turn on the browser developer console. On Chrome just press Ctrl-Shift-j. </p>
68+
<p class="Normal"><strong>* Save your test programs</strong><br />
69+
Updates to the Google software can have the effect that you lose the VPython programs you used for testing purposes. On Windows these programs are stored in C:\Users\YourName\AppData\Local\Temp\appengine.glowscript. On Mac, look for datastore.db in /private/var/folders/..... It is highly recommended that you keep a copy of the programs folder before updating the Google software.</p>
70+
<p class="Normal"><br>
71+
</p>
72+
</div>
73+
<div><br>
74+
<p class="Normal"></p>
75+
<p class="Normal"><em><strong>Important: The &quot;original App Engine SDK&quot; described below, with its graphical user interface, will no longer be available after July 30, 2020, at which time it will be necessary to use the &quot;gcloud&quot; mechanism documented above.</strong></em></p>
4476
<p class="Normal"><strong>* Install the Google App Engine SDK for Python</strong><br />
4577
At <a href="https://developers.google.com/appengine/downloads" target="_blank"><strong>developers.google.com/appengine/downloads</strong></a>, download the package for your platform. Choose Standard environment Python, then scroll down and click &quot;Download and install the original App Engine SDK for Python&quot;. If using Linux, unpack to a folder whose name will probably be google_appengine. <br>
46-
<br>
47-
<em>Important: This &quot;original App Engine SDK&quot; and its graphics user interface will be no longer available after July 30, 2020, so the way to install and use Google App Engine will change.</em><br>
4878
</p>
49-
<p class="Normal"><strong>* Download the GlowScript source files</strong><br />
50-
At the glowscript repository on GitHub, <a href="https://github.com/vpython/glowscript" target="_blank">https://github.com/vpython/glowscript</a>, clone the repository, or click on &quot;Download ZIP&quot; and unpack the zip file into a new folder named glowscript. On Linux, place this folder parallel to the google_appengine folder.</p>
5179
<p class="Normal"><strong>* On Windows and Mac</strong>, the Google App Engine installer includes an app &quot;Google APP Engine Launcher&quot; which simplifies launching GlowScript.<br />
5280
<br />
5381
On Windows, there will be a Google App Engine Launcher icon on your desktop, or in your Start menu. Run the app.<br />
54-
<br />
82+
<br />
5583
On Mac, drag the GoogleAppEngineLauncher out of the installer package (for example, drag it into the Applications folder), then double-click it. When asked, accept the offer to create some symlinks.<br />
56-
<br />
84+
<br />
5785
In the Launcher, choose File &gt; Add Existing Application and specify the glowscript folder. Make a note of the Port number. Click Add. In ide/api.py and untrusted/run.js, search for &quot;localhost:&quot; and adjust the port number to the number assigned by the launcher.<br />
58-
<br />
86+
<br />
5987
With the glowscript entry selected in the launcher, click the green Run button. When the Browse button lights up, click it, which will run your standard browser (which should be Chrome for best error reporting).<br />
60-
<br />
61-
Click Sign in, then click Login and use the name &quot;test&quot;. Write or import a program and check that it runs properly.</p>
88+
<br />
89+
Click Sign in, then click Login and use the name &quot;test&quot;. Write or import a program and check that it runs properly.</p>
6290
<p class="Normal"><strong>* On Ubuntu</strong>, in a terminal cd to the google_appengine folder and execute<br />
6391
python dev_appserver.py ../glowscript<br />
64-
<br />
92+
<br />
6593
Next open a browser, preferably an up-to-date version of Chrome (which gives the best error reporting).<br />
66-
<br />
94+
<br />
6795
Enter as a URL &quot;localhost:8080&quot;<br />
68-
<br />
69-
Click Sign in, then click Login and use the name &quot;test&quot;. <br />
70-
</p>
71-
<p class="Normal"><strong>* Testing your changes</strong><br />
72-
Suppose the current version of GlowScript is 2.7. Change the version number in a program to 2.8dev; that is, 0.1 greater than the current 2.7, plus dev. When you run the program, it will use your latest JavaScript changes. If you make further changes to the JavaScript code, just reload the program edit page to get the latest changes. <br />
73-
<br />
74-
If you want to remake/update the existing version 2.7, or create a new version 2.8, see MakingNewVersion.txt in the docs folder of the GlowScript GitHub repository. Note that use of the build program requires that there be an appropriate version of node in the build-tools folder.<br />
75-
<br />
76-
It is very useful to insert console.log(....) at critical points in the JavaScript code, which will generate output to the web page that is viewable if you turn on the browser developer console. On Chrome just press Ctrl-Shift-j.
77-
</p>
78-
<p class="Normal"><strong>* Save your test programs</strong><br />
79-
Periodically the Google App Engine launcher will
80-
recommend updating the launcher. When you do this, it is often the case that you will lose the VPython programs you used for testing purposes. On Windows these programs are stored in C:\Users\YourName\AppData\Local\Temp\appengine.glowscript. On Mac, look for datastore.db in /private/var/folders/..... It is highly recommended that you keep a copy of the programs folder before updating Google App Engine.</p>
81-
</div>
82-
<div> </div>
96+
<br />
97+
Click Sign in, then click Login and use the name &quot;test&quot;.</p>
98+
</div>
8399
<!-- InstanceEndEditable --></td>
84100
</tr>
85101
</table>

0 commit comments

Comments
 (0)