Re: [PyKDE] PyQt compile problems

2003-03-28 Thread Hans-Peter Jansen
Hi Randall,

Sometimes, it's helpful to look into the list first. Especially if someone
asked for the same problem the day before!

Phils answer:
Upgrade to the snapshot version of PyQt or wait for PyQt v3.6.

Pete

On Friday 28 March 2003 05:21, Randall wrote:
> I'm trying to install PyQt on Gentoo, but I keep getting an error during
> installation.  I have sip 3.5 installed and qt 3.1.2.
>
> I posted on the gentoo list and I was referred here.


___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


[PyKDE] [PATCH] the new build options for sip

2003-03-27 Thread Hans-Peter Jansen
Hi Phil,

as promised, here is a similar patch for sip. The former announced 
ChangeLog entries for -r and -t applies here, too.

Pete--- build.py.orig	2003-03-27 17:56:38.0 +0100
+++ build.py	2003-03-27 18:18:07.0 +0100
@@ -20,12 +20,14 @@
 
 # Define the globals.
 progName = None
 qtDir = None
 qtIncDir = None
+qtLibDir = None
 qtVersion = 0
 qtLib = None
+platPyBaseDir = None
 platPySiteDir = None
 platPyIncDir = None
 platPyLib = None
 platBinDir = None
 modDir = None
@@ -50,11 +52,11 @@
 def usage(rcode = 2):
 """Display a usage message and exit.
 
 rcode is the return code passed back to the calling process.
 """
-global progName, platBinDir, platMake, modDir, sipIncDir, platQTDIRName
+global progName, platBinDir, platMake, modDir, sipIncDir, platQTDIRName, platPyBaseDir
 
 print "Usage:"
 print "%s [-h] [-b dir] [-d dir] [-e dir] [-f gccflag] [-g prog] [-i dir] [-l Qt-library] [-m prog] [-p dir] [-q dir] [-u] [-w] [-x]" % (progName)
 print "where:"
 print "-h display this help message"
@@ -65,10 +67,12 @@
 print "-g progthe name of the Makefile generator"
 print "-i dir the directory containing the Qt header files [default %s%sinclude]" % (platQTDIRName,os.sep)
 print "-l Qt-library  explicitly specify the type of Qt library, either qt, qt-mt or qte"
 print "-m progthe name of the Make program [default %s]" % (platMake)
 print "-q dir the Qt base directory [default %s]" % (platQTDIRName)
+print "-r dir the Qt lib directory [default %s%slib]" % (platQTDIRName, os.sep)
+print "-t dir Python base directory [default %s]" % (platPyBaseDir)
 print "-u build with debugging symbols"
 print "-w enable the use of Python 1.5.x under Windows"
 print "-x disable Qt support"
 
 sys.exit(rcode)
@@ -132,11 +136,11 @@
 
 
 def initGlobals():
 """Sets the values of globals that need more than a simple assignment.
 """
-global platMake, platCopy, platPySiteDir, platPyIncDir, platPyLib
+global platMake, platCopy, platPyBaseDir, platPySiteDir, platPyIncDir, platPyLib
 global platQTDIRName, platBinDir, modDir, sipIncDir, pyFullVers, pyVersNr
 
 pyFullVers = string.split(sys.version)[0]
 
 vl = string.split(re.findall("[0-9.]*",pyFullVers)[0],".")
@@ -148,28 +152,34 @@
 
 if sys.platform == "win32":
 platMake = "nmake"
 platCopy = "copy /y"
 
+if not platPyBaseDir:
+platPyBaseDir = sys.prefix
+
 if pyVersNr < 22:
-platPySiteDir = sys.prefix + "\\Lib"
+platPySiteDir = platPyBaseDir + "\\Lib"
 else:
-platPySiteDir = sys.prefix + "\\Lib\\site-packages"
+platPySiteDir = platPyBaseDir + "\\Lib\\site-packages"
 
-platPyIncDir = sys.prefix + "\\include"
+platPyIncDir = platPyBaseDir + "\\include"
 platQTDIRName = "%QTDIR%"
 platBinDir = sys.exec_prefix
 
-platPyLib = sys.prefix + "\\libs\\python%d.lib" % (pyVersNr)
+platPyLib = platPyBaseDir + "\\libs\\python%d.lib" % (pyVersNr)
 else:
 platMake = "make"
 platCopy = "cp"
 
+if not platPyBaseDir:
+platPyBaseDir = sys.prefix + "/lib/python" + pyVers
+
 if pyVersNr < 20:
-platPySiteDir = sys.prefix + "/lib/python" + pyVers
+platPySiteDir = platPyBaseDir
 else:
-platPySiteDir = sys.prefix + "/lib/python" + pyVers + "/site-packages"
+platPySiteDir = platPyBaseDir + "/site-packages"
 
 platPyIncDir = sys.prefix + "/include/python" + pyVers
 platQTDIRName = "$QTDIR"
 platBinDir = "/usr/local/bin"
 
@@ -458,13 +468,16 @@
 
 
 def checkQtLibrary():
 """Check which Qt library is to be used.
 """
-global qtDir, qtLib
+global qtDir, qtLibDir, qtLib
 
-qtlibdir = qtDir + os.sep + "lib"
+if qtLibDir:
+qtlibdir = qtLibDir
+else:
+qtlibdir = qtDir + os.sep + "lib"
 
 if qtLib is None:
 mtlib = isQtLibrary(qtlibdir,"qt-mt")
 stlib = isQtLibrary(qtlibdir,"qt")
 emlib = isQtLibrary(qtlibdir,"qte")
@@ -849,11 +862,11 @@
 progName = os.path.basename(argv[0])
 
 initGlobals()
 
 try:
-optlist, args = getopt.getopt(argv[1:],"hb:d:e:f:g:i:l:m:q:uwx")
+optlist, args = getopt.getopt(argv[1:],"hb:d:e:f:g:i:l:m:q:r:t:uwx")
 except getopt.GetoptError:
 usage()
 
 global makeBin, platBinDir, debugMode
 
@@ -890,10 +903,17 @@
 makeBin = arg
 explicitMake = 1
 elif opt == "-q":
 global qtDir
 qtDir = arg
+elif opt == "-r":
+global qtLibDir
+qtLibDir = arg
+elif opt == "-t":
+global platPyBaseDir
+platPyBaseDir = arg
+initGlobals(

Re: [PyKDE] [PATCH] new build.py options for lib64 and cat split

2003-03-26 Thread Hans-Peter Jansen
On Wednesday 26 March 2003 14:59, Phil Thompson wrote:
>
> Sorry, I think you've misunderstood. The -r flag should define the full
> path of the Qt library directory - not just a component of it - like the -i
> flag for the header files. This is more flexible because it allows any
> arbitary directory to be specified.
>
> Same for -t - or does the -d flag already do it?
>
> Phil

I understood your concerns, but hesitated to make such deep changes.
Attached is what you asked for ;-) Hopefully all is well, especially the
win32 changes, which I haven't tested.

Here is something (hopefully) suitable for the ChangeLog:
Added -r flag to the build system to explicitly specify the Qt library 
directory. This is useful for 64 bit systems, where the libs are placed 
in $QTDIR/lib64, unlike the default $QTDIR/lib.
Same goes for the new -t flag, which specify the python base directory,
which is /usr/lib64/python#.# on such systems. This option takes 
priority over -d.
For concatenated builds (-c), a -j # flag was added to the build system 
for splitting huge modules, consisting of more then 100 single c++ modules, 
into # of pieces. This is useful in SMP environments, combined with 
make -j #, where # should correspond, to saturate the CPUs. It's also 
helpful for troubling c++ compilers and memory constraint systems, which 
may fail on such big sources otherwise. 

Pete--- build.py.orig	2003-03-24 02:51:15.0 +0100
+++ build.py	2003-03-26 16:34:09.0 +0100
@@ -21,12 +21,14 @@
 
 # Define the globals.
 progName = None
 qtDir = None
 qtIncDir = None
+qtLibDir = None
 qtVersion = 0
 qtLib = None
+platPyBaseDir = None
 platPyScriptDir = None
 platPyDLLDir = None
 platPySiteDir = None
 platPyIncDir = None
 platPyLib = None
@@ -57,38 +59,42 @@
 debugMode = "release"
 catCppFiles = 0
 qpeTag = None
 licType = None
 gccFlags = []
+catSplit = 0
 
 
 def usage(rcode = 2):
 """Display a usage message and exit.
 
 rcode is the return code passed back to the calling process.
 """
-global progName, platBinDir, platMake, modDir, platQTDIRName, sipIncDir
+global progName, platBinDir, platMake, modDir, platQTDIRName, platPyBaseDir, sipIncDir
 
 print "Usage:"
-print "%s [-h] [-a version] [-b dir] [-c] [-d dir] [-e dir] [-f gccflag] [-g prog] [-i dir] [-l Qt-library] [-m prog] [-n dir] [-o dir] [-p dir] [-q dir] [-s dir] [-u] [-w]" % (progName)
+print "%s [-h] [-a version] [-b dir] [-c] [-d dir] [-e dir] [-f gccflag] [-g prog] [-i dir] [-j #] [-l Qt-library] [-m prog] [-n dir] [-o dir] [-p dir] [-q dir] [-r dir] [-s dir] [-t dir] [-u] [-w]" % (progName)
 print "where:"
 print "-h display this help message"
 print "-a tag explicitly enable the qtpe module"
 print "-b dir where pyuic and pylupdate will be installed [default %s]" % (platBinDir)
 print "-c concatenate each module's C++ source files"
 print "-d dir where PyQt will be installed [default %s]" % (modDir)
 print "-e dir the directory containing the SIP header files [default %s]" % (sipIncDir)
 print "-f gccflag additional GCC flag, eg. -fno-exceptions"
 print "-g progthe name of the Makefile generator"
 print "-i dir the directory containing the Qt header files [default %s%sinclude]" % (platQTDIRName,os.sep)
+print "-j #   split huge concatenated modules in # pieces"
 print "-l Qt-library  explicitly specify the type of Qt library, either qt, qt-mt or qte"
 print "-m progthe name of the Make program [default %s]" % (platMake)
 print "-n dir the directory containing the QScintilla header files [default %s%sinclude]" % (platQTDIRName, os.sep)
 print "-o dir the directory containing the QScintilla library [default %s%slib]" % (platQTDIRName, os.sep)
 print "-p dir the name of the SIP code generator [default sip]"
 print "-q dir the Qt base directory [default %s]" % (platQTDIRName)
+print "-r dir the Qt lib directory [default %s%slib]" % (platQTDIRName, os.sep)
 print "-s dir the directory containing the SIP module"
+print "-t dir Python base directory [default %s]" % (platPyBaseDir)
 print "-u build with debugging symbols"
 print "-w enable the use of Python 1.5.x under Windows"
 
 sys.exit(rcode)
 
@@ -151,11 +157,11 @@
 
 
 def initGlobals():
 """Sets the values of globals that need more than a simple assignment.
 """
-global platMake, platCopy, platPyScriptDir, platPyDLLDir, platPySiteDir
+global platMake, platCopy, platPyBaseDir, platPyScriptDir, platPyDLLDir, platPySiteDir
 global platPyIncDir, platPyLib, platQTDIRName, platBinDir, platMkdir
 global platRmdir, modDir, pyFullVers, pyVersNr, sipIncDir
 
 pyFullVers = string.split(sys.version)[0]
 
@@ -16

[PyKDE] [PATCH] new build.py options for lib64 and cat split

2003-03-26 Thread Hans-Peter Jansen
Hi Phil,

next attempt for $subject. They're all separate lowercase options now.
Let me know, if this is acceptable for you. I've thought some time on 
how to make the path handling simpler without loosing flexibility nor 
functionality, but don't wanted to risk breaking stuff in obscure 
environments, which I cannot test here. I think, that stability has 
higher priority by now shortly before the 3.6 release. This approach 
has the advantange to be easily adopted by current build systems, too.

One possible alternative would be changing -d to specify a relative
dir, e.g. "site-packages", and let the new -t option specify the python 
base, but this leads to the afore mentioned disadvantage.

The lib64 stuff is logically chacked against 64 bit package listings
from SuSE.

Here is something (hopefully) suitable for your ChangeLog:
Added -r flag to the build system to specify the Qt library directory.
This is useful for 64 bit systems, where the libs are placed in a "lib64" 
directory. Same goes for the new -t flag, which specify the python lib 
directory. Both options defaults to "lib" in order to keep the current 
behaviour, and should be specified as "lib64" on such systems.
Added -j # flag to the build system for splitting huge modules, consisting 
of more then 100 single c++ modules, into # of pieces, when concatenated (-c).
This is useful in SMP environments, combined with make -j #, where # should 
correspond. It's also useful for troubling c++ compilers, which fail on such 
big sources otherwise.

Pete--- build.py.orig	2003-03-24 02:51:15.0 +0100
+++ build.py	2003-03-26 12:50:18.0 +0100
@@ -21,16 +21,18 @@
 
 # Define the globals.
 progName = None
 qtDir = None
 qtIncDir = None
+qtLibDir = "lib"
 qtVersion = 0
 qtLib = None
 platPyScriptDir = None
 platPyDLLDir = None
 platPySiteDir = None
 platPyIncDir = None
+platPyLibDir = "lib"
 platPyLib = None
 sipModuleDir = None
 sipIncDir = None
 sipBin = None
 sipVersion = 3
@@ -57,38 +59,42 @@
 debugMode = "release"
 catCppFiles = 0
 qpeTag = None
 licType = None
 gccFlags = []
+catSplit = 0
 
 
 def usage(rcode = 2):
 """Display a usage message and exit.
 
 rcode is the return code passed back to the calling process.
 """
-global progName, platBinDir, platMake, modDir, platQTDIRName, sipIncDir
+global progName, platBinDir, platMake, modDir, platQTDIRName, platPyLibDir, sipIncDir, qtLibDir
 
 print "Usage:"
-print "%s [-h] [-a version] [-b dir] [-c] [-d dir] [-e dir] [-f gccflag] [-g prog] [-i dir] [-l Qt-library] [-m prog] [-n dir] [-o dir] [-p dir] [-q dir] [-s dir] [-u] [-w]" % (progName)
+print "%s [-h] [-a version] [-b dir] [-c] [-d dir] [-e dir] [-f gccflag] [-g prog] [-i dir] [-j #] [-l Qt-library] [-m prog] [-n dir] [-o dir] [-p dir] [-q dir] [-r dir] [-s dir] [-t dir] [-u] [-w]" % (progName)
 print "where:"
 print "-h display this help message"
 print "-a tag explicitly enable the qtpe module"
 print "-b dir where pyuic and pylupdate will be installed [default %s]" % (platBinDir)
 print "-c concatenate each module's C++ source files"
 print "-d dir where PyQt will be installed [default %s]" % (modDir)
 print "-e dir the directory containing the SIP header files [default %s]" % (sipIncDir)
 print "-f gccflag additional GCC flag, eg. -fno-exceptions"
 print "-g progthe name of the Makefile generator"
 print "-i dir the directory containing the Qt header files [default %s%sinclude]" % (platQTDIRName,os.sep)
+print "-j #   split huge concatenated modules in # pieces"
 print "-l Qt-library  explicitly specify the type of Qt library, either qt, qt-mt or qte"
 print "-m progthe name of the Make program [default %s]" % (platMake)
 print "-n dir the directory containing the QScintilla header files [default %s%sinclude]" % (platQTDIRName, os.sep)
 print "-o dir the directory containing the QScintilla library [default %s%slib]" % (platQTDIRName, os.sep)
 print "-p dir the name of the SIP code generator [default sip]"
 print "-q dir the Qt base directory [default %s]" % (platQTDIRName)
+print "-r dir the Qt lib directory [default %s]" % (qtLibDir)
 print "-s dir the directory containing the SIP module"
+print "-t dir Python lib directory [default %s]" % (platPyLibDir)
 print "-u build with debugging symbols"
 print "-w enable the use of Python 1.5.x under Windows"
 
 sys.exit(rcode)
 
@@ -152,12 +158,12 @@
 
 def initGlobals():
 """Sets the values of globals that need more than a simple assignment.
 """
 global platMake, platCopy, platPyScriptDir, platPyDLLDir, platPySiteDir
-global platPyIncDir, platPyLib, platQTDIRName, platBinDir, platMkdir
-   

Re: [PyKDE] [PATCH] reduce PyQt concatenated build time on SMP

2003-03-24 Thread Hans-Peter Jansen
On Monday 24 March 2003 15:58, Phil Thompson wrote:
> On Monday 24 March 2003 2:50 pm, Gerard Vermeulen wrote:
> >
> > If you are proposing this, why don't you generalize and code something
> > like the -j switch (parallel build switch) for make.
> >
> > In this case there is no penalty for UP machines (by default one single
> > huge.cpp), and the guys with 4 processors will feel happy, too :-)
>
> Yes - I'd be happy with this. It also helps those compilers (aka MSVC) that
> choke on such a large C++ file but would probably handle...
>
> python build.py -c -j 10

One remark: the semantics will differ: while make -j 10 would run 10 build
processes in parallel, this command should split large modules into 10 pieces. 
Is this fine with you?

> Phil

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] [PATCH] reduce PyQt concatenated build time on SMP

2003-03-24 Thread Hans-Peter Jansen
On Monday 24 March 2003 13:05, Phil Thompson wrote:
> On Monday 24 March 2003 11:53 am, Hans-Peter Jansen wrote:
> > Hi Phil,
> >
> > in order to saturate multiple CPUs on SMP systems, I've created the
> > attached patch.
> >
> > The problem is, that the qt module consists of 228 single modules, and
> > build of its concatenated module outlasts all others by a few minutes
> > here.
> >
> > With it applied, I was able to reduce the rpm build time from 16:15 to
> > 13.30 on my Dual P3/1000.
> >
> > Since it is created on top of my former patch, it will apply with
> > offsets, if applied first.
>
> But doesn't this slow it down for everybody with a UP machine?
>
> Phil

Well, yes, I have to admit. But the performance hit is less then the
improvement, aka 19:53 -> 21:29 UP, AMD 2000+ (~8%), 16:15 -> 13:30 (~20%).

Would you accept a combined cleaned up patch with different lower case options
for this and the lib stuff?

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


[PyKDE] [PATCH] reduce PyQt concatenated build time on SMP

2003-03-24 Thread Hans-Peter Jansen
Hi Phil,

in order to saturate multiple CPUs on SMP systems, I've created the attached 
patch.

The problem is, that the qt module consists of 228 single modules, and 
build of its concatenated module outlasts all others by a few minutes here.

With it applied, I was able to reduce the rpm build time from 16:15 to 13.30
on my Dual P3/1000.

Since it is created on top of my former patch, it will apply with offsets,
if applied first.

Thanks,
Pete--- build.py.new	2003-03-24 11:40:11.0 +0100
+++ build.py	2003-03-24 12:11:55.0 +0100
@@ -1282,23 +1282,42 @@
 srclist = buf[match.start(0):match.end(0)]
 srclist = srclist[13:-1]
 srclist = string.replace(srclist,"\\\n\t","")
 srclist = string.split(srclist," ")
 
+if len(srclist) > 100:
+# special case for huge modules: create two modules
+
+h = len(srclist)/2
+# Concatenate the files.
+d = open(mname + "huge2.cpp","w")
+
+for cppfile in srclist[:h]:
+f = open(cppfile,"r")
+d.write(f.read())
+f.close()
+
+d.close()
+
+srclist = srclist[h:]
+
+# Replace the C++ file names in the project file.
+buf = re.sub(pat,"SOURCES = " + mname + "huge2.cpp " + mname + "huge.cpp\n",buf)
+else:
+# Replace the C++ file names in the project file.
+buf = re.sub(pat,"SOURCES = " + mname + "huge.cpp\n",buf)
+
 # Concatenate the files.
 d = open(mname + "huge.cpp","w")
 
 for cppfile in srclist:
 f = open(cppfile,"r")
 d.write(f.read())
 f.close()
 
 d.close()
 
-# Replace the C++ file names in the project file.
-buf = re.sub(pat,"SOURCES = " + mname + "huge.cpp\n",buf)
-
 f = open(pro + ".new","w")
 f.write(buf)
 f.close()
 
 os.remove(pro)


[PyKDE] [PATCH] PyQt build.py option for lib dir

2003-03-24 Thread Hans-Peter Jansen
Hi Phil,

the attached patch is meant to obsolete an ugly hack found in SuSE rpm specs 
to support 64 bit architectures. They simply patch the offending pathes,
which will break often.

