diff options
Diffstat (limited to 'kexi/plugins/scripting/scripts/python/kexiapp/__init__.py')
-rwxr-xr-x | kexi/plugins/scripting/scripts/python/kexiapp/__init__.py | 25 |
1 files changed, 25 insertions, 0 deletions
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() |