From 76ee4517c1b153a4b6f1065dff596118f6b563fc Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sun, 24 Nov 2013 18:16:22 +0100 Subject: pywizards: Some more pyflakes love Change-Id: I3da78c004068cd7306ef79f5d019ab5bf07cac0b --- wizards/com/sun/star/wizards/agenda/AgendaDocument.py | 11 ----------- wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py | 8 ++------ wizards/com/sun/star/wizards/agenda/CGTopic.py | 1 - wizards/com/sun/star/wizards/agenda/TopicsControl.py | 7 +++---- wizards/com/sun/star/wizards/common/ConfigGroup.py | 1 - wizards/com/sun/star/wizards/common/ConfigSet.py | 1 - wizards/com/sun/star/wizards/common/Desktop.py | 2 +- wizards/com/sun/star/wizards/common/NumberFormatter.py | 2 -- wizards/com/sun/star/wizards/common/Resource.py | 1 - wizards/com/sun/star/wizards/document/OfficeDocument.py | 1 - wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py | 1 - wizards/com/sun/star/wizards/text/TextDocument.py | 2 -- wizards/com/sun/star/wizards/text/TextElement.py | 1 - wizards/com/sun/star/wizards/ui/ControlScroller.py | 2 +- wizards/com/sun/star/wizards/ui/WizardDialog.py | 3 --- wizards/com/sun/star/wizards/ui/event/DataAware.py | 1 - wizards/com/sun/star/wizards/ui/event/ListDataEvent.py | 2 -- wizards/com/sun/star/wizards/ui/event/ListDataListener.py | 1 - wizards/com/sun/star/wizards/ui/event/RadioDataAware.py | 1 - wizards/com/sun/star/wizards/ui/event/TaskEvent.py | 2 -- wizards/com/sun/star/wizards/ui/event/UnoDataAware.py | 5 ++--- 21 files changed, 9 insertions(+), 47 deletions(-) (limited to 'wizards/com') diff --git a/wizards/com/sun/star/wizards/agenda/AgendaDocument.py b/wizards/com/sun/star/wizards/agenda/AgendaDocument.py index d9013bad1b8f..180b83f261cc 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaDocument.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaDocument.py @@ -571,15 +571,6 @@ class AgendaDocument(TextDocument): rows = table.Rows rows.insertByIndex(start, count) - '''returns the row index for this cell name. - @param cellName - @return the row index for this cell name. - ''' - - @classmethod - def getRowIndex(self, cellName): - return int(cellName.RangeName[1:]) - ''' returns the rows count of this table, assuming there is no vertical merged cells. @@ -699,8 +690,6 @@ class ItemsTable(object): if cellName == cursor.RangeName: return - rowIndex = AgendaDocument.getRowIndex(cursor) - rowsCount = AgendaDocument.getRowCount(ItemsTable.table) ''' now before deleteing i move the cursor up so it does not disappear, because it will crash office. diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py index 243365af3c49..8b21e7eb754e 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py @@ -35,9 +35,9 @@ from ..common.Configuration import Configuration from ..common.FileAccess import FileAccess from ..document.OfficeDocument import OfficeDocument +from com.sun.star.util import CloseVetoException from com.sun.star.view.DocumentZoomType import OPTIMAL from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO -from com.sun.star.awt.VclWindowPeerAttribute import OK class AgendaWizardDialogImpl(AgendaWizardDialog): @@ -259,9 +259,6 @@ class AgendaWizardDialogImpl(AgendaWizardDialog): self.myAgendaDoc.redrawTitle("cbLocation") #checkbox listeners - def chkUseMeetingTypeItemChanged(self): - self.myAgendaDoc.agenda.cp_IncludeMinutes = bool(self.chkMinutes.State) - def chkUseMeetingTypeItemChanged(self): self.myAgendaDoc.redraw(self.templateConsts.FILLIN_MEETING_TYPE) @@ -316,7 +313,6 @@ class AgendaWizardDialogImpl(AgendaWizardDialog): bSaveSuccess = False endWizard = True try: - fileAccess = FileAccess(self.xMSF) self.sPath = self.myPathSelection.getSelectedPath() if not self.sPath or not os.path.exists(self.sPath): self.myPathSelection.triggerPathPicker() @@ -388,7 +384,7 @@ class AgendaWizardDialogImpl(AgendaWizardDialog): def closeDocument(self): try: - xCloseable = self.myAgendaDoc.xFrame.close(False) + self.myAgendaDoc.xFrame.close(False) except CloseVetoException: traceback.print_exc() diff --git a/wizards/com/sun/star/wizards/agenda/CGTopic.py b/wizards/com/sun/star/wizards/agenda/CGTopic.py index 240ad0ed4b5b..c09436308f03 100644 --- a/wizards/com/sun/star/wizards/agenda/CGTopic.py +++ b/wizards/com/sun/star/wizards/agenda/CGTopic.py @@ -41,7 +41,6 @@ class CGTopic(ConfigGroup): self.cp_Responsible = str() self.cp_Time = str() else: - num = row[0].Value self.cp_Index = int(row[0].Value[:-1]) self.cp_Topic = row[1].Value self.cp_Responsible = row[2].Value diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py index 65af661553cc..8e7dbc2713b8 100644 --- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py +++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py @@ -16,9 +16,8 @@ # the License at http://www.apache.org/licenses/LICENSE-2.0 . # import uno -from .CGTopic import CGTopic from ..ui.ControlScroller import ControlScroller, PropertyNames, traceback, \ - HelpIds, UnoDialog + HelpIds from .AgendaWizardDialogConst import HID from ..common.Properties import Properties from ..ui.event.CommonListener import FocusListenerProcAdapter, \ @@ -436,8 +435,8 @@ class TopicsControl(ControlScroller): if (event.KeyCode == TAB) and \ (event.Modifiers == SHIFT): if self.nscrollvalue > 0: - setScrollValue(self.nscrollvalue - 1) - focus(self.lastTime) + self.setScrollValue(self.nscrollvalue - 1) + self.focus(self.lastTime) ''' sets focus to the given control. diff --git a/wizards/com/sun/star/wizards/common/ConfigGroup.py b/wizards/com/sun/star/wizards/common/ConfigGroup.py index bd059816061d..200d4ef9d1ad 100644 --- a/wizards/com/sun/star/wizards/common/ConfigGroup.py +++ b/wizards/com/sun/star/wizards/common/ConfigGroup.py @@ -16,7 +16,6 @@ # the License at http://www.apache.org/licenses/LICENSE-2.0 . # import inspect -from .Configuration import Configuration class ConfigGroup(object): diff --git a/wizards/com/sun/star/wizards/common/ConfigSet.py b/wizards/com/sun/star/wizards/common/ConfigSet.py index 79ae0e378520..d4cc7e4886f2 100644 --- a/wizards/com/sun/star/wizards/common/ConfigSet.py +++ b/wizards/com/sun/star/wizards/common/ConfigSet.py @@ -17,7 +17,6 @@ # import traceback from .ConfigGroup import ConfigGroup -from .Configuration import Configuration class ConfigSet(ConfigGroup): ''' diff --git a/wizards/com/sun/star/wizards/common/Desktop.py b/wizards/com/sun/star/wizards/common/Desktop.py index f91caa9c9c15..4a18ca09a287 100644 --- a/wizards/com/sun/star/wizards/common/Desktop.py +++ b/wizards/com/sun/star/wizards/common/Desktop.py @@ -18,7 +18,7 @@ import uno import traceback -from com.sun.star.frame.FrameSearchFlag import ALL, PARENT +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 diff --git a/wizards/com/sun/star/wizards/common/NumberFormatter.py b/wizards/com/sun/star/wizards/common/NumberFormatter.py index 316659f01244..9cb1763c8db1 100644 --- a/wizards/com/sun/star/wizards/common/NumberFormatter.py +++ b/wizards/com/sun/star/wizards/common/NumberFormatter.py @@ -17,8 +17,6 @@ # import traceback from com.sun.star.lang import Locale -from com.sun.star.util.NumberFormat import \ - DATE, LOGICAL, DATETIME, TEXT, NUMBER class NumberFormatter(object): diff --git a/wizards/com/sun/star/wizards/common/Resource.py b/wizards/com/sun/star/wizards/common/Resource.py index 450565e15f48..e35820cf5d8f 100644 --- a/wizards/com/sun/star/wizards/common/Resource.py +++ b/wizards/com/sun/star/wizards/common/Resource.py @@ -16,7 +16,6 @@ # the License at http://www.apache.org/licenses/LICENSE-2.0 . # import traceback -from .Configuration import Configuration from com.sun.star.awt.VclWindowPeerAttribute import OK diff --git a/wizards/com/sun/star/wizards/document/OfficeDocument.py b/wizards/com/sun/star/wizards/document/OfficeDocument.py index 35d3183cf57c..3886f1eb1c70 100644 --- a/wizards/com/sun/star/wizards/document/OfficeDocument.py +++ b/wizards/com/sun/star/wizards/document/OfficeDocument.py @@ -18,7 +18,6 @@ import uno import traceback from unohelper import systemPathToFileUrl, absolutize -from ..ui.event.CommonListener import TerminateListenerProcAdapter from ..common.Desktop import Desktop from com.sun.star.awt import WindowDescriptor diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py index 9328757e3270..bbc281cce9bc 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py @@ -148,7 +148,6 @@ class FaxWizardDialogImpl(FaxWizardDialog): self.switchToStep(self.getCurrentStep(), self.nMaxStep) endWizard = True try: - fileAccess = FileAccess(self.xMSF) self.sPath = self.myPathSelection.getSelectedPath() if not self.sPath or not os.path.exists(self.sPath): self.myPathSelection.triggerPathPicker() diff --git a/wizards/com/sun/star/wizards/text/TextDocument.py b/wizards/com/sun/star/wizards/text/TextDocument.py index aae3d5981fe3..b52f885fedd1 100644 --- a/wizards/com/sun/star/wizards/text/TextDocument.py +++ b/wizards/com/sun/star/wizards/text/TextDocument.py @@ -25,8 +25,6 @@ from ..common.Desktop import Desktop from ..common.Configuration import Configuration from ..common.NumberFormatter import NumberFormatter -from com.sun.star.container import NoSuchElementException -from com.sun.star.lang import WrappedTargetException from com.sun.star.i18n.NumberFormatIndex import DATE_SYS_DDMMYY from com.sun.star.view.DocumentZoomType import ENTIRE_PAGE from com.sun.star.beans.PropertyState import DIRECT_VALUE diff --git a/wizards/com/sun/star/wizards/text/TextElement.py b/wizards/com/sun/star/wizards/text/TextElement.py index 840c70e55af1..57aa4ea268c2 100644 --- a/wizards/com/sun/star/wizards/text/TextElement.py +++ b/wizards/com/sun/star/wizards/text/TextElement.py @@ -15,7 +15,6 @@ # except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 . # -import traceback class TextElement(object): diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.py b/wizards/com/sun/star/wizards/ui/ControlScroller.py index 2f6d4a41f3e0..e6dfc1257118 100644 --- a/wizards/com/sun/star/wizards/ui/ControlScroller.py +++ b/wizards/com/sun/star/wizards/ui/ControlScroller.py @@ -21,7 +21,7 @@ from ..common.Desktop import Desktop from ..common.PropertyNames import PropertyNames from ..common.HelpIds import HelpIds -from com.sun.star.awt.ScrollBarOrientation import HORIZONTAL, VERTICAL +from com.sun.star.awt.ScrollBarOrientation import VERTICAL class ControlScroller(object): diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py index fc1ce41b047c..cd1d9217159f 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.py +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py @@ -20,11 +20,8 @@ import traceback from abc import ABCMeta, abstractmethod from .UnoDialog2 import UnoDialog2, Desktop, PropertyNames, UIConsts, \ ItemListenerProcAdapter -from .event.CommonListener import TerminateListenerProcAdapter from ..common.Resource import Resource from ..common.HelpIds import HelpIds -from ..document.OfficeDocument import OfficeDocument -from ..text.TextDocument import TextDocument from com.sun.star.lang import NoSuchMethodException from com.sun.star.frame import TerminationVetoException diff --git a/wizards/com/sun/star/wizards/ui/event/DataAware.py b/wizards/com/sun/star/wizards/ui/event/DataAware.py index 70e52df47dac..3a4a0efea026 100644 --- a/wizards/com/sun/star/wizards/ui/event/DataAware.py +++ b/wizards/com/sun/star/wizards/ui/event/DataAware.py @@ -18,7 +18,6 @@ import traceback import uno from abc import ABCMeta, abstractmethod -from ...common.PropertyNames import PropertyNames from com.sun.star.util import Date from com.sun.star.util import Time diff --git a/wizards/com/sun/star/wizards/ui/event/ListDataEvent.py b/wizards/com/sun/star/wizards/ui/event/ListDataEvent.py index 0aeb914742c8..50588dd289f1 100644 --- a/wizards/com/sun/star/wizards/ui/event/ListDataEvent.py +++ b/wizards/com/sun/star/wizards/ui/event/ListDataEvent.py @@ -14,9 +14,7 @@ # License, Version 2.0 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 . -from com.sun.star.document import EventObject -#class ListDataEvent(EventObject): class ListDataEvent: INTERVAL_ADDED = 1 diff --git a/wizards/com/sun/star/wizards/ui/event/ListDataListener.py b/wizards/com/sun/star/wizards/ui/event/ListDataListener.py index 56b4c6f8efcb..e3f74659fab5 100644 --- a/wizards/com/sun/star/wizards/ui/event/ListDataListener.py +++ b/wizards/com/sun/star/wizards/ui/event/ListDataListener.py @@ -16,7 +16,6 @@ # the License at http://www.apache.org/licenses/LICENSE-2.0 . # from abc import abstractmethod -from com.sun.star.script import EventListener class ListDataListener(): diff --git a/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py b/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py index 9a263c17b983..67ba0ceb8217 100644 --- a/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py +++ b/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py @@ -15,7 +15,6 @@ # except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 . # -import time from .CommonListener import ItemListenerProcAdapter from .DataAware import DataAware diff --git a/wizards/com/sun/star/wizards/ui/event/TaskEvent.py b/wizards/com/sun/star/wizards/ui/event/TaskEvent.py index 291a18963555..69eaec8cf320 100644 --- a/wizards/com/sun/star/wizards/ui/event/TaskEvent.py +++ b/wizards/com/sun/star/wizards/ui/event/TaskEvent.py @@ -14,9 +14,7 @@ # License, Version 2.0 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 . -from com.sun.star.document import EventObject -#class TaskEvent(EventObject): class TaskEvent: TASK_STARTED = 1 diff --git a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.py b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.py index 1254e981313c..04ba03a3ddb2 100644 --- a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.py +++ b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.py @@ -17,9 +17,8 @@ # import uno from .CommonListener import ItemListenerProcAdapter, TextListenerProcAdapter -from .DataAware import DataAware, PropertyNames, datetime, Date, Time - -from com.sun.star.script import CannotConvertException +from .DataAware import DataAware, datetime, Date, Time +from ...common.PropertyNames import PropertyNames ''' @author rpiterman -- cgit v1.2.3