Therefore I've added a new command line option (-L dir), to specify the lib 
base directory, which defaults to "lib". Hopefully, by using "-L lib64", 
build.py is able to build on such archs, but unfortunately I cannot test it, 
since I don't have access to such a system by now.

If you're going to accept it, I will create a similar patch for sip, too.

Thanks,
Pete--- build.py.orig	2003-03-24 02:51:15.0 +0100
+++ build.py	2003-03-24 03:35:04.0 +0100
@@ -57,21 +57,22 @@
 debugMode = "release"
 catCppFiles = 0
 qpeTag = None
 licType = None
 gccFlags = []
+libDir = "lib"
 
 
 def usage(rcode = 2):
 """Display a usage message and exit.
 
 rcode is the return code passed back to the calling process.
 """
-global progName, platBinDir, platMake, modDir, platQTDIRName, sipIncDir
+global progName, platBinDir, platMake, modDir, platQTDIRName, sipIncDir, libDir
 
 print "Usage:"
-print "%s [-h] [-a version] [-b dir] [-c] [-d dir] [-e dir] [-f gccflag] [-g prog] [-i dir] [-l Qt-library] [-m prog] [-n dir] [-o dir] [-p dir] [-q dir] [-s dir] [-u] [-w]" % (progName)
+print "%s [-h] [-a version] [-b dir] [-c] [-d dir] [-e dir] [-f gccflag] [-g prog] [-i dir] [-l Qt-library] [-L lib-base-dir] [-m prog] [-n dir] [-o dir] [-p dir] [-q dir] [-s dir] [-u] [-w]" % (progName)
 print "where:"
 print "-h display this help message"
 print "-a tag explicitly enable the qtpe module"
 print "-b dir where pyuic and pylupdate will be installed [default %s]" % (platBinDir)
 print "-c concatenate each module's C++ source files"
@@ -79,10 +80,11 @@
 print "-e dir the directory containing the SIP header files [default %s]" % (sipIncDir)
 print "-f gccflag additional GCC flag, eg. -fno-exceptions"
 print "-g progthe name of the Makefile generator"
 print "-i dir the directory containing the Qt header files [default %s%sinclude]" % (platQTDIRName,os.sep)
 print "-l Qt-library  explicitly specify the type of Qt library, either qt, qt-mt or qte"
+print "-L dir Python and Qt lib base directory [default %s]" % (libDir)
 print "-m progthe name of the Make program [default %s]" % (platMake)
 print "-n dir the directory containing the QScintilla header files [default %s%sinclude]" % (platQTDIRName, os.sep)
 print "-o dir the directory containing the QScintilla library [default %s%slib]" % (platQTDIRName, os.sep)
 print "-p dir the name of the SIP code generator [default sip]"
 print "-q dir the Qt base directory [default %s]" % (platQTDIRName)
@@ -153,11 +155,11 @@
 def initGlobals():
 """Sets the values of globals that need more than a simple assignment.
 """
 global platMake, platCopy, platPyScriptDir, platPyDLLDir, platPySiteDir
 global platPyIncDir, platPyLib, platQTDIRName, platBinDir, platMkdir
-global platRmdir, modDir, pyFullVers, pyVersNr, sipIncDir
+global platRmdir, modDir, pyFullVers, pyVersNr, sipIncDir, libDir
 
 pyFullVers = string.split(sys.version)[0]
 
 vl = string.split(re.findall("[0-9.]*",pyFullVers)[0],".")
 major = vl[0]
@@ -187,17 +189,18 @@
 else:
 platMake = "make"
 platCopy = "cp"
 platMkdir = "mkdir"
 platRmdir = "rm -rf"
-platPyScriptDir = sys.prefix + "/lib/python" + pyVers
-platPyDLLDir = sys.prefix + "/lib/python" + pyVers + "/lib-dynload"
+pylib = sys.prefix + "/" + libDir + "/python" + pyVers
+platPyScriptDir = pylib
+platPyDLLDir = pylib + "/lib-dynload"
 
 if pyVersNr < 20:
-platPySiteDir = sys.prefix + "/lib/python" + pyVers
+platPySiteDir = pylib
 else:
-platPySiteDir = sys.prefix + "/lib/python" + pyVers + "/site-packages"
+platPySiteDir = pylib + "/site-packages"
 
 platPyIncDir = sys.prefix + "/include/python" + pyVers
 platQTDIRName = "$QTDIR"
 platBinDir = "/usr/local/bin"
 
@@ -566,13 +569,13 @@
 
 
 def checkQtLibrary():
 """Check which Qt library is to be used.
 """
-global qtDir, qtLib
+global qtDir, qtLib, libDir
 
-qtlibdir = qtDir + os.sep + "lib"
+qtlibdir = qtDir + os.sep + libDir
 
 if qtLib is None:
 mtlib = isQtLibrary(qtlibdir,"qt-mt")
 stlib = isQtLibrary(qtlibdir,"qt")
 emlib = isQtLibrary(qtlibdir,"qte")
@@ -765,13 +768,13 @@
 
 f.close()
 
 # Check the SIP module can be found.
 if sipModuleDir is None:
-		global platPyScriptDir, platPyDLLDir, platPySiteDir
+global platPyScriptDir, platPyDLLDir, platPySiteDir
 
-		dirlist = [platPyDLLDir, platPyScri

Re: [PyKDE] Editable QComboBox in QTable problem ?

2003-03-19 Thread Hans-Peter Jansen
On Wednesday 19 March 2003 17:20, david wrote:
> Le mer 19/03/2003 à 15:13, Hans-Peter Jansen a écrit :
> > Hi David,
> >
> > please have a look into the smalltable.py example, and you will see,
> > what's wrong. Also reading the docs for QTableItem will help you here.
> >
> > Pete
>
> Hello Pete,
>
> Thank you for your help.
> I looked smalltable.py, it's an example for Qt 3.x, with Qt 2.x, there
> isn't QComboTableItem().

Oups. My fault. Sorry, but Qt2 was before my PyQt era started.

> With Qt 2.x, I haven't other solution that using setCellWidget().
>
> True or wrong ?

Don't know. See above. 

> button, checkBox, comboBox works fine with setCellWidget() but with
> editable comboBox, when I'm writing, I lose my focus.
>
> any ideas ?

Does Qt2 has an QTableItem you can subclass from? Testing your example
here with Qt3 made the QCombo disappear as soon as I entered some text
in this field, independant from, how is was instanced, BTW. 

> Thanks Pete.

You're welcome.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] Problems with PyKDE 3.3.2 on KDE 3.1.1

2003-03-19 Thread Hans-Peter Jansen
On Wednesday 19 March 2003 16:03, Jim Bublitz wrote:
> On 19-Mar-03 Hans-Peter Jansen wrote:
>
> > The problem boils down to the now private nature of some
> > ctors/dtors in a few KIO classes. I examined the first one:
> > KService(const KService&),  which is used at least in
> > syentrylist.sip and svctypes.sip for some type  conversations.
> >
> > kservice.h:
> >
> > class KService : public KSycocaEntry
> > {
> >   K_SYCOCATYPE( KST_KService, KSycocaEntry )
> >
> >   KService(const KService&);

I've had some conversation with Dirk Mueller today about this
problem. He holds me, that instancing KService::KService(const KService&)
will crash anyway, therefore it was made private in KDE 3.1.1 (which
will appear soonish). He told me that we need to use KService::Ptr, 
since KService can only share explicitly, thus it cannot be deep 
copied.

> svctypes.sip is handwritten code and SvcList is a mapped type
> meaning neither is really part of KDE, but are created to handle
> template classes within PyKDE. I'm not sure why the copy ctor is
> being invoked there, so I'm not sure how to fix it. Also, I'm not
> sure if that section of code even works, and it's been recoded
> already for the new version.

Would you mind throwing that code on me?

> SvcList is the mapped type for QPtrList, and
> KService::Ptr is typedef'd from KSharedPtr (there's
> probably a mapped type SvcPtr also). You could probably try
> commenting out the SvcList mapped type and also comment out any
> method that references it. You won't lose much unless you're doing
> some low level KIO related programming.

Ok, I will try this next.

> These all look like the same error. ~KAutoMount () is now private.
> Normally dtors don't appear in sip files UNLESS they're private, so
> you'd need to add:
>
> private:
> ~KAutoMount ();
>
> to the KAutoMount class (note - no 'virtual' keyword for sip on the
> dtor).

Will do this after activating kautomount again.

>
> These are all the same kind of error - deleteNextDir() and
> deleteNextFile () in KIO::DeleteJob (jobclasses.sip) are now
> private. Just delete it - sip doesn't handle private methods.
> startNextJob () is gone in 3.1.1 apparently. Either comment those
> out or wrap them in
>
> %If ( - KDE_3_1_1 )
>
> ...
>
> %End

and this, too.

> (assuming you added KDE_3_1_1 to the the %Timeline stmt in dcop.sip
> in the sip/kde300/ directory).

I'm using a full featured Timeline already ;-)

> The new version is complete through KDE 3.0.0.  KDE 3.0.1 through
> 3.0.5 should go pretty fast and KDE 3.1.0 will probably take a few
> days, so it's at least a week or two to a release. There are a fair
> amount of PyKDE bug fixes and few bugfixes for sip 3.6 (some
> created by problems in KDE code, like duplicated base classes for a
> class). I'm trying to nail down as many problems as I can, so it's
> going a little slowly.

By wading through those problems, I have a distant insight of what 
kind of great job you're doing here. Keep it up and take the time
you need.

Thanks a lot,
Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] Editable QComboBox in QTable problem ?

2003-03-19 Thread Hans-Peter Jansen
Hi David,

please have a look into the smalltable.py example, and you will see,
what's wrong. Also reading the docs for QTableItem will help you here.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] Problems with PyKDE 3.3.2 on KDE 3.1.1

2003-03-19 Thread Hans-Peter Jansen
Follow up with Robertos headers/sips:

Since Roberto switched off kautomount completely, the problem is 
reduced to the private KService::KService(const KService&). Please
can you check, if this is also the case for KDE 3.1.0?

g++ -c -pipe -w -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DNO_DEBUG 
-D_REENTRANT -fPIC  -DSIP_MAKE_MODULE_DLL -DQT_NO_DEBUG -DQT_THREAD_SUPPORT 
-fno-exceptions -I/usr/lib/qt3/mkspecs/default -I. -I-I -I../extraH -I. 
-I../../../../../include/python2.2 -I/opt/kde3/include -I-I 
-I/opt/kde3/include/kio -I-I -I../kdecore -I../../../../../include 
-I/usr/lib/qt3/include -o kiohuge.o kiohuge.cpp
/opt/kde3/include/kservice.h: In function `PyObject* 
sipConvertFrom_SycocaEntryList(SycocaEntryList*)':
/opt/kde3/include/kservice.h:47: error: `KService::KService(const KService&)' 
is private
sip/syentrylist.sip:60: error: within this context
/opt/kde3/include/kservice.h: In function `PyObject* 
sipConvertFrom_SvcList(SvcList*)':
/opt/kde3/include/kservice.h:47: error: `KService::KService(const KService&)' 
is private
sip/svctypes.sip:175: error: within this context
/opt/kde3/include/kservice.h: In constructor `sipKService::sipKService(const 
KService&)':
/opt/kde3/include/kservice.h:47: error: `KService::KService(const KService&)' 
is private
sipkioKShellCompletion.cpp:1861: error: within this context

I've tried to switch off the kio module, but then kfile cannot be built...

BTW: The KDE 3.1.1 is what I have found on SuSEs 8.2 beta 3, their latest 
release for us beta testers.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] KIO::DeleteJob

2003-03-19 Thread Hans-Peter Jansen
On Wednesday 19 March 2003 12:45, Roberto H. Alsina wrote:
> Ahem, I sent a mail saying things like KIO::DeleteJob is deprecated.
> Sorry, it's 8AM and I just woke up, and that is completely wrong ;-)

So you mean: -ENOCAFFEINE

No problem, build is running now with your headers and sips, let's 
see how far it gets...

Jim, it would love to see your next version Makefiles working with
export MAKEFLAGS=-j2
Currently, they fail because of missing dependencies between some 
targets. 

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


[PyKDE] Problems with PyKDE 3.3.2 on KDE 3.1.1

2003-03-19 Thread Hans-Peter Jansen
Hi Jim and friends,

motivated by Roberto, I tried to build KyKDE 3.3.2 on top of KDE 3.1.1,
but failed so far. Robertos version fails in exactly the same way, but
it's hard to say what Roberto has changed without a proper context diff
.

The problem boils down to the now private nature of some ctors/dtors
in a few KIO classes. I examined the first one: KService(const KService&), 
which is used at least in syentrylist.sip and svctypes.sip for some type 
conversations.

kservice.h:

class KService : public KSycocaEntry
{
  K_SYCOCATYPE( KST_KService, KSycocaEntry )

  KService(const KService&);

Unfortunately I have not enough insight in the inwards of KDE to rewrite 
those by now.

Attached is a patch of what I've done so far. Additionally, I've created
a few symlinks in my RPM spec, as always:

cd extraH
ln -s kde303 kde304
ln -s kde303 kde305
ln -s kde303 kde311
cd ..
cd sip
ln -s kde30 kde31
cd ..

Here is the full error log [Sorry for the long lines]:

make[1]: Entering directory `/usr/src/packages/BUILD/PyKDE-3.3.2/kio'
g++ -c -pipe -w -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DNO_DEBUG 
-D_REENTRANT -fPIC  -DSIP_MAKE_MODULE_
DLL -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -fno-exceptions -I/usr/lib/qt3/mkspecs/default 
-I. -I-I -I../extraH -I. -I../..
/../../../include/python2.2 -I/opt/kde3/include -I-I -I/opt/kde3/include/kio -I-I 
-I../kdecore -I../../../../../inclu
de -I/usr/lib/qt3/include -o kiohuge.o kiohuge.cpp
/opt/kde3/include/kservice.h: In function `PyObject* sipConvertFrom_SvcList(SvcList*)':
/opt/kde3/include/kservice.h:47: error: `KService::KService(const KService&)' is 
private
sip/svctypes.sip:175: error: within this context
/opt/kde3/include/kservice.h: In constructor `sipKService::sipKService(const 
KService&)':
/opt/kde3/include/kservice.h:47: error: `KService::KService(const KService&)' is 
private
sipkioKShellCompletion.cpp:1861: error: within this context
/opt/kde3/include/kautomount.h: In constructor `sipKAutoUnmount::sipKAutoUnmount(const 
QString&, const QString&)':
/opt/kde3/include/kautomount.h:108: error: `KAutoUnmount::~KAutoUnmount()' is private
sipkioKDataTool.cpp:733: error: within this context
/opt/kde3/include/kautomount.h: In destructor `virtual 
sipKAutoUnmount::~sipKAutoUnmount()':
/opt/kde3/include/kautomount.h:108: error: `KAutoUnmount::~KAutoUnmount()' is private
sipkioKDataTool.cpp:738: error: within this context
/opt/kde3/include/kautomount.h: In function `void 
sipDealloc_KAutoUnmount(sipThisType*)':
/opt/kde3/include/kautomount.h:108: error: `virtual KAutoUnmount::~KAutoUnmount()' is 
private
sipkioKAutoUnmount.cpp:435: error: within this context
/opt/kde3/include/kautomount.h: In function `PyObject* sipNew_KAutoUnmount(PyObject*, 
PyObject*)':
/opt/kde3/include/kautomount.h:108: error: `virtual KAutoUnmount::~KAutoUnmount()' is 
private
sipkioKAutoUnmount.cpp:499: error: within this context
/opt/kde3/include/kautomount.h: In constructor `sipKAutoMount::sipKAutoMount(bool, 
const QString&, const QString&, co
nst QString&, const QString&, bool)':
/opt/kde3/include/kautomount.h:70: error: `KAutoMount::~KAutoMount()' is private
sipkioKAutoUnmount.cpp:607: error: within this context
/opt/kde3/include/kautomount.h: In destructor `virtual 
sipKAutoMount::~sipKAutoMount()':
/opt/kde3/include/kautomount.h:70: error: `KAutoMount::~KAutoMount()' is private
sipkioKAutoUnmount.cpp:612: error: within this context
/opt/kde3/include/kautomount.h: In function `void sipDealloc_KAutoMount(sipThisType*)':
/opt/kde3/include/kautomount.h:70: error: `virtual KAutoMount::~KAutoMount()' is 
private
sipkioKAutoMount.cpp:435: error: within this context
/opt/kde3/include/kautomount.h: In function `PyObject* sipNew_KAutoMount(PyObject*, 
PyObject*)':
/opt/kde3/include/kautomount.h:70: error: `virtual KAutoMount::~KAutoMount()' is 
private
sipkioKAutoMount.cpp:511: error: within this context
sipkioKIOMultiGetJob.cpp: In member function `void 
sipKIO_DeleteJob::sipProtect_startNextJob()':
sipkioKIOMultiGetJob.cpp:2516: error: 'class KIO::DeleteJob' has no member named 
'startNextJob'
/opt/kde3/include/kio/jobclasses.h: In member function `void 
sipKIO_DeleteJob::sipProtect_deleteNextFile()':
/opt/kde3/include/kio/jobclasses.h:1067: error: `void 
KIO::DeleteJob::deleteNextFile()' is private
sipkioKIOMultiGetJob.cpp:2521: error: within this context
/opt/kde3/include/kio/jobclasses.h: In member function `void 
sipKIO_DeleteJob::sipProtect_deleteNextDir()':
/opt/kde3/include/kio/jobclasses.h:1068: error: `void KIO::DeleteJob::deleteNextDir()' 
is private
sipkioKIOMultiGetJob.cpp:2526: error: within this context
make[1]: *** [kiohuge.o] Fehler 1
make[1]: Leaving directory `/usr/src/packages/BUILD/PyKDE-3.3.2/kio'
make: *** [sub-kio] Fehler 2

Looks like It's time to wait for your new version, but I will happily
take advises on how to preceed.

Bye,
Petediff -u5 -uNrx '*.[ao]' -x '*~' -x '*,v' -x '*.orig' -x '*.rej' -x tags -x '*.swp' -x '*.new' PyKDE-3.3.2/build.py PyKDE-3.3.2-hp/build.py
-

Re: [PyKDE] Hello and PyKDE for KDE 3.1

2003-03-19 Thread Hans-Peter Jansen
Hi Ralph,

welcome in this beautiful niche.

On Tuesday 18 March 2003 21:47, Ralph Kaiser wrote:
> Hi Pete,
>
> Try this:
>
> ftp://ftp.kde.org/pub/kde/unstable/apps/KDE3.x/utils/PyKDE-3.3.2-rha3.1.tar
>.bz2

Yup, found it, but failed to build it, because it looks like KDE 3.1.1 is 
a lot more different to 3.1.0 than I've expected. See my next mail, if you 
like.

> And while I'm here I'd like to thank you for your excellent SQL tutorial
> that is included in the PyQT distribution. It made it quite easy (and fun)
> for this newbie to get started.

Thanks a lot. I hoped, someone will find it useful. I plan to write some
articles in german journals about PyQt and friends.

> Peace,
> Ralph

Far-to-many-weapons-in-circulation-to-make-this-happen-soon-ly y'rs,
Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] Editable QComboBox in QTable problem ?

2003-03-18 Thread Hans-Peter Jansen
On Monday 17 March 2003 15:23, david wrote:

> I put an editable QComboBox in a cell of QTable with setCellWidget() :
>
> self.combo = QComboBox(self.table)
> self.combo.setEditable(1)
> self.table.setCellWidget(line,col,self.combo)
>
> When I'm writing in comboBox, the first character is in the comboBox,
> and after, characters are in a other cell.

Please provide a small self contained example of your problem.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] PyQt & QScintilla Status

2003-03-18 Thread Hans-Peter Jansen
On Sunday 16 March 2003 17:33, Phil Thompson wrote:
> FYI...
>
> Tonight's snapshots of SIP, PyQt and QScintilla should be treated as
> release candidates for SIP 3.6, PyQt 3.6 and QScintilla 1.0.
>
> I plan to release the final versions as soon as Python 2.3 is released.
>
> Now is the time to test if you want the next release to work for you.

FYI: I've build and lightly tested those snapshots on SuSE 8.1 and SuSE 
8.2 beta 3 (unlike stated before: Qt 3.1.1, KDE 3.1.1, gcc 3.3, python 
2.2.2) without problems so far.

I'm happily awaiting the release now.

> Phil

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] Hello and PyKDE for KDE 3.1

2003-03-18 Thread Hans-Peter Jansen
On Tuesday 18 March 2003 02:05, Roberto H. Alsina wrote:
> First: hello, and congrats on the amazing software :-)

Welcome to the club

> Second, Since I needed to use KHTML on a app I am writing, and also wanted
> it to work on KDE 3.1, I made a quick hack of PyKDE-3.3.2  to make it work
> under KDE 3.1.
>
> This is just intended as a stopgap thing until the real thing comes out,
> and to let any KDE 3.0 PyKDE apps work on KDE 3.1 (since the API is exactly
> the same).
>
> If anyone wants it, it still seems to be stuck in ftp://upload.kde.org

Sounds interesting, but it seems to be moved somewhere...

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] PyQt & QScintilla Status

2003-03-16 Thread Hans-Peter Jansen
Hi Phil,

I just built qscintilla snapshot 20030314,
sip snapshot 20030312, and PyQt snapshot 20030314
on SuSE 8.1 and 8.2 (Beta 3: Qt 3.1, KDE 3.1, gcc 3.3, python 2.2.2) 
without problems. At least eric 3.1 runs on top of it...

Well done, man.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] qscintilla fix -> pyqt_distutils

2003-03-01 Thread Hans-Peter Jansen
Hi Gerard,

you may have noticed, that I've announced among others things your 
current PyQwt package. Since I'm a bit tight timewise at the moment 
(because my girlfriend :), just let me attest, your package builds 
without a hitch! Therefore I haven't even needed to take a single
look into it, thus your rewritten pyqt_* stuff gone by unnoticed ;-)
Will do it soon. (For my vindication, this was after my qscintilla 
build note). 

Thanks,
Pete

On Saturday 01 March 2003 17:25, [EMAIL PROTECTED] wrote:
> Hi Pete,
>
> > BTW, did you advanced in the setup.py/pyqt_support.py tidy up?
>
> Yes, I did and tested it in an already abandoned project: a PyQt
> wrapper for a Qt-C++ class for VTK (a 3D visualization toolkit).
> The project was motivated by the fact that the PyQt widgets included
> with VTK did not work on Windows.
> In the end, I got into fixing the pure Python PyQt widgets that
> come with VTK (they are now in the VTK cvs -- a new release VTK-4.2
> is imminent).
>
> The most interesting widget -- QVTKRenderWindowInteractor.py -- is
> also available from my web page ( http://gerard.vermeulen.free.fr ).
> A happy user, who discovered it by accident, reports that it works, but
> that it needs a little bit of tweaking. QVTKRenderWindowInteractor
> is compatible with VTK-4.0.
>
> The new setup.py/pyqt_support.py will be part of a new PyQwt release.
> Actually, pyqt_support.py will be replaced by a pyqt_distutils directory,
> writing a setup.py script will be much simpler, and recompiling minimized
> (for my own sake).

Really cool news.

> Gerard

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


[PyKDE] PYQT_VERSION handling for eric3

2003-03-01 Thread Hans-Peter Jansen
Hi Detlev,

while trying to install the current eric snapshot on top of current
PyQt snapshot, install.py complains about:

Traceback (most recent call last):
  File "install.py", line 299, in ?
main(sys.argv)
  File "install.py", line 273, in main
if PYQT_VERSION[:9] == "snapshot-":
TypeError: unsubscriptable object

which is understandable, because Phil has changed PYQT_VERSION
handling recently.

>>> from qt import PYQT_VERSION
>>> print PYQT_VERSION
197888

I've attached a patch, which got it going for me again...

Bye,
Pete--- eric-snapshot-20030210/install.py~	2003-02-10 22:37:58.0 +0100
+++ eric-snapshot-20030210/install.py	2003-03-01 17:01:12.0 +0100
@@ -268,18 +268,23 @@
 if qtMajor < 3:
 print 'Sorry, you must have Qt version 3.0.0 or higher.'
 sys.exit(2)
 
 #check version of PyQt
-if PYQT_VERSION[:9] == "snapshot-":
-if long(PYQT_VERSION[9:]) < 20021122L:
+try:
+from qt import PYQT_VERSION_STR
+qtVersion = PYQT_VERSION_STR
+except:
+qtVersion = PYQT_VERSION
+if qtVersion[:9] == "snapshot-":
+if long(qtVersion[9:]) < 20021122L:
 print 'Sorry, you must have PyQt snapshot-20021217 or higher.'
 sys.exit(3)
 else:
-while PYQT_VERSION.count('.') < 2:
-PYQT_VERSION += '.0'
-(maj, min, pat) = PYQT_VERSION.split('.')
+while qtVersion.count('.') < 2:
+qtVersion += '.0'
+(maj, min, pat) = qtVersion.split('.')
 maj = int(maj)
 min = int(min)
 pat = int(pat)
 if maj < 3 or (maj == 3 and min < 6):
 print 'Sorry, you must have PyQt 3.6.0 or snapshot-20021217 or higher.'


Re: [PyKDE] qscintilla fix

2003-03-01 Thread Hans-Peter Jansen
Hi Phil,

in order to build this snapshot, I've needed an additional patch,
because this error:

g++ -c -pipe -w -O2 -march=i586 -mcpu=i686 -fno-exceptions -fmessage-length=0 
-DNO_DEBUG -D_REENTRANT -fPIC  -DQEXTSCINTILLA_MAKE_DLL -DQT -DSCI_LEXER 
-DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I. -I../include -I../src 
-I/usr/lib/qt3/include -I/usr/lib/qt3/mkspecs/default -o PlatQt.o PlatQt.cxx
PlatQt.cxx: In static member function `static int 
Platform::DBCSCharLength(int, const char*)':
PlatQt.cxx:762: `MB_CUR_MAX' undeclared (first use this function)
PlatQt.cxx:762: (Each undeclared identifier is reported only once for each 
function it appears in.)
PlatQt.cxx:762: `mblen' undeclared (first use this function)
make: *** [PlatQt.o] Fehler 1

MB_CUR_MAX is defined in stdlib.h here (still SuSE 8.1), which is not listed 
in the includes of PlatQt.cxx. Patch attached.

Gerard, thanks for digging into the glitch below. Obviously I needed
your patch, too ;-) Hopefully it does the right thing, too...
BTW, did you advanced in the setup.py/pyqt_support.py tidy up?

