diff options
Diffstat (limited to 'kexi/plugins/scripting/scripts/python')
-rw-r--r-- | kexi/plugins/scripting/scripts/python/Makefile.am | 2 | ||||
-rw-r--r-- | kexi/plugins/scripting/scripts/python/kexiapp/Makefile.am | 2 | ||||
-rwxr-xr-x | kexi/plugins/scripting/scripts/python/kexiapp/__init__.py | 25 |
3 files changed, 29 insertions, 0 deletions
diff --git a/kexi/plugins/scripting/scripts/python/Makefile.am b/kexi/plugins/scripting/scripts/python/Makefile.am new file mode 100644 index 00000000..4b31c35a --- /dev/null +++ b/kexi/plugins/scripting/scripts/python/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/kexi/Makefile.global +SUBDIRS = kexiapp diff --git a/kexi/plugins/scripting/scripts/python/kexiapp/Makefile.am b/kexi/plugins/scripting/scripts/python/kexiapp/Makefile.am new file mode 100644 index 00000000..f0f0492d --- /dev/null +++ b/kexi/plugins/scripting/scripts/python/kexiapp/Makefile.am @@ -0,0 +1,2 @@ +kexiapppythondir = $(kde_datadir)/kexi/kross/python/kexiapp +kexiapppython_SCRIPTS = __init__.py diff --git a/kexi/plugins/scripting/scripts/python/kexiapp/__init__.py b/kexi/plugins/scripting/scripts/python/kexiapp/__init__.py new file mode 100755 index 00000000..b5224304 --- /dev/null +++ b/kexi/plugins/scripting/scripts/python/kexiapp/__init__.py @@ -0,0 +1,25 @@ +""" +Initializer for the krosskexiapp-module. + +Description: +This module provides the entry-point for python scripts +to work with a running Kexi application instance. + +Author: +Sebastian Sauer <[email protected]> + +Copyright: +Dual-licensed under LGPL v2+higher and the BSD license. +""" + +try: + import krosskexiapp +except ImportError, e: + raise "Import of the Kross KexiApp module failed.\n%s" % e + +def get(modulename): + return krosskexiapp.get(modulename) + +def currentConnection(): + mainwindow = krosskexiapp.get("KexiAppMainWindow") + return mainwindow.getConnection() |