Skip to content

Commit

Permalink
r3.forestfrag: Make string replace Python 3 compatible (#466)
Browse files Browse the repository at this point in the history
This does for r3.forestfrag what 44ebd8f does for r.forestfrag.
Unused imports are removed also from r.forestfrag.

Removes unused flag -s (show r.report output) is from r3.forestfrag.
  • Loading branch information
wenzeslaus committed Mar 6, 2021
1 parent eccea34 commit f4294b9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion grass7/raster/r.forestfrag/r.forestfrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
import uuid
import atexit
import tempfile
import string
import grass.script as gs
# neutral naming for better compatibility between 2D and 3D version
from grass.script.raster import mapcalc
Expand Down
11 changes: 1 addition & 10 deletions grass7/raster3d/r3.forestfrag/r3.forestfrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,15 @@
#% description: Keep Pf and Pff maps
#%end

#%flag
#% key: s
#% description: Run r.report on output map
#%end

#%flag
#% key: a
#% description: Trim the output map to avoid border effects
#%end


import os
import sys
import uuid
import atexit
import tempfile
import string
import grass.script as gs
# neutral naming for better compatibility with 2D version
from grass.script.raster3d import mapcalc3d as mapcalc
Expand Down Expand Up @@ -200,7 +192,7 @@ def tmpname(prefix):
Use only for raster maps.
"""
tmpf = prefix + str(uuid.uuid4())
tmpf = string.replace(tmpf, '-', '_')
tmpf = tmpf.replace('-', '_')
CLEAN_RAST.append(tmpf)
return tmpf

Expand Down Expand Up @@ -264,7 +256,6 @@ def main(options, flags):
user_pf = options['pf']
user_pff = options['pff']
flag_r = flags['r']
flag_s = flags['s']
clip_output = flags['a']

# set to current input map region if requested by the user
Expand Down

0 comments on commit f4294b9

Please sign in to comment.