[PyKDE] disconnecting PYSIGNAL
SIGNAL connections get automatically cleaned up by Qt when the recieving C++ object is destroyed. It appears that PYSIGNAL connections get automatically cleaned up when the recieving python object is destroyed. I currently have a problem where I am destroying a c++ object (using deleteLater) but the python object lives on (I guess due to a reference cycle somewhere). This half-dead object still continues to recieve PYSIGNALS, which I wasnt expecting. checked with PyQt 3.8.1, qt 3.1.2 on windows, test script below. Im sure I will fixing the reference cycle eventually, but I dont want to rely on that for program correctness. Is this a bug in pyqt? Is there a way to manually disconnect all PYSIGNALs to an object? Or perhaps my use of deleteLater is the problem is there a better way to remove closed view windows from a QWorkspace? Thanks in advance, from qt import * class A(QObject): pass class B(QObject): def bbb(self): print 'in bbb' print self.children() print 'dont get here' a = A() b = B() app = QApplication([]) a.connect(a,PYSIGNAL('aaa'),b.bbb) b.deleteLater() app.processEvents() #b = 0 # deleting the python object would make the problem go away a.emit(PYSIGNAL('aaa'),()) -- Toby Dickenson ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] pyKDE error
hi i had problems creating pyKDE on my system and output told me to email this to you. i am using suse 9.0 and since there seem to be no precompiled pyKDE rpms for this release and the suse 8.2 ones are causing problems i would be really grateful if someone could figure this out. thanks and greetings hannes hauswedell this is the whole program output: linux:/mnt/hdb2_setup/Linux_Packages/PyKDE-3.7-4 # python build.py -q /usr/ lib/qt3 -v /usr/lib/qt3/sip Building PyKDE 3.8 for Python 2.3+ on linux2. /usr/lib/python2.3/site-packages is the PyKDE installation directory. /usr/include/python2.3 contains Python.h. /usr/bin/sip will be used as the SIP code generator. /usr/include/python2.3 contains sipQt.h. /usr/lib/python2.3/site-packages contains the SIP module. /usr/lib/qt3 is the Qt base directory. /usr/lib/qt3/include contains qglobal.h. Qt 3.2.1 is being used. /opt/kde3 is the KDE base directory. /opt/kde3/include contains kdeversion.h. KDE 3.1.3 is being used. /usr/lib/qt3/bin/qmake will be used to generate Makefiles. The libqt-mt.so.3 Qt library was found. Qt thread support is enabled. Qt and KDE use compatible libs (threading) found libs for modules: dcop kdecore kdesu kdefx kdeui kio kfile (kio) kparts khtml kjs kspell kdeprint PyQt/sip directory found at /usr/lib/qt3/sip PyQt sip file version is compatible with PyKDE (3.8) sip version is compatible with PyKDE-3.8 /usr/bin/make will be used as the make program. Checking to see if the C++ compiler supports -fno-exceptions. g++ -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -w -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -fno-exceptions -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include/python2.3 -I/opt/kde3/include -I/usr/include -I/usr/lib/qt3/ include -o qttest.o qttest.cpp g++ -o qttest qttest.o -L/usr/lib/ -L/usr/lib/qt3/lib/ -L/usr/X11R6/lib/ -lqt-mt -lXext -lX11 -lm -lpthread The C++ compiler supports -fno-exceptions. Using existing features file. Generating the C++ source for the dcop module. Generating the Makefile for the dcop module. Concatenating the C++ files for the dcop module. Compiling dcop.py. Generating the C++ source for the kdecore module. Generating the Makefile for the kdecore module. Concatenating the C++ files for the kdecore module. Compiling kdecore.py. Generating the C++ source for the kdesu module. Generating the Makefile for the kdesu module. Concatenating the C++ files for the kdesu module. Compiling kdesu.py. Generating the C++ source for the kdefx module. Generating the Makefile for the kdefx module. Concatenating the C++ files for the kdefx module. Compiling kdefx.py. Generating the C++ source for the kdeui module. Generating the Makefile for the kdeui module. Concatenating the C++ files for the kdeui module. Compiling kdeui.py. Generating the C++ source for the kio module. Generating the Makefile for the kio module. Concatenating the C++ files for the kio module. Compiling kio.py. Generating the C++ source for the kfile module. Generating the Makefile for the kfile module. Concatenating the C++ files for the kfile module. Compiling kfile.py. Generating the C++ source for the kparts module. Generating the Makefile for the kparts module. Concatenating the C++ files for the kparts module. Compiling kparts.py. Generating the C++ source for the khtml module. Generating the Makefile for the khtml module. Concatenating the C++ files for the khtml module. Compiling khtml.py. Generating the C++ source for the kjs module. Generating the Makefile for the kjs module. Concatenating the C++ files for the kjs module. Compiling kjs.py. Generating the C++ source for the kspell module. Generating the Makefile for the kspell module. Concatenating the C++ files for the kspell module. Compiling kspell.py. Generating the C++ source for the kdeprint module. Generating the Makefile for the kdeprint module. Concatenating the C++ files for the kdeprint module. Compiling kdeprint.py. Creating top level Makefile. QDir::currentDirPath: stat(.) failed QDir::currentDirPath: stat(.) failed QDir::currentDirPath: stat(.) failed Cannot find directory: Error processing project file: /PyKDE.pro An internal error occured. Please report all the output from the program, including the following traceback, to [EMAIL PROTECTED] and CC the PyKDE mailing list: [EMAIL PROTECTED]. Thanks. Traceback (most recent call last): File build.py, line 1616, in ? main(sys.argv) File build.py, line 1595, in main buildMakefile(PyKDE.pro) File build.py, line 1250, in buildMakefile runProgram(makefileGen,['-o', 'Makefile', pro],1,wd) File build.py, line 1431, in main nrcpu = int(os.environ[SMP]) File /usr/lib/python2.3/UserDict.py, line 19, in __getitem__ def __getitem__(self, key): return self.data[key] KeyError: 'SMP' linux:/mnt/hdb2_setup/Linux_Packages/PyKDE-3.7-4 # ___ PyKDE mailing list[EMAIL PROTECTED]
Re: [PyKDE] disconnecting PYSIGNAL
On Mon, 3 Nov 2003 10:24:23 + Toby Dickenson [EMAIL PROTECTED] wrote: SIGNAL connections get automatically cleaned up by Qt when the recieving C++ object is destroyed. It appears that PYSIGNAL connections get automatically cleaned up when the recieving python object is destroyed. bool QObject::disconnect ( const QObject * sender, const char * signal, const QObject * receiver, const char * member ) [static] I do not know if I have example code, but AFAIR it works. Gerard ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] disconnecting PYSIGNAL
On Monday 03 November 2003 3:41 pm, Toby Dickenson wrote: On Monday 03 November 2003 14:54, Gerard Vermeulen wrote: On Mon, 3 Nov 2003 10:24:23 + Toby Dickenson [EMAIL PROTECTED] wrote: SIGNAL connections get automatically cleaned up by Qt when the recieving C++ object is destroyed. It appears that PYSIGNAL connections get automatically cleaned up when the recieving python object is destroyed. bool QObject::disconnect ( const QObject * sender, const char * signal, const QObject * receiver, const char * member ) [static] I do not know if I have example code, but AFAIR it works. I know about that one for individual signals, but you need to know what signals need disconnecting. I was hoping for a way to disconnect all signals into an object in bulk. Or a way of enumerating the signals into an object hmmm. The wildcard variants of disconnect() are on the TODO list. Phil ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] Re: pyKDE error
On Sunday November 2 2003 14:05, Hannes Hauswedell wrote: hi i had problems creating pyKDE on my system and output told me to email this to you. i am using suse 9.0 and since there seem to be no precompiled pyKDE rpms for this release and the suse 8.2 ones are causing problems i would be really grateful if someone could figure this out. thanks and greetings hannes hauswedell snipped everything that looked good Creating top level Makefile. This is definitely weird. I think the following is coming from qmake - build.py doesn't use anything from Qt/PyQt: QDir::currentDirPath: stat(.) failed QDir::currentDirPath: stat(.) failed QDir::currentDirPath: stat(.) failed Cannot find directory: Error processing project file: /PyKDE.pro An internal error occured. Please report all the output from the program, including the following traceback, to [EMAIL PROTECTED] and CC the PyKDE mailing list: [EMAIL PROTECTED]. Thanks. This traceback seems to leftover from the indicated stmt in line 1431 which is in a try-except block - it really can't be the point of failure or build.py would have quit much earlier. Traceback (most recent call last): File build.py, line 1616, in ? main(sys.argv) File build.py, line 1595, in main buildMakefile(PyKDE.pro) File build.py, line 1250, in buildMakefile runProgram(makefileGen,['-o', 'Makefile', pro],1,wd) File build.py, line 1431, in main nrcpu = int(os.environ[SMP]) File /usr/lib/python2.3/UserDict.py, line 19, in __getitem__ def __getitem__(self, key): return self.data[key] KeyError: 'SMP' linux:/mnt/hdb2_setup/Linux_Packages/PyKDE-3.7-4 # First, look in the top level directory for PyKDE and see if the PyKDE.pro file exists. If it doesn't, that would be the problem (build.py should create it). If you don't have it, you can create it. Be sure the user running build.py has write access to the top level directory - build.py needs to create PyKDE.pro and Makefile there. This is all PyKDE.pro consists of: -- TEMPLATE = subdirs SUBDIRS = dcop kdecore kdesu kdefx kdeui kio kfile kparts khtml\ kjs kspell kdeprint -- (SUBDIRS can be all on one line) Then run: qmake -o Makefile PyKDE.pro from the top level directory (you may need to specify the path to qmake - should be something like /usr/lib/qt3/bin/qmake for SuSE). At that point (after creating Makefile/no errors) you should be able to run make and make install, because build.py ran far enough to do everything else necessary. If the above doesn't work, then there's likely a problem with the qmake installation or the template files qmake uses. Let me know how that turns out (esp if PyKDE.pro wasn't created automatically). Jim ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] Problems installing on debian
I have PyQT and sip installed from debian unstable, however i cant get the build to PyKde to work. It finishes quickly with the following: Error: Couldn't find PyQt/sip directory -- from line 750 in build.py I have sip 3.8 and am trying to build this against kde cvs head, so i expect some problems. Any ideas exactly what this means though, and how to do deal with it? Are they any packages for debian i can install? Ricardo's site seems to claim they exist, but not on that server i guess. Thanks Tom -- ^__^| Tom Badran (oo)\__ | Imperial College (__)\ )\/\| Department of Computing ||w || --- || ||| Using Debian SID ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Problems installing on debian
On Monday November 3 2003 12:21, Tom Badran wrote: I have PyQT and sip installed from debian unstable, however i cant get the build to PyKde to work. It finishes quickly with the following: Error: Couldn't find PyQt/sip directory -- from line 750 in build.py I have sip 3.8 and am trying to build this against kde cvs head, so i expect some problems. Any ideas exactly what this means though, and how to do deal with it? Are they any packages for debian i can install? Ricardo's site seems to claim they exist, but not on that server i guess. I don't know about packages, but the error you're getting means what it says - build.py can't find the PyQt sip files. These are the files used to build PyQt, and if you installed a binary of PyQt, you may not have them. There should be a -devel package of some sort that contains them - if not you can download PyQt 3.8 from http://riverbankcomputing.co.uk. You should just be able to untar PyQt in a directory. That will give you the sip files - you shouldn't need to rebuild PyQt. You can then run build.py with the -v switch to specify that path: python build.py -v path to PyQt sip files The path will be something like: /usr/local/PyQt-x11-gpl-3.8/sip The sip on the end is critical - the rest just needs to be the correct path. If you get a version mismatch type of error (using PyKDE-3.7 with PyQt-3.8 for example), you can edit build.py to change the value of Release from 3.7 to 3.8. PyKDE doesn't work with sip4/PyQt4 yet - you need PyQt-3.7 or 3.8. Jim ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Problems installing on debian
On Mon, Nov 03, 2003 at 08:21:56PM +, Tom Badran wrote: I have PyQT and sip installed from debian unstable, however i cant get the build to PyKde to work. It finishes quickly with the following: Error: Couldn't find PyQt/sip directory -- from line 750 in build.py I have sip 3.8 and am trying to build this against kde cvs head, so i expect some problems. Any ideas exactly what this means though, and how to do deal with it? Are they any packages for debian i can install? Ricardo's site seems to claim they exist, but not on that server i guess. Well. I have those packages (built them just today, after a while), and everything seems good... except for a little problem. I didn't realize that Jim's installation process places soft links from $USUALLIBPLACE to $PYTHONPATH/site-packages for libpythonize.so* (just noticed), and I place them manually at site-packages (with no ln -s), so I need to rebuild the package. It will be there (at my repo) late today. Into Debian unstable probably on one-two weeks (maybe I'll wait a bit more until Jim releases the final v3.8). ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde