W dniu 12.07.2012 11:17, C Anthony Risinger pisze:
On Wed, Jul 11, 2012 at 8:44 AM, Łukasz Mach <lukasz.m...@pagema.net> wrote:
Hi,
What should I do to use external .py library (100% pure python, no native
code)?
Long time ago, I read somewhere, that pyjamas can use any library, if only
it's 100% python. So I wrote small library, made setup.py , installed
library (setup.py install), wrote pyjamas code which imports it, made
pyjsbuild on it and I noticed that it don't even try to build it.
So, am I wrong and I cannot use external library in such way or pyjsbuild
works wrong?
nah you can definately build your module/package, but the
pyjs-toolchain does not search the standard python.org module
directories -- you must copy (or symlink to) the module from a
directory pyjs *does* search. there are indeed modules shared between
the native and translated runtimes (eg. pretty much the whole ui.* is
example to this), but they reside in a known location internal to
pyjs, not in site-packages or equivalent.
simply copy the module to the same dir as the top-level module (ie.
the current directory usually), and start the build. you can also
use:
-I PATH, --search-path=PATH
additional paths appended to PYJSPATH
... to search more directories (similar to sys.path).
Would it be very bad idea to add site-packages to -I ? (by hand or by
default)?
--
pozdrawiam
Łukasz Mach - lukasz.m...@pagema.net