[PyKDE] Little bug in QTextStream

2006-10-16 Thread Simon Edwards

Hi Phil,

-
#!/usr/bin/env python

from PyQt4 import QtCore

def main():

f = QtCore.QFile(Stream_test.txt)
f.open(QtCore.QIODevice.WriteOnly)
 
stream = QtCore.QTextStream(f)
num = 80
stream  This is my number   num  .
f.close()

main()
---

Output is This is my number 1., while I had expected This is my number 
80..

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Multiple PyQt version in one Python installation

2006-11-04 Thread Simon Edwards
On Saturday 04 November 2006 21:38, Phil Thompson wrote:
 On Saturday 04 November 2006 7:47 pm, Simon Edwards wrote:
  This would be very useful for PyKDE and KDE 4. Phil, what do you think?
 Yuck. So, in the hypothetical case where a binary incompatibility is 
 introduced you then go through all your existing applications and change the 
 Python source code???

It only applies to code brings its own wrapper C+ classes. It would be the 
responsibility of the developer of the application to keep any 
explicit import sipX statements in sync with what they are using to compile 
their wrappers for their custom C++ classes.

 If you want module version dependencies then don't eggs give you what you 
 need?

From what little I just read about python eggs, it looks like it kind of does 
the things that I'm after. Would PyQt be able to fit into such a system? I'm, 
supporting multiple versions and all?

 Why do you think there is something called libsip that a C++ class is
 compiled  
 against?

sip.so. Point is, once a SIP wrapper for a custom C++ class is compiled it 
then depends on that particular version of sip. Trying to run a program that 
uses a PyQt compiled for sip version X, and uses a custom C++ class compiled 
for sip version Y, will fail. Python programs can't mix two versions of sip.

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Multiple PyQt version in one Python installation

2006-11-05 Thread Simon Edwards
On Sunday 05 November 2006 00:29, Phil Thompson wrote:
 On Saturday 04 November 2006 10:08 pm, Simon Edwards wrote:
  sip.so. Point is, once a SIP wrapper for a custom C++ class is compiled it
  then depends on that particular version of sip.
 No it doesn't.

Are you trying to tell me that if I compile a wrapper for a C++ class with sip 
version X, that that little python module for my C++ class, the little .so 
file I mean, doesn't depend on the version of sip used and will work at 
runtime with what ever version of sip the user has installed?

Or am I just not understanding what you are saying. I'm concerned with 
software distributed to users in compiled form.

 You can't mix two versions of SIP with different API major version numbers. 
 This was last changed to allow PyQt3 and PyQt4 to be installed side by side. 
 I do not anticipate it changing during the life of Qt4 (but I won't make a 
 commitment to that effect).

It is good to hear that it will probably not change. But should it happen, 
will it be possible to install both versions at the same time? like we can do 
with PyQt3 and PyQt4 today?

Just to make it clearer where I'm coming from, here is the scenario that I'm 
concerned with. Imagine it is a few years down the track, and people have 
been happily developing PyQt applications that also mixing C++ classes. 
Debian / Kubuntu / SUSE etc have a lots of these applications packaged and in 
their repositories. Outside the repositories, people have also created and 
distributed software packages. Everyone happy. But then sip gets updated and 
bumps the major version. Will everyone be forced to recompile all of the 
applications if they want to move to the new version of sip/PyQt? Or will it 
be possible to run the older stuff as is, alongside the new stuff? Like what 
we can do with PyQt3 and PyQt4.

Right now it sounds like that on the source code level everything works out 
fine, but for binaries it may not be possible to smoothly transition to a new 
major sip version. This could be a problem for distributions and end-users.

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Multiple PyQt version in one Python installation

2006-11-05 Thread Simon Edwards
On Sunday 05 November 2006 13:15, Phil Thompson wrote:
 I understand where you are coming from, and the situation you describe is 
 perfectly possible - and no different from hundreds of other open source 
 packages.

I don't think that is quite the case. The standard approach that distributions 
use for this kind of problem is to make it possible to install the old 
version along side the new one. This is very common for shared libraries for 
example.

 If you are using out of distro packages you expect to have to recompile them 
 from time to time. The most obvious example is if your distro updates it's 
 version of Python - you have to recompile your extension modules, whether 
 they are SIP based or not.

I am fairly sure that that is not how Debian handles Python these days. They 
phase in support for newer Python versions and modules, while maintaining the 
older packages for any software that needs them. Right I use Python 2.4 and I 
can also install packages for 2.3 or 2.5, and use the them at the same time.

 What I don't get it why SIP merits being singled out for special treatment.

The parallel installation trick doesn't work for SIP inside the same Python 
version.

The reason why I'm busying myself with this whole issue is because KDE 4 is 
coming and little has been communicated about Python and PyKDE in the KDE 
community. I've been talking to Jim about his plans for PyKDE, and once I've 
got some of the details worked out I'll be promoting PyKDE a bit to the 
KDE core developers and anyone else who will listen. :-)

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Multiple PyQt version in one Python installation

2006-11-06 Thread Simon Edwards
On Monday 06 November 2006 08:18, Andreas Pakulat wrote:
 On 05.11.06 19:20:00, Simon Edwards wrote:
  I don't think that is quite the case. The standard approach that
  distributions  
  use for this kind of problem is to make it possible to install the old 
  version along side the new one. This is very common for shared libraries
  for  
  example.
 And they also re-compile their apps against the newer version as soon as
 possible, so they can obsolete the old version and drop it. Because
 maintaining 2 or more versions of the same lib is a nightmare.

True. But as a user I can still install the new version along side the old 
one.

   If you are using out of distro packages you expect to have to recompile
   them  
   from time to time. The most obvious example is if your distro updates
   it's  
   version of Python - you have to recompile your extension modules,
   whether  
   they are SIP based or not.
  I am fairly sure that that is not how Debian handles Python these days.
 Actually it is.

but the old ones keep working. That's the point.

 Well, different Python versions and especially their extension modules
 are installed into totally different prefixes. 

 Lets say SIP version X is coming out and uncompatible with version Y
 (XY) then Debians python maintainers do one of two things:

 a) Prepare a new upload of sip (version X) to unstable, upload it and
 when it hits unstable recompile all the dependant modules, which
 currently is PyQt3/4 and PyKDE - AFAIK

That's the trick. Right now the list of dependant modules is very short and 
manageable and doesn't form a big problem. I'm thinking about the future 
where this list may be much longer and no longer manageable.

 This is no different than an upgrade of libstdc++ would work, if they
 change their ABI or even API. You can't install 2 versions of that
 either, because as soon as the basic libs (like Qt for
 Qt/KDE/PyKDE/PyQt apps) compile against it your applications will break
 and you have to recompile everything.

libstdc++ is a different case since it depends on so much stuff it is not 
practical to produce separate packages for applications that are compiled 
against different libstdc++ versions.

This is different than the situation for Python modules. They are packaged in 
separate packages which can be installed in parallel (e.g. python2.4-ldap and 
python2.5-ldap).

Mind you, looking in the package manager right now I can see 5 different 
versions of libstdc++ that I can install if need be.

 And when you compare the situation of PyQt3/PyQt4 to that of old/new sip
 version your comparing apples and pears. The proper comparison would be
 between 2 different versions of PyQt4, which cannot be installed
 together and you might have a similar problem there.

I _am_ talking about installing two different versions of PyQt. One compiled 
on sip API X and another with sip API X+1. I would like that to work as 
smoothly as PyQt3 and PyQt4.

I guess that at the end of the day it is not a urgent problem today. There are 
very few applications that use SIP, and if a developer needs to use optimise 
something they can use C and maybe the new 'ctypes' module in Python 2.5. 
This problem is something which developers and packagers need keep in the 
back of their mind so to speak.

Also if sip API versions become a problem for a distro, they could still 
combine a move to a new sip API version with a new Python version. I mean, 
have PyQt4 + sip API version X for Python 2.5, and but then for Python 2.6 
compile PyQt4 with sip API X+1. They would work out too. Python versions do 
come out regularly.

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] Plans for PyKDE in KDE 4

2006-11-09 Thread Simon Edwards

Hello all,

I've been talking to Jim Bublitz about plans for PyKDE in the up coming KDE 4. 
We, and I hope a lot of other people here, want PyKDE to be the best, most 
effective and most enjoyable way of developing KDE applications. The main 
change is that PyKDE will be developed in the KDE subversion repository, 
meaning that anyone is free to help develop, improve and test new versions of 
PyKDE.

I've put together this message below explaining these plans in more detail. 
Once everyone here has a had a chance to give feedback or make corrections as 
needed, then I'll be sending this message on to the kde-core-devel list, the 
Technical Working Group and the broader KDE community in general.

Feedback is appreciated.

(Jim, you might want to read the Platform and Versioning sections again).

cheers,
Simon Edwards

---

Background
~~
The Python bindings consist of a couple of parts. The binding tool SIP which 
is used to help generate the binding C++ code, PyQt, Python/Qt bindings which 
use SIP. Both are produced by Phil Thompson at Riverbank Computing[1] in the 
UK, and are available under the GPL or via a commercial closed source license 
which can be bought. This model is similar to Trolltech's of course. SIP/PyQt 
has been available and in commercial use since 1998 and support the same 
platforms as Qt itself.

PyKDE is a set of bindings like PyQt which targets KDE's libraries. It is 
produced and maintained by Jim Bublitz. PyKDE has also been mature for over 5 
years now.

One of the stumbling blocks for people wanting to try out PyKDE has been the 
non-trivial amount of parts of the PyQt/PyKDE stack that need to be compiled 
before one can begin programming KDE with Python. To help easy installation a 
copy of SIP, PyQt and PyKDE was put in the KDE's kde-bindings module for KDE 
3.3 and setup to compile as one piece.


Goals for KDE 4
~~~
The primary goal is to make sure that each version of KDE ships with complete 
and updated set of Python bindings. To do this we will move PyKDE development 
into the kde-bindings module in KDE's subversion repository. Jim Bublitz has 
traditionally developed PyKDE as a one man team, releasing the software 
releases and beta versions to the internet from his own workstation. Opening 
up development will allow those who want to help, to be able to work on PyKDE 
directly. This will also reduce dependency on Jim Bublitz. Although he has 
done an excellent job developing and maintaining PyKDE over the years in his 
free time, he is still one person who has other more important commitments 
too.

During KDE 3, extra support was developed for plugins in Python (David 
Boddie), and support for i18n, building and installation[2] (Simon Edwards). 
Open development in KDE's SVN will mean that these kinds of projects can be 
developed directly as a part of PyKDE; helping form a complete development 
environment.

