Skip to content

Commit

Permalink
checks: flake8 F841 (local variable assigned to but never used) fixes…
Browse files Browse the repository at this point in the history
… in scripts directory part 1 (OSGeo#4238)
  • Loading branch information
mshukuno authored Sep 9, 2024
1 parent d7f4977 commit 57cb4d9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ per-file-ignores =
python/grass/*/*/__init__.py: F401, F403
python/grass/*/*/*/__init__.py: F401, F403
# E402 module level import not at top of file
scripts/d.polar/d.polar.py: F841
scripts/r.in.wms/wms_gdal_drv.py: F841, E722
scripts/r.in.wms/wms_cap_parsers.py: F841
scripts/r.in.wms/wms_gdal_drv.py: E722
scripts/r.in.wms/wms_drv.py: E402, E722
scripts/r.in.wms/srs.py: E722
scripts/r.semantic.label/r.semantic.label.py: E501
Expand Down
9 changes: 0 additions & 9 deletions scripts/d.polar/d.polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def plot_eps(psout):
epsscale = 0.1
frameallowance = 1.1
halfframe = 3000
center = (halfframe, halfframe)
scale = halfframe / (outerradius * frameallowance)

diagramlinewidth = halfframe / 400
Expand All @@ -211,11 +210,6 @@ def plot_eps(psout):
diagramfontsize = halfframe / 20
halfframe_2 = halfframe * 2

averagedirectioncolor = 1 # (blue)
diagramcolor = 4 # (red)
circlecolor = 2 # (green)
axescolor = 0 # (black)

northjustification = 2
eastjustification = 6
southjustification = 8
Expand Down Expand Up @@ -287,7 +281,6 @@ def plot_eps(psout):
)
outf.write(s)

sublength = len(outercircle) - 2
(x, y) = outercircle[1]
outf.write("%.2f %.2f moveto\n" % (x * scale + halfframe, y * scale + halfframe))
for x, y in outercircle[2:]:
Expand Down Expand Up @@ -343,7 +336,6 @@ def plot_eps(psout):
)
outf.write(s)

sublength = len(sine_cosine_replic) - 2
(x, y) = sine_cosine_replic[1]
outf.write("%.2f %.2f moveto\n" % (x * scale + halfframe, y * scale + halfframe))
for x, y in sine_cosine_replic[2:]:
Expand All @@ -369,7 +361,6 @@ def plot_eps(psout):
s = t.substitute(DIAGRAMLINEWIDTH=diagramlinewidth)
outf.write(s)

sublength = len(vector) - 2
(x, y) = vector[1]
outf.write("%.2f %.2f moveto\n" % (x * scale + halfframe, y * scale + halfframe))
for x, y in vector[2:]:
Expand Down
2 changes: 1 addition & 1 deletion scripts/r.in.wms/wms_cap_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _checkFormats(self, capability):
"""!Check if format element is defined."""
request = self._find(capability, "Request")
get_map = self._find(request, "GetMap")
formats = self._findall(get_map, "Format")
self._findall(get_map, "Format")

def _checkLayerTree(self, parent_layer, first=True):
"""!Recursively check layer tree and manage inheritance in the tree"""
Expand Down
1 change: 0 additions & 1 deletion scripts/r.in.wms/wms_gdal_drv.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def _createXML(self):

gdal_wms = ET.Element("GDAL_WMS")
service = ET.SubElement(gdal_wms, "Service")
name = ET.Element("name")
service.set("name", "WMS")

version = ET.SubElement(service, "Version")
Expand Down

0 comments on commit 57cb4d9

Please sign in to comment.