summaryrefslogtreecommitdiff
path: root/wizards/com/sun
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2012-11-26 21:34:43 +0100
committerXisco Fauli <anistenis@gmail.com>2012-11-26 23:39:46 +0100
commitf835b7e321909dfaac925b1bfd7ccca35a59bd45 (patch)
treeeff9368589c66f63b5f6339411e32e3911c2fdc3 /wizards/com/sun
parent5b56643fd426f9e2369a2e78e62768567d65e589 (diff)
pyletter: adapt this wizard to python3.3
Change-Id: I6617478a335cf1b5b6b128f86148029dc7bd81af
Diffstat (limited to 'wizards/com/sun')
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterDocument.py3
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py22
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py6
-rw-r--r--wizards/com/sun/star/wizards/text/TextFieldHandler.py3
4 files changed, 19 insertions, 15 deletions
diff --git a/wizards/com/sun/star/wizards/letter/LetterDocument.py b/wizards/com/sun/star/wizards/letter/LetterDocument.py
index ab29f7fa254e..f8c1cedf693b 100644
--- a/wizards/com/sun/star/wizards/letter/LetterDocument.py
+++ b/wizards/com/sun/star/wizards/letter/LetterDocument.py
@@ -32,6 +32,7 @@ from com.sun.star.text.TextContentAnchorType import AT_PAGE
from com.sun.star.text.SizeType import FIX
from com.sun.star.text.WrapTextMode import THROUGHT
from com.sun.star.awt.FontWeight import BOLD
+from com.sun.star.beans import UnknownPropertyException
class LetterDocument(TextDocument):
@@ -272,5 +273,7 @@ class BusinessPaperObject(object):
try:
self.xTextDocument.Text.removeTextContent(
self.xFrame)
+ except UnknownPropertyException:
+ pass
except Exception:
traceback.print_exc()
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
index e8fe07a946d9..c109b6546155 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
@@ -154,7 +154,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.removeTerminateListener()
self.closeDocument()
self.running = False
- except Exception, exception:
+ except Exception:
self.removeTerminateListener()
traceback.print_exc()
self.running = False
@@ -218,7 +218,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.saveConfiguration()
xIH = self.xMSF.createInstance(
"com.sun.star.comp.uui.UUIInteractionHandler")
- loadValues = range(4)
+ loadValues = list(range(4))
loadValues[0] = uno.createUnoStruct( \
'com.sun.star.beans.PropertyValue')
loadValues[0].Name = "AsTemplate"
@@ -247,7 +247,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
else:
pass
- except Exception, e:
+ except Exception:
traceback.print_exc()
finally:
if endWizard:
@@ -260,7 +260,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
try:
xCloseable = self.myLetterDoc.xFrame
xCloseable.close(False)
- except CloseVetoException, e:
+ except CloseVetoException:
traceback.print_exc()
def optBusinessLetterItemChanged(self):
@@ -636,7 +636,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
and (self.chkUseLogo.State != 0)
self.myLetterDoc.switchElement(
"Company Logo", logostatus)
- except IllegalArgumentException, e:
+ except IllegalArgumentException:
traceback.print_exc()
def chkUseAddressReceiverItemChanged(self):
@@ -650,7 +650,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.myLetterDoc.switchElement(
"Sender Address Repeated", rstatus)
- except IllegalArgumentException, e:
+ except IllegalArgumentException:
traceback.print_exc()
def chkUseSignsItemChanged(self):
@@ -676,7 +676,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
if self.chkFooterNextPages.State != 0:
self.myLetterDoc.switchFooter(
"First Page", False, self.chkFooterPageNumbers.State != 0,
- txtFooter.Text)
+ self.txtFooter.Text)
self.myLetterDoc.switchFooter("Standard", bFooterPossible,
self.chkFooterPageNumbers.State != 0, self.txtFooter.Text)
else:
@@ -691,7 +691,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.getRoadmapItemByID(LetterWizardDialogImpl.RM_FOOTER)
Helper.setUnoPropertyValue(
BPaperItem, PropertyNames.PROPERTY_ENABLED, bFooterPossible)
- except Exception, exception:
+ except Exception:
traceback.print_exc()
def chkFooterNextPagesItemChanged(self):
@@ -899,7 +899,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.xMSF, "Template", "share", "/wizard")
self.sUserTemplatePath = \
FileAccess.getOfficePath2(self.xMSF, "Template", "user", "")
- except NoValidPathException, e:
+ except NoValidPathException:
traceback.print_exc()
def initializeTemplates(self, xMSF):
@@ -1133,7 +1133,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
UnoDataAware.attachEditControl(
cgl, "cp_TemplatePath", self.myPathSelection.xSaveTextBox,
True).updateUI()
- except Exception, exception:
+ except Exception:
traceback.print_exc()
def saveConfiguration(self):
@@ -1142,7 +1142,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
"/org.openoffice.Office.Writer/Wizards/Letter", True)
self.myConfig.writeConfiguration(root, "cp_")
root.commitChanges()
- except Exception, e:
+ except Exception:
traceback.print_exc()
def validatePath(self):
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py
index 64b45f76cc1b..b88424612efd 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py
@@ -256,19 +256,19 @@ class LetterWizardDialogResources(Resource):
self.loadGreetingResources()
def loadRoadmapResources(self):
- for i in xrange(6):
+ for i in range(6):
self.RoadmapLabels.append(self.getResText(
LetterWizardDialogResources.RID_LETTERWIZARDROADMAP_START + \
i + 1))
def loadSalutationResources(self):
- for i in xrange(3):
+ for i in range(3):
self.SalutationLabels.append(self.getResText(
LetterWizardDialogResources.RID_LETTERWIZARDSALUTATION_START + \
i + 1))
def loadGreetingResources(self):
- for i in xrange(3):
+ for i in range(3):
self.GreetingLabels.append(self.getResText(
LetterWizardDialogResources.RID_LETTERWIZARDGREETING_START + \
i + 1))
diff --git a/wizards/com/sun/star/wizards/text/TextFieldHandler.py b/wizards/com/sun/star/wizards/text/TextFieldHandler.py
index 22ebcae0caa9..5bb4c4a8c4b7 100644
--- a/wizards/com/sun/star/wizards/text/TextFieldHandler.py
+++ b/wizards/com/sun/star/wizards/text/TextFieldHandler.py
@@ -21,6 +21,7 @@ from ..common.PropertyNames import PropertyNames
from com.sun.star.util import DateTime
from com.sun.star.uno import RuntimeException
+from com.sun.star.beans import UnknownPropertyException
class TextFieldHandler(object):
@@ -102,7 +103,7 @@ class TextFieldHandler(object):
xProperty = TextFieldHandler.dictTextFields[_aPropertyValue]
try:
xPropertySet = xProperty.TextFieldMaster
- except Exception:
+ except UnknownPropertyException:
return
if xPropertySet.PropertySetInfo.hasPropertyByName(
_PropertyName):