[Libreoffice-commits] core.git: wizards/com
Julien Nabet (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 8 09:01:54 UTC 2020
wizards/com/sun/star/wizards/agenda/AgendaDocument.py | 10 +++++-----
wizards/com/sun/star/wizards/common/Desktop.py | 3 ---
wizards/com/sun/star/wizards/common/SystemDialog.py | 2 +-
wizards/com/sun/star/wizards/document/OfficeDocument.py | 5 +++--
wizards/com/sun/star/wizards/text/TextDocument.py | 4 ++--
wizards/com/sun/star/wizards/ui/PathSelection.py | 6 +++---
wizards/com/sun/star/wizards/ui/UnoDialog2.py | 3 ++-
wizards/com/sun/star/wizards/ui/WizardDialog.py | 6 +++---
8 files changed, 19 insertions(+), 20 deletions(-)
New commits:
commit 62f77e94702657aa25e247da71dab012e280679e
Author: Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Thu May 7 23:16:29 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 8 11:01:13 2020 +0200
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 at collabora.co.uk>
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):
More information about the Libreoffice-commits
mailing list