[GRASS-dev] pygrass

Nikos Alexandris nik at nikosalexandris.net
Fri Mar 13 02:15:05 PDT 2015


Hi PyGRASSers,

I am not exactly familiar with "grass.exceptions" modules.  Am I 
correct in doing the following:

--%<---
# transfer timestamps, if any
if timestamps:
     try:
         datetime = grass.read_command("r.timestamp", map=image)
         run("r.timestamp", map=tmp_cdn, date=datetime)

         msg = "\n|i Timestamping: %s" % datetime
         g.message(msg)

     except CalledModuleError:
         grass.fatal(_('\n|* Timestamp missing from input map! '
         'If you insist to continue without timestamps, '
         'you may use the -t flag.'))
--->%--

or is there a better, more appropriate way?  I've seen some examples in 
existing scripts.

Thanks, Nikos



More information about the grass-dev mailing list