Bye,
Pete

On Saturday 01 March 2003 09:58, [EMAIL PROTECTED] wrote:
> Phil,
>
> Compiling qscintilla-*-20030227 with Qt-3.0.5 gives the following error:
>
> packer:~/BLFS/bld/qscintilla-1.51-x11-gpl-snapshot-20030227/qt$ make
> g++ -c -pipe -w -O2 -D_REENTRANT -fPIC  -DQEXTSCINTILLA_MAKE_DLL -DQT
> -DSCI_LEXER -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I. -I../include -I../src
> -I/usr/lib/qt3/include -I/usr/lib/qt3/mkspecs/default -o SciListBox.o
> SciListBox.cxx SciListBox.cxx: In method `int ListBoxX::GetSelection()':
> SciListBox.cxx:180: no matching function for call to
> `SciListBox::selectedItem ()' make: *** [SciListBox.o] Error 1
> packer:~/BLFS/bld/qscintilla-1.51-x11-gpl-snapshot-20030227/qt$
>
> Grepping for selectedItem gives:
>
> packer:~/BLFS/bin$ grep selectedItem /usr/lib/qt3/include/*.h
> /usr/lib/qt3/include/qlistview.h:QListViewItem * selectedItem() const;
> packer:~/BLFS/bin$
>
> And looking for the base classes of QListBox, gives:
>
> packer:~/BLFS/bin$ grep -3 'QListBox :' /usr/lib/qt3/include/qlistbox.h
> class QStringList;
>
>
> class Q_EXPORT QListBox : public QScrollView
> {
> friend class QListBoxItem;
> friend class QListBoxPrivate;
> packer:~/BLFS/bin$
>
> Attached patch fixes the compiler error (I hope it does what you mean)
>
> Gerard
--- qscintilla-1.51-x11-gpl-snapshot-20030227/qt/PlatQt.cxx~	2003-02-28 02:04:15.0 +0100
+++ qscintilla-1.51-x11-gpl-snapshot-20030227/qt/PlatQt.cxx	2003-03-01 15:20:39.0 +0100
@@ -21,10 +21,11 @@
 
 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 #include 


Re: [PyKDE] GUI Programming with Python: QT Edition (was: dialog/mainwindow question)

2003-02-21 Thread Hans-Peter Jansen
On Friday 21 February 2003 14:17, Gerard Breiner wrote:
> Hello,
>
> I know this book since yesterday. I found it  at
> http://www.xs4all.nl/~bsarempt/python/tutorial.html and i download it from
> opendoc.
> I was surprised to note that the price at opendoc is 49.95 $  whereas in
> Paris at "Le monde en tique" the price is 113 ? as about 113 $
> I phoned to "Le monde en tique", the salesman said the difference in price
> corresponds to the transport charges of DHL.
> Do you have another solution to buy this book. While waiting I have the
> book in form pdf and I printed it too.
> I think indeed the writing style is very good  and  the Introduction to
> Python is good in my case  because i have read the tutorial.
> I like this book.
>
> Best greetings
>
> Gerard Breiner
> Institut D'Astrophysique Spatiale
> Orsay
> FRANCE

Hi Gerard,

your bookstore is ridiculous. I bought mine at Lehmann's Fachbuchhandlung
here in Berlin for 58.75¤ last summer (when the euro exchange rate was much 
worser than now, but with an US price of $49.95). IIRC, it took them about 4 
weeks for my order and sadfully, they still have at least one copy from that 
order of 5 (I've spend 100¤ there today [LDAP/OpenSSL/Linux Journal])...

Cheers,
Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] QThreads

2003-02-19 Thread Hans-Peter Jansen
On Wednesday 19 February 2003 21:36, Stuart Bronk wrote:
> Hi,
>
> I'm trying to find a little example app using Qthreads, before I use
> them for more complex matters.  I've search all over the place but can't
> seem to find one. I don't suppose anyone has a small program or knows
> where I can find an example?

You may have missed examples3/semaphore.py...

Hth,
Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] QWidgetFactory support

2003-01-30 Thread Hans-Peter Jansen
Hi Phil,

attached is an implementation of QWidgetFactory based on the PyQt 
snapshot from 25.01. Since it's my first PyQt module, it would be 
nice, if you take a look over it, especially into the sip files.
Any Transfer* magic missing? The win parts of quimod.sip are
definitely wrong, but I don't know better, yet.

At least, QWidgetFactory.create("some.ui") seems to work fine on
linux.

I've kept your copyright, but added myself to it. I hope, this is
fine with you.

Pete
--- build.py.orig	2003-01-26 02:03:04.0 +0100
+++ build.py	2003-01-30 17:58:49.0 +0100
@@ -345,19 +345,20 @@
 TARGET = qttest
 CONFIG = qt @TEST_OPENGL@ console warn_off release @BL_THREAD@
 INCLUDEPATH = . @BL_INCLUDEPATH@
 DEFINES = @BL_DEFINES@
 SOURCES = qttest.cpp
-LIBS += @TEST_SCILIBDIR@
+LIBS += @TEST_SCILIBDIR@ @TEST_QUILIBDIR@
 
 win32:LIBS += @BL_PYLIB@
 """)
 
-# Disable OpenGL and QScintilla support by default.
+# Disable OpenGL, QScintilla and Qui support by default.
 global proPatches
 proPatches["TOPENGL"] = [re.compile("@TEST_OPENGL@",re.M), ""]
 proPatches["TSCILIBDIR"] = [re.compile("@TEST_SCILIBDIR@",re.M), ""]
+proPatches["TQUILIBDIR"] = [re.compile("@TEST_QUILIBDIR@",re.M), ""]
 
 # Create a dummy source file to suppress a qmake warning.
 copyToFile("qttest.cpp","")
 
 buildMakefile("qttest.pro")
@@ -978,10 +979,22 @@
 
 # Put things back.
 proPatches["TSCILIBDIR"] = [re.compile("@TEST_SCILIBDIR@",re.M), ""]
 buildMakefile("qttest.pro")
 
+if qtVersion >= 0x03:
+quilib = ""
+if sys.platform == "win32":
+quilib = "qui.lib"
+else:
+quilib = "-lqui"
+proPatches["TQUILIBDIR"] = [re.compile("@TEST_QUILIBDIR@",re.M), quilib]
+buildMakefile("qttest.pro")
+tryModule("qui", "qwidgetfactory.h", "QWidgetFactory()")
+# Put things back.
+proPatches["TQUILIBDIR"] = [re.compile("@TEST_QUILIBDIR@",re.M), ""]
+    buildMakefile("qttest.pro")
 
 
 def generateFeatures(featfile):
 """Generate the header file describing the Qt features that are enabled if
 it doesn't already exist.  (If it already exists then we are probably cross

// This is the SIP interface definition for the qui module of PyQt.
//
// Copyright (c) 2003
//  Hans-Peter Jansen <[EMAIL PROTECTED]>
// 	Riverbank Computing Limited <[EMAIL PROTECTED]>
// 
// This file is part of PyQt.
// 
// This copy of PyQt is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2, or (at your option) any later
// version.
// 
// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
// details.
// 
// You should have received a copy of the GNU General Public License along with
// PyQt; see the file LICENSE.  If not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


%Module qui 0

%Import qtmod.sip

%Include copying.sip


%Include qwidgetfactory.sip


// The project file template.

%Makefile qui.pro
# The project file for the qui module.
#
# Copyright (c) 2003
# 	Riverbank Computing Limited <[EMAIL PROTECTED]>
# 
# This file is part of PyQt.
# 
# This copy of PyQt is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
# 
# PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
# 
# You should have received a copy of the GNU General Public License along with
# PyQt; see the file LICENSE.  If not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


TEMPLATE = lib
TARGET = @BL_TARGET@
DESTDIR = @BL_DESTDIR@
CONFIG += qt warn_off @BL_DEBUG@ @BL_SIP@ @BL_DLL@ @BL_THREAD@
INCLUDEPATH = . ../qt @BL_INCLUDEPATH@
DEFINES = SIP_MAKE_MODULE_DLL @BL_DEFINES@

sip3:unix:LIBS += -L@BL_DESTDIR@ -lqtcmodule -L@BL_SIPMODDIR@ -lsip -lqui
sip3:win32:LIBS += @BL_DESTDIR@\libqtc.lib @BL_SIPMODDIR@\libsip.lib @BL_PYLIB@ @BL_Q

Re: [PyKDE] Now tackle dtor strangeness

2003-01-28 Thread Hans-Peter Jansen
On Sunday 26 January 2003 01:16, Phil Thompson wrote:

> > Funny side note: it was enough to fix one of both sub classes this way to
> > prevent attribute errors here. This is pretty undeterministic, and that's
> > exactly the reason, why I don't like this behaviour...
> >
> > Phil, one would expect, that as long as a class exists, its baseclass
> > should exist, either. The same goes for globals in module scope.
>
> The class will exist (because the sub-class keeps a reference to it) but
> that doesn't mean that the reference to the class in (for example) the
> module's dictionary still exists.
>
> The problem is that the order in which a dictionary's elements are deleted
> isn't very deterministic. In your example qEventDict is being removed from
> the module dictionary before the qEvent function is removed. By moving
> qEventDict into the qEvent function you guarantee it will exist whenever
> qEvent is called.
>
> I would guess that the problem would also go away if you played with the
> names of qEvent and qEventDict so that they had hash values that caused
> them to appear in the module dictionary in the opposite order so that
> qEvent was deleted first.

I wasn't able to modify this behaviour with name mangling. OTOH, creating
a separate startup module solved this for me.

For the record: 

If you suffer from attribute exceptions after calling qApp.quit(), and
have defined overloaded event methods in an "all in one" module, try
creating a seperate startup module in order to fix the race between
pythons cleanup and Qt events still delivered. Pythons '-v' option may 
be helpful in this scenario, too.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] qlistbox.sip eventFilter

2003-01-27 Thread Hans-Peter Jansen
Hi Phil,

for the sake of symmetry, I suggest applying attached patch. 
I couldn't exploit any problems without it, though.

Pete
--- sip/qlistbox.sip~	2003-01-26 02:03:45.0 +0100
+++ sip/qlistbox.sip	2003-01-27 11:02:37.0 +0100
@@ -402,11 +402,11 @@
 	void focusOutEvent(QFocusEvent *);
 	void resizeEvent(QResizeEvent *);
 	void showEvent(QShowEvent *);
 
 %If (Qt_3_0_0 -)
-	void eventFilter(QObject *,QEvent *);
+	bool eventFilter(QObject *,QEvent *);
 %End
 
 	void updateItem(int);
 	void updateItem(QListBoxItem *);
 



[PyKDE] Now tackle dtor strangeness

2003-01-25 Thread Hans-Peter Jansen
On Saturday 25 January 2003 17:02, Phil Thompson wrote:
>
> Thanks for putting the effort into this - it was very helpful. The bug is
> that qspinbox.sip should say...
>
> bool eventFilter(QObject *,QEvent *);
>
> ...instead of...
>
> void eventFilter(QObject *,QEvent *);
>
> It will be fixed in tonight's snapshot.

Thanks. Well done. I feel better now. But please have another look into 
these two:

> > > qApp.quit(). Phil, it appears, that the QSpinBox base class disappears
> > > while subclassed SpinBox event() handler is active. This doesn't look
> > > right to me.
> >
> > While making both versions functional identical, I've rewritten the event
> > decoder qEvent(), but couldn't believe my eyes: during qApp.quit() the
> > value of the global defined qEventDict{} in the .py script is replaced
> > with a None value somewhere under the covers! Please remove the
> >
> > Something is definitely going wrong here.
>
> I think this is just Python and Qt racing each other to tidy up. As the
> behaviour of either isn't formally documented I think it's more a feature
> rather than a bug.

Well, I cannot see the feature aspect here. OTOH, this obfuscates the code, 
and it defies the principle of least surprise.

I digged into this a bit further and found a way to get around these problems
somehow:

1) The qEventDict does survive, if it is declared inside the qEvent function.

2) just keep a reference of QSpinBox, and call it, instead of the baseclass:

class SpinBox(QSpinBox):
def __init__(self, minValue, maxValue, step = 1, parent = None, name = None):
self.lastval = None
QSpinBox.__init__(self, minValue, maxValue, step, parent, name)
self.QSpinBox = QSpinBox

def event(self, e):
t = e.type()
print "SpinBox event:", qEvent(t)
return self.QSpinBox.event(self, e)

Funny side note: it was enough to fix one of both sub classes this way to 
prevent attribute errors here. This is pretty undeterministic, and that's 
exactly the reason, why I don't like this behaviour...

Phil, one would expect, that as long as a class exists, its baseclass should 
exist, either. The same goes for globals in module scope.

Note, that this happens, before dtor of QApplication aka PyQtDisownTopLevelWidgets(),
and even siplib:finalise() is called:

closeEvent
exec_loop: 0
PushButton event: WindowDeactivate
SpinBox event: WindowDeactivate
PushButton event: FocusOut
PushButton focusOutEvent
PushButton event: Hide
SpinBox event: Hide
PyQtDisownTopLevelWidgets
PyQtDisownTopLevelWidgets
finalise begin
finalise done

Is it possible to keep a reference on these internally and throw them away in
finalise()? For reference, current sbtest.py attached.

> Phil

Pete
#!/usr/bin/env python

# sbtest v0.1: investigate QSpinBox strangeness
#
# Copyright 2002 Hans-Peter Jansen <[EMAIL PROTECTED]>
#
# This program is placed under the GNU General Public License V.2

import sys
from qt import *

# Just swap the _ of both qEventDicts to suppress the attribute errors
qEventDict = {
0: "None",
1: "Timer",
2: "MouseButtonPress",
3: "MouseButtonRelease",
4: "MouseButtonDblClick",
5: "MouseMove",
6: "KeyPress",
7: "KeyRelease",
8: "FocusIn",
9: "FocusOut",
10: "Enter",
11: "Leave",
12: "Paint",
13: "Move",
14: "Resize",
15: "Create",
16: "Destroy",
17: "Show",
18: "Hide",
19: "Close",
20: "Quit",
21: "Reparent",
22: "ShowMinimized",
23: "ShowNormal",
24: "WindowActivate",
25: "WindowDeactivate",
26: "ShowToParent",
27: "HideToParent",
28: "ShowMaximized",
29: "ShowFullScreen",
30: "Accel",
31: "Wheel",
32: "AccelAvailable",
33: "CaptionChange",
34: "IconChange",
35: "ParentFontChange",
36: "ApplicationFontChange",
37: "ParentPaletteChange",
38: "ApplicationPaletteChange",
39: "PaletteChange",
40: "Clipboard",
42: "Speech",
50: "SockAct",
51: "AccelOverride",
52: "DeferredDelete",
60: "DragEnter",
61: "DragMove",
62: "DragLeave",
63: "Drop",
64: "DragResponse",
70: "ChildInserted",
71: "ChildRemoved",
72: "LayoutHint",
73: "ShowWindowRequest",
80: "ActivateControl",
81: "

Re: [PyKDE] Next attempt to tackle QSpinBox strangeness

2003-01-24 Thread Hans-Peter Jansen
On Thursday 23 January 2003 19:46, me wrote:

> Problem: reimplemented QSpinBox don't get focus events and doesn't behave
> correctly on up/down cursor key events (value doesn't change).

Also, manually editing the QSpinBox value doesn't generate a valueChanged
signal, nor does it revert invalid values.

> Therefore, I'm going to translate this app to c++ in order
> to check this behaviour of Qt directly soon.

Done, attached. Looks like the c++ version doesn't generate focus events,
either, but behaves correctly on cursor keys and manual editing. Consequently 
both actions generate a valueChanged signal, unlike the py version.

> Interesting side note: I needed to prepare the event() handlers not to
> call the base class in order to avoid an attribute error during
> qApp.quit(). Phil, it appears, that the QSpinBox base class disappears
> while subclassed SpinBox event() handler is active. This doesn't look right
> to me.

While making both versions functional identical, I've rewritten the event
decoder qEvent(), but couldn't believe my eyes: during qApp.quit() the
value of the global defined qEventDict{} in the .py script is replaced
with a None value somewhere under the covers! Please remove the try/except 
statement in qEvent, uncomment the print statement and look yourself:

close app
PushButton event: 
Traceback (most recent call last):
  File "sbtest.py", line 121, in event
print "PushButton event:", qEvent(t)
  File "sbtest.py", line 79, in qEvent
if t in qEventDict.keys():
AttributeError: 'NoneType' object has no attribute 'keys'
SpinBox event: 
Traceback (most recent call last):
  File "sbtest.py", line 96, in event
print "SpinBox event:", qEvent(t)
  File "sbtest.py", line 79, in qEvent
if t in qEventDict.keys():

Something is definitely going wrong here.

TIA,
Pete

#!/usr/bin/env python

# sbtest v0.1: investigate QSpinBox strangeness
#
# Copyright 2002 Hans-Peter Jansen <[EMAIL PROTECTED]>
#
# This program is placed under the GNU General Public License V.2

import sys
from qt import *

qEventDict = {
0: "None",
1: "Timer",
2: "MouseButtonPress",
3: "MouseButtonRelease",
4: "MouseButtonDblClick",
5: "MouseMove",
6: "KeyPress",
7: "KeyRelease",
8: "FocusIn",
9: "FocusOut",
10: "Enter",
11: "Leave",
12: "Paint",
13: "Move",
14: "Resize",
15: "Create",
16: "Destroy",
17: "Show",
18: "Hide",
19: "Close",
20: "Quit",
21: "Reparent",
22: "ShowMinimized",
23: "ShowNormal",
24: "WindowActivate",
25: "WindowDeactivate",
26: "ShowToParent",
27: "HideToParent",
28: "ShowMaximized",
29: "ShowFullScreen",
30: "Accel",
31: "Wheel",
32: "AccelAvailable",
33: "CaptionChange",
34: "IconChange",
35: "ParentFontChange",
36: "ApplicationFontChange",
37: "ParentPaletteChange",
38: "ApplicationPaletteChange",
39: "PaletteChange",
40: "Clipboard",
42: "Speech",
50: "SockAct",
51: "AccelOverride",
52: "DeferredDelete",
60: "DragEnter",
61: "DragMove",
62: "DragLeave",
63: "Drop",
64: "DragResponse",
70: "ChildInserted",
71: "ChildRemoved",
72: "LayoutHint",
73: "ShowWindowRequest",
80: "ActivateControl",
81: "DeactivateControl",
82: "ContextMenu",
83: "IMStart",
84: "IMCompose",
85: "IMEnd",
86: "Accessibility",
87: "Tablet"
}

def qEvent(t):
try:
if t in qEventDict.keys():
return qEventDict[t]
except:
pass
return "Unknown";

probmsg = """\
Problem: reimplemented QSpinBox below
don't get focus events and doesn't behave
correctly on up/down cursor keys!\
"""

class SpinBox(QSpinBox):
def __init__(self, minValue, maxValue, step = 1, parent = None, name = None):
self.lastval = None
QSpinBox.__init__(self, minValue, maxValue, step, parent, name)

def event(self, e):
t = e.type()
print "SpinBox event:", qEvent(t)
# this seems to be necessary because of races with qApp.quit()
if QSpinBox:
return QSpinBox.event(self, e)
else:
  

Re: [PyKDE] Next attempt to tackle QSpinBox strangeness

2003-01-24 Thread Hans-Peter Jansen
On Friday 24 January 2003 01:46, Doug Bell wrote:
> Hans-Peter Jansen wrote:
> > Hi *,
> >
> > attached, you will find an app to reproduce some strangeness with
> > QSpinBox behaviour.
> >
> > Problem: reimplemented QSpinBox don't get focus events and doesn't behave
> > correctly on up/down cursor key events (value doesn't change).
>
> I'm not sure if this is your problem (I haven't gone through your
> example in detail), but I've also seen unusual behavior with QSpinBox
> focus events.  I no longer remember details, but the problem concerns
> events being sent to the embedded QLineEdit within a spin box.  You can
> access the embedded editor using the spin box's editor() method and
> check for events there.

Doug, thanks for your answer. Unfortunately accessing editor() isn't
always an option, since it would make simple database frontends f.e.
effusively complicated, if possible at all. Hopefully we get this
fixed, and forget about it again.

> Hope this helps,
> Doug.

Cheers,
Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Next attempt to tackle QSpinBox strangeness

2003-01-23 Thread Hans-Peter Jansen
Hi *,

attached, you will find an app to reproduce some strangeness with QSpinBox 
behaviour.

Problem: reimplemented QSpinBox don't get focus events and doesn't behave
correctly on up/down cursor key events (value doesn't change).

This happens at least with SuSE-Versions 8.0 and 8.1, with all PyQt-Versions
up to the snapshot from 2003/01/11.

If you have a couple of spare minutes, please run the attached script from
a shell,  and watch console output.
I get: (# comments added)
# startup
SpinBox event: ChildInserted
SpinBox event: ChildInserted
PushButton event: Move
PushButton event: Resize
PushButton event: Show
SpinBox event: Move
SpinBox event: Resize
SpinBox event: Show
SpinBox event: LayoutHint
PushButton event: Paint
PushButton event: WindowActivate
SpinBox event: WindowActivate
PushButton event: FocusIn
PushButton focusInEvent
PushButton event: Paint
# startup done
# 
PushButton event: AccelOverride
PushButton event: KeyPress
PushButton event: FocusOut
PushButton focusOutEvent
PushButton event: Paint
SpinBox event: KeyRelease
# PushButton class gets focus event correctly, SpinBox don't
# 
SpinBox event: AccelOverride
SpinBox event: KeyPress
SpinBox event: KeyRelease
# SpinBox doesn't change the value, consequently no valueChanged signal
# 
SpinBox event: AccelOverride
SpinBox event: KeyPress
SpinBox event: KeyRelease
# again..
# 
SpinBox event: AccelOverride
PushButton event: FocusIn
PushButton focusInEvent
PushButton event: Paint
PushButton event: KeyRelease
# again, PushButton class gets focus event correctly
# 
PushButton event: AccelOverride
PushButton event: KeyPress
PushButton event: Paint
PushButton event: KeyRelease
PushButton event: Paint
close app
PushButton event: WindowDeactivate
SpinBox event: WindowDeactivate
PushButton event: FocusOut
PushButton focusOutEvent
PushButton event: Hide
SpinBox event: Hide
# finished

If your output differs significantly from this log, please give me 
a note, mentioning your OS, Qt, and PyQt versions. This is a long 
standing problem, I'm suffering from and would like to get solved 
somehow. Therefore, I'm going to translate this app to c++ in order 
to check this behaviour of Qt directly soon.

Interesting side note: I needed to prepare the event() handlers not to
call the base class in order to avoid an attribute error during qApp.quit().
Phil, it appears, that the QSpinBox base class disappears while subclassed 
SpinBox event() handler is active. This doesn't look right to me.

TIA,
Pete
#!/usr/bin/env python

# sbtest v0.1: investigate QSpinBox strangeness
#
# Copyright 2002 Hans-Peter Jansen <[EMAIL PROTECTED]>
#
# This program is placed under the GNU General Public License V.2

import sys
from qt import *

qEvent = {
0: "None",
1: "Timer",
2: "MouseButtonPress",
3: "MouseButtonRelease",
4: "MouseButtonDblClick",
5: "MouseMove",
6: "KeyPress",
7: "KeyRelease",
8: "FocusIn",
9: "FocusOut",
10: "Enter",
11: "Leave",
12: "Paint",
13: "Move",
14: "Resize",
15: "Create",
16: "Destroy",
17: "Show",
18: "Hide",
19: "Close",
20: "Quit",
21: "Reparent",
22: "ShowMinimized",
23: "ShowNormal",
24: "WindowActivate",
25: "WindowDeactivate",
26: "ShowToParent",
27: "HideToParent",
28: "ShowMaximized",
29: "ShowFullScreen",
30: "Accel",
31: "Wheel",
32: "AccelAvailable",
33: "CaptionChange",
34: "IconChange",
35: "ParentFontChange",
36: "ApplicationFontChange",
37: "ParentPaletteChange",
38: "ApplicationPaletteChange",
39: "PaletteChange",
40: "Clipboard",
42: "Speech",
50: "SockAct",
51: "AccelOverride",
52: "DeferredDelete",
60: "DragEnter",
61: "DragMove",
62: "DragLeave",
63: "Drop",
64: "DragResponse",
70: "ChildInserted",
71: "ChildRemoved",
72: "LayoutHint",
73: "ShowWindowRequest",
80: "ActivateControl",
81: "DeactivateControl",
82: "ContextMenu",
83: "IMStart",
84: "IMCompose",
85: "IMEnd",
86: "Accessibility",
87: "Tablet"
}

probmsg = """\
Problem: reimplemented QSpinBox below
don't get focus events and doesn't behave
correctly on up/down cursor keys!\
"""

class SpinBox(QSpinBox):
def __init__(self, m

Re: [PyKDE] pykde.sourceforge.net

2003-01-16 Thread Hans-Peter Jansen
On Thursday 16 January 2003 14:13, Michael Lauer wrote:
> Am Mit, 2003-01-15 um 23.05 schrieb Torsten Marek:
> > What is the future of pyke.sf.net, because I want to know if it is
> > possible to place some little programs I happened to write on that page.
> > By now, I do not have my own page and I wouldn't like to create one.
> > So it would be nice if there was a section of programs with links and/or
> > direct downloads.
>
> Yeah, I second this. I have a bunch of (hopefully resuable) PyQt widgets
> which I could publish and would be interested in seeing other ones.
>
> > One of the programs I mean is outline.py. It started as a port of the
> > outline example of Qt, but is under development for some time now and has
> > evolved.
> > It keeps a tree of remarks in an XML file, I use it as
> > todolist/notepad/knowledge base/organizer.
>
> Sounds interesting.
>
> Who is in charge of [EMAIL PROTECTED]?

Do possibly mean http://sourceforge.net/project/admin/?group_id=61057

Jonathan and Jim are the project managers there.

Jonathan, Jim, what do you think about a contribution package section.
If somebody want to upload something, just post the details in this list
file name: 
package name:
package version:
release notes:
changelog (opt.):

and upload to anonymous@ftp://upload.sourceforge.net

Hopefully some project member picks it up quickly enough, and publish
the thing in download section.

Comments?

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] sip

2003-01-10 Thread Hans-Peter Jansen
Hi Gerard, hi Jason,

thanks for the reference, Gerard. Attached is a new version, 
including a small README this time. Now 32K, because of some
redundant bitmaps.

I would love to get some feedback on it.

Enjoy,
Pete

On Friday 10 January 2003 16:02, Gerard Vermeulen wrote:
> Jason, take a look at a previous post on this list:
>
> Dec 22 Hans-Peter Jans ( 307)
> [PyKDE] sip beginners project pqfaxview-0.1.0
>
> This is a small project to get you started.
>
> sip does not accept parameter names, so, use
> void foo(int);
> instead of
> void foo(int bar);
>
> Gerard
>
> PS: you'll find more info in Boudewijn's book on PyQt (see Riverbank's
> web pages), but in the end you'll have to compare PyQt's sip files
> with the generated source code. You can also look at PyQwt
> (http://gerard.vermeulen.free.fr) for an example that is bigger than
> pqfaxview but smaller than PyQt itself.
>
> On Fri, Jan 10, 2003 at 08:45:32AM -0600, Jason Lee wrote:
> > I hope this is the right place.  The Riverbank Computing web page said it
> > was, so...
> >
> > I'm new to sip.  I've been toying with swig, and haven't gotten boost to
> > run. I'm trying to get a Python wrapper for a C++ library (duh :), but
> > I'm having trouble setting up my .sip.  If I have an empty class, things
> > work fine.  Once I start adding lines from the header file, I start
> > getting parse errors.  The lines that seem to be causing problems are
> > definitions of functions pointers (static void   (*clearScreen)(uchar w,
> > uchar h);) or struct declarations.  The odd thing about the struct,
> > though, is that if it's empty, it's fine.  Once I add anything to to
> > (e.g., uchar
> > R,G,B,Alpha;), I get a parse error.  It also errors out if I put a const
> > int declaration outside any struct or class scope. I'm sure I'm missing
> > something fundamental, but the docs aren't helpful, and the PyQT .sips
> > are a little overwhelming for a newbie. :)  Does anyone have any pointers
> > as to what I'm doing wrong?  I'd appreciate the help.
> >
> > BTW, if this is the wrong list, I apologize.  It seems to be, based on
> > the web page, but if it's not, I'll gladly take my question somewhere
> > else.
> >
> > Thanks!
> >
> > --
> > jason lee
> > I have not been called to the wisdom of this world, but to a God who's
> > calling
> > out to me, and even though the world may think I'm losing touch with
> > reality,
> > it would be crazy to choose this world over eternity.  -- MercyMe
> >
> > ___
> > PyKDE mailing list[EMAIL PROTECTED]
> > http://mats.gmd.de/mailman/listinfo/pykde
>
> ___
> PyKDE mailing list[EMAIL PROTECTED]
> http://mats.gmd.de/mailman/listinfo/pykde



pqfaxview-0.1.1.tar.gz
Description: application/tgz


[PyKDE] QExtScintilla split views

2003-01-03 Thread Hans-Peter Jansen
Hi Phil,

me again with a totally different topic: What do you think about
implementing split views in QExtScintilla. From a quick glance,
(Q)Scintilla provides an API for this. How hard it would be to
adopt this in QExtScintilla? Since I'm not of big help in sip
development, I could look into this one with your blessing.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] SIP Roadmap

2003-01-03 Thread Hans-Peter Jansen
On Friday 03 January 2003 13:21, Phil Thompson wrote:
> On Friday 03 January 2003 12:05 pm, Hans-Peter Jansen wrote:
> >
> > This roadmap sounds very nice and reasonable.
> >
> > But what are your plans concerning point 18, 22, 23 and 24 from sip TODO?
>
> The Roadmap isn't intended to cover everything - but I don't perceive these
> to be as important. Of course one purpose of the Roadmap is to enable
> people to change my perception.

Well, while 18, 22, and 23 would allow the user to follow more pythonic 
approaches (and help also reducing hand written sip code), I do remember 
some difficulties in advanced QSQL handling without Qt property support,
which is on of the big "sell arguments" for Qt3, IMHO. I can dig into the 
details again, if you want.

> Phil

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] SIP Roadmap

2003-01-03 Thread Hans-Peter Jansen
Hi Phil & friends,

On Thursday 02 January 2003 20:10, Phil Thompson wrote:
> For those interested I've added a SIP Roadmap to the website at
> http://www.riverbankcomputing.co.uk/sip/roadmap.php which describes the
> main objectives and features for SIP v4.
>
> Comments welcome.

This roadmap sounds very nice and reasonable.

But what are your plans concerning point 18, 22, 23 and 24 from sip TODO?

> Phil

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] sip beginners project pqfaxview-0.1.0

2002-12-21 Thread Hans-Peter Jansen
Hi,

this is by far the smallest useful fax viewer, I know of.
And it's smooth scaling, btw. Based on a small qtiffhandler 
c++ module, wrapped by sip.

HOWTO:
install sip and PyQt
tar xvzf pqfaxview-0.1.0.tar.gz
cd pqfaxview-0.1.0
make
tar xvzf qtiffhandler-0.1.0.tar.gz
cd qtiffhandler-0.1.0
make && make install
cd ..
./main.py

Read source.

Let me know, what do you think.

I should mention, that creating this project was pure fun :-)

Enjoy,
Hans-Peter

P.S.: I'm off for a few days. Merry christmas!



pqfaxview-0.1.0.tar.gz
Description: application/tgz


Re: [PyKDE] sip wrapping problem [solved]

2002-12-21 Thread Hans-Peter Jansen
On Saturday 21 December 2002 02:36, Hans-Peter Jansen wrote:
> On Saturday 21 December 2002 00:43, Phil Thompson wrote:
> > Where does the keyword code come from?
>
> It was PyQwt specific, but not the source of the problem.
> It was me being stupid (again). Sorry. The class is called QTIFFHandler,
> and thus python -c "from qth import QTIFFHandler" succeeds.
> A fax load succeeded, too, thus the lib is working now. Cool.
> Will look into getting it displayed later, today.
>
> A question remains, why does the wrong call not generate an error,
> but a loop? Again, it smells PyQwt setup.py related.

I finally solved this glitch. It happened, because the way, I used
setup.py, which created an identical qth.py and __init__.py in module 
dir. Using an intermediate build dir got rid of the stray qth.py.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] sip wrapping problem [solved]

2002-12-20 Thread Hans-Peter Jansen
On Saturday 21 December 2002 00:43, Phil Thompson wrote:

> Where does the keyword code come from?

It was PyQwt specific, but not the source of the problem.
It was me being stupid (again). Sorry. The class is called QTIFFHandler,
and thus python -c "from qth import QTIFFHandler" succeeds.
A fax load succeeded, too, thus the lib is working now. Cool.
Will look into getting it displayed later, today.

A question remains, why does the wrong call not generate an error,
but a loop? Again, it smells PyQwt setup.py related.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] sip wrapping problem

2002-12-20 Thread Hans-Peter Jansen
On Saturday 21 December 2002 00:43, Phil Thompson wrote:

> > class QTIFFHandler(QObject):
> > def __init__(self,*args,**kwargs):
> > libqthc.sipCallCtor(0,self,args)
> > for key in kwargs.keys():
> > method = getattr(self, key)
> > if type(kwargs[key]) == types.TupleType:
> > apply(method,kwargs[key])
> > else:
> > method(kwargs[key])
>
> Where does the keyword code come from?

Looks like it's somewhat related to setup.py and pyqt_support.py from
PyQwt. Do you know, where i can find some simple setup.py or build.py 
for this kind of work? I would like to reduce this to a much simpler
form (hopefully sip and PyQt version independant, if possible somehow).

What do you think about including this in the PyQt examples section,
once it works as expected? (with a simple fax viewer frontend).

> The .sip file looks Ok. Have you tried debugging the generated code to see
> where it is blocking?

Not yet.

> Phil

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] sip wrapping problem

2002-12-20 Thread Hans-Peter Jansen
Hi *,

while trying to wrap a Qt TiffHandler class in order to be able
to load and display facsimiles from PyQt, I stumbled across
this problem: on import of the wrapped class, it blocks after
loading this module:
open("/usr/lib/python2.2/site-packages/qth/qth.py", O_RDONLY|O_LARGEFILE) = 3

created by sip (a bit outdated, I know): << EOF
# Python wrapper code.
#
# Generated by SIP snapshot-20021114 (build 50) on Fri Dec 20 21:58:32 2002

import libsip

from qt import QObject

PYQTH_VERSION = "0.0.0"
import types
import libqthc

libqthc.sipInitModule(__name__)

class QTIFFHandler(QObject):
def __init__(self,*args,**kwargs):
libqthc.sipCallCtor(0,self,args)
for key in kwargs.keys():
method = getattr(self, key)
if type(kwargs[key]) == types.TupleType:
apply(method,kwargs[key])
else:
method(kwargs[key])


# Register the classes with the C++ module.

libqthc.sipRegisterClasses()

EOF

generated from this sip file: << EOF

%Module qth

%PrePythonCode
PYQTH_VERSION = "0.0.0"
%End

%Import qtmod.sip

class QTIFFHandler : QObject
{
%HeaderCode
#include 
#include 
#include 
#include 
%End

public:
enum Resolution {
Undefined,
Fine,
Normal
};

QTIFFHandler(QLabel *, QWidget */TransferThis/ = 0, const char * = 0);