Shipping PyKDE as part of a KDE release helps remove confusion about which 
version of PyKDE should be used with which version of KDE. This also helps 
simplify development and testing, since it no longer be necessary to test a 
release of PyKDE against multiple versions of KDE. (Each release of PyKDE has 
traditionally supported multiple versions of KDE).


Licensing
~
The core PyKDE 4 libraries will be LGPL licensed in conformance with KDE's 
licensing policy and the rest of KDE's libraries. Supporting programs such as 
code generators etc, may be GPL licensed.


Platform Support

All of the software components that PyKDE builds on, like Qt, Python, PyQt, 
etc support a large number of platforms. PyKDE has supported the same 
unix-like platforms that KDE has in the past. This makes it relatively 
straight forward to add support to PyKDE for the new platforms in KDE 4, such 
as WIN32.


Binary Compatibility  Versioning
~
Application programmers using Python rarely have to worry about binary 
compatibility. Python has had very good source level compatibility during the 
current 2.x series of releases.

Since people and distributions don't move to newer versions of Python at the 
same time, it will be necessary that PyKDE support the most popular versions 
of Python. For example, right now that would be 2.3, 2.4 and 2.5. Thankfully 
SIP handles this for the most part automatically.

There is one situation where the picture becomes more complex and that is for 
applications that use a mix of Python code and their own C++ classes. For 
example, an application that uses a C++ class for rendering a complex graph, 
but also uses PyKDE and Python for the rest of the GUI. The application 
developer is this case would use SIP to create their own bindings for their 
graph rendering C++ class.

People compiling and packaging mixed language applications need to keep in 
mind that a compiled SIP binding for a C++ class depends on the version

[PyKDE] Re: Plans for Python bindings in KDE 4

2006-11-24 Thread Simon Edwards

On Wednesday 15 November 2006 21:12, Simon Edwards wrote:
 Background
 ~~
 The Python bindings consist of a couple of parts. The binding tool SIP which 
 is used to help generate the binding C++ code, PyQt, Python/Qt bindings
 which  
 use SIP. Both are produced by Phil Thompson at Riverbank Computing[1] in the 
 UK, and are available under the GPL or via a commercial closed source 
license 
 which can be bought. This model is similar to Trolltech's of course.
 SIP/PyQt  
 has been available and in commercial use since 1998 and support the same 
 platforms as Qt itself.

Sebas was asking if there is an agreement with Riverbank like the one between 
the FreeQt foundation and Trolltech. i.e. what happens to SIP and PyQt if 
Riverbank go out of business. Currently there is no such agreement in place 
if Riverbank disappears. We could try organising one if people feel that it 
is necessary.

And also just to be clear, there are no plans to keep a copy of SIP or PyQt in 
KDE SVN like what has been done during in KDE 3.

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Re: Plans for Python bindings in KDE 4

2006-11-24 Thread Simon Edwards
On Friday 24 November 2006 19:04, Phil Thompson wrote:
 On Friday 24 November 2006 5:37 pm, Simon Edwards wrote:
  On Wednesday 15 November 2006 21:12, Simon Edwards wrote:
   Background
   ~~
   The Python bindings consist of a couple of parts. The binding tool SIP
   which is used to help generate the binding C++ code, PyQt, Python/Qt
   bindings which
   use SIP. Both are produced by Phil Thompson at Riverbank Computing[1] in
   the UK, and are available under the GPL or via a commercial closed
   source license
   which can be bought. This model is similar to Trolltech's of course.
   SIP/PyQt
   has been available and in commercial use since 1998 and support the same
   platforms as Qt itself.
 
  Sebas was asking if there is an agreement with Riverbank like the one
  between the FreeQt foundation and Trolltech. i.e. what happens to SIP and
  PyQt if Riverbank go out of business. Currently there is no such agreement
  in place if Riverbank disappears. We could try organising one if people
  feel that it is necessary.
 
  And also just to be clear, there are no plans to keep a copy of SIP or
  PyQt 
  in KDE SVN like what has been done during in KDE 3.
 Didn't that agreement pre-date the GPL version of Qt? I don't see what the 
 purpose of such an agreement would be given the code is available under the 
 GPL.

That agreement does pre-date the GPL version, and is still in effect and 
relevant. It was updated in May 2004 incidentally. What the agreement 
basically says is that if Trolltech stop releasing the Free Edition (=GPL 
version) of Qt for more than 12 months, then the last version becomes BSD 
licensed. The effect of this is that companies will always be able to build 
non-GPL software on top of Qt and KDE[1] either by buying a Qt license from 
Trolltech, or using the BSD version.

[1] KDE's libraries are LGPL.

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Re: Plans for Python bindings in KDE 4

2006-11-25 Thread Simon Edwards
On Saturday 25 November 2006 00:30, Phil Thompson wrote:
 That makes no sense at all. You're saying that the situation that the 
 agreement covers is if Trolltech continues to develop the commercial version 
 but stops developing the GPL version. Which means that the position of 
 the free community doesn't significantly change, but the commercial 
 community now have the choice of continuing to pay license fees or taking a 
 chance with the free BSD fork.

The main scenario so to speak, is if Trolltech goes bankrupt or is bought out 
by a FOSS unfriendly company. But yes, that is what the agreements says.

 As I see it, the only group with any possible concern is the commercial
 users  
 who have the same issues with any proprietary package they use.

This also concerns KDE. If something happens to Qt, then the KDE project won't 
be able to promote the use of KDE as a platform for free software and 
*commercial* development. Yes, this is the same issue that comes with any 
proprietary package, but if disaster strikes Qt then it has rather dramatic 
consequences for KDE. This agreement is in place to project KDE's interests.

You can read the agreement for yourself. It is a fairly short and straight 
forward document:

http://www.kde.org/whatiskde/kdefreeqtfoundation.php

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Re: Plans for Python bindings in KDE 4

2006-11-28 Thread Simon Edwards
On Tuesday 28 November 2006 15:04, Olaf Schmidt wrote:
 All Qt 4.x release will be binary compatible with earlier Qt 4.y releases,
 so  
 couldn't we simply continue using the old bindings if Riverbank should ever 
 stop to realise new GPL-licensed Python bindings?

yes,

 If we wish to use features  
 of new Qt versions, then we might have to update the bindings ourselves, of 
 course, but my impression is that an agreement with Riverbank would not be
 as  
 important as with Trolltech.

you are probably right here.

 But what about new Python versions - could there be incompatible updates of 
 the language itself?

The bindings use the Python interpreter's module API (a.k.a. the C API). 
This API is not part of the language spec itself per se. It is sometimes 
changed between major releases, breaking backwards compatibility in small 
ways. (read: usually trivial to fix).

As for the Python language itself, it maintains compatibility between releases 
in 99.9% of cases. This is true except for the up coming Python 3000 
release/series, due sometime in 2008. This (very) major release will clean up 
the language and break source level compatibility.

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] kdedistutils and --prefix

2006-12-04 Thread Simon Edwards
On Monday 04 December 2006 15:32, Marcos Dione wrote:
 I've been using kdeextensions' kdedistutils to install a program. I
 use executable_links as this:
 
 [...]
 executable_links = [('psync','psy.py')],
 [...]
 then I run setup.py like this:
 
 $ python setup.py 
install --prefix=/home/mdione/src/projects/psync/src/trunk/debian/tmp/usr
 
 (it's really a debian package being built). the problem is that
 executable_links seems to be ignoring --prefix, as I get this:
 
 [...]
 running install_lib
 [...]
 
byte-compiling 
/home/mdione/src/projects/psync/src/trunk/debian/tmp/usr/lib/python2.4/site-packages/psync/utils.py
 
to utils.pyc
 running install_executable_links
 symlinking /usr/bin/psync - /usr/share/apps/psync/psy.py
 error: Permission denied
 [...]

It has been a while since I've messed with distutils, but I think you might be 
looking for something like:

python setup.py \
  install \
  --root=/home/mdione/src/projects/psync/src/trunk/debian/tmp \
  --prefix=/usr

For KDE4 I'll probably have a look around for a better build/install system. 
I'm not even sure if distutils is still being developed. The release (PEP 
361) schedule for Python 2.6 has an item distutils replacement (requires a 
PEP), but I don't know what they are referring to.

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Why are the python bindings delivered with KDE so old?

2007-01-22 Thread Simon Edwards
Hello,

I maintain the copy of the bindings in KDE's SVN repository.

On Sunday 21 January 2007 17:51, Serge Weinstock wrote:
 Does someone know why the python bindings delivered  with  KDE are so old?

It is a bit of a long story to explain, but what it comes down to is that a 
year or two ago SIP/PyQt had to break binary compatibility. Binary 
compatibility is important to KDE so I decided to stay and keep the older 
version. In retrospect, following SIP/PyQt development would have been the 
better option to take...

 This is a major issue for me and I think for all developers who want to
 develop python applications for KDE as these bindings are the one
 distributed for a lot of major Linux distribution (Suse, Mandriva, ...).

Lobby your distro and/or produce packages for it. That is the best solution 
for now.

 Furthermore, this situation prevents also the  spread  of PyQt4 as the 
 version  of sip  is too old and many  users  are afraid to have to
 replace full parts of their KDE distribution.

PyQt4 is not affected in anyway.

 Is it possible to help solving this problem and try to have up to date
 bindings in the KDE source tree? I'm willing to help...

No, not via KDE's copy in any case. The 3.x series of KDE is in maintenance 
mode and no big changes, only bug fixes, will be released for 3.5.

The plans for PyKDE in KDE 4 are described here BTW:

http://lists.kde.org/?l=kde-bindingsm=116362138117872w=2

Any developer starting a Qt/KDE project in Python should be using Qt 4 now, 
and not Qt 3. PyQt4 has been out and stable for quite some time now.

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Why are the python bindings delivered with KDE so old?

2007-01-27 Thread Simon Edwards
On Wednesday 24 January 2007 00:12, Serge Weinstock wrote:
 Thanks you for your explanations, I didn't know that the KDE 3.x series
 was now in maintenance.

Effort in the KDE community has been concentrated on KDE 4 for quite some time 
now. KDE 4 is due this year, while KDE 3 is (mostly) getting bug fixes and 
maintenance releases.

 I must confess that I'm surprised by the recommendation of using PyQt4
 for new KDE applications as to my knowledge neither the KDE4 API has
 been stabilized, nor a public release of the Python bindings for KDE4
 has been released.

