Skip to content

Commit 1269f16

Browse files
author
Luke Leighton
committed
Merge branch 'master' of pyjs.org:pyjamas
2 parents 0befaa1 + 8dc8db7 commit 1269f16

File tree

108 files changed

+25806
-4092
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+25806
-4092
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@ output
1010
.*.sw?
1111
*.py~
1212

13-
/stdlib
1413
.idea
14+
/stdlib
15+
16+
/dev/parts
17+
/dev/eggs
18+
*PureMVC_Python*
19+

CREDITS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Daniel Carvalho - <[email protected]>
1616
Tobias Weber - <[email protected]>
1717
Daniel Popowich - <[email protected]>
1818
Lex Berezhny - <[email protected]>
19+
Pascal Chambon - <[email protected]>
20+
1921

2022
Other Contributors
2123

contrib/create_imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
"""Create imports for gwt to import from pyjamas in stead of gwt"""
16+
"""Create imports for gwt to import from pyjamas instead of gwt"""
1717

1818
import sys
1919
import os

copyright

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Copyright: 2011 Greg Warner <[email protected]>
8383
Copyright: 2011 Daniel Hopkins <[email protected]>
8484
Copyright: 2011 Lex Berezhny <[email protected]>
8585
Copyright: 2011 Anthon van der Neut <[email protected]>
86+
Copyright: 2011 Pascal Chambon <[email protected]>
8687
Copyright: 2012 Maho/Łukasz Mach <[email protected]>
8788
Copyright: 2012 Vsevolod Fedorov <[email protected]>
8889
Copyright: 2012 Michael Yang <[email protected]>

doc/pyjs_site/build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
# and buildout in order to make pyjsbuild
44

55
options="$*"
6-
if [ -z $options ] ; then options="-O -m";fi
7-
../../bin/pyjsbuild --print-statements $options index
6+
if [ -z $options ] ; then options="--strict -d --no-keep-lib-files --no-compile-inplace";fi
7+
python ../../bin/pyjsbuild.py --print-statements $options website
8+
cp -R output/* ../

doc/pyjs_site/public/developing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
<div id="content">
23

34
<h2>Source Code</h2>
@@ -169,4 +170,3 @@ <h2>Sources Overview</h2>
169170
</ul>
170171

171172
</div>
172-

doc/pyjs_site/public/documentation.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ <h2>Mailing List</h2>
4949
<a href="http://groups.google.com/group/pyjamas-dev">Legacy Mailing List</a>.
5050
</p>
5151

52+
5253
<dl>
5354
<dt>Subscribe:</dt>
5455
<dd>Send an e-mail to
Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
1-
<p>
2-
You should immediately stop trying to do too much, and eliminate pyjamas
3-
from the equation. Download
4-
<a href="http://lkcl.net/jsonrpclib.tgz">jsonrpclib.tgz</a> and add
5-
some python-based client-side code to the <i>server-side</i> testing.
6-
As you are a good web developer, who follows good code standard practices,
7-
this should have already occurred to you and it just temporarily slipped
8-
your mind that there should be an automated test suite based on something
9-
like jsonrpclib.tgz which you can use to <i>prove</i> to yourself that
10-
the JSONRPC server-side services of your app are absolutely perfect.
11-
You already considered the distinct advantages of being able to do
12-
automated tests such as pretending to be a user, interacting with the
13-
server-side forms, adding and deleting of records etc., but you had
14-
juuust not quite got round to doing that yet. well - now you have to.
15-
</p>
16-
<p>
17-
Once you have demonstrated to your satisfaction that there is nothing
18-
wrong with the JSONRPC services, you can then reintroduce Pyjamas,
19-
as a second client, into the equation. The difference between then
20-
and now is that you now <i>know</i> that there is nothing wrong with
21-
the JSONRPC services, server-side. So, anything that's wrong has to be
22-
something like you've specified the wrong URL in the use of the
23-
pyjamas.JSONService module. Check that the URL is the same as the
24-
one that you used in the client-side usage of the python jsonrpclib.
25-
</p>
26-
<p>
27-
You <b>have</b> to remember that you are using AJAX, with JSONRPC. So,
28-
the same standard rules apply: you can <b>not</b> access AJAX URLs
29-
other than those which match the URL from where the web browser downloaded
30-
the HTML and the Javascript. In other words, if your app is downloaded
31-
from http://fred.foo.com/myapp.html, then you can <b>not</b> put
32-
http://fred.foo.com:8080/jsonservice as the URL for the JSONRPC service,
33-
you can <b>not</b> put http://somewhere.else.com as the URL. It
34-
<b>has</b> to be http://fred.foo.com/somewhere.
35-
</p>
36-
<p>
37-
Welcome to the world where people used to use AJAX to do cross-site
38-
scripting attacks, downloading viruses and doing phishing attacks and
39-
other crap, but can't any more, and you, as a developer, have to pay
40-
for that.
41-
</p>
42-
1+
<p>
2+
You should immediately stop trying to do too much, and eliminate pyjamas
3+
from the equation. Download a jsonrpc client (eg. <a href="http://json-rpc.org/wiki/python-json-rpc">python-json-rpc</a>)
4+
and add some python-based client-side code to the <i>server-side</i> testing.
5+
As you are a good web developer, who follows good code standard practices,
6+
this should have already occurred to you and it just temporarily slipped
7+
your mind that there should be an automated test suite based on something
8+
like jsonrpclib.tgz which you can use to <i>prove</i> to yourself that
9+
the JSONRPC server-side services of your app are absolutely perfect.
10+
You already considered the distinct advantages of being able to do
11+
automated tests such as pretending to be a user, interacting with the
12+
server-side forms, adding and deleting of records etc., but you had
13+
juuust not quite got round to doing that yet. well - now you have to.
14+
</p>
15+
<p>
16+
Once you have demonstrated to your satisfaction that there is nothing
17+
wrong with the JSONRPC services, you can then reintroduce Pyjamas,
18+
as a second client, into the equation. The difference between then
19+
and now is that you now <i>know</i> that there is nothing wrong with
20+
the JSONRPC services, server-side. So, anything that's wrong has to be
21+
something like you've specified the wrong URL in the use of the
22+
pyjamas.JSONService module. Check that the URL is the same as the
23+
one that you used in the client-side usage of the python jsonrpclib.
24+
</p>
25+
<p>
26+
You <b>have</b> to remember that you are using AJAX, with JSONRPC. So,
27+
the same standard rules apply: you can <b>not</b> access AJAX URLs
28+
other than those which match the URL from where the web browser downloaded
29+
the HTML and the Javascript. In other words, if your app is downloaded
30+
from http://fred.foo.com/myapp.html, then you can <b>not</b> put
31+
http://fred.foo.com:8080/jsonservice as the URL for the JSONRPC service,
32+
you can <b>not</b> put http://somewhere.else.com as the URL. It
33+
<b>has</b> to be http://fred.foo.com/somewhere.
34+
</p>
35+
<p>
36+
Welcome to the world where people used to use AJAX to do cross-site
37+
scripting attacks, downloading viruses and doing phishing attacks and
38+
other crap, but can't any more, and you, as a developer, have to pay
39+
for that.
40+
</p>
41+
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
<p>
2-
Yep. Someone didn't bother to check that python-hulahop actually
3-
worked, in Ubuntu 9 before uploading it. You'll need to rebuild
4-
the python-hulahop package, from source:
5-
<pre>
6-
&gt;https://bugs.launchpad.net/ubuntu/+source/sugar-hulahop/+bug/390475
7-
&gt;
8-
&gt; Just to be clear I'm running from svn and it works on Ubuntu if you
9-
&gt; rebuild python-hulahop to get the python 2.6 bindings you don't need
10-
&gt; to set the python path to xulrunner.
11-
12-
nice one michael - thank you for investigating.
13-
</pre>
14-
15-
You can download a couple of .debs <a href="http://lkcl.net/pyjamas">here</a>
16-
for ubuntu 9, i386 architecture.
17-
</p>
1+
<p>
2+
Yep. Someone didn't bother to check that python-hulahop actually
3+
worked, in Ubuntu 9 before uploading it. You'll need to rebuild
4+
the python-hulahop package, from source:
5+
<pre>
6+
&gt;https://bugs.launchpad.net/ubuntu/+source/sugar-hulahop/+bug/390475
7+
&gt;
8+
&gt; Just to be clear I'm running from svn and it works on Ubuntu if you
9+
&gt; rebuild python-hulahop to get the python 2.6 bindings you don't need
10+
&gt; to set the python path to xulrunner.
11+
12+
nice one michael - thank you for investigating.
13+
</pre>
14+
15+
</p>
Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
<p>
2-
There are so many things you should be doing to determine the cause
3-
of "it ain't working" it's almost unreal. But before answering
4-
in more detail, it's important that you know what pyjamas is and
5-
is not. First off: pyjamas is a compiler, not a debugger. It's the
6-
equivalent of "gcc". Actually, if you know how gcc works, pyjsbuild
7-
is the equivalent of "gcc" and pyjscompile is the equivalent of,
8-
for example, "/usr/lib/gcc/x86_64-linux-gnu/4.3.3/cc1". In other
9-
words, gcc and pyjsbuild are the general-purpose "front-ends",
10-
and cc1 and pyjscompile are the actual nitty-gritty compilers.
11-
</p>
12-
<p>
13-
You <i>need</i> to be aware of this because you cannot expect pyjamas,
14-
a specialist compiler, to also take on the task of being the debugger,
15-
or to incorporate the tasks performed by tools such as pylint, or to be
16-
the virtual machine under which the javascript executes, or to be
17-
a javascript code-compressor, or to do any other task <i>other</i> than
18-
actual compiling.
19-
</p>
20-
<p>
21-
With that in mind, here are some things that you can do:
22-
<ul>
23-
<li /> Add the -d option to the build process: pyjsbuild -d {myapp.py}.
24-
It's the equivalent of adding "-g" to gcc.
25-
-d will enable a horrendous amount of extra output in the
26-
application, including actually placing the line numbers and
27-
module name into the javascript output, for each and every single
28-
line of code being executed (!) Also, a stacktrace will be
29-
recorded so that if there are any exceptions in your application,
30-
an Alert will come up with the full stacktrace (just like in
31-
"real" python applications).
32-
<li /> Watch the Javascript Console.
33-
<li /> Watch the Javascript Console.
34-
<li /> Watch the Javascript Console.
35-
<li /> Did we say, and emphasise enough, that you need to watch the Javascript
36-
Console?
37-
<li /> You need to watch the javascript console.
38-
<li /> You need to watch the javascript console because that is where
39-
runtime javascript errors are shown. Most web applications are written
40-
so badly that the errors are usually silently ignored by browsers,
41-
so as not to frighten users. As a developer, you cannot ignore
42-
the errors (not if you expect to actually be able to write an app,
43-
that is...)
44-
<li /> If you are using Firefox, install <i>both</i> Venkman <b>and</b>
45-
Firebug. You will need them both. Use them. get used to using them.
46-
<li /> If you are using IE, install the Script Debugger. use it.
47-
<li /> If you were debugging a c or c++ application, you would be using gdb.
48-
The javascript console, Firebug, Venkman, the Microsoft Script Debugger:
49-
these are all the equivalent of gdb. use them. You will suck at
50-
being a Web developer if you do not use these tools.
51-
<li /> Install <a href="http://pyjd.org">Pyjamas Desktop</a> and run your
52-
application under that.
53-
</ul>
54-
</p>
55-
<p>
56-
Overall, then, it's important to remember that pyjamas is a compiler,
57-
not an interpreter, not a debugger, syntax checker or anything else other
58-
than a compiler. This may be a bit of a shock if you are used to the
59-
python interpreter throwing helpful stack traces for you - which is what
60-
Pyjamas-Desktop is there for: it actually runs Pyjamas applications
61-
<i>as real python</i>, not as javascript.
62-
63-
</p>
64-
1+
<p>
2+
There are so many things you should be doing to determine the cause
3+
of "it ain't working" it's almost unreal. But before answering
4+
in more detail, it's important that you know what pyjamas is and
5+
is not. First off: pyjamas is a compiler, not a debugger. It's the
6+
equivalent of "gcc". Actually, if you know how gcc works, pyjsbuild
7+
is the equivalent of "gcc" and pyjscompile is the equivalent of,
8+
for example, "/usr/lib/gcc/x86_64-linux-gnu/4.3.3/cc1". In other
9+
words, gcc and pyjsbuild are the general-purpose "front-ends",
10+
and cc1 and pyjscompile are the actual nitty-gritty compilers.
11+
</p>
12+
<p>
13+
You <i>need</i> to be aware of this because you cannot expect pyjamas,
14+
a specialist compiler, to also take on the task of being the debugger,
15+
or to incorporate the tasks performed by tools such as pylint, or to be
16+
the virtual machine under which the javascript executes, or to be
17+
a javascript code-compressor, or to do any other task <i>other</i> than
18+
actual compiling.
19+
</p>
20+
<p>
21+
With that in mind, here are some things that you can do:
22+
<ul>
23+
<li /> Add the -d option to the build process: pyjsbuild -d {myapp.py}.
24+
It's the equivalent of adding "-g" to gcc.
25+
-d will enable a horrendous amount of extra output in the
26+
application, including actually placing the line numbers and
27+
module name into the javascript output, for each and every single
28+
line of code being executed (!) Also, a stacktrace will be
29+
recorded so that if there are any exceptions in your application,
30+
an Alert will come up with the full stacktrace (just like in
31+
"real" python applications).
32+
<li /> Watch the Javascript Console.
33+
<li /> Watch the Javascript Console.
34+
<li /> Watch the Javascript Console.
35+
<li /> Did we say, and emphasise enough, that you need to watch the Javascript
36+
Console?
37+
<li /> You need to watch the javascript console.
38+
<li /> You need to watch the javascript console because that is where
39+
runtime javascript errors are shown. Most web applications are written
40+
so badly that the errors are usually silently ignored by browsers,
41+
so as not to frighten users. As a developer, you cannot ignore
42+
the errors (not if you expect to actually be able to write an app,
43+
that is...)
44+
<li /> If you are using Firefox, install <i>both</i> Venkman <b>and</b>
45+
Firebug. You will need them both. Use them. get used to using them.
46+
<li /> If you are using IE, install the Script Debugger. use it.
47+
<li /> If you were debugging a c or c++ application, you would be using gdb.
48+
The javascript console, Firebug, Venkman, the Microsoft Script Debugger:
49+
these are all the equivalent of gdb. use them. You will suck at
50+
being a Web developer if you do not use these tools.
51+
<li /> Install Pyjamas Desktop (part of pyjamas)</a> and run your
52+
application under that.
53+
</ul>
54+
</p>
55+
<p>
56+
Overall, then, it's important to remember that pyjamas is a compiler,
57+
not an interpreter, not a debugger, syntax checker or anything else other
58+
than a compiler. This may be a bit of a shock if you are used to the
59+
python interpreter throwing helpful stack traces for you - which is what
60+
Pyjamas-Desktop is there for: it actually runs Pyjamas applications
61+
<i>as real python</i>, not as javascript.
62+
63+
</p>
64+

0 commit comments

Comments
 (0)