int load(const char *);
void close();
void setSmoothScale(bool);
bool smoothScale();
void setPage(int);
void scale(float);
void rotate(double);
int page();
int pages();
float zoom();
QString sender();
QString time();
Resolution resolution();
const char *filename();
QPixmap *currentPage();
signals:
void update();
private:
QTIFFHandler(const QTIFFHandler &);
};

EOF

I managed to mangle PyQwts setup.py to properly generate this module,
but maybe I failed in some mysterious ways... Archive with Makefile
attached. (I know, this package suffers from a couple of flaws, but
I'm trying to get _something_ to work before starting to refine this
thing.)

TIA,
Hans-Peter


qtiffhandler-0.0.0.tar.gz
Description: application/tgz


Re: [PyKDE] Opinions on pyuic Custom Widget Support

2002-12-14 Thread Hans-Peter Jansen
On Saturday 14 December 2002 18:34, Phil Thompson wrote:
> On Saturday 14 December 2002 4:04 pm, Ricardo Javier Cardenes Medina wrote:

> > At first glance, I don't see a better way to do this, but I think you
> > should preserve the current behaviour when no "Python: " has been
> > provided (for backwards compatibility). You could even provide a
> > "Python: @defaults@", or something like that, allowing people to include
> > the current generated imports, along with the other Python: clauses.
>
> I want to drop the current method because it is likely to be broken when
> you want to use both uic and pyuic, ie. when you are using PyQt as a rapid
> prototyping tool for C++ development.

Please go ahead, Phil.

Better supporting another sexy development strategy by far outweighs some  
minor hassle with backward compatibility in this respect.

[Some cursory christmas thoughts/wishes, weather is asking for it:)]
Since I joined this project on mid of july, I'm pleased to realize the 
speed of development without big talk. In fact, I would love to see a
bit more cummunication on these advances<33% wink>.

The biggest gift seems to be Phils effort in order to wrap Scintilla, 
which made it possible for Detlev to enhance eric to a very promising 
IDE in just adding 372 KB Python Source. It has grown to a size of 760 KB
of sane an (mostly) easy to understand and i18ned code.

I cannot imagine a better demonstration of the raw power from a develop 
environment. Simply incredible, guys!

Phil, I would love to see you tackling some entries from the sip TODO. 
When browsing through sip's code last time, me badly realizes my knowledge 
holes on the flex/yacc front, but OTOH, the strong feeling, it would be 
worth the hassle to fill them. This may reduce the call for that somewhat 
crazy idea of coupling several c++ wrapper libs for one toolkit in one 
project. If only we could combine these efforts in order to make out 
world a bit more pythonic tomorrow ;-) This is by no means intended as
an offence against the Boost.People. Please beware!

Although PyQt is carried by a comparably small cummunity, it is a very
nice place to be. Thanks, guys! 
[Asking myself: any xx chromosome coded human listening?]

> Phil

I wish you all a nice christmas,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] (no subject)

2002-12-10 Thread Hans-Peter Jansen
On Tuesday 10 December 2002 12:34, Pantxo Villa wrote:
> Hi,
>
> I've installed Qt 3.0.4, SIP 3.4, PyQt 3.2.4 under redhat 7.1 (french)
> Qt examples are running, but not Pyqt's...
> with the message:
>
> pure virtual method called
> Abandon (core dumped)

You should always use corresponding sip and PyQt versions.

hp

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] help

2002-12-09 Thread Hans-Peter Jansen
Consider installing sip and RTFM.

On Monday 09 December 2002 17:00, Pantxo Villa wrote:
> Hi,
>
> I'm French, so sorry for my English.
> I try to install pyqt with python 2.2 and qt 2.3.1 or newer, but the
> "make install" give me the following error, and it's the same when I try
> to run examples...
> Could you help me please?
>
>
>
> /bin/sh ../mkinstalldirs /opt/python_222/lib/python2.2/site-packages
>  /usr/bin/install -c -m 644 /qt.py
> /opt/python_222/lib/python2.2/site-packages/qt.py
> make install-data-hook
> make[3]: Entering directory `/usr/local/PyQt-3.2.4/qt'
> (cd
> /tmp;PYTHONPATH=/opt/python_222/lib/python2.2/site-packages:/opt/python_
> 222/lib/python2.2/site-packages
> /opt/python_222/bin/python -c "import qt")
> Traceback (most recent call last):
>   File "", line 1, in ?
>   File "/opt/python_222/lib/python2.2/site-packages/qt.py", line 46, in
> ?
> import libsip
> ImportError: libqt-mt.so.3: cannot load shared object file: No such file
> or directory
> make[3]: *** [install-data-hook] Error 1
> make[3]: Leaving directory `/usr/local/PyQt-3.2.4/qt'
> make[2]: *** [install-data-am] Error 2
> make[2]: Leaving directory `/usr/local/PyQt-3.2.4/qt'
> make[1]: *** [install-am] Error 2
> make[1]: Leaving directory `/usr/local/PyQt-3.2.4/qt'
> make: *** [install-recursive] Error 1
>
>
> _
> GRAND JEU SMS : Pour gagner un NOKIA 7650, envoyez le mot IF au 61321
> (prix d'un SMS + 0.35 euro). Un SMS vous dira si vous avez gagné.
> Règlement : http://www.ifrance.com/_reloc/sign.sms
>
>
> ___
> PyKDE mailing list[EMAIL PROTECTED]
> http://mats.gmd.de/mailman/listinfo/pykde

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] [ERIC3][PATCH] Just another file could not be opened message

2002-11-30 Thread Hans-Peter Jansen
On Saturday 30 November 2002 18:24, Detlev Offenbach wrote:

> Can you please try it with the latest version that I just uploaded to my
> site because I was not able to reproduce it.

This one is fixed now, but here is another one:

cd eric
python eric3.py
-> open eric3.pro
-> open UserInterface.py
-> breakpoint on first statement of UserInterface.__init__
-> Debug project [--nosplash]
-> F6
-> keep F7 pressed for a few seconds (not nice but should work, IMO)

Looks like eric forgets about it's running a debug session. 
I hope you can reproduce it.

> >To circumvent this, I suggest applying something like
> > the attached diff ;-)
>
> It is included for all those people that don't like trolls.

or who want to debug eric with eric ;-)

> Detlev

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] [ERIC3][PATCH] Just another file could not be opened message

2002-11-30 Thread Hans-Peter Jansen
Hi Detlef,

while trying to single step through eric3 itself, i got this message:
The file
/usr/src/packages/BUILD/eric-3.0.0a2/eric/eric/Project.py
could not be opened
triggered from Editor.py.

This path contains one 'eric/' to much, and depends on the path,
eric3 is started from. In this case:
/usr/src/packages/BUILD/eric-3.0.0a2/eric
-> open project eric.pro
If started from:
/usr/src/packages/BUILD/eric-3.0.0a2
-> open project eric/eric.pro
it can be single stepped just fine, apart from the splash covering
the screen. To circumvent this, I suggest applying something like 
the attached diff ;-)

BTW: what about remembering the debugger command lines in project file?

Hans-Peter
--- /usr/lib/python/site-packages/eric3/eric3.py	2002-11-24 19:47:11.0 +0100
+++ eric/eric3.py	2002-11-30 16:31:50.0 +0100
@@ -53,12 +53,16 @@
 ericDir = os.path.dirname(sys.argv[0])
 if ericDir == '':
 ericDir = '.'
 app = QApplication(sys.argv)
 
-# generate and show a splash window
-splash = showSplash()
+# generate and show a splash window, if not suppressed
+if "--nosplash" in sys.argv:
+del sys.argv[sys.argv.index("--nosplash")]
+splash = None
+else:
+splash = showSplash()
 
 # We can only import these after creating the QApplication because they
 # make Qt calls that need the QApplication to exist.
 from UserInterface import UserInterface
 
@@ -102,9 +106,10 @@
 
 mw = UserInterface()
 app.setMainWidget(mw)
 mw.show()
 
-del splash
+if splash:
+del splash
 
 app.exec_loop()
 



Re: [PyKDE] Re: eric3 python-site files not found

2002-11-29 Thread Hans-Peter Jansen
On Friday 29 November 2002 22:03, Arno Paehler wrote:
> Hi Detlev,
>
> I now tried Hans-Peter's script and the problem goes away.
> Maybe SuSE need to revise the way they build their rpm.

Before I start bugging some people at SuSE, I would like 
to understand the problem. Phil? As stated before, I see 
some importance to get this fixed before their next release.
I will easily detect this when traffic in suse-beta ML arises
again... In the meantime, we already know, how to fix this ;-)

Jonathan: I will update sf.net release notes soon...

> There is another message that I get but that doesn't seem
> to affect eric3's operation. I just include it here for
> completeness.
>
> Arno
>
> -
>
> paehler@linux> eric3
> eric: no translation file 'qt_C'found.
> Using default.
> eric: no translation file 'qscintilla_C'found.
> Using default.
> eric: no translation file 'eric3_C'found.
> Using default.
> Please report to <[EMAIL PROTECTED]>.

Well, this is related to your locale setting and somewhat
expected here. Maybe Detlef should handle this special case, 
as it doesn't make much sense to search for C locale 
translations in the first place.

BTW, Try
LC_CTYPE=de_DE@euro eric3
to enable the german translation. (I expect you to be a
native german speaker, even if it appears, that you're sitting 
on the other side of the globe ;-)

[...]

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Re: eric3 python-site files not found

2002-11-28 Thread Hans-Peter Jansen
On Thursday 28 November 2002 21:22, Detlev Offenbach wrote:
> Hi Arno,
>
> > Hi Arno,
> >
> > what about subscribing PyKDE? Pretty low traffic ML.
> >
> > On Tuesday 26 November 2002 12:47, you wrote:
> > > Hi,
> > >
> > > when single-stepping through some of my python files with eric3
> > > I get an error dialog with the message
> > >
> > > The file
> > > /var/tmp/python-2.2.1-build/usr/lib/python2.2/sre.py
> > > could not be opened.
> > >
> > > I am using python-2.2.1-45 from SuSE 8.1. I also have the rpm
> > > python-nothreads-2.2.1-45 installed, not sure whether that
> > > maytters. The same python files run fine outside of eric3.
> > >
> > > The filename in the message looks like a leftover from a build.
>
> I am using SuSE 8.1 as well and haven't seen the described behaviour so
> far. Would it be possible for you, to send me one of your scripts that
> fails to run. The only difference I can see from your description is,
> that I don't have the python-nothreads-2.2.1-45 package installed. It
> could be possible, that your Python tries to execute a script
> compiled/optimized with one version with the other one. At the moment I
> don't have any other clue.
>
> > The problem seems to be related to the way, how eric resolves
> > the path of the source (using the path provided in the *.py{c,o}
> > files). This clashes with the way, SuSE built their python package,
> > which leads to these strange messages from eric. I solved this
> > problem with the attached script:
>
> Hans-Peter, what do you mean by that. I am not aware of any special path
> resolving in eric (but maybe that's deep in the old code that I haven't
> touched).

