Skip to content

Commit

Permalink
wxGUI: fix flake F401 (unused import) (#1294)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa committed Feb 5, 2021
1 parent 1ac0d67 commit 2fb3843
Show file tree
Hide file tree
Showing 84 changed files with 49 additions and 180 deletions.
1 change: 0 additions & 1 deletion gui/wxpython/.flake8
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ignore =
E722, # do not use bare 'except'
E731, # do not assign a lambda expression, use a def
E741, # ambiguous variable name 'l'
F401, # 'animation.utils.getCpuCount' imported but unused
F403, # 'from gmodeler.model import *' used; unable to detect undefined names
F405, # '_' may be undefined, or defined from star imports: gmodeler.model
F821, # undefined name '_'
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/animation/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from animation.temporal_manager import TemporalManager
from animation.dialogs import InputDialog, EditDialog, ExportDialog
from animation.utils import TemporalMode, TemporalType, Orientation, RenderText, WxImageToPil, \
sampleCmdMatrixAndCreateNames, layerListToCmdsMatrix, HashCmds, getCpuCount
sampleCmdMatrixAndCreateNames, layerListToCmdsMatrix, HashCmds
from animation.data import AnimationData


Expand Down Expand Up @@ -427,7 +427,7 @@ def _loadLegend(self, animationData):
bitmap = self.bitmapProvider.LoadOverlay(
animationData.legendCmd)
try:
from PIL import Image
from PIL import Image # noqa: F401
for param in animationData.legendCmd:
if param.startswith('at'):
b, t, l, r = param.split('=')[1].split(',')
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/animation/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from animation.utils import validateMapNames, getRegisteredMaps, \
checkSeriesCompatibility, validateTimeseriesName, interpolate
from core.layerlist import LayerList, Layer
import grass.temporal as tgis


class AnimationData(object):
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/animation/nviztask.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

from __future__ import print_function

import os
try:
import xml.etree.ElementTree as etree
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/animation/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import tempfile
from multiprocessing import Process, Queue

from core.gcmd import RunCommand, GException, DecodeString
from core.gcmd import GException, DecodeString
from core.settings import UserSettings
from core.debug import Debug
from core.utils import autoCropImageFromFile
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/animation/temporal_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

from __future__ import print_function

import os
import datetime

import grass.script as grass
Expand Down
2 changes: 0 additions & 2 deletions gui/wxpython/core/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import math
import copy
import tempfile
import types
import time

import wx
Expand All @@ -36,7 +35,6 @@
from grass.script.utils import try_remove, text_to_string
from grass.script.task import cmdlist_to_tuple, cmdtuple_to_list
from grass.pydispatch.signal import Signal
from grass.exceptions import CalledModuleError

from core import utils
from core.ws import RenderWMSMgr
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/core/treemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@author Anna Petrasova <kratochanna gmail.com>
"""
import six
import weakref
import copy

from grass.script.utils import naturally_sort
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/core/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import math

if __name__ == '__main__':
import os
import sys


Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

from grass.script import core as grass
from grass.script import task as gtask
from grass.exceptions import OpenError

from core.gcmd import RunCommand
from core.debug import Debug
Expand Down
3 changes: 0 additions & 3 deletions gui/wxpython/core/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,17 @@
import six

import wx
from wx.lib.newevent import NewEvent

from grass.script.utils import try_remove
from grass.script import core as grass
from grass.exceptions import CalledModuleError

from core import utils
from core.debug import Debug
from core.gthread import gThread

try:
haveGdal = True
from osgeo import gdal
from osgeo import gdalconst
except ImportError:
haveGdal = False

Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/datacatalog/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import wx
from wx.lib.newevent import NewEvent

from core.gcmd import RunCommand, GError, GMessage, GWarning
from core.gcmd import RunCommand, GError, GMessage
from core.utils import GetListOfLocations
from core.debug import Debug
from core.gthread import gThread
Expand Down
4 changes: 0 additions & 4 deletions gui/wxpython/dbmgr/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@
@author Refactoring by Stepan Turek <stepan.turek seznam.cz> (GSoC 2012, mentor: Martin Landa)
"""

import os
import types
import six

from core import globalvar
import wx
import wx.lib.scrolledpanel as scrolled

from core.gcmd import RunCommand, GError
from core.debug import Debug
from core.settings import UserSettings
from dbmgr.vinfo import VectorDBInfo, GetUnicodeValue, GetDbEncoding
from gui_core.widgets import IntegerValidator, FloatValidator
from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \
Expand Down
5 changes: 0 additions & 5 deletions gui/wxpython/dbmgr/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
@author Refactoring by Stepan Turek <stepan.turek seznam.cz> (GSoC 2012, mentor: Martin Landa)
"""

import sys
import os

import wx
Expand All @@ -35,11 +34,7 @@
else:
import wx.lib.flatnotebook as FN

import grass.script as grass


from core.gcmd import GMessage
from core.debug import Debug
from dbmgr.base import DbMgrBase
from gui_core.widgets import GNotebook
from gui_core.wrap import Button, ClearButton, CloseButton
Expand Down
2 changes: 0 additions & 2 deletions gui/wxpython/gcp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@
from core import globalvar
if globalvar.wxPythonPhoenix:
from wx import adv as wiz
from wx.adv import Wizard
else:
from wx import wizard as wiz
from wx.wizard import Wizard

import grass.script as grass

Expand Down
2 changes: 0 additions & 2 deletions gui/wxpython/gcp/mapdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"""

import os
import math
import platform

from core import globalvar
Expand All @@ -30,7 +29,6 @@
from gui_core.dialogs import GetImageHandlers, ImageSizeDialog
from gui_core.mapdisp import SingleMapFrame
from gui_core.wrap import Menu
from core.settings import UserSettings
from mapwin.buffered import BufferedMapWindow
from mapwin.base import MapWindowProperties

Expand Down
4 changes: 0 additions & 4 deletions gui/wxpython/gcp/toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
@author Markus Metz
"""

import os
import sys

import wx

from core import globalvar
from gui_core.toolbars import BaseToolbar, BaseIcons
from icons.icon import MetaIcon

Expand Down
3 changes: 0 additions & 3 deletions gui/wxpython/gis_set_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@
@author Martin Landa <landa.martin gmail.com>
"""

import os
import sys

# i18n is taken care of in the grass library code.
# So we need to import it before any of the GUI code.
# NOTE: in this particular case, we don't really need the grass library;
# NOTE: we import it just for the side effects of gettext.install()
import grass

from core import globalvar
import wx


Expand Down
3 changes: 0 additions & 3 deletions gui/wxpython/gmodeler/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"""

import os
import sys
import six

import wx
Expand All @@ -42,8 +41,6 @@
from gui_core.wrap import Button, StaticText, StaticBox, TextCtrl, \
Menu, ListCtrl, NewId, CheckListCtrlMixin

from grass.script import task as gtask


class ModelDataDialog(SimpleDialog):
"""Data item properties dialog"""
Expand Down
5 changes: 1 addition & 4 deletions gui/wxpython/gmodeler/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import time
import stat
import tempfile
import copy
import re
import random
import six

Expand All @@ -47,11 +45,10 @@
EVT_CMD_RUN, EVT_CMD_DONE, EVT_CMD_PREPARE
from gui_core.goutput import GConsoleWindow
from core.debug import Debug
from core.gcmd import GMessage, GException, GWarning, GError, RunCommand
from core.gcmd import GMessage, GException, GWarning, GError
from gui_core.dialogs import GetImageHandlers
from gui_core.dialogs import TextEntryDialog as CustomTextEntryDialog
from gui_core.ghelp import ShowAboutDialog
from gui_core.preferences import PreferencesBaseDialog
from core.settings import UserSettings
from gui_core.menu import Menu as Menubar
from gmodeler.menudata import ModelerMenuData
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/gmodeler/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
from gui_core.wrap import Button
from gmodeler.giface import GraphicalModelerGrassInterface

from grass.script import core as grass
from grass.script import task as gtask


Expand Down
4 changes: 0 additions & 4 deletions gui/wxpython/gmodeler/toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@
@author Martin Landa <landa.martin gmail.com>
"""

import os
import sys

import wx

from core import globalvar
from gui_core.toolbars import BaseToolbar, BaseIcons

from icons.icon import MetaIcon
Expand Down
3 changes: 1 addition & 2 deletions gui/wxpython/gui_core/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"""

import os
import sys
import re
import six

Expand All @@ -44,7 +43,7 @@
from core.gcmd import GError, RunCommand, GMessage
from gui_core.gselect import LocationSelect, MapsetSelect, Select, \
OgrTypeSelect, SubGroupSelect
from gui_core.widgets import SingleSymbolPanel, GListCtrl, SimpleValidator, \
from gui_core.widgets import SingleSymbolPanel, SimpleValidator, \
MapValidator
from core.settings import UserSettings
from core.debug import Debug
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/gui_core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import queue as Queue
unicode = str

import re
import codecs

from threading import Thread
Expand Down
3 changes: 1 addition & 2 deletions gui/wxpython/gui_core/gselect.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import os
import sys
import glob
import copy
import six

import wx
Expand All @@ -63,7 +62,7 @@

from gui_core.widgets import ManageSettingsWidget, CoordinatesValidator

from core.gcmd import RunCommand, GError, GMessage, GWarning, GException
from core.gcmd import RunCommand, GMessage, GWarning, GException
from core.utils import GetListOfLocations, GetListOfMapsets, \
GetFormats, rasterFormatExtension, vectorFormatExtension
from core.utils import GetSettingsPath, GetValidLayerName, ListSortLower
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/gui_core/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from core import utils
from core.gcmd import EncodeString
from gui_core.treeview import CTreeView
from gui_core.wrap import Button, StaticText, SearchCtrl
from gui_core.wrap import Button, SearchCtrl
from gui_core.wrap import Menu as MenuWidget
from icons.icon import MetaIcon

Expand Down
5 changes: 2 additions & 3 deletions gui/wxpython/gui_core/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import os
import sys
import copy
try:
import pwd
havePwd = True
Expand All @@ -44,10 +43,10 @@
from grass.exceptions import OpenError

from core import globalvar
from core.gcmd import RunCommand, GError
from core.gcmd import GError
from core.utils import ListOfMapsets, GetColorTables, ReadEpsgCodes
from core.settings import UserSettings
from core.globalvar import wxPythonPhoenix, CheckWxVersion
from core.globalvar import CheckWxVersion
from gui_core.dialogs import SymbolDialog, DefaultFontDialog
from gui_core.widgets import IntegerValidator, ColorTablesComboBox
from core.debug import Debug
Expand Down
2 changes: 0 additions & 2 deletions gui/wxpython/gui_core/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
@author Anna Kratochvilova <kratochanna gmail.com>
"""
import os
import wx
import six

from core.gcmd import DecodeString
from gui_core.treeview import TreeListView
from gui_core.wrap import Button, StaticText, Menu, NewId
from core.treemodel import TreeModel, DictNode
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/gui_core/simplelmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
@author Anna Petrasova (kratochanna gmail.com)
"""
import os

import wx
import wx.aui
Expand Down
2 changes: 0 additions & 2 deletions gui/wxpython/gui_core/treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

from __future__ import print_function

import os

import wx
from wx.lib.mixins.treemixin import VirtualTree, ExpansionState
from core.globalvar import hasAgw, wxPythonPhoenix
Expand Down
4 changes: 0 additions & 4 deletions gui/wxpython/gui_core/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
from wx.lib.buttons import ThemedGenBitmapTextButton as BitmapTextButton
except ImportError: # not sure about TGBTButton version
from wx.lib.buttons import GenBitmapTextButton as BitmapTextButton
try:
import wx.lib.agw.customtreectrl as CT
except ImportError:
import wx.lib.customtreectrl as CT

if wxPythonPhoenix:
from wx import Validator as Validator
Expand Down

0 comments on commit 2fb3843

Please sign in to comment.