Skip to content

Commit

Permalink
r.vif: small fix python 2 left-over code (#594)
Browse files Browse the repository at this point in the history
 r.vif: small fix python 2 left-over code
  • Loading branch information
Paulo van Breugel committed Jul 20, 2021
1 parent e27518e commit 038a0fe
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/raster/r.vif/r.vif.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
from cStringIO import StringIO
import uuid
import atexit
import string
import grass.script as gs


Expand All @@ -114,11 +113,15 @@ def cleanup():
gs.run_command("g.remove", flags="f", type="all", name=rast, quiet=True)


def create_unique_name(name):
"""Generate a tmp name which contains prefix
Store the name in the global list.
"""
return name + str(uuid.uuid4().hex)


def tmpname(prefix):
"""Generate a tmp name which contains prefix. Store the name in the
global list. Use only for raster maps."""
tmpf = prefix + str(uuid.uuid4())
tmpf = string.replace(tmpf, "-", "_")
tmpf = create_unique_name(prefix)
CLEAN_RAST.append(tmpf)
return tmpf

Expand Down

0 comments on commit 038a0fe

Please sign in to comment.