[Kexi] Re: List of calls for Kexi?

Jaroslaw Staniek staniek at kde.org
Wed Mar 23 08:03:19 CET 2011

On 23 March 2011 01:10, scott <svetter at ameritech.net> wrote:
>    Is there a list of calls that can be made to Kexi to do something
> from a Python script?  For example:  Let's say from a form menu in Kexi
> it calls a Python script, that script then calls one form and based on
> the input from that form either calls another form or does some table
> action.  Now, what calls to Kexi are available to do this?

Hello Scott,
List of objects and operations is not documented separately of the
source code, which uses the Kross bindings helpers that expose
operations to python.
The author is Sebastian Sauer (mail at dipe.org)

I am sorry but for now one needs to get the source code and look
closer. There's no excuse for no documentation, other plans for
delivering much more extensive set of scriptable objects. This means
we keep the right to completely remove the current object model, with
possibility (in theory)  of breaking backward compatibility (e.g. for
security reasons).

There are two areas:
- kexi window and operations on it; this is exposed in code
- kexidb objects and operations on them, i.e. database-access-related
features; this is exposed in code kexi/plugins/scripting/kexidb

To learn what objects are, look at, let's look at
kexi/plugins/scripting/kexiscripting/kexiscriptadaptor.h, which is:
"Adaptor class that provides Kexi specific functionality to the
scripting world." as has been described in the file.

in line 45, there is  setObjectName("Kexi");
This means the object to use in scripting is called "Kexi".

Then after the line 47, "public Q_SLOTS:"
we have list of operations (slots, i.e. C++ methods) like
windowWidget, viewWidget, actions, and so on.
I.e. calling Kexi.windowWidget() is possible.

All is documented there in the code. To use objects in Python, one
needs to use bindings to Qt, since objects typically inherit
functionality from Qt rather being written from scratch.
The last operation exposed in this file is 'viewIsDirty'.

PS: Perhaps I explained something inaccurately, so Sebastian would
like to correct that.

regards / pozdrawiam, Jaroslaw Staniek
 Kexi & Calligra (kexi-project.org, identi.ca/kexi, calligra-suite.org)
 KDE Software Development Platform on MS Windows (windows.kde.org)

More information about the Kexi mailing list