Skip to content

Commit

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

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

This PR follows the changes in OSGeo/grass#1287
  • Loading branch information
neteler committed Feb 3, 2022
1 parent 2e3dcb5 commit f17c792
Show file tree
Hide file tree
Showing 294 changed files with 24,007 additions and 24,007 deletions.
84 changes: 42 additions & 42 deletions src/db/db.join/db.join.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,48 @@
# or f.write("{}\n".format(grass.db_begin_transaction(fi['driver']))) ?
#############################################################################

#%module
#% description: Joins a database table to another database table.
#% keyword: database
#% keyword: attribute table
#%end

#%option G_OPT_DB_TABLE
#% description: Table to which to join other table
#% required : yes
#%end

#%option G_OPT_DB_COLUMN
#% description: Identifier column (e.g.: cat) in the table to be used for join
#% required : yes
#%end

#%option G_OPT_DB_DATABASE
#%end

#%option G_OPT_DB_DRIVER
#% options: dbf,odbc,ogr,sqlite,pg
#%end

#%option G_OPT_DB_TABLE
#% key: other_table
#% description: Other table name
#% required: yes
#% guidependency: ocolumn,scolumns
#%end

#%option G_OPT_DB_COLUMN
#% key: other_column
#% description: Identifier column (e.g.: id) in the other table used for join
#% required: yes
#%end

#%option G_OPT_DB_COLUMN
#% key: subset_columns
#% multiple: yes
#% required: no
#% description: Subset of columns from the other table
#%end
# %module
# % description: Joins a database table to another database table.
# % keyword: database
# % keyword: attribute table
# %end

# %option G_OPT_DB_TABLE
# % description: Table to which to join other table
# % required : yes
# %end

# %option G_OPT_DB_COLUMN
# % description: Identifier column (e.g.: cat) in the table to be used for join
# % required : yes
# %end

# %option G_OPT_DB_DATABASE
# %end

# %option G_OPT_DB_DRIVER
# % options: dbf,odbc,ogr,sqlite,pg
# %end

# %option G_OPT_DB_TABLE
# % key: other_table
# % description: Other table name
# % required: yes
# % guidependency: ocolumn,scolumns
# %end

# %option G_OPT_DB_COLUMN
# % key: other_column
# % description: Identifier column (e.g.: id) in the other table used for join
# % required: yes
# %end

# %option G_OPT_DB_COLUMN
# % key: subset_columns
# % multiple: yes
# % required: no
# % description: Subset of columns from the other table
# %end

import sys
import string
Expand Down
66 changes: 33 additions & 33 deletions src/display/d.explanation.plot/d.explanation.plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,39 @@
#
#############################################################################

#%module
#% description: Draw a plot of multiple rasters to explain a raster operation for example a + b = c
#% keyword: display
#% keyword: manual
#% keyword: raster
#%end
#%option G_OPT_R_INPUT
#% key: a
#%end
#%option G_OPT_R_INPUT
#% key: b
#%end
#%option G_OPT_R_INPUT
#% key: c
#%end
#%option
#% key: label_a
#% type: string
#% required: no
#% description: Label above the raster
#%end
#%option
#% key: label_b
#% type: string
#% required: no
#% description: Label above the raster
#%end
#%option
#% key: label_c
#% type: string
#% required: no
#% description: Label above the raster
#%end
# %module
# % description: Draw a plot of multiple rasters to explain a raster operation for example a + b = c
# % keyword: display
# % keyword: manual
# % keyword: raster
# %end
# %option G_OPT_R_INPUT
# % key: a
# %end
# %option G_OPT_R_INPUT
# % key: b
# %end
# %option G_OPT_R_INPUT
# % key: c
# %end
# %option
# % key: label_a
# % type: string
# % required: no
# % description: Label above the raster
# %end
# %option
# % key: label_b
# % type: string
# % required: no
# % description: Label above the raster
# %end
# %option
# % key: label_c
# % type: string
# % required: no
# % description: Label above the raster
# %end