True. The trick is that it doesn't make too much sense to develop on an old 
platform, and the KDE API itself needs testing and feedback before release. 
(read: people using it). PyKDE on KDE 4 should be available for initial use 
and testing, real soon now. Of course if you have a KDE3 application that you 
want to release before KDE4, then that's the way it is. But moving to Qt / 
KDE 4 should be a high priority.

We want to have as many applications available as possible when KDE 4 is 
released.

 Personally, I can't use only PyQt for my current project as I don't want
 to rewrite the huge amount of useful code found in the KDE libraries.

I don't want you to either. :-)

 This is very good news to know that pyKDE4 will be developed directly
 inside the KDE project.  

People who are following KDE4 development will be able to track PyKDE 4 
development soon once it hits KDE's SVN. (Jim is still working on an initial 
version/port).

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyQt] PyQt4 dbus mainloop assertion error

2007-04-25 Thread Simon Edwards

Hi,

Ingmar Steen wrote:

I'm trying to use the new PyQt4 dbus mainloop, but it crashes with an
assertion error when I try to get an object from the bus. I'm using Sip 
4.6,

PyQt4.2, Qt 4.2.3, Python 2.5.1, DBus 1.0.2 and dbus-python 0.80.1. Am I
doing something fundamentally insane or wrong?

If I remove the QDBusQtMainLoop(set_as_default=True) line, it works just
fine. The assertion also happens if app.exec_() and get the bus object from
a QTimer event.


Here is some code which works for me. You'll have to strip it down 
yourself though. I'm lazy like that. ;-)


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
#!/usr/bin/python

import sys
import os
import time
import gobject
import signal
import dbus
import dbus.service
if getattr(dbus, 'version', (0,0,0)) = (0,41,0):
import dbus.glib
from PyQt4 import QtCore


class ServerIFace(dbus.service.Object):
def __init__(self, bus_name, object_path='/com/simonzone/watchdog/Server'):
dbus.service.Object.__init__(self, bus_name, object_path)
  
@dbus.service.signal('com.simonzone.watchdog.ServerIFace')
def packetHit(self, message): pass


class WatchdogServerApp(QtCore.QCoreApplication):
def __init__(self,argv):
QtCore.QCoreApplication.__init__(self,argv)
self.log_pipe_fd = -1
self.log_pipe = None

def pipeReady(self,source,condition):
print Pipe ready! 

try:
data = self.log_pipe.readline()
while data!=:
self.handleLine(data)
data = self.log_pipe.readline()
except IOError,e:
#print e
self.connectToPipe()
print ---

return True

def connectToPipe(self):
print connectToPipe()
if self.log_pipe is not None:
gobject.source_remove(self.log_event_source)
self.log_pipe.close()
self.log_pipe = None

self.log_pipe_fd = os.open(/var/lib/WATCHDOGPIPE,os.O_RDONLY|os.O_NONBLOCK)
self.log_pipe = os.fdopen(self.log_pipe_fd,r)

# Qt's QSocketNotifier just doesn't work right when used with pipes.
# It just keeps on sending the same signal. gobject's works.
self.log_event_source = gobject.io_add_watch(self.log_pipe_fd, gobject.IO_IN, self.pipeReady)

print log_pipe_fd:,self.log_pipe_fd

def exec_(self):

self.bus = dbus.SystemBus()
self.bus_name = dbus.service.BusName('com.simonzone.watchdog.ServerIFace', bus=self.bus)
self.iface = ServerIFace(self.bus_name)
self.startTimer(1000)

self.connectToPipe()

# Use the glib main loop
mainloop = gobject.MainLoop()
mainloop.run()
#QtCore.QCoreApplication.exec_()

print Done running

def timerEvent(self,event):
print Timer event
self.iface.packetHit('I sent a hello signal')

def handleLine(self, line):
# is this a package log message?
if kernel: not in line:
return
if IN= not in line:
return



def main():
app = WatchdogServerApp(sys.argv)
app.exec_()

main()
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Rejoice, for PyKDE4 has landed in KDE SVN

2007-09-03 Thread Simon Edwards

[I'll just repeat my blog post here for everyone.]

Python language bindings for KDE's libraries, PyKDE4, has landed in 
KDE's subversion repository. Jim Bublitz has been working behind the 
behind the scenes on PyKDE4 for quite some time, and now PyKDE4 is 
stable enough to enter its new home in subversion. The last of big 
sweeping changes to the code, like licensing notices and module layout 
for example, have been done and PyKDE4 is in good shape for those who 
want to get in there, port their applications or create new ones and 
help shake any bugs out. Now that KDE's libraries are mostly settled, 
changes and improvements to the bindings will be incremental in nature 
and not too disruptive for Python developers.


Almost all classes in kdelibs are covered, except Phonon which is 
waiting on imporved namespace support in SIP before we can add support. 
Supporting tools like a Qt designer compiler that works with KDE classes 
and uses i18n() are also in the works, along with extra support for 
things like installation, handling i18n messages etc, and not to mention 
documentation and example code.


PyKDE4 is in KDE's subversion repository in 
/trunk/KDE/kdebindings/python/pykde4/ . Be sure to read the INSTALL and 
README files for more information. Thanks go to Jim Bublitz who has done 
the real heavy lifting here, and also to Phil Thompson who developes SIP 
and PyQt4 which PyKDE4 is built on top of.



http://www.kdedevelopers.org/node/2968

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyKDE4 Update

2007-09-04 Thread Simon Edwards

Jim Bublitz wrote:
The first is how large should PyKDE be? At some point I'd want to start 
splitting stuff off into a second package, and all 3 you mentioned would be 
good candidates for that. They're not really central to kdelibs for what I 
see as the average user.


I was think about that the other day when I realised that Kate and its 
.h file isn't even in kdelibs, but kdesdk or something. We could put 
everything in PyKDE4 and create some extra configure time flags for 
turning certain dependencies on or off. e.g. just give me bindings for 
everything in kdelibs and that's all or give me the lot). A second 
package PyKDE4EverythingElse has its advantages too. For a start, we 
might get more consistent and clearer packaging. With less of this 
Dammit! XYZ compile their pykde4 package with API ABC turned off! but 
everyone else has it compiled in!. PyKDE4 would then depend on kdelibs 
and maybe kdepimlibs, like kdebase does. And PyKDE4EverythingElse could 
have much large dependencies like, well, everything else.


Another API which I would like to have bindings for is Marble. I was a 
bit surprised to find that it isn't part of kdeui, but kdeedu module.


Learning 
threading or symantic desktops is not high on my list of priorities, but I'll 
get to it eventually (a year or two).


Semantic desktop API is probably useful, but the threading API sounds 
like a big can of worms for Python programs running on CPython.


Someone can speed that up by 
volunteering to debug bindings for those packages AND producing test 
code/examples or (at best) a tutorial. Docs I can get for free from the h 
files.


True, if someone is interested in an API and can help out, then it can 
be given high priority.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyKDE4 guide/tutorial

2007-10-19 Thread Simon Edwards

Hello,

Hans-Peter Jansen wrote:

Am Mittwoch, 17. Oktober 2007 11:03 schrieb Arne Babenhauserheide:

Is there a guide for PyKDE4? Google didn't get me far, here...


Not as such.


I don't yet know KDE programming. Should I try to get into PyKDE4
nontheless?
http://websvn.kde.org/tags/KDE/3.94/kdebindings/python/pykde4/README?view
=markup


For beginners, I suggest start learning/using PyQt4. It is pretty complete 
as a toolkit. Mark Summerfield has written a book about it, which will get 
you started (soon to be released, but also available for (payed) download 
as rough cut PDF edition): http://www.qtrac.eu/pyqtbook.html.


That is good advice. The book is also available now:

http://www.amazon.com/exec/obidos/ASIN/0132354187/ref=nosim/fadingmemorie-2

Before you wrapped your head around it, and probably start missing advanced 
(k) desktop environment features, PyKDE4 will be available, I bet.


PyKDE4 is already available for certain definitions of available. 8-) 
If you have KDE 4 SVN compiled on your machine then it is not very hard 
to checkout the kdebindings module and build PyKDE4. PyKDE4 and kdelibs 
are definitely stable enough to develop on without too much hassle.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] ANN: new eric4 snapshot release

2007-11-07 Thread Simon Edwards

Hi,

Detlev Offenbach wrote:

On Mittwoch, 7. November 2007, Simon Edwards wrote:

Detlev Offenbach wrote:

I would like to inform about the availability of a new eric 4.1 snapshot.
It fixes a bunch of bugs and has these new functions.

I've got the snapshot installed. Here's a couple of comments:

* The autocomplete window always pops up regardless of how I configure
it. I want it to be available but only to appear when I press
Ctnl+Space. (I see that you've improved the popup too in the snapshot.
cool! much better)
Did you disable autocompletion in the configuration dialog? It works over 
here.


I've had a very though play with the autocompletion dialog and have 
tried every combination. It even pops up by its self when the threshold 
is on 10. It does look like a bug. Tell me where to insert the debug 
line. ;-)



* When Eric4 started it showed all of the toolbars by default. That is
probably not a good idea.

What would be a good idea?


As little as possible. Edit, File and View are plenty. The File 
toolbar doesn't need a quit button either. The GUI would be a lot better 
if there was less of it. (I've got a 1e6 + 1 usability suggestions if 
you want them. Do you have a public SVN repository?)


Another thing. I use grey as a background for my editing windows etc. 
I've done this by messing with the syntax highlighting, but every time 
the cursor is on a ':' character the screen flickers white. Is there a 
global windows background colour that I should set?



* How can I generate an API file for something like PyKDE4? I found
eric-api.py and it accepts PyKDE4 as an argument, and says that it was
OK, but it doesn't put anything in the api file.
eric-api.py is there to generate API files from Python source. As PyKDE4 is 
not Python source you cannot use it. sip has an API generation facility for 
sip wrappers. That could be used for PyKDE4. But you should check PyKDE4 
first because I expect it to have an install option, that generates the API.


oh, I see. I'll have a look around in PyQt

thanks,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] stdin processing

2007-11-07 Thread Simon Edwards

Hi,

Vladimir Pouzanov wrote:

Is there any way to read stdin line by line without blocking? My application
receives data over stdin (one command per line) and should react immediately.


Your story sounds a lot like the world of confusion and pain I found 
myself in when I wanted to read a pipe in an async way. I couldn't find 
a way that actually worked in a decent way. Here is my non-decent way of 
reading a pipe. Pure distilled madness.



---
#!/usr/bin/python
import os
import sys
import time

