[PyKDE] C++ wrapper at granularity of Python/C API?

2006-04-08 Thread Nigel Stewart

Hi all,

In the context of our C++/Python/Sip/Qt codebase, we've
had some need for Python-aware C++ classes that utilise
the Python/C API, along with the incref and decref pain
that comes along with that.

I've been toying with the use of boost::intrusive_ptr
and/or boost::python::api::object as C++ wrappers for
PyObject * and some of the potential advantages:

- Default constructor to 0  (no uninitialised PyObject *)
- Destructor to decref and set to 0 (no stale PyObject *)
- Safe copying with implicit incref (automatic incref/decref)

However, when it comes to mixing these "smart pointer"
style wrappers with the Python/C API, there remains
the problem of handling the different scenarios:

- New reference (ref count 1)
- Borrowed reference (ref count >0, incref for long-term use)

So, what would be very nice, would be a whole set of
wrappers for the Python/C API that deal with the reference
counting in a boost::intrusive_ptr or boost::python::api::object
friendly way to make it "idiot-proof".

boost::python encourages use of the Python/C API to the
extent of providing access to the PyObject via
boost::python::api::object::ptr(), but doesn't seem to
provide the entire Python/C API

So, one may need to write
PyCallable_Check(o.ptr());

Rather than simply:
o.Callable_Check();

The real value would be in the case of say:

{
...
o = python::List_New(10);   // PyList_New produces new reference
a = o.List_GetItem(4);  // PyList_GetItem returns borrowed reference
...

// We're all done without a Py_INCREF or PyDECREF, whew!
}

Am I missing something obvious in boost::python?

Kind regards,

Nigel Stewart


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


[PyKDE] EuroPython 2006

2006-04-08 Thread David Boddie
This year the EuroPython conference will be held at CERN (near Geneva).
The call for proposals and abstracts for EuroPython 2006 was recently
published, and it should now be possible to submit abstracts:

  http://www.europython.org/sections/tracks_and_talks/call-for-proposals

Information about the conference is also available on the conference site
hosted at CERN:

  http://indico.cern.ch/conferenceDisplay.py?confId=44

I went to EuroPython in Gothenburg last year. It was the first time I'd been
to one of these community conferences, so I went as a kind of observer more
than anything else. I have to say that I was a bit disappointed by the lack
of talks about GUI programming and Python, and in particular by the general
lack of awareness people had about Free desktop environments and various open
source technologies.

This year, I'd like to try and give a talk about some aspect of PyQt and/or
PyKDE and I wondered if anyone else intends to do something similar. It would
be good to see some talks about using Python with Qt and KDE, if only to
make people aware that these technologies exist.

Has anyone else considered going?

David

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


Re: [PyKDE] PyQt on windows

2006-04-08 Thread Bert Rodiers
On 4/8/06, Phil Thompson <[EMAIL PROTECTED]> wrote:

> > D:\sip-4.4.1>mingw32-make install
> > makefile:29: warning: overriding commands for target `.c.o'
> > makefile:26: warning: ignoring old commands for target `.c.o'
> > mingw32-make[1]: Entering directory `D:/sip-4.4.1/sipgen'
> > syntax error: got EOF, expecting then
>
> I've never seen anything like that before.
>

I finally got passed that problem by changing the Makefiles a bit (not
only for sip, but also for pyqt).
First of all I removed lines such as:
@if not exist C:\programs\Python24\Lib\site-packages mkdir
C:\programs\Python24\Lib\site-packages
and made the directories myself. But then there still seemed to be a
problem with all the copy lines: "copy /y ..."
I changed this in " cp ..." (I have mks installed which supports unix
shell commando's). I don't know why it didn't work, but at least know
it does...

Thanks,
Bert

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


Re: [PyKDE] PyQt on windows

2006-04-08 Thread Phil Thompson
On Saturday 08 April 2006 3:23 pm, Bert Rodiers wrote:
> Hello Phil,
>
> > Run configure.py with the -w flag to see what it's trying to do.
>
> Thanks again.
> OK, configure.py couldn't locate mingw32's version of make.

Which means you haven't set up your environment properly. Did you run...

\Qt\4.1.2\bin\qtvars

> Now I 
> stumbled upon the next problem: I didn't have a recent version of sip.
> I downloaded the code, configured it (with configure.py -p win32-g++),
> ran make, however I get error messages while running make install:
>
> D:\sip-4.4.1>mingw32-make install
> makefile:29: warning: overriding commands for target `.c.o'
> makefile:26: warning: ignoring old commands for target `.c.o'
> mingw32-make[1]: Entering directory `D:/sip-4.4.1/sipgen'
> syntax error: got EOF, expecting then

I've never seen anything like that before.

Phil

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


Re: [PyKDE] PyQt on windows

2006-04-08 Thread Bert Rodiers
Hello Phil,

