[Kde-bindings] PyKDE5: kconfig (was: PyKDE5 current status)

Simon Edwards simon at simonzone.com
Wed Apr 1 19:54:24 UTC 2015


[I'm moving this discussion on to kde-bindings too.]

On 2015-03-31 19:28, Luca wrote:
> Hello Simon,
> 
> In data martedì, 31 marzo 2015 08.23:27, hai scritto:
>> Hi,
>> 
>> On 2015-03-30 22:28, Luca wrote:
>> > thank you, I was able to build PyKDE5 against the new framework 5.8.0
>> > I had to modify the twine2 scripts (toolbox.py) in order to make it
>> > works.
>> > I encountered lot of issues that I had to fix manually with "//ig".
>> > I tried to build kauth without success, during compiling I god some
>> > strange
>> > errors with sip.
>> > I'm new to sip and fixing them is hard for me.
>> 
>> It sounds like you are making progress. :-) Just remember that PyKDE 
>> is
>> one of the biggest (counting classes etc) bindings projects on the
>> planet.
> 
> hehe, yes I saw, without your twine2 script is impossible to maintain 
> this
> package.
> 
>> > Everything fine, except the fact that I continue to have this error:
>> > <<< from PyKDE5.kcoreaddons import kaboutdata
>> >
>> > Traceback (most recent call last):
>> >   File "<stdin>", line 1, in <module>
>> >
>> > ImportError: No module named 'PyKDE5.typedefs'
>> 
>> mmm... May be something changed in later versions of SIP. What you 
>> could
>> try is to open up CMakeLists.txt and add a 'typedefs' module to the
>> build like the other normal modules. May be building a typedefs, even 
>> if
>> it is empty, is enough to get it working.
> 
> I tried to compile as new module, and now I get a different error:
> ImportError: dynamic module does not define init function 
> (PyInit_typedefs)
> 
> I'm modifying the kf5.py script to see if the typdefs.sip file is
> generated/updated correctly.
> I encountered other issues, that maybe you have an idea how to solve 
> them:
> 
> What is the meaning of this error?
> File:
> '/home/luca/Chakra/git/PyKDE5/git/frameworks/kconfig/src/core/kcoreconfigskeleton.h'
> Line: 323 Syntax error in input. Token type: LPAREN, token value: (, 
> lex
> state: variable
> 
> The involved line at 323 is:
>     typedef void (QObject::* NotifyFunction)(quint64 arg);
> 
> An other similar error is on kcoreaddons on plugins, kpluginloader.h 
> line 309
>     static QList<QObject *> instantiatePlugins(const QString 
> &directory,
>             std::function<bool(const KPluginMetaData &)> filter =
> std::function<bool(const KPluginMetaData &)>(),
>             QObject* parent = Q_NULLPTR);
> 
> Thank you for your support,
> If I'm able to fix those issues, I will push the changes upstream :-)

Hi Luca,

twine2 contains a half-assed C++ parser and this is probably an example 
of where it fails.

The kconfig stuff, IIRC is full of templates and it heavily dependent on 
C++ types and method overloading. Saving a JSON style data structure to 
disk is simple and easy in Python compared to kconfig. If we want to 
support kconfig in PyKDE5 then it may have to be done by hand and 
writing an interface to it which doesn't expose templates and has simple 
methods which include the data type in the name, and are thus easy to 
wrap for Python.

cheers,
Simon

-- 
Simon Edwards
simon at simonzone.com
Nijmegen, The Netherlands



More information about the Kde-bindings mailing list