Sarvi,

Kees knows *way* more about this than I do -- I am only a user --
and I see that he's answered your questions about what the
stuff in the pyjs subdirs is and the roles of pyjampiler,
pyjscompile, and pyjsbuild are.  I have provided some more
data based on my experience using pyjs, below ...

On 10/09/2013 04:16 PM, Sarvi Shanmugham wrote:
Thanks for the pointer. I had gone through that doc a couple of times
and still had some questions and hence i asked.

1. sand boxing
    I use virtualenv for sandboxing and has worked great. infact when
experimenting with making this work with pip,
thats what I am doing trying to make install work into a virtualenv
sandboxed python installation. So I suspect I can make this work
with virtualenv

There is no need for sandboxing if you are running pyjsbuild
on the python code you write for translation to javascript -- the
python code you write will never be run by a python interpreter,
so it should never be in any system.path.

2. pyjamas libraries and its replacements for sys and time and stuff.
    If this gets installed to override the standard libraries it will be
a problem. But from what I can tell, these can be installed
as pyjs.stdlib.sys/time/etc and when the compile/build script could
still do their little path magic to work with such an install.
Atleast thats what I am thinking of doing. Would love to know if this
has been tried or if there are any pitfalls I should be aware off.

Again, it makes no sense to install *any* pyjamas libraries -- they are
not intended to be run in a python interpreter.  All the "path magic"
is done when bootstrap.py creates 'pyjsbuild' -- after that, all you do
is run pyjsbuild whenever you change something in your app and it
re-generates the javascript for the app.

3. I see pyjs/pyjs/setup.py but I can't seem to get it to work and is
not documented in INSTALL.txt I only see bootstrap.py
approaches described.

To be honest, I have no idea what that setup.py is for --
I have used pyjs for almost 3 years now and have created
several applications, never having touched that setup.py.

4. I see this setup.py has entry points for sm and translate. i.e. it
will install commands called sm and translate into /usr/bin
Can't seem to figure out what their purpose would or if they should be
eliminated or ignored.

Maybe one of the developers can explain -- I have no idea.

5. I've tried both pyjscompile, which seems to be for a single file and
pyjsbuild for a whole suite of files. But not sure what pyjampiler is?

(Kees explained this.)
I have only used pyjsbuild and contrib/pyjscompressor, which calls
google's javascript "compiler" to compress the pyjs-generated
javascript.  It works great -- gets around 50% compression.

6. Not sure what the role of pgen/ and library/ directories are. Are
they part of the compiler or are they part of the widget library.

7. The last thing I am trying to do is to see how I can translate a
simple helloworld.py program into java script and run using the V8
command line interpreter.
Can't seem to figure out if I should use pyjampiler, pyjscompile or
pyjsbuild. I've tried them they seem to generating incomplete code as is
the case of
pyjscompile or too much more code relating to windows and stuff if I
used pyjsbuild. Has any one tried compiling a simple helloworld.py
program, translated
it into simple javascript and run it inside V8 interpreter as opposed to
the browser?

I have never done that.  As I say, I have always used pyjsbuild.  Its
output directory contains an html file named for the "main" module of
your app, which creates an iframe into which the results of the
"app.onModuleLoad()" call goes.  I don't know how to run the generated
javascript in the V8 interpreter but I would be interested in knowing,
if you get that to work.

HTH,
Steve

--

--- You received this message because you are subscribed to the Google Groups "Pyjs.org Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyjs-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to