>
> Run configure.py with the -w flag to see what it's trying to do.
>

Thanks again.
OK, configure.py couldn't locate mingw32's version of make. Now I
stumbled upon the next problem: I didn't have a recent version of sip.
I downloaded the code, configured it (with configure.py -p win32-g++),
ran make, however I get error messages while running make install:

D:\sip-4.4.1>mingw32-make install
makefile:29: warning: overriding commands for target `.c.o'
makefile:26: warning: ignoring old commands for target `.c.o'
mingw32-make[1]: Entering directory `D:/sip-4.4.1/sipgen'
syntax error: got EOF, expecting then
mingw32-make[1]: *** [install] Error 1
mingw32-make[1]: Leaving directory `D:/sip-4.4.1/sipgen'
mingw32-make: *** [install] Error 2

I also ran:
D:\sip-4.4.1>mingw32-make -d install

And got as last part:

  No need to remake target `sip.exe'.
 Finished prerequisites of target file `install'.
Must remake target `install'.
CreateProcess(c:\PROGRA~1\MKSTOO~1\mksnt\sh.exe,c:/PROGRA~1/MKSTOO~1/mksnt/sh.ex
e -c "if not exist C:\programs\Python24 mkdir C:\programs\Python24",...)
Putting child 0x00a771a8 (install) PID 10975360 on the chain.
Live child 0x00a771a8 (install) PID 10975360
syntax error: got EOF, expecting then
Reaping losing child 0x00a771a8 PID 10975360
mingw32-make[1]: *** [install] Error 1
Removing child 0x00a771a8 PID 10975360 from chain.
mingw32-make[1]: Leaving directory `D:/sip-4.4.1/sipgen'
Reaping losing child 0x00a74ec0 PID 10976616
mingw32-make: *** [install] Error 2
Removing child 0x00a74ec0 PID 10976616 from chain.


Thanks,
Bert

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


Re: [PyKDE] PyQt on windows

2006-04-08 Thread Phil Thompson
On Saturday 08 April 2006 2:14 pm, Bert Rodiers wrote:
> Hello Phil,
>
> Thank you for your prompt reply
>
> > You will need to use the GPL version of Qt4 for your evaluation.
>
> [...]
>
> > That's not the latest PyQt4 snapshot.
>
> I've done both, but I still get the same error:
>
> D:\PyQt4-gpl-snapshot-20060407>c:\programs\Python24\python.exe
> configure.py -q d:\Qt\4.1.2\bin\qmake.exe
> Determining the layout of your Qt installation...
> Error: Failed to create release\qtdirs.exe. Make sure you have a working Qt
> v4 qmake on your PATH or use the -q argument to explicitly specify a
> working Qt v4 qmake.

Run configure.py with the -w flag to see what it's trying to do.

Phil

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


[PyKDE] bugzilla?

2006-04-08 Thread Miguel Angel Alvarez
There is no bugzilla for pykde?
-- 
Don't see the world through a window, be open{source}minded, and be free :-)

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


Re: [PyKDE] PyQt on windows

2006-04-08 Thread Bert Rodiers
Hello Phil,

Thank you for your prompt reply

> You will need to use the GPL version of Qt4 for your evaluation.
>
[...]

> That's not the latest PyQt4 snapshot.

I've done both, but I still get the same error:

D:\PyQt4-gpl-snapshot-20060407>c:\programs\Python24\python.exe
configure.py -q d:\Qt\4.1.2\bin\qmake.exe
Determining the layout of your Qt installation...
Error: Failed to create release\qtdirs.exe. Make sure you have a working Qt v4
qmake on your PATH or use the -q argument to explicitly specify a working Qt v4
qmake.

Thanks,
Bert

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


Re: [PyKDE] Window Flags not working

2006-04-08 Thread Chakkaradeep C C
hi,On 4/8/06, Ismail Donmez <[EMAIL PROTECTED]> wrote:
Cumartesi 8 Nisan 2006 15:25 tarihinde, Chakkaradeep C C şunları yazmıştı:> hi all,>> am using qt-3.3 and PyQt. Am trying to remove the close button,maximize> button and have minimize button only.I
 changed the window flags in the> QDialog constructor as ,>> class NetAccess(QDialog):> def __init__(self,parent = None,name = None,modal = 0,f=> Qt.WStyle_Customize |Qt.WStyle_Title|Qt.WStyle_Minimize):