Detlev, please try this:
strings -f /usr/lib/python2.2/*.py[co] | grep "/var/tmp/"
I bet, you will find a lot of matches. Try single stepping through one of 
these, and you should see. 

Attached is a significantly speeded up version of my compile script.
(works with a pipe and two, not n+1 python processes)

> Detlev

Hans-Peter
#! /usr/bin/env python
"""
usage: %s [-arv] [dirs/files] ...
   byte-compiles python files/dirs
   -a compile all files of current python installation
   -o optimized compile, too
   -r recursive behaviour
   -v verbose level (cumulative)
   dirs/files: to compile
"""
# (c)reated by Hans-Peter Jansen, LISA GmbH, Berlin
#
# Licence:  GPL   http://www.gnu.org/licenses/gpl.html
#
# 2002-11-27hpinitial version
# 2002-11-28hppipe for optimized compile
#
# TODO:
# - testing
#
# vim:set et ts=4 sw=4:

import sys, os
import getopt
import glob
import py_compile

argv0 = os.path.basename(sys.argv[0])
optimize = 0
verbose = 0
optpipe = None

def out(lvl, arg):
if lvl > verbose:
return
err(arg, sys.stdout)

def err(arg, ch = sys.stderr):
if arg:
ch.write(arg)
if arg[-1] != "\n":
ch.write("\n")
else:
ch.write("\n")
ch.flush()

def exit(ret=0, arg=None):
if arg:
out(0, "%s: %s" % (argv0, arg))
sys.exit(ret)

def usage(ret=0, arg=None):
if arg:
out(0, "%s: %s" % (argv0, arg))
out(0, __doc__ % (argv0))
sys.exit(ret)

def pycompile(path, recursive = 0, depth = 0):
if os.path.isdir(path):
for p in glob.glob(os.path.join(path, "*")):
if depth == 0 or recursive:
pycompile(p, recursive, depth + 1)
elif os.path.isfile(path):
if path[-3:] == '.py':
out(1, "compiling %s" % (path))
py_compile.compile(path)
if optimize:
out(1, "compiling %s (opt)" % (path))
optpipe.write("%s\n" % path)
optpipe.flush()
else:
out(1, "%s ignored" % (path))

if __name__ == '__main__':
#global verbose, optimize
try:
optlist, args = getopt.getopt(sys.argv[1:], "aorvO")
except getopt.error, msg:
usage(1, msg)

all = 0
optimize = 0
recursive = 0
optproc = 0
for opt, par in optlist:
if opt == '-a':
all = 1
elif opt == '-o':
optimize = 1
elif opt == '-r':
recursive = 1
elif opt == '-v':
verbose += 1
elif opt == '-O':
optproc = 1

if optimize:
# create a pipe to a slave process for optimized compile
optpipe, stdout = os.popen2("python -O %s -O" % (sys.argv[0]))
elif optproc:
# handle optimized compile here
while 1:
l = sys.stdin.readline()
if not l:
sys.exit(0)
py_compile.compile(l[:-1])

if all:
pyFullVers = sys.version.split()[0]
vl = pyFullVers.split(".")
pyVers = vl[0] + "." + vl[1]
pycompile(os.path.join(sys.prefix, "lib/python" + pyVers), 1)
else:
for p in args:
pycompile(p, recursive)
if optpipe:
optpipe.close()




[PyKDE] eric3 alt. layout

2002-11-28 Thread Hans-Peter Jansen
Hi Detlev, Hi PyQties,

here's a patch to top of ericgeom.diff, which implements an _experimental_
alternate layout. If you want your old layout back, set 
self.layoutstyle = "qtdes" in UserInterface.py. Expect a restored geometry 
to be mangled. It separates Browser, Inspector, and Log component on the 
left pane, in order to get a bigger editing space.
Here is a screenshot: http://lisa-gmbh.de/download/eric3alt.jpg (80k)
   full size: http://lisa-gmbh.de/download/eric3altfull.jpg (165k)
Yes, I'm using a uncommon color set. Note also, that this one uses smaller
icons 20x18, opposed to the genuine 22x22. [ericIconsShrink1.tar.gz]
Detlev: Sorry, the first icon patchset was broken. Please try this one.

Comments welcome.

eric-hacking-is-fun'ly y'rs,
Hans-Peter



ericIconsShrink1.tar.gz
Description: application/tgz
--- UserInterface.py.hp	2002-11-28 22:53:06.0 +0100
+++ UserInterface.py	2002-11-28 22:53:28.0 +0100
@@ -88,43 +88,72 @@
 # Generate the debug server object
 dbs = DebugServer()
 
 # Generate an empty project object
 self.project = Project(self)
+
+# Create the workspace now so that we can connect QActions to it
+self.layoutStyle = "alt"
+if self.layoutStyle == "alt":
+# alternate layout style
+self.hSplitter = QSplitter(self.centralWidget(),"hSplitter")
+self.hSplitter.setOrientation(QSplitter.Horizontal)
+
+# Create a splitter for the right hand side
+self.vSplitter = QSplitter(self.hSplitter,"vSplitter")
+self.vSplitter.setOrientation(QSplitter.Vertical)
+
+# Create the project browser
+self.projectBrowser = ProjectBrowser(self.project, self.qtdir, self.vSplitter)
+self.projectBrowser.show()
+
+# Create the shell, browser, variables part of the user interface
+self.sbv = SBVviewer(dbs, self.vSplitter)
+
+# Create the log viewer part of the user interface
+self.logViewer = LogView(self.vSplitter)
+self.logViewer.setMinimumSize(100,60)
+
+ # Create the view manager depending on the configuration setting
+self.viewmanager = ViewManager.factory(self.hSplitter, self, dbs)
+   
+# add the splitter to the main windows layout
+appWindowLayout.addWidget(self.hSplitter)
+
+else: # self.layoutstyle == "qtdes"
+# style to match the appearence of Qt Designer.
+self.hSplitter = QSplitter(self.centralWidget(),"hSplitter")
+self.hSplitter.setOrientation(QSplitter.Horizontal)
+
+# Create the project browser
+self.projectBrowser = ProjectBrowser(self.project, self.qtdir, self.hSplitter)
+self.projectBrowser.show()
+
+# Create the view manager depending on the configuration setting
+self.viewmanager = ViewManager.factory(self.hSplitter, self, dbs)
+
+# Create a splitter for the right hand side
+self.vSplitter = QSplitter(self.hSplitter,"vSplitter")
+self.vSplitter.setOrientation(QSplitter.Vertical)
+
+# Create the shell, browser, variables part of the user interface
+self.sbv = SBVviewer(dbs, self.vSplitter)
+
+# Create the log viewer part of the user interface
+self.logViewer = LogView(self.vSplitter)
+self.logViewer.setMinimumSize(100,100)
+
+# add the splitter to the main windows layout
+appWindowLayout.addWidget(self.hSplitter)
 
-# Create the workspace now so that we can connect QActions to it.  This
-# is done to match the appearence of Qt Designer.
-self.hSplitter = QSplitter(self.centralWidget(),"hSplitter")
-self.hSplitter.setOrientation(QSplitter.Horizontal)
-
-# Create the project browser
-self.projectBrowser = ProjectBrowser(self.project, self.qtdir, self.hSplitter)
-self.projectBrowser.show()
-
-# Create the view manager depending on the configuration setting
-self.viewmanager = ViewManager.factory(self.hSplitter, self, dbs)
-
-# Create a splitter for the right hand side
-self.vSplitter = QSplitter(self.hSplitter,"vSplitter")
-self.vSplitter.setOrientation(QSplitter.Vertical)
-
-# Create the shell, browser, variables part of the user interface
-self.sbv = SBVviewer(dbs, self.vSplitter)
-
-# Create the log viewer part of the user interface
-self.logViewer = LogView(self.vSplitter)
-self.logViewer.setMinimumSize(100,100)
-
+# setup logview
 self.stdoutTab = LogWidget(self)
 self.logViewer.addTab(self.stdoutTab, self.trUtf8("stdout"))
 
 self.stderrTab = LogWidget(self)
 sel

Re: [PyKDE] Re: eric3 python-site files not found

2002-11-28 Thread Hans-Peter Jansen
Hi Ricardo,

I am aware of compileall.py, but it doesn't generate both flavors in
one hitch, does it? Which flavor it generates seems to depend on the state 
of __debug__. Maybe it's enough to modify that, I will check that soonish.

On Thursday 28 November 2002 01:21, Ricardo Javier Cardenes Medina wrote:
> On Thu, Nov 28, 2002 at 12:26:00AM +0100, Hans-Peter Jansen wrote:
> > pycompile -vao
>
> Mmmh... Check for /usr/lib/python2.X/compileall.py. That script does the
> same and I think it's on the standard Python distribution.

Thanks,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Re: eric3 python-site files not found

2002-11-27 Thread Hans-Peter Jansen
Hi Arno,

what about subscribing PyKDE? Pretty low traffic ML.

On Tuesday 26 November 2002 12:47, you wrote:
> Hi,
>
> when single-stepping through some of my python files with eric3
> I get an error dialog with the message
>
> The file
> /var/tmp/python-2.2.1-build/usr/lib/python2.2/sre.py
> could not be opened.
>
> I am using python-2.2.1-45 from SuSE 8.1. I also have the rpm
> python-nothreads-2.2.1-45 installed, not sure whether that
> maytters. The same python files run fine outside of eric3.
>
> The filename in the message looks like a leftover from a build.

The problem seems to be related to the way, how eric resolves
the path of the source (using the path provided in the *.py{c,o}
files). This clashes with the way, SuSE built their python package,
which leads to these strange messages from eric. I solved this 
problem with the attached script:

pycompile -vao

will byte-compile the full python installation, thus requiring root
privilege. This choke on a few files in the test tree, which
seems to be expected, and on a few files, where it's not :-(

BTW: does somebody knows a faster way to generate pyc and pyo
files in one go? (I'm using a stupid system call to get it done)

I will try to ensure a clean python build from SuSE in their next 
distrib.

> Arno

Bye,
Hans-Peter
#! /usr/bin/env python
"""
usage: %s [-arv] [dirs/files] ...
   byte-compiles python files/dirs
   -a compile all files of current python installation
   -o optimized compile, too
   -r recursive behaviour
   -v verbose level (cumulative)
   dirs/files: to compile
"""
# (c)reated by Hans-Peter Jansen, LISA GmbH, Berlin
#
# Licence:  GPL   http://www.gnu.org/licenses/gpl.html
#
# 2002-11-27hpinitial version
#
# TODO:
# - testing
#
# vim:set et ts=4 sw=4:

import sys, os
import getopt
import glob
import py_compile

argv0 = os.path.basename(sys.argv[0])
optimize = 0
verbose = 0

def out(lvl, arg):
if lvl > verbose:
return
err(arg, sys.stdout)

def err(arg, ch = sys.stderr):
if arg:
ch.write(arg)
if arg[-1] != "\n":
ch.write("\n")
else:
ch.write("\n")
ch.flush()

def exit(ret=0, arg=None):
if arg:
out(0, "%s: %s" % (argv0, arg))
sys.exit(ret)

def usage(ret=0, arg=None):
if arg:
out(0, "%s: %s" % (argv0, arg))
out(0, __doc__ % (argv0))
sys.exit(ret)

def pycompile(path, recursive = 0, depth = 0):
if os.path.isdir(path):
for p in glob.glob(os.path.join(path, "*")):
if depth == 0 or recursive:
pycompile(p, recursive, depth + 1)
elif os.path.isfile(path):
f, e = os.path.splitext(path)
if e == '.py':
out(1, "compiling %s" % (path))
py_compile.compile(path)
if optimize:
out(1, "compiling %s (opt)" % (path))
os.system("python -O %s %s" % (sys.argv[0], path))
else:
out(1, "%s ignored" % (path))

if __name__ == '__main__':
#global verbose, optimize
try:
optlist, args = getopt.getopt(sys.argv[1:], "aorv")
except getopt.error, msg:
usage(1, msg)

all = 0
optimize = 0
recursive = 0
for opt, par in optlist:
if opt == '-a':
all = 1
elif opt == '-o':
optimize = 1
elif opt == '-r':
recursive = 1
elif opt == '-v':
verbose += 1

if all:
pyFullVers = sys.version.split()[0]
vl = pyFullVers.split(".")
pyVers = vl[0] + "." + vl[1]
pycompile(os.path.join(sys.prefix, "lib/python" + pyVers), 1)
else:
for p in args:
pycompile(p, recursive)




Re: [PyKDE] ANN: Packages for Eric, the Python IDE

2002-11-27 Thread Hans-Peter Jansen
On Wednesday 27 November 2002 17:19, Gordon Tyler wrote:
> Víctor R. Ruiz wrote:
> >   - The default fonts are too big
>
> This was a prolem for me too. I found it quite annoying to change all
> the fonts to something else like Courier New because I had to
> individually change every different font style (Comment, Numbers, etc.).
> It would be nice if there was a "Change All Styles Font" button where I
> could select one font to use for _all_ the styles.

Implying, you're using eric3 on some unix derivate, try using an editor
with search and replace in [Scintilla] section of ~/.eric3/eric3rc.
Been there, done that, now it fits me needs. Note: you cannot use eric3 
itself for that task.

> Ciao,
> Gordon

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] [PATCH] eric3 remembers geometry

2002-11-27 Thread Hans-Peter Jansen
Hi Detlef,

what do you think about the attached patch. Is it good enough for inclusion?
My first eric source contact was a pleasure (as it took me less then 45 min
to finish it and writing this mail :)

Works-for-me'ly y'rs,
Hans-Peter

P.S.: diff complains about unterminated last line in both modified files.
If they're created with eric3, could you fix this?
--- eric/Preferences.py.orig	2002-11-27 18:05:30.0 +0100
+++ eric/Preferences.py	2002-11-27 18:32:19.0 +0100
@@ -73,10 +73,16 @@
 
 # defaults for system settings
 sysDefaults = {
 "StringEncoding" : "latin-1"
 }
+
+# defaults for geometry
+geometryDefaults = {
+"MainGeometry" : [0,0,0,0],
+"MainSplitter" : [0,0,0,0,0]
+}
 
 def readPreferences(prefClass = Prefs):
 """
 Module function to read the preferences and transfer them into the central
 store.
@@ -152,11 +158,21 @@
 # read the entries for system settings
 prefClass.sysPrefs = {}
 prefClass.sysPrefs["StringEncoding"], ok = \
 prefClass.settings.readEntry("/eric3/System/StringEncoding",
 prefClass.sysDefaults["StringEncoding"])
-
+
+# read the entries for the display geometry
+prefClass.geometryPrefs = {}
+for key in prefClass.geometryDefaults.keys():
+v, ok = prefClass.settings.readEntry("/eric3/Geometry/" + key)
+if ok:
+prefClass.geometryPrefs[key] = eval(str(v))
+else:
+prefClass.geometryPrefs[key] = prefClass.geometryDefaults[key]
+
+ 
 def savePreferences(prefClass = Prefs):
 """
 Module function to write the preferences from the central store.
 """
 # write the entries for the variables display
@@ -201,10 +217,15 @@
 
 # write the entries for the system settings
 prefClass.settings.writeEntry("/eric3/System/StringEncoding",
 prefClass.sysPrefs["StringEncoding"])
 
+# write the entries for the display geometry
+for key in prefClass.geometryPrefs.keys():
+prefClass.settings.writeEntry("/eric3/Geometry/" + key,
+str(prefClass.geometryPrefs[key]))
+
 def readToolbarSettings(mw, tbs, prefClass = Prefs):
 """
 Module function to read the toolbar settings from the central store
 and set the toolbars accordingly.
 """
@@ -381,6 +402,18 @@
 """
 Module function to store the various system settings.
 """
 prefClass.sysPrefs[key] = value
 
-initPreferences()
\ Kein Zeilenumbruch am Dateiende.
+def getGeometry(key, prefClass = Prefs):
+"""
+Module function to retrieve the display geometry.
+"""
+return prefClass.geometryPrefs[key]
+
+def setGeometry(key, value, prefClass = Prefs):
+"""
+Module function to store the display geometry.
+"""
+prefClass.geometryPrefs[key] = value
+
+initPreferences()
--- eric/UserInterface.py.orig	2002-11-27 18:19:34.0 +0100
+++ eric/UserInterface.py	2002-11-27 18:31:09.0 +0100
@@ -63,13 +63,18 @@
 
 """
 def __init__(self):
 QMainWindow.__init__(self)
 
-self.resize(qApp.desktop().size())
-self.setIcon(IconEric)
+g = Preferences.getGeometry("MainGeometry")
+if g == [0,0,0,0]:
+self.resize(qApp.desktop().size())
+else:
+self.move(g[0], g[1])
+self.resize(g[2], g[3])
 
+self.setIcon(IconEric)
 self.setCaption(Program)
 
 self.setCentralWidget(QWidget(self))
 appWindowLayout = QHBoxLayout(self.centralWidget(),0,6)
 
@@ -178,14 +183,19 @@
  self.stderrTab.append)
 self.connect(self, PYSIGNAL('preferencesChanged'),
  self.viewmanager.handlePreferencesChanged)
 
 # Set the sizes of the splitters
-width = self.width()
-height = self.height()
-hSizes = [int(0.21*width), int(0.49*width), int(0.3*width)]
-vSizes = [int(0.8*height), int(0.2*height)]
+g = Preferences.getGeometry("MainSplitter")
+if g == [0,0,0,0,0]:
+width = self.width()
+height = self.height()
+hSizes = [int(0.21*width), int(0.49*width), int(0.3*width)]
+vSizes = [int(0.8*height), int(0.2*height)]
+else:
+hSizes = g[:3]
+vSizes = g[3:]
 self.hSplitter.setSizes(hSizes)
 self.vSplitter.setSizes(vSizes)
 
 # Generate the unittest dialog
 self.unittestDialog = UnittestDialog(None, 1, self)
@@ -772,8 +782,14 @@
 def shutdown(self):
 if not self.viewmanager.closeViewManager():
 return 0
 if not self.project.closeProject():
 return 0
+s = self.geometry()
+p = self.frameGeometry()
+Preferences.setGeometry("MainGeometry", [p.x(),p.y(),s.width(),s.height()])
+h = self.hSplitter.sizes()
+v = self.vSplitter.sizes()
+Preferenc

Re: [PyKDE] [ANN] New repository for non-official Debian packages

2002-11-25 Thread Hans-Peter Jansen
Hi Ric,

On Monday 25 November 2002 23:01, Tom Jenkins wrote:
>
> I installed python2.2-qtext which pulled in libqscintilla0.  However the
> installation failed with:
>
> Setting up python2.2-qtext (3.4+20021122-1) ...
> Traceback (most recent call last):
>File "", line 1, in ?
>File "/usr/lib/python2.2/site-packages/qtext.py", line 28, in ?
>  import libqtextc
> ImportError: libqscintilla.so.0: cannot open shared object file: No such
> file or directory
> dpkg: error processing python2.2-qtext (--configure):
>   subprocess post-installation script returned error exit status 1
>
> i looked at libqscintilla0's files and there are only /usr/share/doc
> files; no actual so's.  did i miss something or is this a problem with
> the package?

FJI: This one hit me today, too. Well not me, but another guy told me...

I was missing this module in _PyQt_:

%{python_site}/qtext.py
%{python_site}/libqtextcmodule.so
%{python_site}/libqtextcmodule.so.1
%{python_site}/libqtextcmodule.so.1.0
%{python_site}/libqtextcmodule.so.1.0.0

It's noted in NEWS, btw.

Cheers,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Speed of derived objects

2002-11-25 Thread Hans-Peter Jansen
Hi Vincent,

On Monday 25 November 2002 21:54, Vincent Wagelaar wrote:
> On Monday 25 November 2002 14:06, Michael Lauer wrote:
> > Am Son, 2002-11-24 um 23.35 schrieb Vincent Wagelaar:
> > > I am currently working with a QListView and QListViewItem. If I don't
> > > derive from these objects speed is great, but derived these objects
> > > become very slow.
> >
> > First of all -
> > you are experiencing an inherent fact in the nature of Python bindings
> > which support deriving and virtual methods. If you don't subclass,
> > there's nearly no Python code involved - if you do subclass, your
> > (really really slow - compared to the speed of executing code in C/C++
> > extension modules) Python code is called. There's nothing you can do
> > about this fact.

[...]

> I think I'll will have to go for the SIP-method because I'm overloading the
> paint method in QListViewItem (called a lot).
>
> The code looks like:
>
> class MyListViewItem(QListViewItem):
>   def paint():
>   # My overridden paint stuff
>   def key():
>   # My overloaded sorting stuff...
>
> Overloading QListView shouldn't give a performance degradation because it's
> only called once. Nothing compared to how many times MyListViewItem is
> called.

I can imagine this would give a nice example. If you like to share some code, 
I'm going to prepare one.

> > If this all don't work for you, then I'm afraid you have to implement
> > your derived class in C++ and use sip to bind this and use it from
> > Python.
>
> I'm affraid so too, but shouldn't give that many troubles. I've also tried
> Psyco but that didn't give a speed boost either.
>
> Thanks for the reply
>
> Vincent

Bye,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] [ANN] SuSE 8.1 RPMs for PyQt/PyQwt/PyKDE snapshots added/updated

2002-11-25 Thread Hans-Peter Jansen
Hi PyQties,

just updated PyQt-20021122-2.i586.rpm to PyQt-20021122-3.i586.rpm,
because I missed to include the new qtext module. This is due to fact, 
that I haven't managed to build the rpm with a proper RPM_BUILD_ROOT.

Sorry for the inconvenience.

As a bonus, I've added PyQwt and PyKDE today:

http://lisa-gmbh.de/download.html#PyQt-snapshots

http://lisa-gmbh.de/download/qscintilla-20021122-1.i586.rpm 285 KB
http://lisa-gmbh.de/download/sip-20021114-1.i586.rpm 131 KB
http://lisa-gmbh.de/download/PyQt-20021122-3.i586.rpm 3.4 MB ***UPDATED*** 
http://lisa-gmbh.de/download/eric3-3.0.0a2-1.i586.rpm 500 KB
http://lisa-gmbh.de/download/PyQwt-20020807p1-2.i586.rpm 498 KB 
http://lisa-gmbh.de/download/PyKDE-3.3.2-7.i586.rpm 5.4 MB

A short success/busted message on usage is highly appreciated.

Thanks goes out to everybody involved.

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] [ANN] SuSE 8.1 RPMs for QScintilla/sip/PyQt/eric3 snapshots

2002-11-24 Thread Hans-Peter Jansen
Hi PyQties,

thanks to the efforts of Phil and Detlef, I proudly announce the
availability of following packages here: 
http://lisa-gmbh.de/download.html#PyQt-snapshots

http://lisa-gmbh.de/download/qscintilla-20021122-1.i586.rpm 285 KB 
http://lisa-gmbh.de/download/sip-20021114-1.i586.rpm 131 KB 
http://lisa-gmbh.de/download/PyQt-20021122-1.i586.rpm 3.4 MB 
http://lisa-gmbh.de/download/eric3-3.0.0a2-1.i586.rpm 500 KB 

A short success/busted message on usage is highly appreciated.

Thanks goes out to Phil and Detlef.

This toolkit is simply the sexiest in town.

Enjoy,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] crash: pure virtual function called

2002-11-12 Thread Hans-Peter Jansen
On Tuesday 12 November 2002 22:39, marvelan L wrote:
> I have built an application with Qt 3.0.4 and PyQt 3.4.
>
> From time to time I get a error message on stdout
> saying "pure virtual function call" and then abort is called
> and the program exits.

What about providing the facts at least, not some "magical phrase".

Narrowing down the problem to the essence inside a test script 
often helps a lot. Remember: we're all telepathic unapt.

> I suspect that this is from the PyQt bindings. Have anyone
> seen this and know what to do about it?
>
> /Marv

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Changing Color in QTable entries

2002-11-12 Thread Hans-Peter Jansen
On Monday 11 November 2002 16:23, David Sathiaraj wrote:
> Hello QT folks:
>
> I have been trying to implement a GUI that uses the QTable and
> QTableItem methods.  I have a table of entries and
> I want to keep track of the changes I make to the table entries.
>
> Now I want to highlight the changed cells with a different color.  I
> sub-classed QTableItem and re-implemented the
> QTableItem::Paint method to change the color of the entries.  However, I
> see a quick flicker of color change and
> then the old white background seems to override it.  I believe before
> the color change is incorporated, garbage collection
> takes over and clears the colored objects created.   If anyone has
> encountered such a problem,  can you tell me how I could force the color
> of the
> changed items to persist?
>
> I have attached a small test snippet - The main process is coded in
> changeColor.py. Table.py is the code generated by Qt designer that is
> used by changeColor.py.  One can run changeColor.py to test it. The
> button 'show changes' should ideally color the items.

Hi David,

this depends on the EditType flag from the QTableItem. If you want to
use QTableItem.Always, you need also to reimplement createEditor() and
friends. Read QTableItem::EditType in FM. Try QTableItem.OnTyping, 
which hopefully does, what you want...

> Regards,
> David S.

Hth,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[BUG] QSettings strangeness WAS: Re: [PyKDE] QSettings.subkeyList not working?

2002-11-10 Thread Hans-Peter Jansen
Hi Trolls,

recently, I stumbled across a strange Qt behaviour:
when supplying an absolute config path with QSettings, Qt seems to miss
subkey lists, but lists simple entries. Omiting the leading slash corrects
this behaviour.

See supplied source: test.cpp, test.py.

Also note, that when renaming keys/subkey on subsequent calls, one would 
expect to preserve former entries. This isn't true, but maybe this is due 
to the simplicity of the test.

This happens at least with Qt 3.0.5 from SuSE 8.1.

Regards,
Hans-Peter

On Sunday 10 November 2002 12:53, Phil Thompson wrote:
> On Saturday 09 November 2002 12:42 pm, Hans-Peter Jansen wrote:
> > Hi Phil et al.,
> >
> > while adopting QSettings for my hand rolled config stuff, I stumbled
> > over the QSettings.subkeyList() not working as expected:
> >
> > Qt doc says, entryList return all entries, which are not keys, while
> > subkeyList return all keys. At least in my tests under X11/linux,
> > subkeyList always return an empty list, but OTOH, they find their way
> > into the config file ($HOME/.qt/testrc in this case).
>
> In my testing subkeyList() is returning a list containing only "test". A
> C++ version does the same thing. I don't know whether it is a bug or a
> misunderstanding - but I don't think it is a PyQt problem.
>
> Phil

/*
 2002/11/10 test.cpp: qt settings glitch by Hans-Peter Jansen <[EMAIL PROTECTED]>
 */

#include 
#include 

#define COMPANY "/whatever"
#define PROGRAM "/test"

int main( int argc, char **argv )
{
QString p = PROGRAM;
if (argc == 1) qDebug("call as './test test' to see it working...");
if (argc >= 2 && argv[1]) p = argv[1];

QSettings qs;
qs.insertSearchPath(QSettings::Windows, COMPANY);
qs.writeEntry(p + "/value", "ok");
if (p[0] != '/') {
qs.writeEntry(p + "/subkey/value", "ok");
} else {
qs.writeEntry(p + "/subkey/value", "not ok");
}

QString k, sk, v;
qDebug("list entries: " + p);
QStringList keys = qs.entryList(p);
QStringList::Iterator it = keys.begin();
while (it != keys.end()) {
k = QString("%1/%2").arg(p).arg(*it);
v = qs.readEntry(k);
qDebug(k + ": " + v);
++it;
}

qDebug("list subkeys: " + p);
keys = qs.subkeyList(p);
it = keys.begin();
if (keys.empty())
qDebug("BUG: no subkeys 8(");
else while (it != keys.end()) {
sk = QString("%1/%2").arg(p).arg(*it);
qDebug("list entry: " + sk);
QStringList skeys = qs.entryList(sk);
QStringList::Iterator sit = skeys.begin();
while (sit != skeys.end()) {
k = QString("%1/%2/%3").arg(p).arg(*it).arg(*sit);
v = qs.readEntry(k);
qDebug(k + ": " + v);
++sit;
}
++it;
}
}

/*
 gcc -I/usr/lib/qt3/include -L/usr/lib/qt3/lib -lqt-mt -o test test.cpp

 vim:set et:ts=4:sw=4:
 */

#!/usr/bin/env python

import sys
from qt import *

program = 'test'
company = 'whatever'

path = "/%s" % (program)
if len(sys.argv) == 1:
print "call as './test test' to see it working..."
if len(sys.argv) >= 2 and sys.argv[1]:
path = sys.argv[1]

qs = QSettings()
qs.insertSearchPath(QSettings.Windows, "/%s" % company)
qs.writeEntry("%s/value" % path, "ok")
if path[0] != '/':
qs.writeEntry("%s/subkey/value" % path, "ok")
else:
qs.writeEntry("%s/subkey/value" % path, "not ok")

print "list entries:", path
for k in qs.entryList(path):
print "%s: %s" % (k, qs.readEntry("%s/%s" % (path, k))[0])

print "list subkeys:", path
skl = qs.subkeyList("%s" % path)
if not skl:
print "BUG: no subkeys 8("
else:
for k in qs.subkeyList("%s" % path):
for sk in qs.entryList("%s/%s" % (path, k)):
print "%s/%s: %s" % (k, sk, qs.readEntry("%s/%s/%s" % (path, k, sk))[0])




[PyKDE] QSettings.subkeyList not working?

2002-11-09 Thread Hans-Peter Jansen
Hi Phil et al.,

while adopting QSettings for my hand rolled config stuff, I stumbled
over the QSettings.subkeyList() not working as expected:

8< 8< 8< 8< 8<

from qt import *

program = 'test'
company = 'whatever'

qs = QSettings()
qs.insertSearchPath(QSettings.Windows, "/%s" % company)
path = "/%s" % (program)
qs.writeEntry("%s/value" % path, "ok")
qs.writeEntry("%s/value2" % path, "ok, too")
qs.writeEntry("%s/list/test" % path, "not ok")
qs.writeEntry("%s/list/test2" % path, "not ok, too")