from PyQt4 import QtCore

# Frequency to poll the file for more data.
POLL_INTERVAL = 250 #ms

# Maximum amount of time to use reading logs without returning to the 
main event loop.

MAX_TIME_SLICE=  0.1# seconds

class LogReader(QtCore.QObject):
def __init__(self, filename):
QtCore.QObject.__init__(self)
self.filename = filename

self.log_file = None
self.connectToFile()

def connectToFile(self):
if self.log_file is not None:
gobject.source_remove(self.log_event_source)
self.log_file.close()
self.log_file = None

self.log_file_fd = os.open(self.filename,os.O_RDONLY|os.O_NONBLOCK)
self.log_file = os.fdopen(self.log_file_fd,r)
self.timer_id = self.startTimer(0)

def timerEvent(self,event):
if event.timerId()==self.timer_id:
self.killTimer(self.timer_id)
self.timer_id = None
self.fileReady()
else:
QObject.timerEvent(self,event)

def fileReady(self):
try:
enter_time = time.time()
restart_time = POLL_INTERVAL
while True:
data = self.log_file.readline()
if data==:
break
self.emit(QtCore.SIGNAL(newLine), data)

new_time = time.time()
if (new_time-enter_time)  MAX_TIME_SLICE:
restart_time = 0
break

self.timer_id = self.startTimer(restart_time)

except IOError,e:
self.connectToFile()

def handleLine(self, line):
print line

def main():
app = QtCore.QCoreApplication(sys.argv)
log_reader = LogReader(/var/log/messages)
app.exec_()

if __name__==__main__:
main()
---

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] stdin processing

2007-11-08 Thread Simon Edwards

Tom Dossis wrote:


On 07/11/2007, at 2:08 AM, Vladimir Pouzanov wrote:

Is there any way to read stdin line by line without blocking? My 
application
receives data over stdin (one command per line) and should react 
immediately.




I get the same problem in the following doctest.
Also I don't see the bytesWritten signal either.



Create a pair of QFile objects to read/write from/to a pipe:


If you google on Qt and pipes then you should be able to find something. 
I'm fairly sure that it is a (known) bug in Qt.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] ANN: new eric4 snapshot release

2007-11-08 Thread Simon Edwards

Detlev Offenbach wrote:

* The autocomplete window always pops up regardless of how I configure
it. I want it to be available but only to appear when I press
Ctnl+Space. (I see that you've improved the popup too in the snapshot.
cool! much better)

Did you disable autocompletion in the configuration dialog? It works over
here.

I've had a very though play with the autocompletion dialog and have
tried every combination. It even pops up by its self when the threshold
is on 10. It does look like a bug. Tell me where to insert the debug
line. ;-)


In file QScintilla/Editor.py in method __setAutoCompletion check, what the 
call of Preferences.getEditor(AutoCompletionEnabled) returns. If 
autocompletion has been turned off in the configuration dialog, this should 
be False. If it still returns True, please exit eric4 and check the file 
~/.config/Eric4/eric4.conf. The AutoCompletionEnabled in the Editor section 
should be 0.


Ok. That does turn off the automatic popup, but now Ctnl+Space gives an 
error message about ...no autocompletion source set.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] ANN: new eric4 snapshot release

2007-11-09 Thread Simon Edwards

Detlev Offenbach wrote:

On Donnerstag, 8. November 2007, Simon Edwards wrote:

Detlev Offenbach wrote:

* The autocomplete window always pops up regardless of how I configure
it. I want it to be available but only to appear when I press
Ctnl+Space. (I see that you've improved the popup too in the snapshot.
cool! much better)

Did you disable autocompletion in the configuration dialog? It works
over here.

I've had a very though play with the autocompletion dialog and have
tried every combination. It even pops up by its self when the threshold
is on 10. It does look like a bug. Tell me where to insert the debug
line. ;-)

In file QScintilla/Editor.py in method __setAutoCompletion check, what
the call of Preferences.getEditor(AutoCompletionEnabled) returns. If
autocompletion has been turned off in the configuration dialog, this
should be False. If it still returns True, please exit eric4 and check
the file ~/.config/Eric4/eric4.conf. The AutoCompletionEnabled in the
Editor section should be 0.

Ok. That does turn off the automatic popup, but now Ctnl+Space gives an
error message about ...no autocompletion source set.
And that is a bug, which will be fixed in the next release/snapshot. If you 
need it sooner, please let me know by private email.


ok. I won't die if I don't get it sooner. Let me know when the next 
snapshot is out and I'll take it for a spin.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] QAbstractItemModel subclass + QTreeView brickwall

2007-11-25 Thread Simon Edwards

Hello all,

I'm having a hard time getting a QTreeView widget to work with my own 
model. I've tried translating the Simple Tree Model Example from the 
Qt docs, but it still doesn't work. Does anyone have working example 
code for a QAbstractItemModel, or know what is going wrong?


Tested on PyQt 4.3 + Qt 4.3.2, and kde's qt-copy (pre Qt 4.4-ish) with 
4.3-snapshot-20070905. Some of the methods get called (I've left the 
debug in), but nothing is displayed.


thanks,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
from PyQt4 import QtCore, QtGui

class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(Dialog)
Dialog.resize(QtCore.QSize(QtCore.QRect(0,0,400,300).size()).expandedTo(Dialog.minimumSizeHint()))

self.vboxlayout = QtGui.QVBoxLayout(Dialog)
self.vboxlayout.setObjectName(vboxlayout)

self.treeView = QtGui.QTreeView(Dialog)
self.treeView.setObjectName(treeView)
self.vboxlayout.addWidget(self.treeView)

self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate(Dialog, Dialog, None, QtGui.QApplication.UnicodeUTF8))

class TreeItem(object):
def __init__(self,data,parent=None):
self.parentItem = parent
self.itemData = data
self.childItems = []

def appendChild(self, item):
self.childItems.append(item)

def child(self,row):
return self.childItems[row]

def childCount(self):
return len(self.childItems)

def columnCount(self):
return len(self.itemData)
 
def data(self,column):
return self.itemData[column]

def parent(self):
return self.parentItem

def row(self):
if self.parentItem is not None:
return self.parentItem.childItems.index(self)
return 0

class TreeModel(QtCore.QAbstractItemModel):
def __init__(self,parent=None):
QtCore.QAbstractItemModel.__init__(self,parent)
self.rootData = []
self.rootItem = TreeItem(self.rootData)
self.setupModelData(self.rootItem)

def columnCount(self, parent=QtCore.QModelIndex()):
print(columnCount)
if parent.isValid():
return parent.internalPointer().columnCount()
else:
return self.rootItem.columnCount()

def data(self, index, role):
print(data)
if not self.index.isValid():
return QtCore.QVariant()

if role != Qt.DisplayRole:
return QtCore.QVariant()

item = index.internalPointer()
return item.data(index.column())

def flags(self, index):
print(flags)
if not index.isValid():
return 0
return QtCore.Qt.ItemFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable)

def headerData(self, section, orientation, role):
print(headerData)
if orientation == QtCore.Qt.Horizontal and role == QtCore.Qt.DisplayRole:
return self.rootItem.data(section)
return QtCore.QVariant()

def index(self, row, column, parent):
print(index)
if not self.hasIndex(row, column, parent):
return QtCore.QModelIndex()

if not parent.isValid():
parentItem = self.rootItem
else:
parentItem = parent.internalPointer()

childItem = parentItem.child(row)
if childItem is not None:
return self.createIndex(row, column, childItem)
else:
return QtCore.QModelIndex()

def parent(self, index):
print(parent)
if not index.isValid():
return QtCore.QModelIndex()

childItem = index.internalPointer()
parentItem = childItem.parent()

if parentItem is rootItem:
return QtCore.QModelIndex()

return self.createIndex(parentItem.row(), 0, parentItem)

def rowCount(self, parent):
print(rowCount)
if parent.column()  0:
return 0

if not parent.isValid():
parentItem = self.rootItem
else:
parentItem = parent.internalPointer()

return parentItem.childCount()

def setupModelData(self, parent):
x1 = TreeItem(['one','two'],parent)
TreeItem(['x','x2'],x1)
TreeItem(['three','four'],parent)

if __name__ == __main__:
import sys
global app,model
app = QtGui.QApplication(sys.argv)

view = QtGui.QTreeView()
model = TreeModel()
view.setModel(model)
view.setWindowTitle(Simple Tree Model)
view.show()
sys.exit(app.exec_())

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] QAbstractItemModel subclass + QTreeView brickwall

2007-11-25 Thread Simon Edwards

Andreas Pakulat wrote:

On 25.11.07 21:17:12, Simon Edwards wrote:
I'm having a hard time getting a QTreeView widget to work with my own 
model. I've tried translating the Simple Tree Model Example from the Qt 
docs, but it still doesn't work. Does anyone have working example code for 
a QAbstractItemModel, or know what is going wrong?


Huh? That example is already existing in a PyQt version, see
examples/itemviews/simpletreemodel/ in the PyQt sources


I grepped and searched a few times in the examples dir with Krusader. I 
obviously missed it.


Thanks for pointing that out!

Some of the methods get called (I've left the debug 
in), but nothing is displayed.

Check contrib/pymodeltest/ add that to your model and it should help you
to find which of your models methods don't work according to the
contract.


interesting.

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] [PyKDE4] Text of menus not showing up

2008-01-09 Thread Simon Edwards

Hi,

Adeodato Simó wrote:

I'm starting to port my application (audio player) to PyKDE4. The
bindings compiled fine, but after the first steps I encountered that the
text in the menu bar and the menus themselves was not being displayed.

If you could try to reproduce, that'd be nice. I attach two minimal
programs, one in C++ and another in Python. I can see the File menu in
the C++ one, but in the Python one the menu is there, but the text is
missing. Does it happen to you too?


I haven't tried the C++ version (kudo on that, good bug report). The 
Python version doesn't display the text in the menubar with the Oxygen 
style. Room is made in the menubar for the text though. (Try 
File___) I changed the style to plastique and the menubar *was* 
displayed as expected.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] pykde4 using KConfig XT - tutorial

2008-01-12 Thread Simon Edwards

Hi,

Peter Liedler wrote:

I am trying to autogenerate a configuration dialog with a
KConfigSkeleton. I just can't get it working.


What went wrong?


Can you post me a sample, tutorial or something else on how to call a
config dialog in pykde4?


Not that I'm aware of.


I tried it with a .kcfg file as described in the tutorials on kde.org,
but there was no success.


