[Kde-bindings] twine2 (PyKDE5 code generator) parsing issues

Scott Kitterman kde at kitterman.com
Sat Apr 18 23:04:13 UTC 2015


On Sunday, April 19, 2015 12:48:07 AM Luca wrote:
> In data sabato, 18 aprile 2015 12.27:46, Scott Kitterman ha scritto:
> > On Friday, April 17, 2015 09:24:13 PM Luca wrote:
> > > Hello Scott,
> > > I did some tests and I was able to build easily kconfig.
> > > 
> > > The KCOREADDONS_DEPRECATED must be added to the qtkde5macros script. I
> > > attached a patch I created, so you have an idea what I did.
> > 
> > Thanks.  I committed your patch and extended it to cover this case as
> > well.
> > 
> > > For the other errors are very specific.
> > > I found for instance that pointer are not handled correctly, and throw
> > > an
> > > error.
> > > 
> > > Also this line is problematic:
> > > typedef void (QObject::* NotifyFunction)(quint64 arg);
> > > 
> > > Seems also that also this line is not handled:
> > > #ifndef KDE_NO_DEPRECATED
> > > I looked in pplexer.py but seems that the #ifndef definition is managed,
> > > don't know why this generates an error.
> > > 
> > > You are working on the official repository?
> > > I'm personally testing locally, I need this lib to port our SW to kf5 on
> > > Chakra linux.
> > 
> > Do you think these are problems in Sip, PyQt5, Qt, or Kf5?
> 
> I'm new to sip in general, so I don't know exactly where is the problem, but
> I suspect that is related to the parsing scripts in twine2 where some
> conditions are not handled correctly.
> I was wrong with my last email, I was only able to prepare the .sip files of
> the kconfig module. I figure out how to build it but seems that the python
> result is not correct and the python interpreter is not able to detect it.
> 
> To generate correct .sip file twine2 is not enough, in fact every time I had
> to:
> 1) call the twine2 script to generate the .sip file
> 2) modify the .c/.h sources if twine was not able to parse them, then repeat
> point 1) until all error are fixed
> 3) compile the .sip file
> 4) manually add the comments (//ig //force //end) to skip line that break
> compilation, then repeat point 3) again
> 
> Don't know if twine2 can be extended to improve this process, can be a huge
> work.

That seems to somewhat match the work flow that Simon Edwards described in his 
message that he was stepping down as PyKDE maintainer.  

I'm a KDE packager and a Python programmer so both sip and the C++ aspects of 
this are new to me.  I'm focusing on making kf5.py easier to use, so more 
people can contribute more easily, the sip bits I am pretty lost on right now.

If we can narrow down the problematic behaviors in twine2, then I think the 
fixes should be tractable.

If I skip kcoreaddons, then code is generated for all the modules that are 
defined in kf5.py, so that's something.  I diff'ed some of it and it seems very 
similar to what's in the PyKDE5 repository on projects.kde.org, so I think 
that things are ~working.

Scott K


More information about the Kde-bindings mailing list