import sys
Expand Down
90 changes: 45 additions & 45 deletions src/display/d.frame/d.frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,51 @@
# GNU General Public License for more details.
#
############################################################################
#%module
#% description: Manages display frames on the user's graphics monitor.
#% keyword: display
#% keyword: graphics
#% keyword: monitors
#% keyword: frame
#% overwrite: yes
#%end
#%flag
#% key: c
#% description: Create a new frame if doesn't exist and select
#%end
#%flag
#% key: e
#% description: Remove all frames, erase the screen and exit
#% suppress_required: yes
#%end
#%flag
#% key: p
#% description: Print name of current frame and exit
#% suppress_required: yes
#%end
#%flag
#% key: a
#% description: Print names of all frames including 'at' position and exit
#% suppress_required: yes
#%end
#%option
#% key: frame
#% type: string
#% required: yes
#% multiple: no
#% key_desc: name
#% description: Frame to be selected or created (if -c flag is given)
#%end
#%option
#% key: at
#% type: double
#% required: no
#% multiple: no
#% key_desc: bottom,top,left,right
#% label: Screen coordinates in percent where to place the frame (0,0 is lower-left)
#% options: 0-100
#% description: Implies only when -c or --overwrite flag is given
#%end
# %module
# % description: Manages display frames on the user's graphics monitor.
# % keyword: display
# % keyword: graphics
# % keyword: monitors
# % keyword: frame
# % overwrite: yes
# %end
# %flag
# % key: c
# % description: Create a new frame if doesn't exist and select
# %end
# %flag
# % key: e
# % description: Remove all frames, erase the screen and exit
# % suppress_required: yes
# %end
# %flag
# % key: p
# % description: Print name of current frame and exit
# % suppress_required: yes
# %end
# %flag
# % key: a
# % description: Print names of all frames including 'at' position and exit
# % suppress_required: yes
# %end
# %option
# % key: frame
# % type: string
# % required: yes
# % multiple: no
# % key_desc: name
# % description: Frame to be selected or created (if -c flag is given)
# %end
# %option
# % key: at
# % type: double
# % required: no
# % multiple: no
# % key_desc: bottom,top,left,right
# % label: Screen coordinates in percent where to place the frame (0,0 is lower-left)
# % options: 0-100
# % description: Implies only when -c or --overwrite flag is given
# %end

import os
import sys
Expand Down
112 changes: 56 additions & 56 deletions src/display/d.mon2/d.mon2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,62 +11,62 @@
#
#############################################################################

#%Module
#% description: Starts a graphics display monitor which can be controlled from the command line.
#% keyword: display
#% keyword: CLI
#%End
#%Option
#% key: width
#% type: integer
#% description: Width for display monitor if not set by GRASS_RENDER_WIDTH
#% answer: 800
#%End
#%Option
#% key: height
#% type: integer
#% description: Height for display monitor if not set by GRASS_RENDER_HEIGHT
#% answer: 600
#%End
#%Option
#% key: handler
#% type: string
#% description: Window program to use
#% options: ximgview,wximgview,wxpyimgview,qiv,none
#% answer: wximgview
#%End
#%option
#% key: tempfile
#% type: string
#% gisprompt: new_file,file,input
#% description: Name and location of temp file
#% required : no
#%end
#%option
#% key: percent
#% type: integer
#% description: Percentage of CPU time to use
#% answer: 10
#%end
#%option
#% key: color
#% type: string
#% description: Background color, either a standard GRASS color or R:G:B triplet (separated by colons)
#% answer: white
#% gisprompt: old_color,color,color
#%end
#%Flag
#% key: c
#% description: Use the Cario driver to render images
#%End
#%Flag
#% key: b
#% description: output Bourne shell code to set up display
#%End
#%Flag
#% key: d
#% description: output DOS code to set up display
#%End
# %Module
# % description: Starts a graphics display monitor which can be controlled from the command line.
# % keyword: display
# % keyword: CLI
# %End
# %Option
# % key: width
# % type: integer
# % description: Width for display monitor if not set by GRASS_RENDER_WIDTH
# % answer: 800
# %End
# %Option
# % key: height
# % type: integer
# % description: Height for display monitor if not set by GRASS_RENDER_HEIGHT
# % answer: 600
# %End
# %Option
# % key: handler
# % type: string
# % description: Window program to use
# % options: ximgview,wximgview,wxpyimgview,qiv,none
# % answer: wximgview
# %End
# %option
# % key: tempfile
# % type: string
# % gisprompt: new_file,file,input
# % description: Name and location of temp file
# % required : no
# %end
# %option
# % key: percent
# % type: integer
# % description: Percentage of CPU time to use
# % answer: 10
# %end
# %option
# % key: color
# % type: string
# % description: Background color, either a standard GRASS color or R:G:B triplet (separated by colons)
# % answer: white
# % gisprompt: old_color,color,color
# %end
# %Flag
# % key: c
# % description: Use the Cario driver to render images
# %End
# %Flag
# % key: b
# % description: output Bourne shell code to set up display
# %End
# %Flag
# % key: d
# % description: output DOS code to set up display
# %End

import sys
import os
Expand Down

0 comments on commit f17c792

Please sign in to comment.