If I remember rightly, the kconfig stuff in KDE uses a lot of C++ 
templates which makes bindings difficult. There is a good chance that 
the config stuff is incomplete.


Jim appears to be off-line for a while now and I've had to try keeping 
the kconfig stuff up to date and working. If it is screwed up, then it 
is probably my fault. :)


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] A couple of question about PyKDE4

2008-02-07 Thread Simon Edwards

Jim Bublitz wrote:

Before I start out with PyKDE4, I have a couple of questions:
- what is the preferred build system? cmake or configure.py? Will any of
these build system vanish in the future?


I haven't looked lately, but I think Simon is using cmake with the KDE SVN 
version. I'll be continuing to use configure.py. I'm pretty sure Simon will 
want to go with/stay with cmake, and that I'll stay with the configure.py 
setup.


cmake support is needed to make it possible for people to build the 
whole kde-bindings module in one (big) go. I've also pulled out parts of 
that cmake code and made it possible to install PyKDE programs with it. 
Using cmake for a Python program means you also get access to the 
existing cmake support for building other KDE related things like 
translation (.po) files, docs, and C++ modules if you want to do mixed 
development.



- are you going to make separate releases of PyKDE4, or will everything
be coordinated with the KDE releases?
I'll probably do separate releases - I'm behind again and won't be releasing 
for a month or two.


If you are adding bug fixes to the KDE 4.0, then you could probably just 
skip the extra releases and just release via KDE SVN. KDE bug fix 
releases come out once a month these days, and we don't even have to 
lift a finger for that to happen. ;-)


There's also a better set of documentation and a documentation viewer 
(pykdedocs) that integrates tutorials, example programs, docs and will let 
you browse other docs (Python, PyQt, Qt, KDE, etc) locally or online.


The Ply-based tools will make it a lot easier to develop docs from the KDE doc 
set and is a much easier to maintain bunch of code.


Once the docs are updated, and if the viewer is stable/complete enough, 
then we can put it in KDE 4.1.


The only thing missing in PyKDE4 is Phonon support, which is a little messy 
(or was last time I looked).


IIRC, Phonon will be moving into Qt itself, possibly in Qt 4.4. In which 
case it'll become Phil's problem. ;-)


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] [PyKDE4] Crash when using KConfig

2008-02-14 Thread Simon Edwards

Adeodato Simó wrote:

Hello, any news about this?


This works. (see attachment).

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
#! /usr/bin/env python

Using KConfig crashes the application.

import sys

from PyKDE4 import kdeui, kdecore

class MainWindow(kdeui.KMainWindow):
def __init__ (self, *args):
kdeui.KMainWindow.__init__(self, *args)
config = kapp.sessionConfig()
config.group('Foo').writeEntry('a', 'b')
print '=== syncing now ===' # not reached
config.sync()

def main():
global kapp

kdecore.KCmdLineArgs.init(sys.argv, 'test', '', kdecore.ki18n('test'), '1.0')
kapp = kdeui.KApplication()
main_window = MainWindow()
main_window.show()
kapp.exec_()

if __name__ == '__main__':
main()
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Pythonize library

2008-04-10 Thread Simon Edwards

Miller, Douglas K. CONT NAVAIR 2109, 1, N139 wrote:
Does the pythonize library still exist?  If so, where and where is it 
documented?  Thanks.


It doesn't really exist anymore. Hopefully we'll be able to do plugins 
for Qt4 / KDE 4 without hacks like pythonize.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Goods news about the menu text missing in PyKDE apps with Oxygen bug

2008-04-10 Thread Simon Edwards


Hello all,

Some people here might have crossed paths with the menu text missing in 
PyKDE apps with Oxygen bug. Basically menu labels are not rendered when 
a PyKDE4 application is used with the Oxygen widget style. After quite a 
lot of hair-pulling work over the last few days I've figured out what 
the problem is.


First, a solution. Put the following lines in your PyKDE4/__init__.py 
file in your Python installation's site-packages directory. (typically 
/lib/python2.5/site-packages/PyKDE4/__init__.py).


  import sys, dl
  sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)

I'm sure what the 'official' solution is going to be, but Jim and I will 
work it out. This _might_ fix the problems some people have been having 
with KConfig and friends. Let me + Jim know if that is the case.


Phil: Does this problem affect PyQt4? I don't know if they use 
dynamic_cast much.


For those who are interested in the gory details, the problem is 
described here:


  http://gcc.gnu.org/faq.html#dso

A dynamic_cast was failing in Oxygen in the menu drawing code, and a 
default value was being used instead (an empty string). The thing is 
that Python dlopens()s kdeui instead of just being linked to it like a 
normal C++ program. This breaks dynamic_cast between kdeui.so and 
oxygen.so. I've tested this out with test code here, and the problem 
fits this analysis exactly.


A workaround in Python:

  http://mail.python.org/pipermail/c++-sig/2005-April/008829.html


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Goods news about the menu text missing in PyKDE apps with Oxygen bug

2008-04-12 Thread Simon Edwards

Detlev Offenbach wrote:

On Donnerstag, 10. April 2008, Simon Edwards wrote:

Hello all,

Some people here might have crossed paths with the menu text missing in
PyKDE apps with Oxygen bug. Basically menu labels are not rendered when
a PyKDE4 application is used with the Oxygen widget style. After quite a
lot of hair-pulling work over the last few days I've figured out what
the problem is.

First, a solution. Put the following lines in your PyKDE4/__init__.py
file in your Python installation's site-packages directory. (typically
/lib/python2.5/site-packages/PyKDE4/__init__.py).

   import sys, dl
   sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)


Python seems to be broken on openSUSE 10.3 64-bit. It doesn't contain the 
dl.so library. Any help is appreciated.


Looking at the dl docs I see:


Note: This module will not work unless sizeof(int) == sizeof(long) == 
sizeof(char *) If this is not the case, SystemError will be raised on 
import.



That explains why it is not there for 64bit.

Docs for sys.setdlopenflags():


setdlopenflags(  n)
 Set the flags used by the interpreter for dlopen() calls, such as when 
the interpreter loads extension modules. Among other things, this will 
enable a lazy resolving of symbols when importing a module, if called as 
sys.setdlopenflags(0). To share symbols across extension modules, call 
as sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL). Symbolic names for 
the flag modules can be either found in the dl module, or in the DLFCN 
module. If DLFCN is not available, it can be generated from 
/usr/include/dlfcn.h using the h2py script. Availability: Unix. New in 
version 2.2.



Try this:

import sys,DLFCN
sys.setdlopenflags(DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Issues with PyKDE4 and i18n API (fixed)

2008-05-28 Thread Simon Edwards

Chusslove Illich wrote:

KDE 4 i18n API, with intended usage patterns, is given here:

http://api.kde.org/4.0-api/kdelibs-apidocs/kdecore/html/classKLocalizedString.html

For the same semantics to be fully supported by the Python bindings, some
special care is needed.


All of these issues are fixed in the coming 4.0.5 release of KDE  
kdebindings.


http://websvn.kde.org/?view=revrevision=813476

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] KAboutData() broken when using PyQt 4.4

2008-06-15 Thread Simon Edwards

Adeodato Simó wrote:

Hello,

I upgraded to PyQt 4.4.2 this morning, and now KAboutData no longer
works for me:


How did you upgrade and this which version of PyKDE4 are you using? and 
how did you install PyKDE4. While working on the PyKDE 4.1 I came across 
a build problem which happen if PyQt 4.4 is used. The symptoms were 
rather confusing. This was the fix:


http://websvn.kde.org/?view=revrevision=812575

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] KAboutData() broken when using PyQt 4.4

2008-06-15 Thread Simon Edwards

Adeodato Simó wrote:

* Jim Bublitz [Sat, 14 Jun 2008 14:00:27 -0700]:

It works here with Qt 4.3/PyQt 4.3.3/sip 4.7.4/KDE 4.0.2/PyKDE 4.0.2.


Right, it is without doubt related to PyQt, because upgrading that is
what caused the problem. This is my last *working* state:

  sip - 4.7.6
  Qt  - 4.4.0
  PyQt - 4.3.3 -- note this
  KDE  - 4.0.80
  PyKDE4 - 4.0.2 (from Riverbank)

If I upgrade PyQt to 4.4.2, things stop working. Also note how running
PyQt 4.3 against Qt 4.4 works, and PyKDE4 against KDE 4.0.80 too.



So, Jim, sounds like a change in PyQt, yes. No idea if this could be
related to the fix Simon mentions or not.


Did you recompile PyKDE4 against the new version of PyQt4? When 
recompiling PyKDE4, did it see that PyQt 4.4 was being used?


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Re: Importing Phonon module

2008-06-27 Thread Simon Edwards

Gustavo A. Díaz wrote:

I only have this:

[EMAIL PROTECTED]:~$ apt-cache search phonon
libphonon-dbg - Phonon debugging symbols
phonon-dbg - Phonon debugging symbols
phonon - metapackage for Phonon multimedia framework
phonon-backend-gstreamer - Phonon GStreamer 0.10.x backend
libphonon-dev - development files for the Phonon multimedia framework
libphonon4 - Phonon multimedia framework for Qt 4
phonon-backend-null - Phonon null backend (no real backend)

I've installed libphonon4 just in case... but nothing :(


Do a:

locate libphonon.so

That should quickly tell you which phonons you have and where they come 
from.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Re: Importing Phonon module

2008-06-27 Thread Simon Edwards

Gustavo A. Díaz wrote:

Is that the Qt4 phonon or the KDE4 phonon? PyQt only supports the Qt4
phonon.

Phil


BTW, KDE 4.1 will have support for KDE's version of Phonon. I just 
wrapped that in the last week.


(yes, having multiple versions of phonon floating around in users' 
systems is a PITA.)


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] pykde4 solid question

2008-07-06 Thread Simon Edwards

Peter Liedler wrote:

Which gives me the following error:
   print cdrom.supportedMedia()
AttributeError: supportedMedia



Am I using Solid in a wrong way?


If you post a complete but minimal python program which reproduces the 
problem, then I'll try it against KDE 4.1 and see what is going on.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] pykde4 solid question

2008-07-06 Thread Simon Edwards

Hi,

Peter Liedler wrote:

this one should be executable:



  if cdrom.isDeviceInterface (Solid.DeviceInterface.OpticalDrive):
   burner = cdrom.asDeviceInterface 
(Solid.DeviceInterface.OpticalDrive)

   print burner.supportedMedia()


Looks like a bug in PyKDE. You should be getting an optical driver 
object back, but instead you get a drive object.


