GiWebKit backend (gobject-introspection)

496 views
Skip to first unread message

C Anthony Risinger

unread,
Aug 3, 2012, 6:44:01 AM8/3/12
to pyjs-...@googlegroups.com
this is brief because i need to go to bed, but i've got the gobject
backed running near flawlessly for simple examples, and only a couple
edge cases to get the heavier stuff running.

still need to add important bits, like XMLHTTP, but i'll be working on
it more this weekend. the good news is DOM handling is near 100%
perfect, and stuff like alerts are working as well.

... to try it out, build webkit 1.8.1 built with this patch:

https://github.com/downloads/pyjs/pyjs/bug77835.patch

thanks!

--

C Anthony

C Anthony Risinger

unread,
Aug 3, 2012, 5:38:10 PM8/3/12
to pyjs-...@googlegroups.com
since building webkit is sort of annoying, i've put my Archlinux
package here (sorry, x86_64 only):

https://github.com/downloads/pyjs/pyjs/libwebkit3-1.8.1-1-x86_64.pkg.tar.gz

... Archlinux users can simply install this package, checkout
`feature/giwebkit` branch, and try it out.

i don't want to spend time creating packages for
Ubuntu/Debian/{insert-here} at this point, but if your distribution is
recent enough (eg. binary compatible with *all* the dynamically linked
dependencies ... kind of alot), you can try this script:

https://github.com/downloads/pyjs/pyjs/giwebkit.sh

... which looks like:

# cat giwebkit.sh
================================================
#!/bin/bash

pkg_file=libwebkit3-1.8.1-1-x86_64.pkg.tar.gz
pkg_uri=https://github.com/downloads/pyjs/pyjs/${pkg_file}
git_uri=https://github.com/pyjs/pyjs.git

cd
mkdir -p .pyjd/
echo -e '[gui]\nengine = giwebkit' > ~/.pyjd/pyjdrc
mkdir giwebkit/
cd giwebkit/
git clone -b feature/giwebkit --depth=1 --single-branch ${git_uri}
curl -L ${pkg_uri} | tee ${pkg_file} | tar xz usr/lib
cd pyjs/
python2.7 bootstrap.py
cd examples/helloworld/

export GI_TYPELIB_PATH=~/giwebkit/usr/lib/girepository-1.0
export LD_LIBRARY_PATH=~/giwebkit/usr/lib
../../bin/pyjd Hello.py
================================================

... simply download the file, `chmod +x` it, and see what happens.
tbh, there isn't a great chance it will work outside of Arch, but the
above does work if all the right libraries are installed, or if your
on Arch and just want to try it without installing [replacing]
anything.

now, if you're really daring, you can just:

curl -L https://github.com/downloads/pyjs/pyjs/giwebkit.sh | bash

... and maybe it'll Just Work.

--

C Anthony

C Anthony Risinger

unread,
Aug 3, 2012, 7:53:20 PM8/3/12
to pyjs-...@googlegroups.com

On Aug 3, 2012 5:22 PM, "Lex Berezhny" <eukr...@gmail.com> wrote:
>
> lex@D830:~/projects/giweb/pyjs/examples/helloworld$ sudo ldconfig -v |
> grep webkit
>         libwebkitgtk-3.0.so.0 -> libwebkitgtk-3.0.so.0.13.2
>         libwebkitgtk-python-1.0.so.0 -> libwebkitgtk-python-1.0.so.0.2.0
>         libwebkitgtk-1.0.so.0 -> libwebkitgtk-1.0.so.0.13.1
>         libwebkitgtk-3.0.so.0 -> libwebkitgtk-3.0.so.0.13.1
>
>
> On Fri, Aug 3, 2012 at 6:15 PM, Lex Berezhny <eukr...@gmail.com> wrote:
> > Hmm, I added the LD_LIBRARY_PATH but it doesn't seem to be used:
> >
> >
> > lex@D830:~/projects/giweb/pyjs/examples/helloworld$ ls $LD_LIBRARY_PATH
> > girepository-1.0             libjavascriptcoregtk-3.0.so.0
> > libwebkitgtk-3.0.so    libwebkitgtk-3.0.so.0.13.2
> > libjavascriptcoregtk-3.0.so  libjavascriptcoregtk-3.0.so.0.13.2
> > libwebkitgtk-3.0.so.0  pkgconfig
> >
> > lex@D830:~/projects/giweb/pyjs/examples/helloworld$ ../../bin/pyjd Hello.py
> >
> > ** (Hello.py:28941): WARNING **: Failed to load shared library
> > 'libwebkitgtk-3.0.so.0' referenced by the typelib:
> > libwebkitgtk-3.0.soso: cannot open shared object file: No such file or
> > directory
> >
> > ** (Hello.py:28941): WARNING **: Failed to load shared library
> > 'libjavascriptcoregtk-3.0.so.0' referenced by the typelib:
> > libjavascriptcoregtk-3.0.soso: cannot open shared object file: No such
> > file or directory
> > Traceback (most recent call last):
> >   File "Hello.py", line 1, in <module>
> >     import pyjd # this is dummy in pyjs.
> >   File "/home/lex/projects/giweb/pyjs/pyjd/__init__.py", line 37, in <module>
> >     from giwebkit import *
> >   File "/home/lex/projects/giweb/pyjs/pyjd/giwebkit.py", line 125, in <module>
> >     WebKit = WebKit()
> >   File "/home/lex/projects/giweb/pyjs/pyjd/giwebkit.py", line 44, in WebKit
> >     tlc = (WebKit.DOMDocument, WebKit.DOMHTMLElement,
> >   File "/usr/lib/python2.7/dist-packages/gi/module.py", line 243, in __getattr__
> >     return getattr(self._introspection_module, name)
> >   File "/usr/lib/python2.7/dist-packages/gi/module.py", line 153, in __getattr__
> >     parent = get_parent_for_object(info)
> >   File "/usr/lib/python2.7/dist-packages/gi/module.py", line 73, in
> > get_parent_for_object
> >     return getattr(module, name)
> >   File "/usr/lib/python2.7/dist-packages/gi/module.py", line 243, in __getattr__
> >     return getattr(self._introspection_module, name)
> >   File "/usr/lib/python2.7/dist-packages/gi/module.py", line 154, in __getattr__
> >     interfaces = tuple(interface for interface in
> > get_interfaces_for_object(info)
> >   File "/usr/lib/python2.7/dist-packages/gi/module.py", line 83, in
> > get_interfaces_for_object
> >     interfaces.append(getattr(module, name))
> >   File "/usr/lib/python2.7/dist-packages/gi/module.py", line 243, in __getattr__
> >     return getattr(self._introspection_module, name)
> >   File "/usr/lib/python2.7/dist-packages/gi/module.py", line 180, in __getattr__
> >     wrapper = metaclass(name, bases, dict_)
> >   File "/usr/lib/python2.7/dist-packages/gi/types.py", line 232, in __init__
> >     register_interface_info(cls.__info__.get_g_type())
> > TypeError: must be an interface

This won't use ldconfig or any cache, the LD_* is meant to override the that and allow you to use the local copy.

Make sure you have libwebkit3 (gtk3). You're also missing the GI_TYPELIB_PATH is seems?

Does the script I linked work?

What does `ldd path/to/libwebkit.so` output?

I'm on road ATM (passenger ;-) so a bit hard to diagnose but I try.

--

C Anthony

C Anthony Risinger

unread,
Aug 3, 2012, 8:01:55 PM8/3/12
to pyjs-...@googlegroups.com

On Aug 3, 2012 6:53 PM, "C Anthony Risinger" <ant...@xtfx.me> wrote:
>
> Does the script I linked work?
>
> What does `ldd path/to/libwebkit.so` output?

File not found errors related to linker are usually signs of missing libraries -- `ldd` will show these missing libs, just make sure to export everything in the script.

--

C Anthony

Lex Berezhny

unread,
Aug 3, 2012, 8:03:43 PM8/3/12
to pyjs-...@googlegroups.com
lex@D830:~$ ldd projects/giweb/usr/lib/libwebkitgtk-3.0.so
linux-vdso.so.1 => (0x00007fffb49ff000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb2d321a000)
libjavascriptcoregtk-3.0.so.0 =>
/home/lex/projects/giweb/usr/lib/libjavascriptcoregtk-3.0.so.0
(0x00007fb2d2c5b000)
libenchant.so.1 => /usr/lib/libenchant.so.1 (0x00007fb2d2a4f000)
libgailutil-3.so.0 => /usr/lib/x86_64-linux-gnu/libgailutil-3.so.0
(0x00007fb2d2846000)
libgeoclue.so.0 => /usr/lib/libgeoclue.so.0 (0x00007fb2d2630000)
libdbus-glib-1.so.2 => /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2
(0x00007fb2d2408000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fb2d21c4000)
libgstapp-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstapp-0.10.so.0
(0x00007fb2d1fb8000)
libgstaudio-0.10.so.0 =>
/usr/lib/x86_64-linux-gnu/libgstaudio-0.10.so.0 (0x00007fb2d1d80000)
libgstfft-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstfft-0.10.so.0
(0x00007fb2d1b76000)
libgstinterfaces-0.10.so.0 =>
/usr/lib/x86_64-linux-gnu/libgstinterfaces-0.10.so.0
(0x00007fb2d1964000)
libgstpbutils-0.10.so.0 =>
/usr/lib/x86_64-linux-gnu/libgstpbutils-0.10.so.0 (0x00007fb2d1740000)
libgstvideo-0.10.so.0 =>
/usr/lib/x86_64-linux-gnu/libgstvideo-0.10.so.0 (0x00007fb2d1524000)
libgstbase-0.10.so.0 =>
/usr/lib/x86_64-linux-gnu/libgstbase-0.10.so.0 (0x00007fb2d12d1000)
libgstreamer-0.10.so.0 =>
/usr/lib/x86_64-linux-gnu/libgstreamer-0.10.so.0 (0x00007fb2d0fe9000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0
(0x00007fb2d0de5000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0
(0x00007fb2d0be3000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fb2d09da000)
libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007fb2d0352000)
libgdk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007fb2d00d4000)
libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0
(0x00007fb2cfeb1000)
libpangocairo-1.0.so.0 =>
/usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007fb2cfca5000)
libgdk_pixbuf-2.0.so.0 =>
/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007fb2cfa85000)
libcairo-gobject.so.2 =>
/usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007fb2cf87b000)
libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007fb2cf5bd000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007fb2cf36e000)
libsoup-2.4.so.1 => /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1
(0x00007fb2cf102000)
libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
(0x00007fb2cedb3000)
libxslt.so.1 => /usr/lib/x86_64-linux-gnu/libxslt.so.1 (0x00007fb2ceb78000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007fb2ce81c000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007fb2ce5bc000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb2ce3b8000)
libpangoft2-1.0.so.0 =>
/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007fb2ce18d000)
libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
(0x00007fb2cdf44000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6
(0x00007fb2cdca8000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
(0x00007fb2cda71000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
(0x00007fb2cd822000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fb2cd52d000)
libpng15.so.15 => not found
libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
(0x00007fb2cd289000)
libicui18n.so.49 => not found
libicuuc.so.49 => not found
libicudata.so.49 => not found
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1
(0x00007fb2cd07e000)
libXt.so.6 => /usr/lib/x86_64-linux-gnu/libXt.so.6 (0x00007fb2cce17000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fb2ccae3000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fb2cc8cc000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb2cc5cb000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb2cc2d1000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb2cbf14000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb2cbcfd000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb2d4de5000)
libicui18n.so.49 => not found
libicuuc.so.49 => not found
libicudata.so.49 => not found
liborc-0.4.so.0 => /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0
(0x00007fb2cba81000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007fb2cb871000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007fb2cb66b000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fb2cb459000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1
(0x00007fb2cb256000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007fb2cb04d000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1
(0x00007fb2cae42000)
libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1
(0x00007fb2cac3f000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1
(0x00007fb2caa3c000)
libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0
(0x00007fb2ca7b4000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007fb2ca58c000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0
(0x00007fb2ca388000)
libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0
(0x00007fb2ca17e000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fb2c9f60000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fb2c9d40000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fb2c9b24000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007fb2c98fe000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
(0x00007fb2c96fc000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0
(0x00007fb2c94e5000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1
(0x00007fb2c92df000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007fb2c90d4000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fb2c8ea9000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fb2c8ca1000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fb2c8a64000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007fb2c885b000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007fb2c8641000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fb2c843d000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fb2c8237000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fb2c8031000)
> --
>
>
>

C Anthony Risinger

unread,
Aug 3, 2012, 9:27:59 PM8/3/12
to pyjs-...@googlegroups.com

On Aug 3, 2012 7:03 PM, "Lex Berezhny" <eukreign@gmail.com> wrote:
>
> lex@D830:~$ ldd projects/giweb/usr/lib/

Damn ... I'm actually sort of surprised all the libs matched up so nicely ... neat :-)

You are missing a depend:

>         libicui18n.so.49 => not found
>         libicuuc.so.49 => not found
>         libicudata.so.49 => not found

... but this exact prob has happened to me before and should be a very easy fix.  I'm still not at comp but the GOOG suggests installing:

icu

... will fix it.  If already installed, but lower soname (.48 or lower) you'll need to rebuild that library and LD_LIBRARY_PATH load it (ie. like we are doing with WebKit) or LD_PRELOAD it ... should be fast/small and much easier than WebKit rebuild, but you likely can't install it systemwide because I think that package is actually Unicode support (or related/similar), and many packages will depend in current version.

So you'll probably need to rebuild it and pre load, or maybe pull a newer Ubuntu package and extract from there.

--

C Anthony

C Anthony Risinger

unread,
Aug 4, 2012, 6:35:17 AM8/4/12
to pyjs-...@googlegroups.com
On Fri, Aug 3, 2012 at 8:27 PM, C Anthony Risinger <ant...@xtfx.me> wrote:
ok forget it, it looked promising but since they both link to ...
*everything* ... it's less than trivial for me to rebuild on an Arch
machine. I'll do it in an Ubuntu VM when i can, but probably not
until i'm closer to completion.

if anyone else wants to build said deb package, i can certainly guide;
it's not too terrible.

alas ... icu and libpng are pretty low level, with only 1 dependency
each. i still think if you just build the correct versions (libpng 1.5
and icu 4.9), put them in usr/local (or ensure they are found via
LD_LIBRARY_PATH, etc), and everything will work fine. the end result
is webkit itself uses slightly different versions of icu and libpng
than it's dependencies, but that isn't necessarily a problem, and
should suffice for testing/evaluation until a rebuild is ready.

--

C Anthony

C Anthony Risinger

unread,
Aug 5, 2012, 7:25:22 AM8/5/12
to pyjs-...@googlegroups.com
On Fri, Aug 3, 2012 at 4:38 PM, C Anthony Risinger <ant...@xtfx.me> wrote:
> On Fri, Aug 3, 2012 at 5:44 AM, C Anthony Risinger <ant...@xtfx.me> wrote:
>> this is brief because i need to go to bed, but i've got the gobject
>> backed running near flawlessly for simple examples, and only a couple
>> edge cases to get the heavier stuff running.
>>
>> still need to add important bits, like XMLHTTP, but i'll be working on
>> it more this weekend. the good news is DOM handling is near 100%
>> perfect, and stuff like alerts are working as well.

DOM handling is 100% now, and save one or two very small quirks
(namely, window.location needs a small custom object) i am able to run
KitchenSink 100%! hooray!

i'll be working on XMLHTTP today/tomorrow (whichever == Sunday in your
head/timezone) ... after that it should serve as a full replacement
for any other runtime.

after XMLHTTP ill add Timer support -- SVG is not currently enabled in
GObject generated bindings, but by this point i'm pretty familiar with
the code so i may look into enabling it down the line.

once we are relatively stable i plan to fix the upstream patch,
hopefully before next release, and also dig into Firebreath as the
End-All-Be-All-Solution.

thanks,

--

C Anthony

C Anthony Risinger

unread,
Aug 10, 2012, 6:53:22 AM8/10/12
to pyjs-...@googlegroups.com
well it was super-incredible-too-much-effort, but i've created a PPA
for the Ubuntu crew:

https://launchpad.net/~xtfxme/+archive/pyjs

... add the PPA and update, or if you don't have libwebkit3 already, install:

libwebkitgtk-3.0-0

... then checkout `feature/giwebkit`.

i got slightly distracted fixing some hacky crap withe the way these
loaders are initialized (will be pushing an update tomorrow that 1/2
eliminates the "need" for bootstrap.py), and i've unfortunately
discovered that Luke sprinkled PyWebkitGTK hack all over the place
instead of using the override system proper ... ugh .. will be
remedying that ASAP.

regardless, i expect to merge the `feature/giwebkit` sometime this
weekend or early/mid next week at latest, once XMLHttpRequest is
finished. there is currently a problem with history (triggered
properly from app perspective but not actually doing the browser
part), and no Timers, but both of those will be corrected soon after,
and not significant enough to block what is already a remarkably
stable backend. there is also once or two bugs in pyjs that the
backend exposes but i've yet to fix.

so test it out, and report back bugs, because this will be replacing
both hulahop and pywebkitgtk ASAP.

--

C Anthony

Rene Maurer

unread,
Aug 11, 2012, 9:34:50 AM8/11/12
to pyjs-...@googlegroups.com
On 08/10/2012 at 05:08 C Anthony Risinger <ant...@xtfx.me> wrote:
>
> so test it out, and report back bugs, because this will be replacing
> both hulahop and pywebkitgtk ASAP.
>

I have just started some testing with the "feature/giwebkit" branch and
the "libwebkit3 ARCH package" you provide.

A very basic test application (a button with greet message) works fine
when i use

page = "Desktop.html"
host = "public"
pyjd.setup("%s/%s" % (host, page))

When i use (local webserver is running of course)

page = "Desktop.html"
host = "http://localhost:50000"
pyjd.setup("%s/%s" % (host, page))

the test application is still working bit i have the following
backtrace:

Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pyjd/giwebkit.py", line 347,
in _icon_loaded_cb
fp = urlopen(uri)
File "/usr/lib/python2.7/urllib.py", line 86, in urlopen
return opener.open(url)
File "/usr/lib/python2.7/urllib.py", line 207, in open
return getattr(self, name)(url)
File "/usr/lib/python2.7/urllib.py", line 291, in open_http
import httplib
File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 109, in
_import_hook
top_module = self._import_top_module(parts[0])
File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 217, in
_import_top_module
module = item.import_top(name)
File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 244, in
import_top
return self._import_one(None, name, name)
File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 295, in
_import_one
result = self.get_code(parent, modname, fqname)
File "/usr/lib/python2.7/site-packages/pyjd/importers.py", line 300,
in get_code
result = _fs_import(dir, modname, fqname)
File "/usr/lib/python2.7/site-packages/pyjd/importers.py", line 122,
in _fs_import
f = open(filenamec, 'rb')
IOError: [Errno 13] Permission denied: '/usr/lib/python2.7/httplib.pyc'


When i try to import (not start only import) my real world application
(which uses json rpc, timer etc), the backtrace ends with:

File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 329, in
_process_result exec code in module.__dict__
File
"/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/Calendar.py",
line 397, in <module> class DateField(Composite): File
"/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/Calendar.py",
line 399, in DateField img_base = pygwt.getImageBaseURL(True) File
"/home/rene/Local/python/pyjs/pyjs/library/pygwt.py", line 44, in
getImageBaseURL return getModuleBaseURL() + "images/" File
"/home/rene/Local/python/pyjs/pyjs/library/pygwt.py", line 28, in
getModuleBaseURL s = get_main_frame().getUri() AttributeError:
'NoneType' object has no attribute 'getUri'

HTH René

C Anthony Risinger

unread,
Aug 12, 2012, 4:03:02 AM8/12/12
to pyjs-...@googlegroups.com

Weird ... I had a similar issue ... I think it was done kind of Arch bug.  Check the permissions on your py/pyc files and I think you'll find some are owned by the wrong user/group and or have wrong permissions, such as 600 read-only to root.

Manually chmod/chown or reinstall python to fix.  I did the latter.

> When i try to import (not start only import) my real world application
> (which uses json rpc, timer etc), the backtrace ends with:
>
> File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 329, in
>  _process_result exec code in module.__dict__
>   File
>  "/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/Calendar.py",
>  line 397, in <module> class DateField(Composite): File
>  "/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/Calendar.py",
>  line 399, in DateField img_base = pygwt.getImageBaseURL(True) File
>  "/home/rene/Local/python/pyjs/pyjs/library/pygwt.py", line 44, in
>  getImageBaseURL return getModuleBaseURL() + "images/" File
>  "/home/rene/Local/python/pyjs/pyjs/library/pygwt.py", line 28, in
>  getModuleBaseURL s = get_main_frame().getUri() AttributeError:
>  'NoneType' object has no attribute 'getUri'

Did you import pyjd, very _first_ thing?

I'll check this out in AM right away.  I'll have JSONRPC working tomorrow I think but probably not timers ... I have 2-3 implementations in mind but haven't had time to confirm one yet.

Thanks Rene!

--

C Anthony

Rene Maurer

unread,
Aug 12, 2012, 8:43:27 AM8/12/12
to pyjs-...@googlegroups.com

On 08/12/2012 at 03:08 C Anthony Risinger <ant...@xtfx.me> wrote:
> On Aug 11, 2012 8:35 AM, "Rene Maurer" <rene...@gmail.com> wrote:
>>
>> IOError: [Errno 13] Permission denied:
>> '/usr/lib/python2.7/httplib.pyc'
>
> Weird ... I had a similar issue ...
> Manually chmod/chown or reinstall python to fix. I did the latter.

Reinstall python solves it.
Thanks.

> Did you import pyjd, very _first_ thing?

Yes.

It is just the "Calendar widget", which cannot be imported:

from pyjamas.ui.Calendar import DateField

Traceback (most recent call last):
File "DesktopTest.py", line 13, in <module>
from pyjamas.ui.Calendar import DateField
File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 140, in
_import_hook return importer._finish_import(top_module, parts[1:],
fromlist) File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line
253, in _finish_import bottom = self._load_tail(top, parts)
File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 349, in
_load_tail m = self._import_one(m, part, fqname)
File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 299, in
_import_one module = self._process_result(result, fqname)
File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 329, in
_process_result exec code in module.__dict__
File
"/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/Calendar.py",
line 397, in <module> class DateField(Composite): File
"/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/Calendar.py",
line 399, in DateField img_base = pygwt.getImageBaseURL(True) File
"/home/rene/Local/python/pyjs/pyjs/library/pygwt.py", line 44, in
getImageBaseURL return getModuleBaseURL() + "images/" File
"/home/rene/Local/python/pyjs/pyjs/library/pygwt.py", line 28, in
getModuleBaseURL s = get_main_frame().getUri() AttributeError:
'NoneType' object has no attribute 'getUri'

René

C Anthony Risinger

unread,
Aug 12, 2012, 5:40:18 PM8/12/12
to pyjs-...@googlegroups.com
hmm, and this works in pythonwebkit? no changes?

im having a hard time figuring out how this can possibly work in
either, until pyjd.setup() has been called.

pyjd.setup -> set_main_frame

... this might be a lower level bootstrapping issue, as this image uri
stuff was only recently changed:

https://github.com/pyjs/pyjs/commit/64299dbb4558fbd8d3b2772108675af9da70e2a3

... but this change was modeled after :

https://github.com/pyjs/pyjs/blob/master/library/pyjamas/ui/Calendar.py#L399

... the difference being that the latter sets the attribute on an
instance ... not the class (creation-time), which is much much later.
so, my guess is this change doesn't work for *any* of the
direct/native runners.

i'll cook a small patch to fix then you can try again.

--

C Anthony

C Anthony Risinger

unread,
Aug 12, 2012, 8:07:09 PM8/12/12
to pyjs-...@googlegroups.com
On Sun, Aug 12, 2012 at 4:40 PM, C Anthony Risinger <ant...@xtfx.me> wrote:
>
> i'll cook a small patch to fix then you can try again.

i've corrected this now, but the link itself may still break ... this
would have been a long-standing problem though and unrelated to the
current issue.

please test again!

thanks,

--

C Anthony

Rene Maurer

unread,
Aug 13, 2012, 6:13:54 AM8/13/12
to pyjs-...@googlegroups.com
Yes! yes! yes!

I have now:

from pyjamas.ui.Calendar import DateField :: Working.

from app import App :: Working.

Even more:

After (more than one year?!) i can start my real world application with
pyjd again! Of course there is a crash when calling GetXMLHttpRequest()
(as this is not yet working) but i can see the welcome screen :)

This is an enormous step forward for pyjd, the desktop version!

Thanks,

René

C Anthony Risinger

unread,
Aug 14, 2012, 4:34:14 AM8/14/12
to pyjs-...@googlegroups.com
hooray! that's fantastic news :-D

it seems i was a bit too optimistic in thinking i'd finish this
weekend (wedding to attend among other obligations ...) but i still
expect to wrap up GetXmlHttpRequest() in the next few days. the
Timer() stuff i think will be simple enough ... i just haven't
actually tried/confirmed yet.

so ... TBC ...

--

C Anthony

C Anthony Risinger

unread,
Aug 16, 2012, 6:52:09 AM8/16/12
to pyjs-...@googlegroups.com
woo hoo! we have 100% working Timers and Intervals.

it's implemented a little funky, [temporarily] relying on JS to create
the Timers, but still cancelled from python (i have
clearTimeout/clearInterval available, but not setTimeout/setInterval
... bug for sure).

however, i figured out a really badass/robust way to marshall
objects/data back and forth between python and JS ... so i may end up
implementing XmlHttpRequest this way too ... basically i add a single
node to the DOM, get a reference from BOTH python and JS, THEN
disconnect it -- the disconnected tree can still receive events and
stuff, is unlimited in size/structure, and ultimately functions like a
private channel between my objects. a little hacky, but still pretty
elegant IMO. eventually the gobject stuff will be fixed proper, but
it's not that critical for the time being.

note: the work needs to be cleaned up a bit so i have not yet pushed
to Github (100% working, but code needs to be moved elsewhere).
updates should be published tomorrow.

... so, all that remains now is XmlHttpRequest(), and i have a *very*
clear understanding of how to implement it ... TBC!

--

C Anthony

C Anthony Risinger

unread,
Aug 17, 2012, 4:39:55 AM8/17/12
to pyjs-...@googlegroups.com
Timers impl is feature complete and pushed to `feature/giwebkit`. if
someone can spare a few minutes, i'd be very grateful to receive some
feedback/tests on it (esp. regarding the TODO, see
library/pyjamas/Timer.giwebkit.py).

XmlHttpRequest() can now be focused on in entirety, as the final
obstacle; once this lands and i'm reasonably satisfied with it's
stability, it'll be about time to cut a release ... there have been
many many updates since May.

so, if there is anything you want to see in a 0.9.0 release (or
possibly `2012.09.01` if we do time-based versions), please open some
tickets and start some discussion!

thanks,

--

C Anthony

C Anthony Risinger

unread,
Aug 20, 2012, 7:36:32 AM8/20/12
to pyjs-...@googlegroups.com
On Fri, Aug 17, 2012 at 3:39 AM, C Anthony Risinger <ant...@xtfx.me> wrote:
>
> Timers impl is feature complete and pushed to `feature/giwebkit`. if
> someone can spare a few minutes, i'd be very grateful to receive some
> feedback/tests on it (esp. regarding the TODO, see
> library/pyjamas/Timer.giwebkit.py).
>
> XmlHttpRequest() can now be focused on in entirety, as the final
> obstacle;

Hooray!

i'm pleased to announce that with the latest push i am now able to run
a very non-trivial application without any apparant breakage (thanks
Lex for borrowing me said application ;-).

it was annoying, and i'm pretty sure i overlooked something that would
have made it 100x simpler, but i essentially implemented 90% of the
XMLHttpRequest Level 2 spec ... before realizing some hours later that
we only use the very basic, what amounts to Level 1 i guess ... oh
well.

instead of putzing around with JS/etc/etc i decided to just use
libsoup directly, which worked fantastic. i am able to acquire a ref
to the defualt soup session used by all of webkit, then simple make
network calls from that ... this is safe because they are part of the
same main loop. this also means i can probably implement timers
properly, as i forgot about the 127 other gobject-introspection
libraries at my disposal ...

anyways, history is still a little broken, XMLHttpRequest is
synchronous-only right now (not that you even notice locally though)
... there are no technical challenges remaining, only tedious
cleanup/polish.

so check it out! it's very fast, and nicely covers a lot of ground
(navigator object among many others) without any help from me -- the
dynamic alias system will Just Work as new features roll out -- aside
from window.location and XMLHttpRequest, i did not need to special
case anything else.

it needs some more days before merging, but it now implements
everything needed to start and RUN *any* app ... should this not be
the case, please LMK asap.

thanks!

--

C Anthony

Rene Maurer

unread,
Aug 22, 2012, 1:47:53 AM8/22/12
to pyjs-...@googlegroups.com
On 08/20/2012 at 06:08 C Anthony Risinger <ant...@xtfx.me> wrote:
>
> i'm pleased to announce that with the latest push i am now able to run
> a very non-trivial application without any apparant breakage (thanks
> Lex for borrowing me said application ;-).
>
>
> it needs some more days before merging, but it now implements
> everything needed to start and RUN *any* app ... should this not be
> the case, please LMK asap.

Fantastic, impressive!!!

I have no time to do really deep testing. But as far as i can see my
non-trival application (using timers, json rpc etc etc) runs without
any serious troubles! (i have an unicode exception in a dialog and i
assume some text colors must be defined in css ...as they are white
instead of black). I also have the impression that giwebkit is really
fast (at least faster than python webkit).

Great.
Thanks a lot.

René

C Anthony Risinger

unread,
Aug 23, 2012, 12:58:55 AM8/23/12
to pyjs-...@googlegroups.com
that's great to hear :-)

i'd be interested in hearing more about the unicode exception when you
get a chance (there is plenty to do, no rush there ...). the CSS
stuff is an semi-known issue ... i haven't investigated yet but i know
there are some naming conflicts happening there.

i'm looking into some other options for XMLHttpRequest, but should get
everything merged very soon, and can work from there.

--

C Anthony

Jim Washington

unread,
Aug 23, 2012, 6:13:16 AM8/23/12
to pyjs-...@googlegroups.com
OK. I want to play!

With much bitching and patching, I have now got WebKitGTK+ (1.8.1)
compiled with the patch from the first post in this thread. I'm on
Gentoo x86_64, so I have some somewhat incompatible tools in the kit,
and (autoreconf -fvi) was needed to get around the libtool version
mismatch. Then, I had to manually edit the "configure" file to remove a
syntax error in the FLEX check. Then, I needed a patch for the bison
thing (http://trac.webkit.org/changeset/124099/). It finally compiled
with --enable-introspection --disable-spellcheck.

I'm using the latest pyjs from git on feature/giwebkit branch, and I'm
getting "no module named gi" when I try to run "python Hello.py". I feel
I must have missed an incantation somewhere. The libwebkit3[...]gz link
in the second post in this thread has gone missing, and I was going to
look there for a hint.

I realize that I am whining that "this recipe doesn't work with *my*
oven", but a hint would be much appreciated, even "these are not the
codes you are looking for".

- Jim Washington



Rene Maurer

unread,
Aug 23, 2012, 7:42:31 AM8/23/12
to pyjs-...@googlegroups.com
On 08/22/2012 at 23:08 C Anthony Risinger <ant...@xtfx.me> wrote:
> On Wed, Aug 22, 2012 at 12:47 AM, Rene Maurer <rene...@gmail.com>
> wrote:
>>
>> I have no time to do really deep testing. But as far as i can see my
>> non-trival application (using timers, json rpc etc etc) runs without
>> any serious troubles! (i have an unicode exception in a dialog and i
>> assume some text colors must be defined in css ...as they are white
>> instead of black). I also have the impression that giwebkit is
>> really fast (at least faster than python webkit).
>
> i'd be interested in hearing more about the unicode exception when you
> get a chance (there is plenty to do, no rush there ...).

I have just tried the following snippets (embedded in my app):

This one works:
tb = TextBox()
tb.setText(u"oaueau")

This one doesn't:
tb = TextBox()
tb.setText(u"öäüéàè")

=> File
"/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/TextBoxBase.py",
line 113, in setText DOM.setAttribute(self.getElement(), "value",
str(text)) UnicodeEncodeError: 'ascii' codec can't encode characters in
position 0-11: ordinal not in range(128)

This one works again:
tb = TextBox()
tb.setText(u"öäüéàè".encode("utf-8"))


Besides....

I have to use pyjd explicitly to start the "desktop":

../../pyjs/bin/pyjd Desktop.py

When I use python I have:

python2 Desktop.py
Traceback (most recent call last):
File "Desktop.py", line 8, in <module>
import pyjd
File "/usr/lib/python2.7/site-packages/pyjd/__init__.py", line 5, in
<module> from pyjs.runners import RunnerManager
ImportError: No module named runners

"import pyjd" is the very first statement in Desktop.py. I have cleaned
everything and installed from scratch. So maybe I have just forgotten
something.

HTH René

C Anthony Risinger

unread,
Aug 23, 2012, 2:08:30 PM8/23/12
to pyjs-...@googlegroups.com
On Thu, Aug 23, 2012 at 5:13 AM, Jim Washington
<washing...@gmail.com> wrote:
>
> OK. I want to play!
>
> With much bitching and patching, I have now got WebKitGTK+ (1.8.1)
> compiled with the patch from the first post in this thread. I'm on
> Gentoo x86_64, so I have some somewhat incompatible tools in the kit,
> and (autoreconf -fvi) was needed to get around the libtool version
> mismatch. Then, I had to manually edit the "configure" file to remove a
> syntax error in the FLEX check. Then, I needed a patch for the bison
> thing (http://trac.webkit.org/changeset/124099/). It finally compiled
> with --enable-introspection --disable-spellcheck.

dang :-)

yeah, while the patch hasn't changed, i did add some of those things
to the Ubuntu build:

https://launchpad.net/~xtfxme/+archive/pyjs/+packages

(i can't seem to find a direct link to the file, but if you pull the
source and look at `debian/rules` it has similar stuff, like
autoreconf)

> I'm using the latest pyjs from git on feature/giwebkit branch, and I'm
> getting "no module named gi" when I try to run "python Hello.py". I feel
> I must have missed an incantation somewhere. The libwebkit3[...]gz link
> in the second post in this thread has gone missing, and I was going to
> look there for a hint.

yeah maybe i should have left the orignal up, but the version was
bumped to 1.8.2 in Arch so i uploaded a new revision:

https://github.com/downloads/pyjs/pyjs/libwebkit3-1.8.2-1-x86_64.pkg.tar.gz

.., but you can always just go here too:

https://github.com/pyjs/pyjs/downloads

> I realize that I am whining that "this recipe doesn't work with *my*
> oven", but a hint would be much appreciated, even "these are not the
> codes you are looking for".

i think you're about set -- you just need gobject-introspection python
libs now -- in Arch the package is `python2-gobject`, and Ubuntu it's
`python-gi` ... look for something like that. it should provide this
file:

/usr/lib/python2.7/site-packages/gi/__init__.py

... and everything else in that package.

--

C Anthony

C Anthony Risinger

unread,
Aug 25, 2012, 1:10:54 AM8/25/12
to pyjs-...@googlegroups.com
does this work in other runners? like the pywebkitgtk one?

i think this is a general python issue -- from my testing it's unrelated:

>>> 'öäüéàè'
'\xc3\xb6\xc3\xa4\xc3\xbc\xc3\xa9\xc3\xa0\xc3\xa8'
>>> u'öäüéàè'
u'\xf6\xe4\xfc\xe9\xe0\xe8'
>>> type('öäüéàè')
<type 'str'>
>>> type(u'öäüéàè')
<type 'unicode'>

... unless you `from __future__ import unicode_literals` in python
2.x, literal unicode is really a string of bytes (what would be a
`bytes` object in python3), hence no decode error.

however, a simple:

grep -R 'str(' library/

... shows very few places this is done; i think it would be OK to drop
the str() call here. can you verify removing the call to str() works
fine?

> Besides....
>
> I have to use pyjd explicitly to start the "desktop":
>
> ../../pyjs/bin/pyjd Desktop.py
>
> When I use python I have:
>
> python2 Desktop.py
> Traceback (most recent call last):
> File "Desktop.py", line 8, in <module>
> import pyjd
> File "/usr/lib/python2.7/site-packages/pyjd/__init__.py", line 5, in
> <module> from pyjs.runners import RunnerManager
> ImportError: No module named runners
>
> "import pyjd" is the very first statement in Desktop.py. I have cleaned
> everything and installed from scratch. So maybe I have just forgotten
> something.

have you installed from a recent build? i am trying to eliminate the
pyjd module altogether. this module was introduced here:

https://github.com/pyjs/pyjs/commit/a9e41c9c88c34dca10894d176dea268a19249a31

... my plan is to drop `pyjd` module altogether. it presence causes
complicated bootstrapping issues and tons of sys.path mangling, along
with being hard to modify/extend because a dummy module is required in
pyjs.

in the near future the "pyjd" module disappear, and be replaced by an
actual tool, say (hypothetical):

pyjs runner --backend="giwebkit" --root="/path/to/..." --fullscreen
/path/to/my/application.py

... as this will allow me to really clean up some cruft, drop pyjd
requirement from the JS side of things, and make the whole thing
simpler and more flexible.

--

C Anthony

Rene Maurer

unread,
Aug 25, 2012, 4:51:25 AM8/25/12
to pyjs-...@googlegroups.com
On 08/25/2012 at 00:08 C Anthony Risinger <ant...@xtfx.me> wrote:
> On Thu, Aug 23, 2012 at 6:42 AM, Rene Maurer <rene...@gmail.com>
> wrote:

>> This one doesn't:
>> tb = TextBox()
>> tb.setText(u"öäüéàè")
>>
>> => File
>> "/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/TextBoxBase.py",
>> line 113, in setText DOM.setAttribute(self.getElement(), "value",
>> str(text)) UnicodeEncodeError: 'ascii' codec can't encode
>> characters in position 0-11: ordinal not in range(128)
>>
>> This one works again:
>> tb = TextBox()
>> tb.setText(u"öäüéàè".encode("utf-8"))

> does this work in other runners? like the pywebkitgtk one?

Sorry I don't have a running pywebkitgtk version available right now. I
can test Reit next week.

> ... shows very few places this is done; i think it would be OK to drop
> the str() call here. can you verify removing the call to str() works
> fine?

I have modified ' library/pyjamas/ui/TextBoxBase.py:'

def setText(self, text):
# -OLD- DOM.setAttribute(self.getElement(), "value", str(text))
DOM.setAttribute(self.getElement(), "value", text)

Of course this works. IMHO it doesn't make sense to replace the other
calls to str()...

>> python2 Desktop.py
>> Traceback (most recent call last):
>> File "Desktop.py", line 8, in <module>
>> import pyjd
>> File "/usr/lib/python2.7/site-packages/pyjd/__init__.py", line 5,
>> in <module> from pyjs.runners import RunnerManager
>> ImportError: No module named runners
>>
>> "import pyjd" is the very first statement in Desktop.py. I have
>> cleaned everything and installed from scratch. So maybe I have just
>> forgotten something.
>
> have you installed from a recent build?

git clone https://github.com/pyjs/pyjs.git
git checkout feature/giwebkit

Still the same (no problem at all for me right now).


> say (hypothetical):
>
> pyjs runner --backend="giwebkit" --root="/path/to/..." --fullscreen
> /path/to/my/application.py

Nice!

René

C Anthony Risinger

unread,
Aug 26, 2012, 11:54:34 PM8/26/12
to pyjs-...@googlegroups.com
On Sat, Aug 25, 2012 at 3:51 AM, Rene Maurer <rene...@gmail.com> wrote:
> On 08/25/2012 at 00:08 C Anthony Risinger <ant...@xtfx.me> wrote:
>> On Thu, Aug 23, 2012 at 6:42 AM, Rene Maurer <rene...@gmail.com>
>> wrote:
>
>>> This one doesn't:
>>> tb = TextBox()
>>> tb.setText(u"öäüéàè")
>>>
>>> => File
>>> "/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/TextBoxBase.py",
>>> line 113, in setText DOM.setAttribute(self.getElement(), "value",
>>> str(text)) UnicodeEncodeError: 'ascii' codec can't encode
>>> characters in position 0-11: ordinal not in range(128)
>>>
>>> This one works again:
>>> tb = TextBox()
>>> tb.setText(u"öäüéàè".encode("utf-8"))
>
>> does this work in other runners? like the pywebkitgtk one?
>
> Sorry I don't have a running pywebkitgtk version available right now. I
> can test Reit next week.

no worries -- i am near positive it won't make any difference -- don't
bother :-)

>> ... shows very few places this is done; i think it would be OK to drop
>> the str() call here. can you verify removing the call to str() works
>> fine?
>
> I have modified ' library/pyjamas/ui/TextBoxBase.py:'
>
> def setText(self, text):
> # -OLD- DOM.setAttribute(self.getElement(), "value", str(text))
> DOM.setAttribute(self.getElement(), "value", text)
>
> Of course this works. IMHO it doesn't make sense to replace the other
> calls to str()...

yeah, i just meant "there doesn't appear to be a precedence of
converting to str()" ... i only intended on changing the one instance
affecting you (which i will do here in about 5 minutes, btw).

>>> python2 Desktop.py
>>> Traceback (most recent call last):
>>> File "Desktop.py", line 8, in <module>
>>> import pyjd
>>> File "/usr/lib/python2.7/site-packages/pyjd/__init__.py", line 5,
>>> in <module> from pyjs.runners import RunnerManager
>>> ImportError: No module named runners
>>>
>>> "import pyjd" is the very first statement in Desktop.py. I have
>>> cleaned everything and installed from scratch. So maybe I have just
>>> forgotten something.
>>
>> have you installed from a recent build?
>
> git clone https://github.com/pyjs/pyjs.git
> git checkout feature/giwebkit
>
> Still the same (no problem at all for me right now).

just to be clear: you've checkout out the `giwebkit` branch, then
installed to your system? can you just paste the commands here? (i've
never actually installed pyjs with pip/easy_install)

your error implies the `pyjs` package exists, and only the `runners`
package is missing suggesting perhaps an incomplete install. if you
can paste the commands used for a system install, this might be a good
time for me to try and fix the pypi package too.

lastly, do either of these files exist?

/usr/lib/python2.7/site-packages/pyjs/__init__.py
/usr/lib/python2.7/site-packages/pyjs/runners/__init__.py

thanks René!

--

C Anthony

Jim Washington

unread,
Aug 27, 2012, 7:33:57 AM8/27/12
to pyjs-...@googlegroups.com
CA - Thanks!

That was the missing incantation: emerged dev-python/pygobject. With the
proper environment variables set, it works (for me) as advertised.
Huzzah!

I see that you are working on the Timer thing. My installation is still
importing Timer.py instead of Timer.giwebkit.py.

I'll see what I can do to get dnd working. I need it for a project. I
know I can get it to work within a Window, but to do dnd between apps
will need some help in the infrastructure. Right now for dnd operations,
the attached mouse event is a DOMMouseEvent, which does not have a
dataTransfer member. I've tried recompiling with
--enable-data-transfer-items, but the compiler balks
(https://bugs.webkit.org/show_bug.cgi?id=94496) .

IMHO, the dnd implementation needs a real API, rather than expecting
arcane low-level knowledge from the pyjs programmer. So, this is an FYI
- DND implementation will have an API in the future. A quick patch for
the current webkitgtk problem (intra-Window, anyway) would be maybe
something like a dnd.getDNDEvent(event) method to wrap the event in
something providing .dataTransfer in the case that the .dataTransfer
attribute is not already present in the event object.

- Jim Washington


Reply all
Reply to author
Forward
0 new messages