Skip to content

Commit

Permalink
parser: Use #-space-% to allow writing PEP8-compliant Python code (OS…
Browse files Browse the repository at this point in the history
…Geo#1287)

Accept '# %' in parser script header definition because '#%' is against PEP8
(each line of a block comment starts with a # and a single space).

'#%' is still supported and documented as backwards compatibility.

All documentation and generated code uses the new '# %'.

Changes '#%' to '# %' for modules in scripts, gui, and temporal.
  • Loading branch information
wenzeslaus authored and marisn committed Mar 22, 2021
1 parent 2ece3c4 commit 2c6ff57
Show file tree
Hide file tree
Showing 158 changed files with 6,508 additions and 6,492 deletions.
20 changes: 10 additions & 10 deletions doc/gui/wxpython/example/g.gui.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
#
############################################################################

#%module
#% description: Example GUI application which displays raster map and further information
#% keyword: example
#% keyword: GUI
#% keyword: raster
#%end
#%option G_OPT_R_INPUT
#% description: Name of raster map to load
#% required: no
#%end
# %module
# % description: Example GUI application which displays raster map and further information
# % keyword: example
# % keyword: GUI
# % keyword: raster
# %end
# %option G_OPT_R_INPUT
# % description: Name of raster map to load
# % required: no
# %end

import os
import sys
Expand Down
40 changes: 20 additions & 20 deletions doc/python/m.distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@
# Requires Numeric module (NumPy) from http://numpy.scipy.org/
#

#%module
#% label: Finds the distance between two or more points.
#% description: If the projection is latitude-longitude, this distance is measured along the geodesic.
#% keyword: miscellaneous
#% keyword: distance
#% keyword: measure
#%end
#%option
#% key: coord
#% type: string
#% required: yes
#% multiple: yes
#% key_desc: easting,northing
#% description: Comma separated list of coordinate pairs
#%end
#%flag
#% key: i
#% description: Read coordinate pairs from stdin
#% suppress_required: yes
#%end
# %module
# % label: Finds the distance between two or more points.
# % description: If the projection is latitude-longitude, this distance is measured along the geodesic.
# % keyword: miscellaneous
# % keyword: distance
# % keyword: measure
# %end
# %option
# % key: coord
# % type: string
# % required: yes
# % multiple: yes
# % key_desc: easting,northing
# % description: Comma separated list of coordinate pairs
# %end
# %flag
# % key: i
# % description: Read coordinate pairs from stdin
# % suppress_required: yes
# %end

import os, sys

Expand Down
20 changes: 10 additions & 10 deletions doc/python/script/r.example.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env python3

#%module
#% description: Selects values from raster above value of mean plus standard deviation
#% keyword: raster
#% keyword: select
#% keyword: standard deviation
#%end
#%option G_OPT_R_INPUT
#%end
#%option G_OPT_R_OUTPUT
#%end
# %module
# % description: Selects values from raster above value of mean plus standard deviation
# % keyword: raster
# % keyword: select
# % keyword: standard deviation
# %end
# %option G_OPT_R_INPUT
# %end
# %option G_OPT_R_OUTPUT
# %end


import sys
Expand Down
Loading

0 comments on commit 2c6ff57

Please sign in to comment.