It looks like something I can fix for KDE 4.1, and maybe 4.0 if there is 
demand for it.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] pykde4 solid question

2008-07-06 Thread Simon Edwards

Simon Edwards wrote:

Hi,

Peter Liedler wrote:

this one should be executable:



  if cdrom.isDeviceInterface (Solid.DeviceInterface.OpticalDrive):
   burner = cdrom.asDeviceInterface 
(Solid.DeviceInterface.OpticalDrive)

   print burner.supportedMedia()


Looks like a bug in PyKDE. You should be getting an optical driver 
object back, but instead you get a drive object.


It looks like something I can fix for KDE 4.1, and maybe 4.0 if there is 
demand for it.


I just committed the fix to KDE 4.1. :-)

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Changes in PyKDE

2008-07-12 Thread Simon Edwards

Christoph Burgmer wrote:
One small question: can we now use the KDE bug tracker for fileing bugs? Not 
that there are any big ones ;)


For now you can just report problems to this list like usual. If this 
list gets filled up with bug reports then we can move over to bugs.kde.org.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


PyKDE releases (was: [PyQt] Changes in PyKDE)

2008-07-12 Thread Simon Edwards

Hello all,

Jim Bublitz wrote:
The major change will probably be that up-to-date releases will come via KDE 
releases (version releases and bugfix releases), and Simon will probably keep 
you up-to-date on the where and when of those. Any project decisions are now 
up to Simon.


Just to expand on this a bit.

PyKDE4 will be released as part of the KDE platform and will be part of 
KDE's releases and schedule. Bug fix releases regularly come out every 4 
week or so, which should be fast enough for most people. Either way the 
current code is always available in KDE's subversion. Distributions are 
much better at packaging and updating PyKDE4 these days, which makes it 
much easier for people to get the current PyKDE4.


I anyone has other wishes or needs then let me know and I'll see what I 
can do. Nothing is set in stone.


I'm about to look into adding support for kcontrol/systemsettings 
modules and other plugins. That work would officially arrive in KDE 4.2, 
but if I have something useful and working I could release a tarball for 
the people who want to start working with it and don't want to compile 
KDE from svn or wait 6 months. =)


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Python ready to go in KDE 4.1 blog

2008-07-12 Thread Simon Edwards

Hello all,

In case not everyone follows the blogs on planetkde.org, I wrote 
something about the state of PyKDE in KDE 4.1:


http://kdedevelopers.org/node/3549

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyKDE4 documentation?

2008-07-30 Thread Simon Edwards

Benno Dielmann wrote:
Hi, 
http://techbase.kde.org/Development/Languages/Python/Using_PyKDE_4
says there are several tutorials on programming in PyKDE4. Where can they be 
found? 


There are some in the PyKDE docs themselves. I intend to put them up on 
techbase too.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyKDE4: installing pykdedocs fails

2008-07-30 Thread Simon Edwards

Hi,

Benno Dielmann wrote:
Hi, 
since the Kubuntu PyKDE4 packages don't contain the pykdedocs viewer, I tried 
to install it from the sources (PyKDE4-4.0.2-1.tar.bz2). Unfortunately, it 
fails:


Install the python-qt4-dev package. It contains pyqtconfig. I don't know 
why they think it is a good idea to split pyqtconfig out into the dev 
package though.


If you are using the KDE 4.1 version of PyKDE then I don't think the 
pykdedocs viewer will work. I might have moved some the docs around. I 
would like to fix it up and ship it with KDE 4.2 proper. (Volunteers are 
welcome for this job).


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] KDE API docs for us Pythonists

2008-08-05 Thread Simon Edwards


From my blog: http://www.kdedevelopers.org/node/3593

After the kdebindings meeting about a month ago in Berlin, I had a 8-ish 
hour long trip back on the train from Berlin to Nijmegen. Deutsche 
Bahn's trains are rather civilised and have power on board for all your 
laptop charging needs (provided you can get close enough to the seats 
with the tables *and* the power outlets). Anyway, after getting some 
preliminary Python coding working inside KDE 4's systemsettings (thanks 
go to rdale for his help), I had a go at trying to fix up the PyKDE 
class documentation to more closely match the C++ KDE API docs. About 5 
weeks of hack time later I now have something which is ready enough for 
the public. The formatting is much more in line with the C++ docs and 
the pages are laid out and cross linked much better than the previous 
class reference for PyKDE. It is still not perfect (code fragments are 
not translated to Python), but it should be perfectly usable 98% of the 
time. Give it a try. http://api.kde.org/pykde-4.1-api/


This is part of my effort to update the PyKDE docs a bit move them over 
to the KDE techbase where it is much easier for everyone to help keep 
them updated and to add more information. 
http://techbase.kde.org/Development/Languages/Python


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Problems with Sonnet Highlighter

2008-08-08 Thread Simon Edwards

Hi,

Albert Cervera i Areny wrote:
I wanted to give Sonnet Highlighter a try and I find that it simply doesn't 
work for me (debian unstable packages), it gives:


Traceback (most recent call last):
  File test-sonnet.py, line 10, in module
Sonnet.Highlighter( edit )
TypeError: argument 1 of Highlighter() has an invalid type


[EMAIL PROTECTED] ~/devel/pykde4]$ python test-sonnet.py
Fatal error: you need to have a KComponentData object before
you do anything that requires it! Examples of this are config
objects, standard directories or translations.

This is on KDE 4.1. Your example code should use KApplication instead of 
just QApplication. What version of everything are you using?


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Auto-generate sip specification file?

2008-08-15 Thread Simon Edwards

Hello,

Jim Bublitz wrote:
Simon Edwards is using a tool for PyKDE4 called twine whose lexer./parser 
are based on PLY and which will generate a versioned set of sip files (one 
that, at least in theory, will build for any version of your lib).



If Simon doesn't chime in with a location where it's available, email him -
simon AT simonzone.com :)


I'm still at Akademy, but I'll try to get this checked into KDE's SVN 
some time this weekend along with all of my changes. (Probably in 
kdesupport. I'm not sure if I can keep the change history though.)


I used twine this week to generate bindings for Plasma.

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Bug in SIP w.r.t. signals, typedefs and mapped types

2008-08-16 Thread Simon Edwards

Hello Phil,

While working on integrating Python into KDE4's Plasma I hit a crasher 
when using @pyqtSignature where one of the arguments for the slot is a 
typedef which in turn in a mapped type:


@pyqtSignature(dataUpdated(const QString , const 
Plasma::DataEngine::Data ))


Plasma::DataEngine::Data is a typedef for QHashQString,QVariant.

This would crash when the signal is sent to the slot. After a heap of 
debugging I've figured out goes wrong. When the signal comes in the 
Plasma::DataEngine::Data type was being converted to QHash. Later when 
sip looks for the mapped type in order to do the conversion, it can't 
find what it is looking for but sip continues and dereferences a null 
pointer.


The cause is in the code generated for the plasma module. The 
typedefsTable looks something like this:


static sipTypedefDef typedefsTable[] = {
  ...
  {Plasma::DataEngine::Data, mtype_sat, QHash, NULL},
  ...
};

The extra types for the QHash are stripped off. The table should look 
more like:


static sipTypedefDef typedefsTable[] = {
  ...
  {Plasma::DataEngine::Data, mtype_sat, QHashQString,QVariant, NULL},
  ...
};


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Bug in SIP w.r.t. signals, typedefs and mapped types

2008-08-17 Thread Simon Edwards

Phil Thompson wrote:

On Sun, 17 Aug 2008 01:44:29 +0200, Simon Edwards [EMAIL PROTECTED]
wrote:


The extra types for the QHash are stripped off. The table should look 
more like:


static sipTypedefDef typedefsTable[] = {
   ...
   {Plasma::DataEngine::Data, mtype_sat, QHashQString,QVariant,
NULL},
   ...
};


If you change the table by hand, does it then work?


Yes.

For this case it does. I don't know if there are other use cases which 
use this code.


--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Bug in SIP w.r.t. signals, typedefs and mapped types

2008-08-17 Thread Simon Edwards

Hi,

Phil Thompson wrote:

Should be fixed in tonight's snapshot.

I'm not planning another SIP release for some time. However, if you need
the fix for an upcoming KDE release then let me know.


I'll need it for KDE 4.2 by January latest, and preferably long before 
that time for easier testing and development, and it gives the distros a 
chance package it up and get it out to users in a timely manner.


thanks,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Re: Auto-generate sip specification file?

2008-08-19 Thread Simon Edwards

Kevin Watters wrote:
I'm still at Akademy, but I'll try to get this checked into KDE's SVN 
some time this weekend along with all of my changes. (Probably in 
kdesupport. I'm not sure if I can keep the change history though.)


+1 on interest in seeing this! Especially the autodocs-from-doxygen support.


That part is probably one of the more dubious ones, especially now that 
I've hacked a bunch of extra stuff on to it.


Anyway, twine is now in KDE's subversion repository in kdesupport:

http://websvn.kde.org/trunk/kdesupport/twine/

There are currently no docs for it though and it is a bit too KDE 4 
specific in places too. But you're welcome to have a look at it.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Calling protected methods on objects

2008-09-03 Thread Simon Edwards

Phil Thompson wrote:

On Mon, 01 Sep 2008 22:29:37 +0200, Simon Edwards [EMAIL PROTECTED]
wrote:

Hello Phil,

I'm busy working on integrating Python with Plasma in KDE 4. The API for 
doing network distributed applets is a bit convoluted, there is a lot of 
delegation of methods calls to other objects. I've hit a part where it 
would be really handy if I could call protected methods on objects which 
were not created by Python itself. SIP appears to explicitly prevent 
this kind of access, although I've commented out the check in 
getComplexCppPtr() and it appears to work fine.


* Is there a technical reason why this is forbidden? or is it more 
philosophical?


* I would like an official way in SIP to call protected 
methods/functions regardless of where the object came from. Perhaps, 
just a way to unlock an instance making all of its method available. 
Is this possible?



I need to think this over for a bit to feel comfortable with it.


I just found a workaround lets me do what I need to do without having to 
change SIP. So, it looks like I won't need this (potentially dangerous) 
functionality for the time being.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] how to import pykde ?

2008-09-04 Thread Simon Edwards

Hi,

Feth AREZKI wrote:
I got a (beginner?) problem initializing some objects, for instance of the 
class KAboutData:

  *works:
 from kdecore import KAboutData 
 (how to be sure of the kdecore version used? I suspect it's from kde 3,
 help(KAboutData) is not explicit) 
  *does not work, although is favoured by documentation [0]:

 from PyKDE4.kdecore import KAboutData'.
 (help(KAboutData) refers to kde4 classes)

However, it seems I cannot use both kinds of imports in the same program (both 
wrap the QObject class...).


So, should I use only the first kind of import ? Will it work ?


For example:

http://websvn.kde.org/branches/KDE/4.1/kdebindings/python/pykde4/tests/i18n_test.py?revision=829867view=markup

The first one is KDE 3 as you correctly guessed. The second is KDE 4.

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyQt4 and Python 3.0

2008-10-05 Thread Simon Edwards

Hello,

Phil Thompson wrote:

Major transitions (Qt3 = Qt4, Python2 = Python3) should be considered as
opportunities for rewrites. They should not be treated as how can I get
from one to the other with as few changes as possible.


I thought the way the Python guys handled Python 3 was very good. Just 
break what (really) needs to be broken and clear the way for future 
enhancements. Although porting of applications is still needed, they've 
stayed away from trivial and stylistic 'fixes' to Python and the libs 
which bring a lot more porting work for little real world gain. Things 
like changing the naming of classes and modules names etc fall into the 
stylistic change category in my book.


I hope Phil can stick to the really needed stuff. Porting stuff from 
Qt/KDE 3 to 4 has proven to be draining work which I hope to avoid 
having to do again in the near future.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] [PyKDE] Create Plasma applets with PyKDE?

2008-10-12 Thread Simon Edwards

Luca Ferrari wrote:

can I create Plasma applets with PyKDE4?
I can't find any documents regarding programming plasma with PyKDE4...


In KDE 4.2 you will be able to.

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED]   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] no UDSEntryList in PyKDE leads to crash

2008-12-17 Thread Simon Edwards

Hi,

Magnus Kulke wrote:
there is a signal in KDE, emitted by a KIO::ListJob, entries (KIO::Job 
*, const KIO::UDSEntryList ). there seems to be no binding for this 
class in python. USDEntryList is really a typedef'ed QList UDSEntry 
KIO::UDSEntryList. Only UDSEntry seems to be available in PyKDE4. when 
connecting the signal to my slot the application crashes, anyone knows 
how to work around this?


If you can boil the problem down to something simple enough that I can 
(reasonably) easily reproduce it here, then I'll have a look at it.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyKDE segfaults when calling group() on KSharedConfig object

2009-02-05 Thread Simon Edwards

Hello,

Benno Dielmann wrote:

config = KSharedConfig.openConfig()
group = config.group('General')

The second line results in a segfault. Interestingly, it doesn't if the config 
object is returned by KGlobal.config(). Documentation tells us KGlobal.config() 
returns a KSharedConfig object as does KSharedConfig.openConfig(). Strange.


See the attached minimal.py example.


thanks. I'll have a look at it soon.

This bug occurs since the update from KDE 4.1.4 to 4.2. 


... interesting.

Actually, where do bug reports on PyKDE go? bugs.kde.org? Should I file one for 
this?


Here or to me is fine. If that system breaks down then we should make 
proper use of bugs.kde.org.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Fosdem 2009

2009-02-05 Thread Simon Edwards

Hello,

Erik Janssens wrote:

For those of you who attend FOSDEM this year,
you might be interested in the short tutorial I will
present on building GUI applications with
PyQt and Elixir/Sqlalchemy.


Cool. I'll be at FOSDEM with the KDE crowd. Come over and say hello. 
That welcome applies to any else who is going to FOSDEM too. ;-)


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyKDE segfaults when calling group() on KSharedConfig object

2009-02-19 Thread Simon Edwards

Hi,

Benno Dielmann wrote:
thanks, Simon, for looking into this and in general for your great work on 
PyKDE :-). 

I'm using KGlobal.config() in my application now. What is the difference between 
this and KSharedConfig.openConfig()? What is the preferred way of getting access 
to the configuration system? From the api docs this isn't clear to me...


KSharedConfig.openConfig() crashes here too. Actually it complains about 
a pure virtual method being called. I don't know where or which 
exactly. KSharedConfig looks like a way of sharing config objects around 
in a C++ program and having it cleaned up in a timely way. It doesn't 
look relevant to Python as we already have better automatic memory 
management.


I always use KGlobal.config() and I'm fairly sure that is the right way 
to go. If that stops working, then get back to me.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyKDE segfaults when calling group() on KSharedConfig object

2009-02-27 Thread Simon Edwards

Benno Dielmann wrote:

config = KSharedConfig.openConfig()
group = config.group('General')

The second line results in a segfault. Interestingly, it doesn't if the config 
object is returned by KGlobal.config(). Documentation tells us KGlobal.config() 
returns a KSharedConfig object as does KSharedConfig.openConfig(). Strange.


I've committed a fix for KSharedConfig.openConfig() in KDE 4.2.1 (out 
next week). It keeps things working but appears to leak memory. I'll 
probably have another look at the problem and make something better for 
4.2.2.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyKDE Question : Anyone know what's up with the KDE4 sample code?

2009-03-06 Thread Simon Edwards

Arthur Pemberton wrote:

URL: http://websvn.kde.org/trunk/KDE/kdebindings/python/pykde4/examples/

I originally sent this to the PyKDE list, but it seemed to have
bounced. So i'm trying here.

Wasn't sure if other people were using some alternate means of
learning or if everyone is just very proficient with the C++ and the
C++ API


You mean like a tutorial or something?

  http://techbase.kde.org/Development/Tutorials/Plasma

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyQt and Python v3

2009-03-24 Thread Simon Edwards

Phil Thompson wrote:

The current SIP and PyQt4 snapshots now support Python v3. The build
process is exactly the same - just use the right interpreter to run
configure.py.



I'm still working through the examples - so far they have all run under
Python v3 without any changes.


oh excellent news! I didn't expect to see anything working so soon 
actually. How much work can we expect for getting Python 2 .sip files 
working on Python 3? Did you encounter many problems with hand written code?


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-04-19 Thread Simon Edwards

Hello Phil,

I'm working on getting PyKDE4 trunk working on SIP 4.8 and PyQt 4.5 and 
hit what looks like a fairly straight forward regression bug.


The compile error is:

/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip: 
In function ‘int convertTo_KSharedPtr_0200DNSSD_RemoteService(PyObject*, 
void**, int*, PyObject*)’:
/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip:247: 
error: ‘sipForceConvertTo_DNSSD’ was not declared in this scope 

/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip:247: 
error: expected ‘,’ or ‘;’ before ‘::’ token 



The offending C++ code is:

DNSSD::RemoteService *cpp = (DNSSD::RemoteService 
*)sipForceConvertTo_DNSSD::RemoteService (sipPy, iserr);


which was expanded from the mapped type:

---
template TYPE
%MappedType KSharedPtrTYPE
{
// ... etc etc ...

%ConvertToTypeCode
// Convert a Python instance to a Ptr on the heap.

if (sipIsErr == NULL)
return PyInstance_Check(sipPy);

int iserr = 0;
TYPE *cpp = (TYPE *)sipForceConvertTo_TYPE (sipPy, iserr);
// ... etc etc ...
---

elsewhere in the sip files I've got this which sets it all in motion:

typedef KSharedPtrDNSSD::RemoteService Ptr;

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Link between a QWebViev and a JavaScript program

2009-04-19 Thread Simon Edwards

projetmbc wrote:
I'm seeking for information about how to comunicate from PyQt with a 
JavaScript program.


QWebFrame's evaluateJavaScript() might be a start.

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-04-19 Thread Simon Edwards

Hi,

Phil Thompson wrote:

sipForceConvertTo_*() (and related functions) are internal and should not
be used by handwritten code. If it isn't documented then you can't use it.


Thanks that helps a lot.

Another question. 4.8 gives errors on PyKDE related it trying to use a 
copy constructor or operator=() on some classes which don't have one or 
have one which is private. It looks like SIP wants to use the copy 
constructor to copy a returned value from a method and then fails. Has 
anything changed? Have you got any tips about what I should be trying.


thanks,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-04-20 Thread Simon Edwards

Phil Thompson wrote:

On Sun, 19 Apr 2009 21:39:29 +0200, Simon Edwards si...@simonzone.com
wrote:

Phil Thompson wrote:

sipForceConvertTo_*() (and related functions) are internal and should

not

be used by handwritten code. If it isn't documented then you can't use
it.

Thanks that helps a lot.

Another question. 4.8 gives errors on PyKDE related it trying to use a 
copy constructor or operator=() on some classes which don't have one or 
have one which is private. It looks like SIP wants to use the copy 
constructor to copy a returned value from a method and then fails. Has 
anything changed? Have you got any tips about what I should be trying.


If a copy ctor is private then SIP should be told about it - see
qobject.sip.


The copy ctor is included and private like many others. This might be a 
namespace related issue. Here is what I've got. It worked in SIP  4.8.


class KEditListBox : QGroupBox
{
public:
class CustomEditor
{
public:
CustomEditor ();
CustomEditor (QWidget* repWidget, KLineEdit* edit);
CustomEditor (KComboBox* combo);

private:
CustomEditor (const KEditListBox::CustomEditor);
};
// ...
};


class KUrlRequester : KHBox
{
// ...
public:
explicit KUrlRequester (QWidget* parent /TransferThis/ = 0);
explicit KUrlRequester (const KUrl url, QWidget* parent 
/TransferThis/ = 0);

KUrlRequester (QWidget* editWidget, QWidget* parent /TransferThis/);

const KEditListBox::CustomEditor  customEditor ();
//  ^ This here fails.
}


/home/sbe/devel/kdesvninstall/include/keditlistbox.h: In function 
‘PyObject* meth_KUrlRequester_customEditor(PyObject*, PyObject*)’:
/home/sbe/devel/kdesvninstall/include/keditlistbox.h:77: error: 
‘KEditListBox::CustomEditor::CustomEditor(const 
KEditListBox::CustomEditor)’ is private

sipkiopart5.cpp:22797: error: within this context

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Regression(?) in SIP sip-4.8-snapshot-20090420

2009-04-21 Thread Simon Edwards

Hello,

Phil Thompson wrote:

Try tonight's SIP snapshot. It's a problem with the new implicit copying of
const reference results.


Thanks, that works better now.

I've hit another problem in a similar vein. This worked in SIP  4.8:

sip: Plasma::AbstractRunner::serviceQuery() unsupported function 
return type - provide %MethodCode and a C++ signature


This class here works fine:
---
class KService : KSycocaEntry
{
// ...
public:
typedef KSharedPtrKService Ptr;

typedef QListKService::Ptr List;
// ...
};

%MappedType QListKService::Ptr
{
// etc etc
}
---

And the problem is here:

namespace Plasma
{

class AbstractRunner : QObject
{
// ...

public:
// ...
typedef QListPlasma::AbstractRunner* List;

protected:

KService::List serviceQuery (const QString serviceType, const 
QString constraint = QString()) const;

/...
}

Something to do with the const return type?

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] (PyQt-snapshot) + (SIP-snapshot) = plasma crash

2009-04-24 Thread Simon Edwards

Grissiom wrote:
After installed PyQt-snapshot-20090422 and sip-snapshot-20090420 my 
plasma crashed after re-login. KDE4.2.2, Qt-copy(equal to 4.5). Need I 
recompile KDE?... Any hints? Thanks in advance. ;)


