Procházet zdrojové kódy

update d.what.rast and d.what.vect to the new monitor architecture

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64428 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa před 10 roky
rodič
revize
bd851f6f63

+ 4 - 2
scripts/d.what.rast/d.what.rast.py

@@ -5,7 +5,7 @@
 # MODULE:    d.what.rast
 # AUTHOR(S): Anna Petrasova <kratochanna gmail.com>
 # PURPOSE:   Script for querying raster maps in d.mon
-# COPYRIGHT: (C) 2014 by the GRASS Development Team
+# COPYRIGHT: (C) 2014-2015 by the GRASS Development Team
 #
 #		This program is free software under the GNU General
 #		Public License (>=v2). Read the file COPYING that
@@ -30,7 +30,9 @@ def main():
     options, flags = gcore.parser()
     gisenv = gcore.gisenv()
     if 'MONITOR' in gisenv:
-        cmd_file = gisenv['MONITOR_{monitor}_CMDFILE'.format(monitor=gisenv['MONITOR'].upper())]
+        cmd_file = gcore.parse_command('d.info', flags='s').get('cmd', None)
+        if not cmd_file:
+            gcore.fatal(_("Unable to open file '%s'") % cmd_file)
         dout_cmd = 'd.what.rast'
         for param, val in options.iteritems():
             if val:

+ 3 - 1
scripts/d.what.vect/d.what.vect.py

@@ -30,7 +30,9 @@ def main():
     options, flags = gcore.parser()
     gisenv = gcore.gisenv()
     if 'MONITOR' in gisenv:
-        cmd_file = gisenv['MONITOR_{monitor}_CMDFILE'.format(monitor=gisenv['MONITOR'].upper())]
+        cmd_file = gcore.parse_command('d.info', flags='s').get('cmd', None)
+        if not cmd_file:
+            gcore.fatal(_("Unable to open file '%s'") % cmd_file)
         dout_cmd = 'd.what.vect'
         for param, val in options.iteritems():
             if val: