Wrapping wxWebKitCtrl

Hi Robin,

I've suddenly got a pretty immediate need to wrap wxWebKitCtrl for wxPython, and so I thought I'd ask you where I should add the wrapper. Is it a problem to just add it to html.i?

Thanks,

Kevin

Kevin Ollivier wrote:

Hi Robin,

I've suddenly got a pretty immediate need to wrap wxWebKitCtrl for wxPython, and so I thought I'd ask you where I should add the wrapper. Is it a problem to just add it to html.i?

I think it would make more sense as its own module, webkit.i.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

Thanks! One last question - this is Panther only. Do you know of any good way to get the OS X version number from Python? Or is it possible to place the .i file inside of #ifdef wxUSE_WEBKIT blocks?

Thanks,

Kevin

···

On Oct 15, 2004, at 6:23 PM, Robin Dunn wrote:

Kevin Ollivier wrote:

Hi Robin,
I've suddenly got a pretty immediate need to wrap wxWebKitCtrl for wxPython, and so I thought I'd ask you where I should add the wrapper. Is it a problem to just add it to html.i?

I think it would make more sense as its own module, webkit.i.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-dev-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-help@lists.wxwidgets.org

Kevin Ollivier wrote:

Hi Robin,

Thanks! One last question - this is Panther only. Do you know of any good way to get the OS X version number from Python? Or is it possible to place the .i file inside of #ifdef wxUSE_WEBKIT blocks?

Take a look at _joystick.i. Basically it has code inside of %{ %} that implements a dummy version of the class for the platforms that don't have it, and then defines the class like normal for SWIG. That way it will exist in all builds, but a NotImplementedError will be raised if anybody uses it on the platforms that don't have the real implementation. The joystick dummy uses an explicit message for not implemented, but there is also a wxPyRaiseNotImplemented() helper that will do a generic message. I use it in most other places that I need to do someting like this.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

Kevin Ollivier wrote:

Hi Robin,
Thanks! One last question - this is Panther only. Do you know of any good way to get the OS X version number from Python? Or is it possible to place the .i file inside of #ifdef wxUSE_WEBKIT blocks?

Take a look at _joystick.i. Basically it has code inside of %{ %} that implements a dummy version of the class for the platforms that don't have it, and then defines the class like normal for SWIG. That way it will exist in all builds, but a NotImplementedError will be raised if anybody uses it on the platforms that don't have the real implementation. The joystick dummy uses an explicit message for not implemented, but there is also a wxPyRaiseNotImplemented() helper that will do a generic message. I use it in most other places that I need to do someting like this.

Thanks! I should've known you'd have a trick for this. :wink: I've just committed the webkit wrappers, and have tried building both using the 'dummy' class and the real thing and both ways built without problems, so I think it's in good shape. Please let me know if I messed anything up! ;-/

Thanks,

Kevin

···

On Oct 18, 2004, at 10:32 AM, Robin Dunn wrote:

Hi,

Kevin Ollivier wrote:

Thanks! I should've known you'd have a trick for this. :wink: I've
just committed the webkit wrappers, and have tried building both
using the 'dummy' class and the real thing and both ways built
without problems, so I think it's in good shape. Please let me know
if I messed anything up! ;-/

vasek@wintermute wxPython $ PATH=/opt/wxPython-2.5/bin:$PATH python2.3
setup.py build_ext --inplace--debug UNICODE=1 BUILD_GLCANVAS=0
Found wx-config: /opt/wxPython-2.5/bin/wx-config
    Using flags: --toolkit=gtk2 --unicode=yes --version=2.5
Preparing CORE...
Traceback (most recent call last):
  File "setup.py", line 358, in ?
    USE_SWIG, swig_force, swig_args, swig_deps)
  File "/home/vasek/softlabs/wxpy/wxPython/config.py", line 374, in
run_swig
    copy_file(py_file, package, update=not force, verbose=0)
  File "/usr/lib/python2.3/distutils/file_util.py", line 118, in
copy_file
    raise DistutilsFileError, \
distutils.errors.DistutilsFileError: can't copy 'src/gtk/webkit.py':
doesn't exist or not a regularfile

Vaclav

···

--
PGP key: 0x465264C9, available from http://pgp.mit.edu/

Vaclav Slavik wrote:

distutils.errors.DistutilsFileError: can't copy 'src/gtk/webkit.py': doesn't exist or not a regularfile

It still needs to have SWIG run on all the platforms to make that file. I'll get to it later today.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

···

On Oct 19, 2004, at 12:09 PM, Robin Dunn wrote:

Vaclav Slavik wrote:

distutils.errors.DistutilsFileError: can't copy 'src/gtk/webkit.py': doesn't exist or not a regularfile

It still needs to have SWIG run on all the platforms to make that file. I'll get to it later today.

Sorry, of course I forgot to check in the generated files on Mac too. ^_^; Is this going to be a new test build?

Thanks,

Kevin

Hi,

Robin Dunn wrote:

> distutils.errors.DistutilsFileError: can't copy
> 'src/gtk/webkit.py': doesn't exist or not a regularfile

It still needs to have SWIG run on all the platforms to make that
file. I'll get to it later today.

I ran SWIG myself and it generated gtk/webkit.cpp that didn't compile
(a missing header), so there's some additional problem that I didn't
figure out.

Regards,
Vaclav

···

--
PGP key: 0x465264C9, available from http://pgp.mit.edu/

Kevin Ollivier wrote:

^_^; Is this going to be a new test build?

Not yet. I've still got the OSX package build script ripped to shreds...

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Vaclav Slavik wrote:

Hi,

Robin Dunn wrote:

distutils.errors.DistutilsFileError: can't copy
'src/gtk/webkit.py': doesn't exist or not a regularfile

It still needs to have SWIG run on all the platforms to make that
file. I'll get to it later today.

I ran SWIG myself and it generated gtk/webkit.cpp that didn't compile (a missing header), so there's some additional problem that I didn't figure out.

Update from CVS and try again.

BTW, as you discovered earlier, there are going to be some incompatibilities with the rest of CVS HEAD. I've currently got my workspaces stuck on the WX_2_5_3 tag, except for the wxPython sub-tree and a few other files where I've fixed critical bugs.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!