You need to recompile PyKDE in kdebindings which actually won't work 
right now since PyKDE needs to be fixed up for SIP 4.8. I'm working on 
that at the moment.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyQt Licensing

2009-05-12 Thread Simon Edwards

Hello,

Phil Thompson wrote:

In a nutshell, the PyQt licensing will not be changed in the short term.

This is mainly a financial decision - I want to ensure that PyQt
development, and that of other software, can still be funded. For the
moment an least, making an LGPL version available would be too much of a
risk - particularly as it would be impossible to reverse such a decision if
it proved to be a mistake - but it is something that I will continually
review.


Thanks for the clarification. This is a position that I can understand 
and respect. There are at least a few people who would like to see a 
LGPL and supported SIP + PyQt, but realistically there are more like two 
options or outcomes: 1) Current situation with a supported and developed 
SIP + PyQt, or 2) LGPL SIP + PyQt but unsupported and undeveloped. I 
don't see a lot of people putting their hand up to do bindings 
development (see QtJambi). From a Free Software point of view, a support 
GPL SIP + PyQt is a lot more useful than an unsupported LGPL version. 
Closed source wise, I don't have a problem with the idea that you should 
pay for the tools that are helping you develop and make money with your 
own software.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyQt Licensing

2009-05-12 Thread Simon Edwards

Hello,

A Corsaire wrote:
 I do think that this is a
worst-case outcome for the Python community as a whole. It means that 
PyQt development won't open up and become more community driven, that we 
(and other customers) still have to worry about the 
what-if-Phil-gets-hit-by-a-bus scenario,


Is this the classic What happens to my FOSS / closed source application 
if Riverbank disappears? problem? (Also known as Bus Factor 1) How big 
is the concern seriously? This sounds like the same situation that KDE 
was in when Qt was QPL/GPL, incidentally.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Copy constructors and assignment operator

2009-06-14 Thread Simon Edwards

Phil Thompson wrote:

On Sat, 13 Jun 2009 16:04:35 +0200, Arve Knudsen arve.knud...@gmail.com
wrote:

Phil, can you please explain why SIP 4.8 makes use of the assignment
operator when wrapping a class' copy constructor?


It doesn't as far as I know.


We have a couple of
classes that expose a copy constructor, but not the assignment operator

and

the SIP generated wrappers no longer compile with 4.8 (4.7.x worked),

since

the assignment operator is referenced.


An assignment helper is (sometimes) generated which does assume that there
is an assignment operator if there is a public copy ctor. I can change it
to allow you to explicitly define a private assignment operator if this is
not the case.


I seem to be hitting this problem too.


--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] can't compile pykde (kdebindings)

2009-09-28 Thread Simon Edwards

Tamás Bajusz wrote:

I'm trying to build a kdebindings package for UHU-Linux, but i can't.
It was ok with previous stable releases of sip and pyqt4.

python 2.6.2
qt 4.5.2
sip 4.9
pyqt4 4.6
kdebindings 4.3.0


It will work in the next KDE bug fix release of 4.3. It is already fixed 
in KDE's SVN.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Supporting Python 3 (and 2)

2009-11-09 Thread Simon Edwards

Hello Phil and Friends,

I'm (finally) digging into figuring out what I need to do for PyKDE to 
support Python 3. There doesn't seem to be much written on the subject, 
but I get the impression still that it is dead simple. It is just a 
matter of generating the C++ using SIP and compiling the result against 
the Python 3 headers and linking against Python 3's library? And then 
possibly adding some API annotations to PyKDE to support the newer way 
of doing things?


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Supporting Python 3 (and 2)

2009-11-10 Thread Simon Edwards

Phil Thompson wrote:

On Tue, 10 Nov 2009 08:40:31 +0100, Simon Edwards si...@simonzone.com
wrote:

Hello Phil and Friends,

I'm (finally) digging into figuring out what I need to do for PyKDE to 
support Python 3. There doesn't seem to be much written on the subject, 
but I get the impression still that it is dead simple. It is just a 
matter of generating the C++ using SIP and compiling the result against 
the Python 3 headers and linking against Python 3's library? And then 
possibly adding some API annotations to PyKDE to support the newer way 
of doing things?

 [snip]

ok, thanks. But as far as the first step goes, building and compilation, 
it is just a case of using Python 3's headers and library?



--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Supporting Python 3 (and 2)

2009-11-10 Thread Simon Edwards

Phil Thompson wrote:

On Tue, 10 Nov 2009 12:46:26 +0100, Simon Edwards si...@simonzone.com
wrote:

Phil Thompson wrote:

On Tue, 10 Nov 2009 08:40:31 +0100, Simon Edwards si...@simonzone.com
wrote:

Hello Phil and Friends,

I'm (finally) digging into figuring out what I need to do for PyKDE to 
support Python 3. There doesn't seem to be much written on the subject,


but I get the impression still that it is dead simple. It is just a 
matter of generating the C++ using SIP and compiling the result against


the Python 3 headers and linking against Python 3's library? And then 
possibly adding some API annotations to PyKDE to support the newer way 
of doing things?

  [snip]

ok, thanks. But as far as the first step goes, building and compilation, 
it is just a case of using Python 3's headers and library?


Apart from the fact that I think that's one of the last steps - yes.

SIP's build system will sort it out for you - if you are using it.


I'm invoking sip and g++ etc from cmake. I didn't notice any special 
python 3 flags for sip.




--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Bug in sip-4.9.2-snapshot-20091108 handling virtual methods

2009-11-13 Thread Simon Edwards

Giovanni Bajo wrote:

this kind of problems happen to me without a full recompilation;
specifically, if module A %Imports module B, you need to recompile A
whenever *any* of B's sip files changes.

sipdistutils.py doesn't handle this automatically yet, but I have a
patch in progress.


I don't think that is the problem since I blown away the build files and 
recompiled plenty of times but the problem persists, and another person 
has also consistently had the same thing.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Support for Qt v4.6

2009-12-20 Thread Simon Edwards

Hello,

Phil Thompson wrote:

For those interested, the current PyQt and SIP snapshots fully support Qt
v4.6. I've also ported the animation examples.


I'm compiling PyKDE trunk with it and first problem I've hit is that a 
mapped type for QSetTYPE* is now available, PyKDE already has one for 
this and SIP complains about it already being defined. Easy enough for 
me fix in PyKDE, but it is a (small) BC problem.



The next releases will probably be very early in the new year.


excellent.

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] KAuth and PyKDE4

2010-09-20 Thread Simon Edwards

Hello,

On 09/20/2010 05:36 PM, Максим Кольцов wrote:

Hi. I have live build of pykde4 (just from svn) and i want to use KAuth
framework with my python application. I have trouble with implemening
KAuth helper: what arguments should be passed to
KAuth.HelperSupport.helperMain? You can look at my code at
http://github.com/maksbotan/krf/


There is a PolKit example in kdebindings (examples/polkitqtExamples 
directory) if that helps.


cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] kdebindings 4.4.4 build failure with sip-4.11.1

2010-09-22 Thread Simon Edwards

Hello,

On 09/21/2010 11:32 PM, Hans-Peter Jansen wrote:

in an attempt to build python-kde4 from kdebindings-4.4.4, I stumbled
across this failure:

sip:  
/usr/src/packages/BUILD/kdebindings-4.4.4/python/pykde4/sip/kdecore/typedefs.sip:737:
   Mapped type has already been defined in another module
make[2]: *** [python/pykde4/sip/akonadi/sipakonadipart0.cpp] Error 1
make[2]: Leaving directory `/usr/src/packages/BUILD/kdebindings-4.4.4/build'
make[1]: *** [python/pykde4/CMakeFiles/python_module_PyKDE4_akonadi.dir/all] 
Error 2

Is this issue already known?


yep. It is a small incompatibility in PyQt introduced after KDE 4.5 came 
out.


This change on trunk will most likely fix your problem. You should be 
able to apply the change to 4.4.4  4.5.1.


  http://websvn.kde.org/?view=revisionrevision=1170602

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] kdebindings 4.4.4 build failure with sip-4.11.1 continues

2010-09-30 Thread Simon Edwards

Hello,

On 09/30/2010 02:27 PM, Phil Thompson wrote:

On Wed, 22 Sep 2010 11:25:21 +0200, Hans-Peter Jansenh...@urpla.net
wrote:

Yes, that fixed this problem. Thanks a bunch. I guess, sip got pickier
about
multiply defined type converters lately.

Unfurtunately, here's the next stumbling point:

/usr/include/kio/tcpslavebase.h: In function 'PyObject*
slot_KIO_TCPSlaveBase_SslResult___xor__(PyObject*, PyObject*)':
/usr/include/kio/tcpslavebase.h:63: error: 'enum
KIO::TCPSlaveBase::SslResultDetail' is protected
/usr/share/sip/PyQt4/QtCore/qglobal.sip:320: error: within this context
/usr/include/kio/tcpslavebase.h: In function 'PyObject*
slot_KIO_TCPSlaveBase_SslResult___or__(PyObject*, PyObject*)':
/usr/include/kio/tcpslavebase.h:63: error: 'enum
KIO::TCPSlaveBase::SslResultDetail' is protected
/usr/share/sip/PyQt4/QtCore/qglobal.sip:315: error: within this context

Phil, this one is due to the logic operator changes. It's not obvious,
what's
going wrong, but related to the friend class QFlags declararation, where



qglobal.sip got pulled in..


Try changing global.sip with...


I tried to build PyKDE 4.5 the other day and got the same problem as 
what Hans-Peter describes. I just tried your advice Phil and it looks 
like it fixed the compile problem.


thanks Phil and Hans,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


<    1   2