Skip to content

Commit

Permalink
wxGUI: Fixed F405 in psmap/ (OSGeo#4541)
Browse files Browse the repository at this point in the history
  • Loading branch information
arohanajit authored Oct 17, 2024
1 parent fd347b9 commit daee989
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ per-file-ignores =
gui/wxpython/nviz/*: E266, E722, F403, F405
gui/wxpython/photo2image/*: F841, E722, E265
gui/wxpython/photo2image/g.gui.photo2image.py: E501, F841
gui/wxpython/psmap/*: F841, E266, E722, F405, F403
gui/wxpython/psmap/*: F841, E266, E722
gui/wxpython/vdigit/*: F841, E722, F405, F403
gui/wxpython/vnet/*: F841
gui/wxpython/wxgui.py: F841
Expand Down
53 changes: 43 additions & 10 deletions gui/wxpython/psmap/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,34 @@

import wx
import wx.lib.agw.floatspin as fs
from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin

from core import globalvar
from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin

if globalvar.wxPythonPhoenix:
from wx import Validator
else:
from wx import PyValidator as Validator

import grass.script as gs

from core.utils import PilImageToWxImage
from core.gcmd import GError, GMessage, RunCommand
from core.utils import PilImageToWxImage, cmp
from dbmgr.vinfo import VectorDBInfo
from gui_core.gselect import Select
from core.gcmd import RunCommand, GError, GMessage
from gui_core.dialogs import SymbolDialog
from gui_core.gselect import Select
from gui_core.wrap import (
BitmapButton,
BitmapComboBox,
BitmapFromImage,
Button,
CheckBox,
CheckListCtrlMixin,
Choice,
ClientDC,
ColourPickerCtrl,
Dialog,
DirBrowseButton,
EmptyBitmap,
EmptyImage,
ExpandoTextCtrl,
FileBrowseButton,
FloatSpin,
Expand All @@ -86,11 +86,44 @@
StaticText,
TextCtrl,
TextEntryDialog,
EmptyImage,
CheckListCtrlMixin,
)
from psmap.utils import *
from psmap.instructions import *

# Explicit imports from psmap.instructions
from psmap.instructions import (
Image,
Labels,
Line,
MapFrame,
Mapinfo,
NewId,
NorthArrow,
Point,
Raster,
RasterLegend,
Rectangle,
Scalebar,
Text,
Vector,
VectorLegend,
VProperties,
)

# Explicit imports from psmap.utils
from psmap.utils import (
AutoAdjust,
BBoxAfterRotation,
ComputeSetRegion,
PaperMapCoordinates,
PILImage,
Rect2D,
Rect2DPP,
SetResolution,
UnitConversion,
convertRGB,
getRasterType,
havePILImage,
projInfo,
)

# grass.set_raise_on_error(True)

Expand Down
57 changes: 41 additions & 16 deletions gui/wxpython/psmap/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
"""

import os
import sys

import queue as Queue
from math import sin, cos, pi, sqrt
import sys
from math import cos, pi, sin, sqrt

import wx

Expand All @@ -29,25 +28,51 @@
import wx.lib.flatnotebook as FN

import grass.script as gs

from core import globalvar
from gui_core.menu import Menu
from core.gconsole import CmdThread, EVT_CMD_DONE
from psmap.toolbars import PsMapToolbar
from core.gcmd import RunCommand, GError, GMessage
from core.gcmd import GError, GMessage, RunCommand
from core.gconsole import EVT_CMD_DONE, CmdThread
from core.settings import UserSettings
from core.utils import PilImageToWxImage
from gui_core.forms import GUI
from gui_core.widgets import GNotebook
from gui_core.dialogs import HyperlinkDialog
from gui_core.forms import GUI
from gui_core.ghelp import ShowAboutDialog
from gui_core.wrap import ClientDC, PseudoDC, Rect, StockCursor, EmptyBitmap
from psmap.menudata import PsMapMenuData
from gui_core.menu import Menu
from gui_core.toolbars import ToolSwitcher

from psmap.dialogs import *
from psmap.instructions import *
from psmap.utils import *
from gui_core.widgets import GNotebook
from gui_core.wrap import ClientDC, EmptyBitmap, PseudoDC, Rect, StockCursor

from psmap.dialogs import (
ImageDialog,
LabelsDialog,
LegendDialog,
MainVectorDialog,
MapDialog,
MapinfoDialog,
NorthArrowDialog,
PageSetupDialog,
PointDialog,
RasterDialog,
RectangleDialog,
ScalebarDialog,
TextDialog,
)
from psmap.instructions import InitMap, Instruction, NewId, SetResolution, PageSetup
from psmap.menudata import PsMapMenuData
from psmap.toolbars import PsMapToolbar
from psmap.utils import (
AutoAdjust,
ComputeSetRegion,
GetMapBounds,
PaperMapCoordinates,
PILImage,
Rect2D,
Rect2DPP,
Rect2DPS,
UnitConversion,
convertRGB,
havePILImage,
projInfo,
)


class PsMapFrame(wx.Frame):
Expand Down
20 changes: 15 additions & 5 deletions gui/wxpython/psmap/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,27 @@
import os
import string
from math import ceil
from time import strftime, localtime
from time import localtime, strftime

import wx
import grass.script as gs
from grass.script.task import cmdlist_to_tuple

import wx
from core.gcmd import GError, GMessage, GWarning
from core.utils import GetCmdString
from dbmgr.vinfo import VectorDBInfo
from grass.script.task import cmdlist_to_tuple
from gui_core.wrap import NewId as wxNewId
from psmap.utils import *

from psmap.utils import ( # Add any additional required names from psmap.utils here
BBoxAfterRotation,
GetMapBounds,
PaperMapCoordinates,
Rect2D,
Rect2DPP,
SetResolution,
UnitConversion,
getRasterType,
projInfo,
)


def NewId():
Expand Down

0 comments on commit daee989

Please sign in to comment.