Skip to content

Commit d80d3cf

Browse files
committedSep 22, 2012
fixed #6295
did some cleaning in GrassAlgorithm.py
1 parent 73fcb66 commit d80d3cf

File tree

2 files changed

+1
-74
lines changed

2 files changed

+1
-74
lines changed
 

‎python/plugins/sextante/grass/GrassAlgorithm.py

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -103,67 +103,9 @@ def defineCharacteristicsFromFile(self):
103103
raise e
104104
lines.close()
105105

106-
#=======================================================================
107-
# self.xmin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMIN)
108-
# self.xmax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMAX)
109-
# self.ymin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMIN)
110-
# self.ymax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMAX)
111-
# extentString = str(self.xmin) + "," + str(self.xmax) + str(self.xmin) + "," + str(self.xmax)
112-
# self.cellsize = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_CELLSIZE)
113-
#=======================================================================
114106
self.addParameter(ParameterExtent(self.GRASS_REGION_EXTENT_PARAMETER, "GRASS region extent"))
115107
self.addParameter(ParameterNumber(self.GRASS_REGION_CELLSIZE_PARAMETER, "GRASS region cellsize", 0, None, 1))
116108

117-
#===============================================================================
118-
# def calculateRegion(self):
119-
# auto = SextanteConfig.getSetting(GrassUtils.GRASS_AUTO_REGION)
120-
# if auto:
121-
# try:
122-
# self.cellsize = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_CELLSIZE)
123-
# except Exception:
124-
# self.cellsize = 0;
125-
# first = True;
126-
# for param in self.parameters:
127-
# if param.value:
128-
# if isinstance(param, (ParameterRaster, ParameterVector)):
129-
# if isinstance(param.value, (QgsRasterLayer, QgsVectorLayer)):
130-
# layer = param.value
131-
# else:
132-
# layer = QGisLayers.getObjectFromUri(param.value)
133-
# self.addToRegion(layer, first)
134-
# first = False
135-
# elif isinstance(param, ParameterMultipleInput):
136-
# layers = param.value.split(";")
137-
# for layername in layers:
138-
# layer = QGisLayers.getObjectFromUri(layername, first)
139-
# self.addToRegion(layer, first)
140-
# first = False
141-
# if self.cellsize == 0:
142-
# self.cellsize = 1
143-
# else:
144-
# self.xmin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMIN)
145-
# self.xmax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMAX)
146-
# self.ymin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMIN)
147-
# self.ymax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMAX)
148-
# self.cellsize = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_CELLSIZE)
149-
#
150-
#
151-
# def addToRegion(self, layer, first):
152-
# if first:
153-
# self.xmin = layer.extent().xMinimum()
154-
# self.xmax = layer.extent().xMaximum()
155-
# self.ymin = layer.extent().yMinimum()
156-
# self.ymax = layer.extent().yMaximum()
157-
# if isinstance(layer, QgsRasterLayer):
158-
# self.cellsize = (layer.extent().xMaximum() - layer.extent().xMinimum())/layer.width()
159-
# else:
160-
# self.xmin = min(self.xmin, layer.extent().xMinimum())
161-
# self.xmax = max(self.xmax, layer.extent().xMaximum())
162-
# self.ymin = min(self.ymin, layer.extent().yMinimum())
163-
# self.ymax = max(self.ymax, layer.extent().yMaximum())
164-
# if isinstance(layer, QgsRasterLayer):
165-
# self.cellsize = max(self.cellsize, (layer.extent().xMaximum() - layer.extent().xMinimum())/layer.width())
166-
#===============================================================================
167109

168110
def processAlgorithm(self, progress):
169111
if SextanteUtils.isWindows():
@@ -327,18 +269,3 @@ def getTempFilename(self):
327269

328270
def commandLineName(self):
329271
return "grass:" + self.name[:self.name.find(" ")]
330-
331-
#===============================================================================
332-
# def checkBeforeOpeningParametersDialog(self):
333-
# for param in self.parameters:
334-
# if isinstance(param, (ParameterRaster, ParameterVector)):
335-
# return None
336-
# if isinstance(param, ParameterMultipleInput):
337-
# if not param.optional:
338-
# return None
339-
#
340-
# if SextanteConfig.getSetting(GrassUtils.GRASS_AUTO_REGION):
341-
# return "This algorithm cannot be run with the 'auto-region' setting\nPlease set a GRASS region before running it"
342-
# else:
343-
# return None
344-
#===============================================================================

‎python/plugins/sextante/r/RAlgorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def getImportCommands(self):
230230
# if rgdal is not available, try to install it
231231
# just use US mirror
232232
commands.append('options("repos"="http://cran.us.r-project.org")')
233-
rLibDir = "%s/rlibs" % SextanteUtils.userFolder()
233+
rLibDir = "%s/rlibs" % SextanteUtils.userFolder().replace("\\","/")
234234
if not os.path.isdir(rLibDir): os.mkdir(rLibDir)
235235
commands.append(
236236
'tryCatch(find.package("rgdal"), error=function(e) install.packages("rgdal", lib="%s"))' % rLibDir)

0 commit comments

Comments
 (0)
Please sign in to comment.