for k in qs.entryList("%s" % path):
print k, "=", qs.readEntry("%s/%s" % (path, k))[0]

for k in qs.subkeyList("%s" % path):
for sk in qs.entryList("%s/%s" % (path, k)):
print k, sk, "=", qs.readEntry("%s/%s/%s" % (path, k, sk))[0]

>8 >8 >8 >8 >8

Qt doc says, entryList return all entries, which are not keys, while 
subkeyList return all keys. At least in my tests under X11/linux, 
subkeyList always return an empty list, but OTOH, they find their way 
into the config file ($HOME/.qt/testrc in this case).

What's wrong?

Hans-Peter


___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] qwidgetstack.sip bug

2002-11-06 Thread Hans-Peter Jansen
Hi Michael,

That's why we all LOVE context diffs. I suggest:
alias diff='diff -u5'

Have a nice day,
Hans-Peter

On Wednesday 06 November 2002 17:21, Michael Lauer wrote:
> Hi,
>
> -
> %If (- Qt_3_0_0)
> void addWidget(QWidget * /Transfer/,int);
> %End
> %If (Qt_3_0_0 -)
> void addWidget(QWidget * /Transfer/,int = -1);
> %End
> -
>
> is wrong. It should be
> -
> %If (- Qt_3_0_0)
> void addWidget(QWidget * /Transfer/,int);
> %End
> %If (Qt_3_0_0 -)
> int addWidget(QWidget * /Transfer/,int = -1);
> %End
> -
>
> Yours,

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Python list handling for QRect, QPoint, and QSize

2002-11-04 Thread Hans-Peter Jansen
On Monday 04 November 2002 19:57, Phil Thompson wrote:
> On Monday 04 November 2002 6:36 pm, Hans-Peter Jansen wrote:
> > Hi Phil,
> >
> > since I catched the flu this weekend, I think of contributing something
> > useful to PyQt. Namely the IMHO missing handling of python lists, where
> > QRect, QPoint, and QSize objects are expected. (QColor?)
>
> I'm not sure I understand. Are you saying that you want to pass a list of
> (say) x and y coordinates wherever a QPoint was expected? (Wouldn't a tuple
> be better?)

Exactly. Why not support both.

Imagine a typical situation: restore position and size of an app:
(tuple or list doesn't matter much here)

wh = self.cfg.mainScreenSize
if wh:
self.resize(wh[0], wh[1])
xy = self.cfg.mainScreenLocation
if xy:
self.move(xy[0], xy[1])

would then read:

if self.cfg.mainScreenSize:
self.resize(self.cfg.mainScreenSize)
if self.cfg.mainScreenLocation:
self.move(self.cfg.mainScreenLocation)

Do you like this idea? 

> Or are you saying that you want to make QPoint behave a bit like a list?

Not really. Sorry for being too vague. 

> > On my first cursory look, there seem to be to ways, but I don't know
> > their implications:
> >
> > 1) implement __len__(), __getitem__() like in qstringlist.sip
> > 2) %MappedType Qxyz, like in qvaluelist.sip
> >
> > Q1) Why is __setitem__ missing from 1
>
> Because I'm lazy and nobody has complained.

Fair enough.

> > Q2) Does method 2 provide transparent conversion from and to the correct
> > types, whereever they're used? (e.g. QObject)
>
> Yes.
>
> Phil

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Python list handling for QRect, QPoint, and QSize

2002-11-04 Thread Hans-Peter Jansen
Hi Phil,

since I catched the flu this weekend, I think of contributing something
useful to PyQt. Namely the IMHO missing handling of python lists, where
QRect, QPoint, and QSize objects are expected. (QColor?)

On my first cursory look, there seem to be to ways, but I don't know
their implications:

1) implement __len__(), __getitem__() like in qstringlist.sip
2) %MappedType Qxyz, like in qvaluelist.sip

Q1) Why is __setitem__ missing from 1
Q2) Does method 2 provide transparent conversion from and to the correct
types, whereever they're used? (e.g. QObject)

TIA,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] eric locale problem fixed

2002-10-24 Thread Hans-Peter Jansen
Hi Detlef, hi Phil,

as promised, I looked into my eric locale issue here.
The attached patch fixes it for me. It boils down to filtering
the locale definition to the major value, and fixes two c/p
glitches. Along the way, hunk 1 and 2 removes some stray ^M's
at EOL.

BTW: Today, I prepared some new SuSE 8.1 rpm's, but won't find 
time to throw them on my site today: sip-20021018-1.i586.rpm (112k), 
qscintilla-0.2-1.i586.rpm (252k), and PyQt-20021024-2.i586.rpm (3,45m).
I will happily send them everybody directly on short request. 
(w or w/o src.rpm's?).

Have a good day,
Hans-Peter
--- /usr/src/packages/SOURCES/PyQt-x11-gpl-snapshot-20021024/eric/eric.py	2002-10-24 11:04:14.0 +0200
+++ eric/eric.py	2002-10-24 16:19:41.0 +0200
@@ -5,7 +5,7 @@
 import os
 from qt import QApplication, QTranslator, QTextCodec
 
-from Dirs import ericDir
+from Dirs import ericDir
 import Preferences
 
 qtTrans = None
@@ -27,11 +27,16 @@
 prog = None
 
 # Load translation files and install them
-loaded = 0
+loaded = 0
 loc = Preferences.getUILanguage()
 if loc is None:
 loc = unicode(QTextCodec.locale())
-
+# grab the major locale
+try:
+loc = loc.split("_")[0]
+except:
+pass
+
 # 1) load translations for qt
 qtTrans = QTranslator(None)
 qtdir = os.getenv("QTDIR")
@@ -54,10 +59,10 @@
 
 # 2) load translations for eric
 ericTrans = QTranslator(None)
-loaded = qtTrans.load("eric_" + loc, ".")
+loaded = ericTrans.load("eric_" + loc, ".")
 # try in our installation if not found
 if not loaded:
-loaded = qtTrans.load("eric_" + loc, ericDir)
+loaded = ericTrans.load("eric_" + loc, ericDir)
 # install it if successful
 if loaded:
 app.installTranslator(ericTrans)



Re: [PyKDE] Back to work..

2002-10-23 Thread Hans-Peter Jansen
On Wednesday 23 October 2002 18:42, Detlev Offenbach wrote:

> The .ts files should not be installed just the .qm files. Qt doesn't even
> look for them if called the way it is within eric.

This would allow users to prepare translations without digging in source/build 
trees, wouldn't it?
>
> Detlev

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Where & What ?

2002-10-23 Thread Hans-Peter Jansen
On Wednesday 23 October 2002 10:10, Phil Thompson wrote:
> On Wednesday 23 October 2002 9:02 am, Jonathan Gardner wrote:
> > On Tuesday 22 October 2002 12:25 pm, Rob Hooft wrote:
> > > Jonathan Gardner wrote:
> > > > 3. Web designer. Needs to be familiar with PHP, or willing and able
> > > > to learn.
> > >
> > > What you describe might actually be served very well with a WikiWiki.
> > > And with MoinMoin there is a very nice python implementation available.
> > > That would just leave you with the requirement to find a place that can
> > > host a Wiki for you.
> >
> > Sounds great. Where can we do it? Can you administer something like this?
>
> Why don't you use the Wiki on python.org? There is a section for PyQt which
> I put introductory, "PyQt is great" type stuff in. It would be one way to
> give PyQt greater exposure to the wider Python community.

Also regular Freshmeat release entries would serve this purpose. Last one 
of PyQt is from july with version 3.3, and for PyKDE from may with 3.2.4.

> Phil

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Back to work..

2002-10-23 Thread Hans-Peter Jansen
Hi Phil,

here is the diff against build.py v3.4, I'm using for the RPMs.
I'm confident about the first hunk, but unsure about the second:

--- build.py.orig   2002-10-08 19:11:40.0 +0200
+++ build.py2002-10-08 20:13:35.0 +0200
@@ -1147,7 +1147,7 @@
 f = open("Makefile","a")
 f.write("\ninstall-eric:\n")
 
-ericdir = modDir + os.sep + "eric"
+ericdir = os.path.join(modDir, "eric")
 
 # Create the platform specific wrappers.
 ename = createPyWrapper(ericdir,"eric","eric")
@@ -1162,6 +1162,7 @@
 f.write("\t-%s eric%s*.py %s\n" % (platCopy,os.sep,ericdir))
 f.write("\t-%s eric%s*.pyc %s\n" % (platCopy,os.sep,ericdir))
 f.write("\t-%s eric%s*.qm %s\n" % (platCopy,os.sep,ericdir))
+f.write("\t-%s eric%s*.ts %s\n" % (platCopy,os.sep,ericdir))
 f.write("\t-%s %s %s\n" % (platCopy,ename,platBinDir))
 f.write("\t-%s %s %s\n" % (platCopy,uname,platBinDir))
 f.write("\t-%s %s %s\n" % (platCopy,hname,platBinDir))

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Where & What ?

2002-10-22 Thread Hans-Peter Jansen
Hi Marc,

On Tuesday 22 October 2002 10:54, Marc Schmitt wrote:
> I'd like to start a discussion about those points :
>
> Where to place sip, PyQt and PyKDE related material. This means sources,
> patches, packages, docs, examples, ... Currently sources are on riverbank,
> some packages on sf, some on lisa-gmbh.de. Patches seem to be nowhere,
> examples within the sources.
> Wouldn't it be best to unify (or maximal dualify) the places where we
> collect the stuff ?

As far as official releases are concerned, this should be decided by Phil 
and Jim. I wouldn't mind to be linked on their sites, and willing
to take over some organizational tasks on Sourceforge/Freshmeat.

In my opinion, we should crosslink the resources, and try to get more
public attention with freshmeat entries. I thought about publishing the 
rpm availability on Freshmeat, but hesitated to not interfere on such
actions with our masters. Phil, Jim, opinions?

> What about packaging policy ? To me this means, how to split packages. For
> SuSE 8.0 I made -devel and -doc packages, for 8.1 I merged everything
> together reflect the source structure : There are only three packages, sip,
> PyQt and PyKDE left. Each contains all of the sources stuff, like libs,
> docs, examples and sips. IMHO we should provide three super-spec, that
> everyone can use for every distribution.

You convinced me, that "the simpler, the better" approach is far superior,
and recreated the rpms to conform with it. I will try to convince Adrian 
Schroeter, the SuSE package maintainer, to create similar package layouts.

> -Marc

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] QPixmap.getWidget() returns colurful something

2002-10-17 Thread Hans-Peter Jansen
Hi Marc,

On Thursday 17 October 2002 09:49, Marc Schmitt wrote:
> Hi,
>
> I get strange behavior when I try to grab a pixmap from a widget. After one
> second, when the timer times, the app "flickers" and all buttons are gone.
>
> When I then open the saved image, only lines and some colors appear. Did I
> miss something, or is it an PyQt anormaly ?

Works for me here. Want the snap?

> Thanks
> -Marc

Cheers,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] ANN : PyKDE 3.3.2 SuSE 8.1 rpm

2002-10-16 Thread Hans-Peter Jansen

On Wednesday 16 October 2002 11:28, Marc Schmitt wrote:
> Hi,
>
> PyKDE 3.3.2 for SuSE 8.1 is there (its currently uploading). It has the
> subtitle ("Krippled") as I had to remove the paint function within
> khtml_part.sip in order to make it compile. Everything else should work as
> before.
> When we find a way to work around the non-pod type error (probably caused
> by gcc3.2) I'll make a new minor release.

For your convenience, I've made an alternative build available here:

http://lisa-gmbh.de/download.html#PyQt-RPMs

Note, that I don't regard this as a contest with Marc's affords,
with were pretty valuable to get this job done. Not to forget the
affords of the well known creators of these packages. Thanks a lot!

We finally came to the conclusion, that providing more than the 
necessary number of packages, is sub optimal for most users.

I hope, I've made the correct fixes to sip/khtml_part.sip:

--- ../PyKDE-3.3.2.orig/sip/khtml_part.sip  2002-08-21 20:08:45.0 +0200
+++ ./sip/khtml_part.sip2002-10-16 21:11:18.0 +0200
@@ -124,8 +124,8 @@
QRect r;
int i = 0;
 
-   if 
(sipParseArgs(&sipArgsParsed,sipArgs,"mJ0J0ii",sipThisObj,sipClass_KHTMLPart,&ptr, 
sipClass_QPainter, p,
-   sipClass_QRect, r, i))
+   if 
+(sipParseArgs(&sipArgsParsed,sipArgs,"mJ0J0i",sipThisObj,sipClass_KHTMLPart,&ptr, 
+sipClass_QPainter, p,
+   sipClass_QRect, &r, i))
{
bool b;

> Bye
> -Marc

Enjoy,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-16 Thread Hans-Peter Jansen

Hi Marc, hi Jim,

I finally touched the khtml_part problem. Here is my mod:

--- ../PyKDE-3.3.2.orig/sip/khtml_part.sip  2002-08-21 20:08:45.0 +0200
+++ ./sip/khtml_part.sip2002-10-16 13:02:32.0 +0200
@@ -124,8 +124,8 @@
QRect r;
int i = 0;
 
-   if 
(sipParseArgs(&sipArgsParsed,sipArgs,"mJ0J0ii",sipThisObj,sipClass_KHTMLPart,&ptr, 
sipClass_QPainter, p,
-   sipClass_QRect, r, i))
+   if 
+(sipParseArgs(&sipArgsParsed,sipArgs,"mJ0J0JOi",sipThisObj,sipClass_KHTMLPart,&ptr, 
+sipClass_QPainter, p,
+   sipClass_QRect, &r, i))
{
bool b;

At least, it compiles, but does this make sense also? 
I moderately sure about the missing &, which fixes the compiler complaint, 
but what about this sip argument format string?

Please comment!

Thanks,
Hans-Peter

On Wednesday 16 October 2002 11:10, Marc Schmitt wrote:
> On Mittwoch, 16. Oktober 2002 02:48, Jim Bublitz wrote:
> > > Nope. I changed that (and some randomly some other permutation of
> > > that occurance within khtml*.sip) but without success.
> >
> > I'm not sure what you mean here - the 'ii' means it's looking for
> > two ints passed in, but only one is passed in PyKDE (the second from
> > the original declaration was a bool *, which PyKDE *returns* as a
> > value in a tuple). "ii" is only wrong if only one int is expected
> > in the arg list; it would be correct for two ints in the arglist,
> > which isn't the case here.
>
> I first assumed replacing the (to me mysterious) string "mJ0J0ii" had
> helped and brought me further (which was a mistake, I just looked at the
> wrong lines) so I thought, "Hey, if this helpes lets edit some others too"
> :)
>
> About the internals of sip I know not much. I've read a bit about swig, and
> used it once but not sip.
>
> > Ooops! My mistake (in more ways than one). The exact same code is
> > in khtml_part.sip (cut and pasted, I'm sure), so you might try
> > another iteration of the same fixes but on khtml_part.sip instead.
> > It doesn't seem likely that the extra 'i' is the problem though -
> > I'm not sure what is. Anybody recognize the meaning of "non-POD
> > type"??
>
> I found this :
>
> http://www.boost.org/libs/python/doc/v2/definitions.html
>
> POD: A technical term from the C++ standard. Short for "Plain Ol'Data": A
> POD-struct is an aggregate class that has no non-static data members of
> type pointer to member, non-POD-struct, non-POD-union (or array of such
> types) or reference, and has no user-defined copy assign- ment operator and
> no user-defined destructor. Similarly, a POD-union is an aggregate union
> that has no non-static data members of type pointer to member,
> non-POD-struct, non-POD-union (or array of such types) or reference, and
> has no user-defined copy assignment operator and no user-defined
> destructor. A POD class is a class that is either a POD-struct or a
> POD-union. An aggregate is an array or a class (clause 9) with no
> user-declared constructors (12.1), no private or protected non-static data
> members (clause 11), no base classes (clause 10), and no virtual functions
> (10.3).
>
> and especially this one :
>
> http://lists.trolltech.com/qt-interest/2002-03/thread4-0.html :
>
> [Q:]
> I'm trying to use QString::sprintf with little luck.
> During compilation I get the following warnings:
>
> g++ -c -pipe -Wall -W -O2  -DQT_NO_DEBUG -I/var/tmp/qt/include
> -I/var/tmp/qt/mkspecs/default -o main.o main.cpp
> main.cpp: In function `int main (int, char **)':
> main.cpp:50: warning: cannot pass objects of non-POD type `class
> QString' through `...'
> main.cpp:50: warning: cannot pass objects of non-POD type `class
> QString' through `...'
>
> [A:]
>
> You can't pass QStrings through QString::sprintf().
>
> [A2:]
>
> Yes, you can, but you'll lose some Unicode information:
> sprintf("%s", string.latin1())
> or just
> sprintf("%s", (const char*)string)
>
>
> This leas me to the following conclusion : Its not KDE3.0.4 that changed,
> but GCC3.2 ! Before it has been just a warning, now it's an error ... So,
> what do you think ?
>
> That's exactly the reason why I stopped developing C(++) and started
> python.
>
> c-compiler-developer : "Hey, compiling is just too easy. Lets do some
> education on our users and show them how -officially- standarized code must
> look like ..."
>
>
> -Marc
>
> ps: I'm just compliling without the paint method. Let's see.
>
> ___
> PyKDE mailing list[EMAIL PROTECTED]
> http://mats.gmd.de/mailman/listinfo/pykde

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] sip/PyQt-3.4 RPMs for SuSE 8.1 updated

2002-10-15 Thread Hans-Peter Jansen

Hi,

I've just updated my sip/PyQt-3.4 builds to reflect SuSEs update
of qt3-3.0.5-85, which doesn't need the KDE_MALLOC=0 workaround 
anymore.

It's available here:
http://lisa-gmbh.de/download.html#PyQt-RPMs

Enjoy,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-15 Thread Hans-Peter Jansen

On Tuesday 15 October 2002 03:38, Ricardo Javier Cardenes Medina wrote:
> On Mon, Oct 14, 2002 at 09:14:29PM -0400, Eron Lloyd wrote:
>
> Hi Eron.
>
> This SuSE issue was discussed a couple of weeks ago. Please, read the end
> of the thread, starting from:
>
>  http://mats.gmd.de/pipermail/pykde/2002-October/003767.html
>
> to see the causes and the solution. I don't know if Marc published at last
> the fixed SuSE packages.

Well, SuSE fixed their qt3 package, which is available as online update.
Unfortunately their "yast online update", aka "you" has a problem.
If you run "you" the first time, it will force you to update some yast2
packages first. Before running "you" a second time, run this in a shell:

cd /var/adm/YaST
mkdir SelDB
cp InstSrcManager/IS_CACHE_0x0001/DATA/descr/default.sel SelDB
mkdir ProdDB
cp InstSrcManager/IS_CACHE_0x0001/DESCRIPTION/description ProdDB/prod_0001

see: http://sdb.suse.de/de/sdb/html/81_you.html
and: http://sdb.suse.de/de/sdb/html/81_you2.html

Hth,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] sip/PyQt-3.4 RPMs for SuSE 8.1 available

2002-10-08 Thread Hans-Peter Jansen

Hi Adrian, hi *,

I put some homebrewn PyQt-x11-gpl-3.4 RPMs here:
http://lisa-gmbh.de/download.html#PyQt-RPMs

Please bear with me, as these are my first RPM experiments...

Althrough it doesn't solve the KDE_MALLOC problem generally, 
it fixes eric and friends by patching the generated wrapper
scipts and _really_ installs him [It took me a while to get
the "Eric Idle" joke :-)].

BTW: Detlev, somehow eric doesn't appear localized here,
although it loads its de translation (verified with strace), 
unlike the qt translations:
> eric
eric: no translations for Qt found

I added an additional doc package with doc and examples3(*)
dirs.

Hans-Peter

(*) this is, where my contributions live

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Python functions as slots

2002-09-30 Thread Hans-Peter Jansen

Hi Konrad,

On Monday 30 September 2002 20:50, Konrad Hinsen wrote:
> I have lots of problems using Python functions as slots. As a simple
> illustration, take the following code (an example from Boudewijn Rempt's
> excellent book with an added connect):
>
>import sys
>from qt import *
>
>def foo(*args):
>print args
>
>app=QApplication(sys.argv)
>button=QPushButton("Hello World", None)
>app.setMainWidget(button)
>button.show()
>app.connect(button, SIGNAL("clicked()"), app, foo)
>app.exec_loop()

