From 41b8bad143c06bc5419783b9f3cf5685aa3eea63 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 5 Dec 2011 13:04:05 +0000 Subject: wizards: completely work python wizard packaging and registration Also improve exception handling and error printing in pythonloader Allow registration of explicit .py components - the only method that works --- wizards/com/sun/star/wizards/fax/CallWizard.py | 9 +++++++-- wizards/com/sun/star/wizards/fax/FaxWizardDialog.py | 1 + wizards/com/sun/star/wizards/fax/__init__.py | 2 ++ wizards/com/sun/star/wizards/fax/fax.component | 3 +-- wizards/com/sun/star/wizards/ui/UnoDialog2.py | 1 + wizards/com/sun/star/wizards/ui/WizardDialog.py | 1 + wizards/com/sun/star/wizards/ui/event/__init__.py | 0 7 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 wizards/com/sun/star/wizards/ui/event/__init__.py (limited to 'wizards/com') diff --git a/wizards/com/sun/star/wizards/fax/CallWizard.py b/wizards/com/sun/star/wizards/fax/CallWizard.py index 5aae1b75140f..1114603bf621 100644 --- a/wizards/com/sun/star/wizards/fax/CallWizard.py +++ b/wizards/com/sun/star/wizards/fax/CallWizard.py @@ -14,8 +14,13 @@ class CallWizard(unohelper.Base, XJobExecutor): self.ctx = ctx def trigger(self, args): - fw = FaxWizardDialogImpl(self.ctx.ServiceManager) - fx.startWizard() + try: + fw = FaxWizardDialogImpl(self.ctx.ServiceManager) + fw.startWizard(self.ctx.ServiceManager) + except Exception as e: + print ("Wizard failure exception " + str(type(e)) + + " message " + str(e) + " args " + str(e.args) + + traceback.format_exc()); # pythonloader looks for a static g_ImplementationHelper variable g_ImplementationHelper = unohelper.ImplementationHelper() diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py index c465d88952e8..c74aa1faa2e0 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py @@ -1,3 +1,4 @@ +import wizards.ui.UIConsts from wizards.ui.WizardDialog import * from wizards.fax.FaxWizardDialogResources import FaxWizardDialogResources from wizards.fax.FaxWizardDialogConst import * diff --git a/wizards/com/sun/star/wizards/fax/__init__.py b/wizards/com/sun/star/wizards/fax/__init__.py index e69de29bb2d1..1ad913ad7b52 100644 --- a/wizards/com/sun/star/wizards/fax/__init__.py +++ b/wizards/com/sun/star/wizards/fax/__init__.py @@ -0,0 +1,2 @@ +__all__ = ['CallWizard', 'CGFax', 'GCFaxWizard', 'FaxDocument', 'FaxWizardDialogConst', + 'FaxWizardDialogImpl', 'FaxWizardDialog', 'FaxWizardDialogResources'] diff --git a/wizards/com/sun/star/wizards/fax/fax.component b/wizards/com/sun/star/wizards/fax/fax.component index a03d00afc5a6..06383e74db2f 100644 --- a/wizards/com/sun/star/wizards/fax/fax.component +++ b/wizards/com/sun/star/wizards/fax/fax.component @@ -28,8 +28,7 @@ - + diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog2.py b/wizards/com/sun/star/wizards/ui/UnoDialog2.py index 58b448c92afa..31ab465c2e0a 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog2.py +++ b/wizards/com/sun/star/wizards/ui/UnoDialog2.py @@ -1,3 +1,4 @@ +from wizards.ui.UIConsts import * from wizards.ui.UnoDialog import * from wizards.ui.event.CommonListener import * from wizards.common.Desktop import Desktop diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py index d73fb4f736b6..fddc2e09d63a 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.py +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py @@ -1,3 +1,4 @@ +import wizards.ui.UIConsts from wizards.ui.UnoDialog2 import * from abc import ABCMeta, abstractmethod from wizards.common.Resource import Resource diff --git a/wizards/com/sun/star/wizards/ui/event/__init__.py b/wizards/com/sun/star/wizards/ui/event/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 -- cgit