[GRASS-user] Python Script- grass.debug

Hi there

I’m doing a Python script, based on r.in.aster, to import a set of images but, I’m not sure for that is used the following:
grass.debug(“gdalwarp -t_srs %s %s %s” % (proj, srcfile, tempfile))
WHat is the point of using grass.debug if I do the following after this:

if platform.system() == “Darwin”:
cmd = [“arch”, “-i386”, “gdalwarp”, “-t_srs”, proj, srcfile, tempfile ]
else:
cmd = [“gdalwarp”, “-t_srs”, proj, srcfile, tempfile ]
p = grass.call(cmd)
if p != 0:
#check to see if gdalwarp executed properly
return

Thanks

Luisa

I have sent this email a couple of days ago with no reply. Can anyone help me?
Luisa

2010/9/23 Luisa Peña <luisapena1979@gmail.com>

Hi there

I’m doing a Python script, based on r.in.aster, to import a set of images but, I’m not sure for that is used the following:
grass.debug(“gdalwarp -t_srs %s %s %s” % (proj, srcfile, tempfile))
WHat is the point of using grass.debug if I do the following after this:

if platform.system() == “Darwin”:
cmd = [“arch”, “-i386”, “gdalwarp”, “-t_srs”, proj, srcfile, tempfile ]
else:
cmd = [“gdalwarp”, “-t_srs”, proj, srcfile, tempfile ]
p = grass.call(cmd)
if p != 0:
#check to see if gdalwarp executed properly
return

Thanks

Luisa

Luisa Peña wrote:

I'm doing a Python script, based on r.in.aster, to import a set of images
but, I'm not sure for that is used the following:
    grass.debug("gdalwarp -t_srs %s %s %s" % (proj, srcfile, tempfile))
WHat is the point of using grass.debug

grass.debug prints a debugging message if DEBUG is set.

It's just an interface to "g.message -d ...":

def debug(msg, debug = 1):
    run_command("g.message", flags = 'd', message = msg, debug = debug)

--
Glynn Clements <glynn@gclements.plus.com>