[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] design flaw in python khtml DOM bindings
From: lkcl <lkcl () lkcl ! net>
Date: 2008-10-15 12:46:31
Message-ID: 19992772.post () talk ! nabble ! com
[Download RAW message or body]
Jim Bublitz wrote:
>
> On Tuesday 14 October 2008 14:21, Luke Kenneth Casson Leighton wrote:
>
> > the issue is that the wrapper objects aren't unique [don't return the
> > same python object for a given DOM c++ object], due to the underlying
> > c++ objects being typecast down to "Node*" (or Element*), and the use
> > of the khtml.DOM.* "casting" functions being inadequate for the job.
>
> It's a bug in twine - the PyKDE code generator. It should be generating
> code
> to cast factory-generated types to their actual type, and does for a
> variety
> of base classes (eg, QObject). DOM::Node is specified in the project file
> to
> have a %ConvertToSubClassCode block generated for it, but it appears twine
> is
> ignoring those for any base class declared in a namespace (works for
>
>
ahhh.
you are a star - thank you for letting me know that it's something that
people are aware of, and is even, by the sounds of it, on its way to being
fixed already.
> > i cannot express enough how much _not_ fixing this makes khtml
> > completely unusable.
>
> There were DOM applications written for PyKDE3, which also didn't do any
> promotion of factory-generated DOM::Node objects, and nobody indicated it
> was
> a problem there. Which is why it was never checked.
>
yeah - it's only if you want to retrieve the nodes that you're adding, keep
track of them (every single one created/added, in the case of the pyjamas
API), identify them uniquely and make comparison-tests (node1 == node2) that
you run into difficulties.
>
> Either way, it shouldn't be hard to fix. And then somebody (like people
> who
> need the feature and know how it should work) should write/contribute some
> test code to make sure it stays fixed.
>
>
_great_. it'd just be really exciting to have several different desktop
ports for the pyjamas API, to be able to demonstrate the point that it's
truly platform- and browser- _and- widget-set- independent.
so... yeah, i'd be more than happy to write some simple tests. it's really
easy/straightforward to demonstrate: should take about 30 lines of code.
l.
--
View this message in context: \
http://www.nabble.com/design-flaw-in-python-khtml-DOM-bindings-tp19982564p19992772.html
Sent from the PyQt mailing list archive at Nabble.com.
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic