diff options
author | Xisco Fauli <anistenis@gmail.com> | 2012-11-26 21:06:36 +0100 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2012-11-26 23:39:46 +0100 |
commit | 5b56643fd426f9e2369a2e78e62768567d65e589 (patch) | |
tree | 1b8628ed538502f54bc2338e5123a3829f1bef4f /wizards | |
parent | c279c575950b08e45f5f1d9c7935716a76d67139 (diff) |
pyfax: make this wizard completely compatible with python3.3
Change-Id: Ice2eaaa014ee4858658c5643b51b6f70faefa128
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/text/TextFieldHandler.py | 8 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/WizardDialog.py | 5 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/event/CommonListener.py | 25 |
3 files changed, 19 insertions, 19 deletions
diff --git a/wizards/com/sun/star/wizards/text/TextFieldHandler.py b/wizards/com/sun/star/wizards/text/TextFieldHandler.py index dfb4d0bd47da..22ebcae0caa9 100644 --- a/wizards/com/sun/star/wizards/text/TextFieldHandler.py +++ b/wizards/com/sun/star/wizards/text/TextFieldHandler.py @@ -100,7 +100,10 @@ class TextFieldHandler(object): self, _PropertyName, _aPropertyValue): try: xProperty = TextFieldHandler.dictTextFields[_aPropertyValue] - xPropertySet = xProperty.TextFieldMaster + try: + xPropertySet = xProperty.TextFieldMaster + except Exception: + return if xPropertySet.PropertySetInfo.hasPropertyByName( _PropertyName): oValue = xPropertySet.getPropertyValue(_PropertyName) @@ -115,7 +118,8 @@ class TextFieldHandler(object): DependentTextFields = self.__getTextFieldsByProperty( PropertyNames.PROPERTY_NAME, _FieldName) if DependentTextFields is not None: - DependentTextFields.TextFieldMaster.setPropertyValue("Content", _FieldContent) + DependentTextFields.TextFieldMaster.setPropertyValue( + "Content", _FieldContent) self.refreshTextFields() except Exception: traceback.print_exc() diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py index 370a4c30eb6a..7ccd2ce381aa 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.py +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py @@ -28,7 +28,6 @@ from ..document.OfficeDocument import OfficeDocument from ..text.TextDocument import TextDocument from com.sun.star.lang import NoSuchMethodException -from com.sun.star.lang import IllegalArgumentException from com.sun.star.frame import TerminationVetoException from com.sun.star.awt.PushButtonType import HELP, STANDARD @@ -77,7 +76,7 @@ class WizardDialog(UnoDialog2): if self.nNewStep != self.nOldStep: self.switchToStep() - except IllegalArgumentException: + except Exception: traceback.print_exc() def setRoadmapInteractive(self, _bInteractive): @@ -89,7 +88,7 @@ class WizardDialog(UnoDialog2): def isRoadmapComplete(self): try: return bool(Helper.getUnoPropertyValue(self.oRoadmap, "Complete")) - except IllegalArgumentException: + except Exception: traceback.print_exc() return False diff --git a/wizards/com/sun/star/wizards/ui/event/CommonListener.py b/wizards/com/sun/star/wizards/ui/event/CommonListener.py index 99b232d7b78f..4883a1617706 100644 --- a/wizards/com/sun/star/wizards/ui/event/CommonListener.py +++ b/wizards/com/sun/star/wizards/ui/event/CommonListener.py @@ -19,7 +19,7 @@ import unohelper from com.sun.star.awt import XActionListener class ActionListenerProcAdapter( unohelper.Base, XActionListener ): - def __init__( self, oProcToCall, tParams=() ): + def __init__(self, oProcToCall): self.oProcToCall = oProcToCall def actionPerformed( self, oActionEvent ): @@ -28,20 +28,19 @@ class ActionListenerProcAdapter( unohelper.Base, XActionListener ): from com.sun.star.awt import XItemListener class ItemListenerProcAdapter( unohelper.Base, XItemListener ): - def __init__( self, oProcToCall, tParams=() ): + def __init__(self, oProcToCall): self.oProcToCall = oProcToCall - self.tParams = tParams def itemStateChanged( self, oItemEvent ): if callable( self.oProcToCall ): try: self.oProcToCall() except: - self.oProcToCall((oItemEvent,) + self.tParams ) + self.oProcToCall(oItemEvent) from com.sun.star.awt import XTextListener class TextListenerProcAdapter( unohelper.Base, XTextListener ): - def __init__( self, oProcToCall, tParams=() ): + def __init__(self, oProcToCall): self.oProcToCall = oProcToCall def textChanged( self, oTextEvent ): @@ -50,7 +49,7 @@ class TextListenerProcAdapter( unohelper.Base, XTextListener ): from com.sun.star.frame import XTerminateListener class TerminateListenerProcAdapter( unohelper.Base, XTerminateListener ): - def __init__( self, oProcToCall, tParams=() ): + def __init__(self, oProcToCall): self.oProcToCall = oProcToCall def queryTermination(self, TerminateEvent): @@ -61,7 +60,7 @@ class TerminateListenerProcAdapter( unohelper.Base, XTerminateListener ): from com.sun.star.awt import XWindowListener class WindowListenerProcAdapter( unohelper.Base, XWindowListener ): - def __init__( self, oProcToCall, tParams=() ): + def __init__(self, oProcToCall): self.oProcToCall = oProcToCall def windowShown(self, TerminateEvent): @@ -70,7 +69,7 @@ class WindowListenerProcAdapter( unohelper.Base, XWindowListener ): from com.sun.star.awt import XAdjustmentListener class AdjustmentListenerProcAdapter( unohelper.Base, XAdjustmentListener ): - def __init__( self, oProcToCall, tParams=() ): + def __init__(self, oProcToCall): self.oProcToCall = oProcToCall def adjustmentValueChanged(self, TerminateEvent): @@ -79,20 +78,18 @@ class AdjustmentListenerProcAdapter( unohelper.Base, XAdjustmentListener ): from com.sun.star.awt import XFocusListener class FocusListenerProcAdapter( unohelper.Base, XFocusListener ): - def __init__( self, oProcToCall, tParams=() ): + def __init__( self, oProcToCall): self.oProcToCall = oProcToCall - self.tParams = tParams def focusGained(self, FocusEvent): if callable( self.oProcToCall ): - self.oProcToCall((FocusEvent,) + self.tParams ) + self.oProcToCall(FocusEvent) from com.sun.star.awt import XKeyListener class KeyListenerProcAdapter( unohelper.Base, XKeyListener ): - def __init__( self, oProcToCall, tParams=() ): + def __init__(self, oProcToCall): self.oProcToCall = oProcToCall - self.tParams = tParams def keyPressed(self, KeyEvent): if callable( self.oProcToCall ): - self.oProcToCall((KeyEvent,) + self.tParams ) + self.oProcToCall(KeyEvent) |