diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-05-07 23:16:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-08 11:01:13 +0200 |
commit | 62f77e94702657aa25e247da71dab012e280679e (patch) | |
tree | 7affdb22aa015e910e8861078a35c67ad7ec0edc /wizards/com | |
parent | 439ea553bef5a7e29ed20764ede1ae987e839bca (diff) |
pyflakes3: fix some reports on wizards
Change-Id: I0fef17ccc8f110d1d8bf629737807f1bcc618b76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93685
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'wizards/com')
8 files changed, 19 insertions, 20 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaDocument.py b/wizards/com/sun/star/wizards/agenda/AgendaDocument.py index 5989158fcbd6..b96fe44cf150 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaDocument.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaDocument.py @@ -473,13 +473,13 @@ class AgendaDocument(TextDocument): itemText = item.String.lstrip().lower() if itemText == \ self.templateConsts.FILLIN_MINUTE_NUM: - fillMinutesItem(item, topic[0].Value, "") + self.fillMinutesItem(item, topic[0].Value, "") elif itemText == \ self.templateConsts.FILLIN_MINUTE_TOPIC: - fillMinutesItem(item, topic[1].Value, "") + self.fillMinutesItem(item, topic[1].Value, "") elif itemText == \ self.templateConsts.FILLIN_MINUTE_RESPONSIBLE: - fillMinutesItem(item, topic[2].Value, "") + self.fillMinutesItem(item, topic[2].Value, "") elif itemText == \ self.templateConsts.FILLIN_MINUTE_TIME: topicTime = 0 @@ -499,7 +499,7 @@ class AgendaDocument(TextDocument): topicStartTime += topicTime * 1000 time += str(topicStartTime) - fillMinutesItem(item, time, "") + self.fillMinutesItem(item, time, "") self.textSectionHandler.removeTextSectionbyName( self.templateConsts.SECTION_MINUTES) @@ -528,7 +528,7 @@ class AgendaDocument(TextDocument): Range.ParaStyleName = paraStyle if text is None or text == "": if placeholder is not None and not placeholder == "": - placeHolder = createPlaceHolder( + placeHolder = self.createPlaceHolder( self.xTextDocument, placeholder, self.resources.resPlaceHolderHint) try: diff --git a/wizards/com/sun/star/wizards/common/Desktop.py b/wizards/com/sun/star/wizards/common/Desktop.py index 2715ffb75274..99c9d60d8384 100644 --- a/wizards/com/sun/star/wizards/common/Desktop.py +++ b/wizards/com/sun/star/wizards/common/Desktop.py @@ -22,9 +22,6 @@ from com.sun.star.frame.FrameSearchFlag import ALL from com.sun.star.util import URL from com.sun.star.i18n.KParseTokens import ANY_LETTER_OR_NUMBER, ASC_UNDERSCORE -from com.sun.star.util import URL - - class Desktop(object): @classmethod diff --git a/wizards/com/sun/star/wizards/common/SystemDialog.py b/wizards/com/sun/star/wizards/common/SystemDialog.py index 5dccd8231102..412029213039 100644 --- a/wizards/com/sun/star/wizards/common/SystemDialog.py +++ b/wizards/com/sun/star/wizards/common/SystemDialog.py @@ -113,7 +113,7 @@ class SystemDialog(object): if i is not None and i.Name == "UIName": return str(i.Value).replace("%productname%", "LibreOffice") - raise NullPointerException( + raise Exception( "UIName property not found for Filter " + filterName); except Exception: traceback.print_exc() diff --git a/wizards/com/sun/star/wizards/document/OfficeDocument.py b/wizards/com/sun/star/wizards/document/OfficeDocument.py index cb7c1cebeb33..1483f902da17 100644 --- a/wizards/com/sun/star/wizards/document/OfficeDocument.py +++ b/wizards/com/sun/star/wizards/document/OfficeDocument.py @@ -19,6 +19,7 @@ import uno import traceback from unohelper import systemPathToFileUrl, absolutize from ..common.Desktop import Desktop +from ..common.SystemDialog import SystemDialog from com.sun.star.awt import WindowDescriptor from com.sun.star.awt import Rectangle @@ -70,7 +71,7 @@ class OfficeDocument(object): Desktop.dispatchURL(xMSF, ".uno:CloseDoc", xFrame) - except PropertyVetoException: + except Exception: traceback.print_exc() @classmethod @@ -191,7 +192,7 @@ class OfficeDocument(object): try: xComponent.close(True) bState = True - except com.sun.star.util.CloseVetoException: + except Exception: print ("could not close doc") bState = False diff --git a/wizards/com/sun/star/wizards/text/TextDocument.py b/wizards/com/sun/star/wizards/text/TextDocument.py index 92226302c9a8..f975dad5718b 100644 --- a/wizards/com/sun/star/wizards/text/TextDocument.py +++ b/wizards/com/sun/star/wizards/text/TextDocument.py @@ -59,8 +59,8 @@ class TextDocument(object): self.xDesktop = Desktop.getDesktop(xMSF); self.xFrame = OfficeDocument.createNewFrame(xMSF, listener) self.xTextDocument = OfficeDocument.load( - xFrame, URL, "_self", xArgs); - self.xWindowPeer = xFrame.getComponentWindow() + self.xFrame, URL, "_self", xArgs); + self.xWindowPeer = self.xFrame.getComponentWindow() self.m_xDocProps = self.xTextDocument.DocumentProperties CharLocale = self.xTextDocument.CharLocale return diff --git a/wizards/com/sun/star/wizards/ui/PathSelection.py b/wizards/com/sun/star/wizards/ui/PathSelection.py index bd9ba6adbdd5..1467085f9be8 100644 --- a/wizards/com/sun/star/wizards/ui/PathSelection.py +++ b/wizards/com/sun/star/wizards/ui/PathSelection.py @@ -122,11 +122,11 @@ class PathSelection(object): FileAccess.getParentDir(sStorePath) self.sDefaultName = myFA.getFilename(sStorePath) return - elif iTransferMode == TransferMode.LOAD: - if iDialogType == DialogTypes.FOLDER: + elif self.iTransferMode == self.TransferMode.LOAD: + if self.iDialogType == self.DialogTypes.FOLDER: #TODO: write code for picking a folder for loading return - elif iDialogType == DialogTypes.FILE: + elif self.iDialogType == self.DialogTypes.FILE: #TODO: write code for picking a file for loading return except Exception: diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog2.py b/wizards/com/sun/star/wizards/ui/UnoDialog2.py index a812aec49605..42aee8c5f5bd 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog2.py +++ b/wizards/com/sun/star/wizards/ui/UnoDialog2.py @@ -18,6 +18,7 @@ from .UnoDialog import UnoDialog, UIConsts from ..common.Desktop import Desktop from ..common.PropertyNames import PropertyNames +from ..common.SystemDialog import SystemDialog from .event.CommonListener import ItemListenerProcAdapter, \ ActionListenerProcAdapter, TextListenerProcAdapter, \ AdjustmentListenerProcAdapter @@ -199,5 +200,5 @@ class UnoDialog2(UnoDialog): def showMessageBox(self, windowServiceName, windowAttribute, MessageText): return SystemDialog.showMessageBox( - xMSF, self.xControl.Peer, + super().xMSF, self.xControl.Peer, windowServiceName, windowAttribute, MessageText) diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py index ab8d64412898..7f0060bdc49d 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.py +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py @@ -169,7 +169,7 @@ class WizardDialog(UnoDialog2): from .SystemDialog import SystemDialog sError = "The files required could not be found.\n" + \ "Please start the LibreOffice Setup and choose 'Repair'." - SystemDialog.showMessageBox(xMSF, "ErrorBox", OK, sError) + SystemDialog.showMessageBox(super().xMSF, "ErrorBox", OK, sError) except Exception: traceback.print_exc() @@ -430,14 +430,14 @@ class WizardDialog(UnoDialog2): except Exception: traceback.print_exc() - def windowHidden(): + def windowHidden(self): self.cancelWizard_1() def queryTermination(self): self.activate() raise TerminationVetoException() - def disposing(arg0): + def disposing(self, arg0): self.cancelWizard_1() def optCreateFromTemplateItemChanged(self): |