[GRASS-SVN] r72465 - in grass-addons/grass7/imagery: i.signature.copy i.signature.list

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 21 07:39:48 PDT 2018


Author: lucadelu
Date: 2018-03-21 07:39:48 -0700 (Wed, 21 Mar 2018)
New Revision: 72465

Modified:
   grass-addons/grass7/imagery/i.signature.copy/i.signature.copy.py
   grass-addons/grass7/imagery/i.signature.list/i.signature.list.py
Log:
i.signature.*: fixed path to signature files

Modified: grass-addons/grass7/imagery/i.signature.copy/i.signature.copy.py
===================================================================
--- grass-addons/grass7/imagery/i.signature.copy/i.signature.copy.py	2018-03-21 13:07:11 UTC (rev 72464)
+++ grass-addons/grass7/imagery/i.signature.copy/i.signature.copy.py	2018-03-21 14:39:48 UTC (rev 72465)
@@ -93,9 +93,9 @@
         mapset = gisenv['MAPSET']
     
     ipath = os.path.join(gisenv['GISDBASE'], gisenv['LOCATION_NAME'],
-                         mapset, name, 'subgroup', isub, isign)
+                         mapset, name, 'subgroup', isub, 'sig', isign)
     if not os.path.exists(ipath):
-        grass.fatal(_("<{}> does not exist".format(ipath)))
+        grass.fatal(_("Signature file <{}> does not exist".format(ipath)))
     
     # try to split output group and mapset
     try:
@@ -105,7 +105,7 @@
         omapset = gisenv['MAPSET']
 
     opath = os.path.join(gisenv['GISDBASE'], gisenv['LOCATION_NAME'],
-                         omapset, oname, 'subgroup', osub)
+                         omapset, oname, 'subgroup', osub, 'sig')
     if not os.path.exists(opath):
         grass.fatal(_("<{pa}> does not exist, do group <{gr}> and "
                       "subgroup <{su}> exist?".format(pa=ipath, gr=ogroup,

Modified: grass-addons/grass7/imagery/i.signature.list/i.signature.list.py
===================================================================
--- grass-addons/grass7/imagery/i.signature.list/i.signature.list.py	2018-03-21 13:07:11 UTC (rev 72464)
+++ grass-addons/grass7/imagery/i.signature.list/i.signature.list.py	2018-03-21 14:39:48 UTC (rev 72465)
@@ -66,7 +66,7 @@
                           " {ma}".format(na=name, loc=gisenv['LOCATION_NAME'],
                                          ma=mapset)))
         if sub:
-            path = os.path.join(path, 'subgroup', sub)
+            path = os.path.join(path, 'subgroup', sub, 'sig')
             if not os.path.exists(path):
                 grass.fatal(_("No subgroups with name {na} in group "
                               "{gr}".format(na=sub, gr=name)))
@@ -84,7 +84,7 @@
                 grass.fatal(_("No subgroups for group {gr}".format(gr=name)))
             for di in os.listdir(path):
                 print("    Subgroup: {}".format(di))
-                for sig in os.listdir(os.path.join(path, di)):
+                for sig in os.listdir(os.path.join(path, di, 'sig')):
                     if sig != 'REF':
                         print("        {}".format(sig))
     else:
@@ -100,7 +100,7 @@
                 continue
             for di in os.listdir(os.path.join(path, gr, 'subgroup')):
                 print("    Subgroup: {}".format(di))
-                for sig in os.listdir(os.path.join(path, gr, 'subgroup', di)):
+                for sig in os.listdir(os.path.join(path, gr, 'subgroup', di, 'sig')):
                     if sig != 'REF':
                         print("        {}".format(sig))
                 



More information about the grass-commit mailing list