diff options
author | Xisco Fauli <anistenis@gmail.com> | 2012-11-26 02:23:06 +0100 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2012-11-26 23:39:44 +0100 |
commit | d03f2be8e1b01e2c5504fac837240ea473a03c98 (patch) | |
tree | af674f6190e5968a012a712e358be5852d4e109a /wizards | |
parent | 7ce4ca1c49c1183ffb32b0e7f85e29e3d5b2eb37 (diff) |
pyfax: adapt it to python3.3. it can be already launched
Change-Id: Id0c98e95d6b40dabe0dc07af232bda84989d1815
Diffstat (limited to 'wizards')
6 files changed, 13 insertions, 16 deletions
diff --git a/wizards/com/sun/star/wizards/common/FileAccess.py b/wizards/com/sun/star/wizards/common/FileAccess.py index 1a578c3e5b20..ae31c282a442 100644 --- a/wizards/com/sun/star/wizards/common/FileAccess.py +++ b/wizards/com/sun/star/wizards/common/FileAccess.py @@ -16,7 +16,6 @@ # the License at http://www.apache.org/licenses/LICENSE-2.0 . # import traceback -import types from os import path as osPath from .NoValidPathException import NoValidPathException @@ -101,9 +100,9 @@ class FileAccess(object): sPath + "_internal") Template_user = xPathInterface.getPropertyValue( sPath + "_user") - if type(Template_internal) is not types.InstanceType: + if not hasattr(Template_internal, '__dict__'): ReadPaths = ReadPaths + Template_internal - if type(Template_user) is not types.InstanceType: + if not hasattr(Template_user, '__dict__'): ReadPaths = ReadPaths + Template_user ReadPaths = ReadPaths + (Template_writable,) if sType.lower() == "user": @@ -125,7 +124,6 @@ class FileAccess(object): if not bexists: raise NoValidPathException (xMSF, ""); - return ResultPath @classmethod diff --git a/wizards/com/sun/star/wizards/common/NoValidPathException.py b/wizards/com/sun/star/wizards/common/NoValidPathException.py index 73faf8ea5338..861e273a82f2 100644 --- a/wizards/com/sun/star/wizards/common/NoValidPathException.py +++ b/wizards/com/sun/star/wizards/common/NoValidPathException.py @@ -20,7 +20,7 @@ class NoValidPathException(Exception): def __init__(self, xMSF, _sText): super(NoValidPathException,self).__init__(_sText) # TODO: NEVER open a dialog in an exception - from SystemDialog import SystemDialog + from .SystemDialog import SystemDialog if xMSF: SystemDialog.showErrorBox(xMSF, "dbwizres", "dbw", 521) #OfficePathnotavailable diff --git a/wizards/com/sun/star/wizards/document/OfficeDocument.py b/wizards/com/sun/star/wizards/document/OfficeDocument.py index bd138cae820a..69391bbbcb4b 100644 --- a/wizards/com/sun/star/wizards/document/OfficeDocument.py +++ b/wizards/com/sun/star/wizards/document/OfficeDocument.py @@ -46,7 +46,7 @@ class OfficeDocument(object): @classmethod def attachEventCall(self, xComponent, EventName, EventType, EventURL): try: - oEventProperties = range(2) + oEventProperties = list(range(2)) oEventProperties[0] = uno.createUnoStruct( 'com.sun.star.beans.PropertyValue') oEventProperties[0].Name = "EventType" @@ -85,7 +85,7 @@ class OfficeDocument(object): @classmethod def createNewDocument(self, frame, sDocumentType, preview, readonly): - loadValues = range(2) + loadValues = list(range(2)) loadValues[0] = uno.createUnoStruct( 'com.sun.star.beans.PropertyValue') loadValues[0].Name = "ReadOnly" @@ -194,7 +194,7 @@ class OfficeDocument(object): def store(self, xMSF, xComponent, StorePath, FilterName): try: if len(FilterName): - oStoreProperties = range(2) + oStoreProperties = list(range(2)) oStoreProperties[0] = uno.createUnoStruct( 'com.sun.star.beans.PropertyValue') oStoreProperties[0].Name = "FilterName" @@ -205,7 +205,7 @@ class OfficeDocument(object): oStoreProperties[1].Value = xMSF.createInstance( "com.sun.star.comp.uui.UUIInteractionHandler") else: - oStoreProperties = range(0) + oStoreProperties = list(range(0)) if StorePath.startswith("file://"): #Unix @@ -260,7 +260,7 @@ class OfficeDocument(object): def getFileMediaDecriptor(self, xmsf, url): typeDetect = xmsf.createInstance( "com.sun.star.document.TypeDetection") - mediaDescr = range(1) + mediaDescr = list(range(1)) mediaDescr[0] = uno.createUnoStruct( 'com.sun.star.beans.PropertyValue') mediaDescr[0].Name = "URL" diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py index d93100d63b14..4f7352cc1976 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py @@ -151,7 +151,6 @@ class FaxWizardDialogImpl(FaxWizardDialog): try: fileAccess = FileAccess(self.xMSF) self.sPath = self.myPathSelection.getSelectedPath() - print os.path.exists(self.sPath) if not self.sPath or not os.path.exists(self.sPath): self.myPathSelection.triggerPathPicker() self.sPath = self.myPathSelection.getSelectedPath() @@ -184,7 +183,7 @@ class FaxWizardDialogImpl(FaxWizardDialog): 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" diff --git a/wizards/com/sun/star/wizards/text/TextDocument.py b/wizards/com/sun/star/wizards/text/TextDocument.py index 7190bc0768e1..41d7fbf2a032 100644 --- a/wizards/com/sun/star/wizards/text/TextDocument.py +++ b/wizards/com/sun/star/wizards/text/TextDocument.py @@ -120,7 +120,7 @@ class TextDocument(object): self.xProgressBar.setValue(5) def loadAsPreview(self, sDefaultTemplate, asTemplate): - loadValues = range(3) + loadValues = list(range(3)) # open document in the Preview mode loadValues[0] = uno.createUnoStruct( 'com.sun.star.beans.PropertyValue') @@ -244,7 +244,7 @@ class TextDocument(object): auxList = [] allItems = self.xTextDocument.findAll(sd) - for i in xrange(allItems.Count): + for i in range(allItems.Count): auxList.append(allItems.getByIndex(i)) return auxList diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py index e23315f0c906..c5f000c89bb0 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.py +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py @@ -161,7 +161,7 @@ class WizardDialog(UnoDialog2): def getRoadmapItemByID(self, _ID): try: getByIndex = self.oRoadmap.getByIndex - for i in xrange(self.oRoadmap.Count): + for i in range(self.oRoadmap.Count): CurRoadmapItem = getByIndex(i) CurID = int(Helper.getUnoPropertyValue(CurRoadmapItem, "ID")) if CurID == _ID: @@ -339,7 +339,7 @@ class WizardDialog(UnoDialog2): def enablefromStep(self, _iStep, _bDoEnable): if _iStep <= self.nMaxStep: - for i in xrange(_iStep, self.nMaxStep): + for i in range(_iStep, self.nMaxStep): self.setStepEnabled(i, _bDoEnable) enableFinishButton(_bDoEnable) if not _bDoEnable: |