[GRASS-SVN] r57559 - grass/trunk/lib/python/pygrass/modules/grid

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 30 15:18:01 PDT 2013


Author: zarch
Date: 2013-08-30 15:18:01 -0700 (Fri, 30 Aug 2013)
New Revision: 57559

Modified:
   grass/trunk/lib/python/pygrass/modules/grid/grid.py
Log:
Small fixes when create a new directory

Modified: grass/trunk/lib/python/pygrass/modules/grid/grid.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/grid/grid.py	2013-08-30 17:14:21 UTC (rev 57558)
+++ grass/trunk/lib/python/pygrass/modules/grid/grid.py	2013-08-30 22:18:01 UTC (rev 57559)
@@ -53,8 +53,8 @@
     per_new = os.path.join(path, 'PERMANENT')
     map_old = mapset.path()
     map_new = os.path.join(path, mapset.name)
-    if not os.path.isdir(path):
-        os.makedirs(path)
+    if not os.path.isdir(per_new):
+        os.makedirs(per_new)
     if not os.path.isdir(map_new):
         os.mkdir(map_new)
     for f in (fi for fi in os.listdir(per_old) if fi.isupper()):
@@ -100,6 +100,7 @@
         dst.current()
         rupck(input=file_dst, output=rast, overwrite=True)
         os.remove(file_dst)
+    return gisrc_src, gisrc_dst
 
 
 def get_cmd(cmdd):
@@ -201,10 +202,15 @@
         self.start_col = start_col
         self.out_prefix = out_prefix
         self.n_mset = None
+        self.gisrc_src = self.gisrc_dst = None
         if move:
             self.n_mset = copy_mapset(self.mset, move)
-            copy_raster(select(self.module.inputs, 'raster'),
-                        self.mset, self.n_mset, region=self.region)
+            rasters = select(self.module.inputs, 'raster')
+            self.gisrc_src, self.gisrc_dst = copy_raster(rasters,
+                                                         self.mset,
+                                                         self.n_mset,
+                                                         region=self.region)
+
         self.bboxes = split_region_tiles(region=region,
                                          width=width, height=height,
                                          overlap=overlap)



More information about the grass-commit mailing list