This is apparently wrong. Remove app arg from app.connect and 
all goes well. BTW: signal clicked does not take any arguments. 
If you want to pass some custom arguments with signals, roll 
your own (signals).

> When I run this code, I get:
>
>Traceback (most recent call last):
>  File "hello1.py", line 14, in ?
>app.connect(button, SIGNAL("clicked()"), app, foo)
>TypeError: Argument 4 of QObject.connect() has an invalid type
>
> This doesn't always happen. For example, I can run the example
> "dial.py" from the same book without problems, although it uses Python
> methods as slots.
>
> In case it matters, I use PyQt 3.4 and Qt 2.3.1.
>
> Any idea what is happening here?
>
> Konrad.

BTW: Are you the Konrad "Signum" Hinsen?

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] [PATCH] i18n

2002-09-30 Thread Hans-Peter Jansen

Hi Detlev,

what do you think about the attached patch. Without keeping a 
reference to the widgets, they all disappear, but the last,
when selecting All...

Really nice example, though.

Hans-Peter


--- i18n.py.orig	Tue Sep 10 14:56:22 2002
+++ i18n.py	Mon Sep 30 15:08:39 2002
@@ -56,6 +56,7 @@
 self.emit(PYSIGNAL('mapped(int)'), (self.map[qo],))
 
 translator = None
+wlist = []  # keep reference to widgets
 
 def showLang(lang):
 global translator
@@ -80,6 +81,7 @@
 qApp.installTranslator(translator)
 m = MyWidget()
 m.setCaption("PyQt Example - i18n - " + unicode(m.caption()))
+wlist.append(m)
 return m
 
 def main(argv):



Re: [PyKDE] Segmentation faults with PyQt

2002-09-29 Thread Hans-Peter Jansen

On Sunday 29 September 2002 16:54, Boudewijn Rempt wrote:
> On Sun, 29 Sep 2002, Gerard Vermeulen wrote:
> > On Sun, Sep 29, 2002 at 01:00:06PM +0200, Boudewijn Rempt wrote:
> > > I managed to get the latest snapshot to compile, and it can run simple
> > > examples, like tut1.py. But eric, for instance, still segfaults as soon
> > > as I try to open a file.
> > >
> > > I should have saved an earlier version of PyQt so I could at least use
> > > my apps...
> >
> > Ingo is right, you should have some conflict between Qt, sip, sip modules
> > modules in your Python library directory and PyQt modules. Eric runs as
> > do my own apps.
>
> That what I should think -- and in fact I do have two sips, two pythons
> and to PyQt's, but the build process tells me it is only using the the
> Python and sip in /usr/local, not the one in /usr. The weirdest thing
> is that even if I install precompiled binaries, that shouldn't exhibit
> these problems, on a machine that has been completely emptied of PyQt
> and sip, I still get segfaults.
>
> I'm going to try with an older version Ricardo pointe me to. If that
> doesn't work on my machines, I'm afraid I'll have to re-install Linux
> again...

Hi Boudwijn,

before reinstalling everything, consider providing us a "strace -s 256".

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] lineedits.py example

2002-06-16 Thread Hans-Peter Jansen

[No reponses on my previous mails. Seems like a Mo-Fr 9-5 list :-(]

Anyways,

this time a new transition is attached. I took an easy one, and this
one is working already (less Qt bug, Double Validator isn't working
here in both versions).

Phil: would you mind throwing it into examples?

I'm doing these to get comfortable with PyQt and being able to study
Kalle's book "Programming with Qt, 2nd Edition" more successful. Boudewijn's
book is missing some important aspects of PyQt 3 from my view, especially
SQL features. Although Kalle's book isn't comprehensive on this topic, 
either.

Will go on with table examples.

Bye,
  Hans-Peter


lineedits.py
Description: Binary data


[PyKDE] Update to sqltable3.py and new sqlcustom1.py with new problem

2002-06-15 Thread Hans-Peter Jansen

Hi again,

I've fixed one problem in sqltable3.py not returning the right object
in CustomSqlEditorFactory. 

Also attached is a conversion of sql/custom1. This one shows badly,
that I haven't yet succeeded in wrapping my mind around signals/slots
nor Q_PROPERTIES. Running it doesn't show the any widgets but the save
button and segfaults on exit :-(.

Any help highly appreciated.

TIA,
  Hans-Peter



sqltable3.py
Description: Binary data


sqlcustom1.py
Description: Binary data


[PyKDE] pyqt sql table3 problem

2002-06-15 Thread Hans-Peter Jansen

Hi all,

while diving into the wonderful world of sql featured PyQt-3.2.4,
I've tried to convert the sql/table3 example from qt 3.0.4 into python.

While thinking, that I've done the conversion correctly (I'm pretty
new on mind translation c++ to python, so please be patient), it 
just behaves different to the c++ version. The subject of this example
is a custom combobox editor for QDataTable. In the c++ version,
the combobox pops it up correctly, when double clicking on a status 
field, while the python version simply does ignore this.

What's wrong with it?

For your convenience, I've attached both, the sqltable3.py script,
and a testdb.sql to offer an instant starting point. Please edit
DB variables on top of sqltable3.py to fit your needs, and populate
the database with mysql < testdb.sql. The script expects to have the
right database plugin compiled for qt. I've configured qt additionally
with:
-plugin-sql-mysql -I /usr/include/mysql -L /usr/lib/mysql 
on my SuSE 7.3 setup.

To Phil: sqltable3.py is prepared to go into the example section,
if it works some day. Any objections?

Cheers,
  Hans-Peter


sqltable3.py
Description: Binary data


testdb.sql
Description: Binary data


Re: [PyKDE] Problem building PyQt

2002-06-11 Thread Hans-Peter Jansen

On Tue, 11 Jun 2002 18:03:03 +0200
"jblazi" <[EMAIL PROTECTED]> wrote:

> I had to rebuild my system and now I cannot build PyQt any more. I built Qt 
> 3.0.4, Sip and then I ran ./configure and make.
> Finally, when I run make install, I get
> 
> /bin/sh ../mkinstalldirs /usr/local/lib/python2.2/site-packages
>  /usr/bin/install -c -m 644 qt.py /usr/local/lib/python2.2/site-packages/qt.py
> make  install-data-hook
> make[3]: Entering directory `/usr/local/PyQt-3.2.4/qt'
> (cd /tmp; 
> 
>PYTHONPATH=/usr/local/lib/python2.2/site-packages:/usr/local/lib/python2.2/site-packages
> 
> /usr/local/bin/python -c "import qt")
> Traceback (most recent call last):
>   File "", line 1, in ?
>   File "/usr/local/lib/python2.2/site-packages/qt.py", line 49, in ?
> import libqtc
> ImportError: /usr/local/lib/python2.2/site-packages/libqtcmodule.so: undefined 
> symbol: hideEvent__10QScrollBarP10QHideEvent
> make[3]: *** [install-data-hook] Error 1
> 
> Can anybody help me?

Please read thread with subject:
[PyKDE] Qt 3.0.4 and PyQt-3.2.4 install trouble
in short:

make clean
./configure --with-qt-dir=$QTDIR

and tell us, if it fixes the install problems for you, too.

> TIA,
> Janos Blazi
> 

Cheers,
  Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Qt 3.0.4 and PyQt-3.2.4 install trouble

2002-06-11 Thread Hans-Peter Jansen

Hi Joe, hi Donovan,

thanks for your answers. They pushed me in the right direction.
Let me resume, that, if you get strange build errors like mine
or Joe's, clean up your environment:

check $QTDIR for root and your build account
 
> 1)Delete all PyQt and sip files from /usr/lib/python2.1/site-packages/ 
> including eric/ .
> 2)If you have ever installed a version of sip less than 3.1 there will be 
> files in /usr/local/lib and /usr/local/include , get rid of these, there is 
> also a file in /usr/local/bin , I got rid of this as well, but it is not 
> mentioned in the sip README file.
> 3)The PyQt README file mentions version prior to 2.0, but I don't know where 
> they installed.
> 4)chmod 000 the old version of Qt that was causing problems. Remember that 
> software using it wont work.
> 5)Delete the source trees of PyQt and sip, assuming you built in the source 
> tree, and create them again from the original .tar.gz files.
> 6)Start all over again but this time using ./configure --with-qt-dir=$QTDIR ; 
> for both sip and PyQT.

I've done 1, 2, 5 before. 3 and 4 seems not to matter here.

6 was the one, which solved $subject for me, although 
ldd /usr/lib/python2.1/site-packages/libqtcmodule.so
linked to the correct version via some symlink levels:

libqt-mt.so.2 => /usr/lib/libqt-mt.so.2
/usr/lib/libqt-mt.so.2 -> qt2/lib/libqt-mt.so.2
/usr/lib/qt2/lib/libqt-mt.so.2 -> libqt-mt.so.2.3.1
-rwxr-xr-x1 root root  5567532 24. Sep 2001
  /usr/lib/qt2/lib/libqt-mt.so.2.3.1

Self compiled KDE 2.2.2 is running fine with it, btw...

> I doubt all of this was necessary, but PyQt takes such a long time to compile 
> I was taking no chances.
> 
> I hope this is usefull to you.

Indeed, it was. Thanks again.

> It would be good if someone could tell me at what point Qt is linked to, and 
> how it is decided which Qt to link to? I notice that make install ; uses 
> libtool .

I assume, gcc and/or build tools gets confused somehow with deeply symlinked libs.

Some questions remain: PyQt links against /usr/lib/qt3/lib/libqt-mt.so.3
What are the tradeoffs of the multithread option. Should I rebuild without?
Is this the source of the "Mutex destroy failure: Device or resource busy"
errors with examples/desktop.py?

I tried to port examples/table.py, but besides of including qttable, it
seem to be QTableView is missing, isn't it?

Cheers,
  Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] PyQt-3.2.4 for Qt 2.3.1 examples

2002-06-10 Thread Hans-Peter Jansen

Hi Phil et al.,

while failed in setup of PyQt-3.2.4 for Qt-3.0.4 (see my last mail),
I'm playing with the Qt-2.3.1 version now, accompanied by Boudewijn's
book, which is very nice and really helpful, by the way. 

Congratulations, Boudewijn!

Back on track, here are my first observations:
a) The themes.py example only shows the first tab label on startup.
   It takes at least on switch of the style to show them all..

b) Executing desktop.py says:
   QMutex::~QMutex: destroy failure: Device or resource busy
   Could this be related with qt compiled with multi thread support?

As before, SuSE 7.3, Qt 2.3.1, PyQt-3.2.4

May some kind soul shred some light on this, especially (b).

TIA & Cheers,
  Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Qt 3.0.4 and PyQt-3.2.4 install trouble

2002-06-08 Thread Hans-Peter Jansen

Hi, 

just tried to install $subject. While building Qt and PyQt was successful,
PyQt throws this error message on make install:

/bin/sh ../mkinstalldirs /usr/lib/python2.1/site-packages
 /usr/bin/install -c -m 644 qt.py /usr/lib/python2.1/site-packages/qt.py
make  install-data-hook
make[3]: Entering directory `/home/hp/Downloads/qt/PyQt-3.2.4/qt'
(cd /tmp; PYTHONPATH=/usr/lib/python2.1/site-packages:/usr/lib/python2.1/site-packages
/usr/bin/python -c "import qt")
Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/lib/python2.1/site-packages/qt.py", line 49, in ?
import libqtc
ImportError: /usr/lib/python2.1/site-packages/libqtcmodule.so: undefined symbol:
static_QUType_ptr

while objdump says, it exists:

objdump -t /usr/lib/python2.1/site-packages/libqtcmodule.so | grep static_QUType_ptr
 *UND*    static_QUType_ptr

I haven't seen this one before. Any ideas? To be sure, I removed all sip and qt
rudiments from site-packages and tried again, with the same results.
I'm puzzled :-(

/usr/lib/python2.1/site-packages:
-rw-r--r--1 root root91470  8. Jun 21:43 qt.pyc
-rwxr-xr-x1 root root  7513152  8. Jun 21:43 libqtcmodule-3.2.4.so*
-rwxr-xr-x1 root root  910  8. Jun 21:43 libqtcmodule.la*
lrwxrwxrwx1 root root   21  8. Jun 21:43 libqtcmodule.so ->
libqtcmodule-3.2.4.so*
-rw-r--r--1 root root21518  8. Jun 21:43 qt.py
-rwxr-xr-x1 root root  769  8. Jun 21:11 libsip.la*
lrwxrwxrwx1 root root   15  8. Jun 21:11 libsip.so -> libsip.so.9.0.3*
lrwxrwxrwx1 root root   15  8. Jun 21:11 libsip.so.9 -> 
libsip.so.9.0.3*
-rwxr-xr-x1 root root   159003  8. Jun 21:11 libsip.so.9.0.3*

System: SuSE 7.3
Above is running in a shell with:
export QTDIR=/usr/lib/qt3
export LD_LIBRARY_PATH=$QTDIR/lib

Any help highly appreciated.

TIA,
  Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] (no subject)

2002-06-06 Thread Hans-Peter Jansen

On Thu, 6 Jun 2002 09:26:32 GMT
"François CORRIHONS" <[EMAIL PROTECTED]> wrote:

> Hi, 
> 
> I have a problem: 
> 
> I want to use Qt Designer both on PC and XTerm. On XTerm, no problem. 
> 
> But on PC, a segmentation fault (core dumped) appears each time I try to
> start 
> Qt Designer. 
> I'm using a screen emulator to connect on Linux: Reflexion X (version
> 7.00). I 
> think the problem comes from that. 
>
> Could you help me please?? 

Parse error! Please rethink your problem and come back again.
Hint: PC is a synonym for a common hardware architecture, XTerm is a 
terminal emulation within the X Window System...

> Thanks a lot. 

Please insert coin to try again...

hp

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] PyQwt win32 binary?

2001-02-03 Thread Hans-Peter Jansen

Boudewijn Rempt wrote:
> 
> On Fri, 2 Feb 2001, Scott Prive wrote:
> 
> >
> > [EMAIL PROTECTED] (Hans-Peter Jansen) wrote:
> > >
> > > Scott Prive wrote:
> > [snip]
> > > Well, may have a look on wxPython. At least, the library is free, allows
> > > cross platform development on windows and unix, and has some nice features. Docs 
>and some (non) free gui builder are available.
> >
> > Thanks for the tip. I had looked at wxPython, and put aside dealing with it for a 
>few reasons. The first was less intergration with the OS desktop... I run Linux at 
>home, using a mixmash of GNOME and Linux applications... I would rather have learned 
>either Qt or GTK, and not a "third" toolkit. Yes, GTK compiles on Windows too and is 
>"more" GPL, but it's not ready even for experienced C coders to use (GIMP/Win32 is an 
>exception).
> >
> > I wasn't too impressed with the free GUI builders for wxPython.

In fact, at least boa I couldn't get to work, either.

> > Phil Thompson is
> > > called Robin Dunn in wxPython world. Robin used swig for wrapping. An in
> > > deep comparison of these two opponents would be nice...
> >
> > A comparitive review *would* be nice. I'm waiting for one to happen... maybe 
>Boudewijn Rempt could get together with Camaron Laird and hash one together. :)
> >
> 
> I'd first have to get wxPython to install. Over the past two years, I've
> tried repeatedly, but I only once succeeded, and then wxPython segfaulted
> over its own example applications. (Just like PyGTK did when I succeeded
> in installing it.)

I'm using different wxGTK/wxPython versions for a couple of month, and 
beside the usual small probs, it's working fine.
(wxGTK 2.2.[23], wxPython 2.2.[12], python 1.5.2, linux)

My probs so far arose from locale handling of python, GTK, wxGTK, mySQLdb 
in the mix, grid issues (biggest one resolved last night ;-), and some 
memory leaking from the wx libs (which is addressed in the CVS version,
but haven't tried it, yet).

I never got my work done that fast before...

Boudewijn, if you're willing to try it one more time, I'm willing to 
help you to get things going!

Keep-on-hacking-ly yours, hp
 
> ___
> PyKDE mailing list[EMAIL PROTECTED]
> http://mats.gmd.de/mailman/listinfo/pykde

-- 
When I originally designed Perl 5's OO, I thought about a lot of this stuff,
and chose the explicit object model of Python as being the least confusing. So
far I haven't seen a good reason to change my mind on that.
  -- Larry Wall, 27 Feb 1997 on perl5-porters

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] PyQwt win32 binary?

2001-02-01 Thread Hans-Peter Jansen

Scott Prive wrote:
> 
> Philippe Fremy wrote:
> 
> > Hi all,
> >
> > I had the chance to meet Eirik Eng (the president of Troll Tech) at the
> > french Linux Expo. I didn't know that there where a whole thread on this
> > list but I have asked him a few questions about PyQt and ohter things.
> >
> > He is a very nice guy and was in charge of the licensing nightmare of Qt.
> > Some of you probably remember that he was the author of one freshmeat
> > editorial one month before they released Qt under GPL, where he tried to
> > remember people that Qt was doing free software and that it didn't deserve
> > all the bashing it was getting.
> >
> > My question to him was something like "I consider it strange that you
> > allowed one guy to distribute a working windows Qt for free, because it
> > breaks your business model. Why did you let him do so ?". Well, his answer
> > was that what Phil Thompson was doing was illegal and that they contacted
> > him as soon as they realised it was there, to make an arrangment with
> > TheKomany.
> >
> > I precise that my company owns a Qt windows license and that we were
> > distributing a DLL of our own, statically linked to Qt. When we asked Troll
> > Tech if this was legal, their answer was that it was ok if our library
> > wasn't providing access to Qt or if it wasn't a wrapper around Qt. I don't
> > have a copy of their commercial license but I guess they know what they are
> > saying. And Phil was just distributing a wrapper around Qt, so it is
> > illegal to distribute it, now you know it.
> >
> > It was really cool to have free PyQt for windows, but hey, it was illegal.
> > According to this it looks like it is even illegal to recompile PyQt under
> > windows with a Qt windows license and to distribute it.
> >
> > What remains legal though is to port the GPL Qt to windows, compile PyQt
> > with it and redistribute the whole thing.
> >
> > Some unrelated informations I also got that might interest you if you are a
> > Qt enthusiast :
> > -> Qt sells good. 20 % of the license are Unix only, 75 % are unix-windows,
> > 5 % are windows only. They have an income of 2 millions $ by month (I not
> > sure if I remembered the correct number). They double the number of sales
> > licences every 6 month.
> > -> Troll Tech has now 30 employee and is expanding (anybody interested ?
> > You might need to move to Oslo).
> > -> they will probably release a beta of Qt 3.0 for march. It will feature a
> > plugin system, a database backend, dynamic dialog generation from ui files,
> > and probably a lot of other cool stuff. :-)
> > -> they are working on mac support but don't want to talk about it until it
> > is ready. So please don't spread this. Unofficial release date goal is,
> > well, I won't say it but it is before the end of the year, and probably
> > even long before.
> > -> they were taking a big risk when they released Qt under GPL. Their
> > greatest fear was that Red Hat could fork Qt and release their own version,
> > that could concurrence Troll Tech itself. Now, they are not afraid of that
> > anymore, nobody could really make Qt cooler than Troll Tech does, at the
> > speed at which they are doing it.
> >
> > It means that we might have a PyQt for unix, windows and mac. That would
> > really rocks :- Ok, except for the fact that cross platform PyQt is not
> > free. :-(
> >
> > About blackadder, I'm concerned about this problem: even if I buy a home
> > user license, I won't be able to distribute my program, right ? So this
> > license is almost useless to me and I can't afford a commercial license,
> > especially to distribute free software.
> >
> > Like many others, I think it would make sense to allow people to distribute
> > free PyQt software, if not for free, at least for a small amount of money -
> > hence for a home user license.
> >
> > I think I will ask a few more questions to Eirik Eng about this. If you
> > have specific questions, tell me and I will forward.
> 
> Forking the UNIX Qt into a Windows DLL branch remains a improbability. The
> Free Software guys *don't care* -- they've settled on GTK. The Open Source
> people would feel this would be an attack on Troll Tech. So the problem from
> my point is, there is enough steam pressure being let off that there is no
> push for a true free runtime. wxPython is undocumented... Tk is ugly (and
> sends Windows users scurrying back to VB)... GTK on Windows is a
> *joke* (except GIMP/Win32).

Well, may have a look on wxPython. At least, the library is free, allows
cross platform development on windows and unix, and has some nice features.
Docs and some (non) free gui builder are available. Phil Thompson is 
called Robin Dunn in wxPython world. Robin used swig for wrapping. An in 
deep comparison of these two opponents would be nice...

http://wxPython.org
 
> My questions have been answered, but my comment is the TT license should be
> the same on both Linux and Windows. I'd like free software to work on