> QDialog.__init__(self,parent,name,modal,f)>> But i dont get reflected :(.Respecting them is up to window manager running and for example KWin won't letyou remove some of those buttons.

Thanks  for the reply.

If thats the case, any work around?, yes, am using KDE. I need this to be removed :(
Regards,ismail-- \\o \o> ___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.dehttp://mats.imk.fraunhofer.de/mailman/listinfo/pykde
-- Regards,C.C.Chakkaradeep,Novatium Solutions Limited,Chennai.http://www.novatium.com
http://www.yoper.com--"Sometimes
it's better not to ask - or to listen - when people tell you something
can't be done. I didnt ask for permission or approval. I just went
ahead and did it."  - from "Direct from Dell"
___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Window Flags not working

2006-04-08 Thread Ismail Donmez
Cumartesi 8 Nisan 2006 15:25 tarihinde, Chakkaradeep C C şunları yazmıştı: 
> hi all,
>
> am using qt-3.3 and PyQt. Am trying to remove the close button,maximize
> button and have minimize button only.I changed the window flags in the
> QDialog constructor as ,
>
> class NetAccess(QDialog):
> def __init__(self,parent = None,name = None,modal = 0,f=
> Qt.WStyle_Customize |Qt.WStyle_Title|Qt.WStyle_Minimize):
> QDialog.__init__(self,parent,name,modal,f)
>
> But i dont get reflected :(.

Respecting them is up to window manager running and for example KWin won't let 
you remove some of those buttons.

Regards,
ismail

-- 
 \\o \o> 

pgpVBMAhdKWbo.pgp
Description: PGP signature
___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] PyQt on windows

2006-04-08 Thread Phil Thompson
On Saturday 08 April 2006 12:58 pm, Bert Rodiers wrote:
> Hello everybody,
>
> I want to evaluate PyQt. I first downloaded Qt and installed it (the
> evaluation version 4.1.2) and thereafter I installed PyQt (the
> evaluation version), but then I get the message that I'm missing dll
> qt-mteval335.dll when I try running an example.
> Does PyQt3 suppose that you have installed Qt3 ? (I does seem to make
> sence, somehow).

PyQt4 doesn't yet support the evaluation version of Qt4. The version you were 
trying is for the evaluation version of Qt3.

You will need to use the GPL version of Qt4 for your evaluation.

> Well, I also tried to install the latest snapshot of PyQt4, but I even
> can't successfully run configure:
>
> D:\PyQt4-gpl-snapshot-20060406>configure.py
> Error: Failed to create qtdirs.exe. Make sure you have a working Qt v4
> qmake on your PATH or use the -q argument to explicitly specify a working
> Qt v4 qmake.
>
> Then I specified the correct location:
>
> D:\PyQt4-gpl-snapshot-20060406>configure.py -q d:\Qt\4.1.2\bin\qmake.exe
> Error: Failed to create qtdirs.exe. Make sure you have a working Qt v4
> qmake on your PATH or use the -q argument to explicitly specify a working
> Qt v4 qmake.
>
> Can somebody help me to make PyQt work? (and I'd rather start from a
> precompiled version).

That's not the latest PyQt4 snapshot.

Phil

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


[PyKDE] Window Flags not working

2006-04-08 Thread Chakkaradeep C C
hi all,

am using qt-3.3 and PyQt. Am trying to remove the close button,maximize
button and have minimize button only.I changed the window flags in the
QDialog constructor as ,

class NetAccess(QDialog):
    def __init__(self,parent = None,name = None,modal =
0,f=Qt.WStyle_Customize |Qt.WStyle_Title|Qt.WStyle_Minimize):
    QDialog.__init__(self,parent,name,modal,f)

But i dont get reflected :(.

I would be happy if anyone could help me.

Thanks in advance.-- Regards,C.C.Chakkaradeep,Novatium Solutions Limited,Chennai.http://www.novatium.comhttp://www.yoper.com
--"Sometimes
it's better not to ask - or to listen - when people tell you something
can't be done. I didnt ask for permission or approval. I just went
ahead and did it."  - from "Direct from Dell"
___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] PyQt on windows

2006-04-08 Thread Bert Rodiers
Hello everybody,

I want to evaluate PyQt. I first downloaded Qt and installed it (the
evaluation version 4.1.2) and thereafter I installed PyQt (the
evaluation version), but then I get the message that I'm missing dll
qt-mteval335.dll when I try running an example.
Does PyQt3 suppose that you have installed Qt3 ? (I does seem to make
sence, somehow).
Well, I also tried to install the latest snapshot of PyQt4, but I even
can't successfully run configure:

D:\PyQt4-gpl-snapshot-20060406>configure.py
Error: Failed to create qtdirs.exe. Make sure you have a working Qt v4 qmake on
your PATH or use the -q argument to explicitly specify a working Qt v4 qmake.

Then I specified the correct location:

D:\PyQt4-gpl-snapshot-20060406>configure.py -q d:\Qt\4.1.2\bin\qmake.exe
Error: Failed to create qtdirs.exe. Make sure you have a working Qt v4 qmake on
your PATH or use the -q argument to explicitly specify a working Qt v4 qmake.

Can somebody help me to make PyQt work? (and I'd rather start from a
precompiled version).

Thanks,
Bert

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