summaryrefslogtreecommitdiffstats
path: root/dcoppython/README
blob: e5b8c3e828ba9d42d69897fefa5d759029a7ae23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
PYTHON bindings for DCOP
========================

These are the new-style Python DCOP bindings. The way in which the bindings are
implemented has changed since KDE 3.1.1.


How they work
=============

The code is divided into two parts:

pcop.cpp - the C++ interface between Python and DCOP - generates shared library pcop.so
           which can be imported by Python

pydcop.py - the Python interface to pcop.cpp

pcop.cpp includes a header file marshal_funcs.h, which is generated from
a data file called marshal_funcs.data by a converter script, gen_marshal_funcs.py

marshal_funcs.data contains the basic code necessary to marshal and demarshal the different
types that DCOP can handle. For example, it codes how to convert a QString for use by Python
(in this case, a Python string) and the reverse - what the user may supply in Python when
DCOP requires a QString. In addition to the fundemental types, more complex QT classes are
coded, such as QRect (which converts to a Python tuple ( (x1,y1), (x2,y2) ) ).

Documentation is auto-generated out of marshal_funcs.data, creating file marshal_funcs_doc.html,
which details how each DCOP type (e.g. QString, QRect, int, QCStringList) is represented in Python.

In this implementation, each DCOP type is represented by a basic Python type - numeric, tuple, etc.
There are no "QT bindings" necessary.

These bindings allow you to code Python to act as a DCOP client (querying and/or controlling
other DCOP applications), or as a DCOP server. This means that you can DCOP-enable Python applications
even if they are not QT based.

If you want to use DCOP in the context of a Python QT application, then there are DCOP bindings included in
the PyQT and PyKDE bindings available from:

http://www.riverbankcomputing.co.uk/

Examples
========

There are some example Python programs in the test directory.

Known problems
=============

There is currently a bug which means you must import both pcop and pydcop in your Python programs.
This means that a Python program using dcoppython must include:

import pcop
import pydcop

In that order. If you don't import pcop, a seg fault occurs when the interpreter exits. This, of course, will be
fixed once I find out what the hell's going on.

Authors
=======

The original Python DCOP bindings were written by Torben Weis (weis@kde.org).
The current implementation, based on Torben's worked, was written by Julian Rockey (kde@jrockey.com).
Julian is also the current maintainer.