当前位置: 首页>>代码示例>>Python>>正文


Python SextanteConfig.setSettingValue方法代码示例

本文整理汇总了Python中sextante.core.SextanteConfig.SextanteConfig.setSettingValue方法的典型用法代码示例。如果您正苦于以下问题:Python SextanteConfig.setSettingValue方法的具体用法?Python SextanteConfig.setSettingValue怎么用?Python SextanteConfig.setSettingValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sextante.core.SextanteConfig.SextanteConfig的用法示例。


在下文中一共展示了SextanteConfig.setSettingValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from sextante.core.SextanteConfig import SextanteConfig [as 别名]
# 或者: from sextante.core.SextanteConfig.SextanteConfig import setSettingValue [as 别名]
 def setUp(self):
     SextanteConfig.setSettingValue(SextanteConfig.USE_THREADS, self.threaded)
     print
     print bcolors.INFO, self.msg, bcolors.ENDC,
     print "Parameters: ", self.alg.parameters,
     print "Outputs: ", [out for out in self.alg.outputs if not out.hidden],
     self.args = list(self.gen_test_parameters(self.alg, True))
     print ' => ', self.args, bcolors.WARNING,
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:10,代码来源:test.py

示例2: fillCoords

# 需要导入模块: from sextante.core.SextanteConfig import SextanteConfig [as 别名]
# 或者: from sextante.core.SextanteConfig.SextanteConfig import setSettingValue [as 别名]
 def fillCoords(self):
     r = self.tool.rectangle()
     SextanteConfig.setSettingValue(GrassUtils.GRASS_REGION_XMIN, r.xMinimum())
     SextanteConfig.setSettingValue(GrassUtils.GRASS_REGION_YMIN, r.yMinimum())
     SextanteConfig.setSettingValue(GrassUtils.GRASS_REGION_XMAX, r.xMaximum())
     SextanteConfig.setSettingValue(GrassUtils.GRASS_REGION_YMAX, r.yMaximum())
     SextanteConfig.setSettingValue(GrassUtils.GRASS_AUTO_REGION, False)
     s = str(r.xMinimum()) + "," + str(r.xMaximum()) + "," + str(r.yMinimum()) + "," + str(r.yMaximum())
     self.tool.reset()
     canvas = QGisLayers.iface.mapCanvas()
     canvas.setMapTool(self.prevMapTool)
     QtGui.QMessageBox.information(None, "GRASS Region", "GRASS region set to:\n" + s + \
                                   "\nTo set the cellsize or set back the autoregion option,\ngo to the SEXTANTE configuration.")
开发者ID:mokerjoke,项目名称:Quantum-GIS,代码行数:15,代码来源:DefineGrassRegionAction.py

示例3: execute

# 需要导入模块: from sextante.core.SextanteConfig import SextanteConfig [as 别名]
# 或者: from sextante.core.SextanteConfig.SextanteConfig import setSettingValue [as 别名]
 def execute(self):
     layers = QGisLayers.getAllLayers();
     layersMap = dict([(layer.name(), layer) for layer in layers])
     layerNames = [layer.name() for layer in layers]
     item, ok = QtGui.QInputDialog.getItem(None, "Select a layer", "Layer selection", layerNames, editable=False)
     if ok:
         layer = layersMap[item]
         SextanteConfig.setSettingValue(GrassUtils.GRASS_REGION_XMIN, layer.extent().xMinimum())
         SextanteConfig.setSettingValue(GrassUtils.GRASS_REGION_YMIN, layer.extent().yMinimum())
         SextanteConfig.setSettingValue(GrassUtils.GRASS_REGION_XMAX, layer.extent().xMaximum())
         SextanteConfig.setSettingValue(GrassUtils.GRASS_REGION_YMAX, layer.extent().yMaximum())
         SextanteConfig.setSettingValue(GrassUtils.GRASS_AUTO_REGION, False)
         s = str(layer.extent().xMinimum()) + "," + str(layer.extent().xMaximum()) + "," + str(layer.extent().yMinimum()) + "," + str(layer.extent().yMaximum())
         QtGui.QMessageBox.information(None, "GRASS Region", "GRASS region set to:\n" + s + \
                                   "\nTo set the cellsize or set back the autoregion option,\ngo to the SEXTANTE configuration.")
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:17,代码来源:DefineGrassRegionFromLayerAction.py

示例4: addToLog

# 需要导入模块: from sextante.core.SextanteConfig import SextanteConfig [as 别名]
# 或者: from sextante.core.SextanteConfig.SextanteConfig import setSettingValue [as 别名]
 def addToLog(msgtype, msg):
     try: #it seems that this fails sometimes depending on the msg added:
         #To avoid it stopping the normal functioning of the algorithm,
         #we catch all errors, assuming that is better to miss some log info
         #that breaking the algorithm.
         if isinstance(msg, list):
             a = "|".join(m.strip("\n")  for m in msg)
             text = a
         else:
             text = msg.replace("\n", "|")
         line = msgtype + "|" + datetime.datetime.now().strftime(SextanteLog.DATE_FORMAT).decode("utf-8") + "|" + text + "\n"
         logfile = codecs.open(SextanteLog.logFilename(), "a", encoding="utf-8")
         #logfile = codecs.open(SextanteLog.logFilename(), "a", encoding='utf-8')
         logfile.write(line)
         logfile.close()
         if msgtype==SextanteLog.LOG_ALGORITHM:
            algname = text[len("Sextante.runalg(\""):]
            algname = algname[:algname.index("\"")]
            if algname not in SextanteLog.recentAlgs:
                SextanteLog.recentAlgs.append(algname)
                recentAlgsString = ';'.join(SextanteLog.recentAlgs[-6:])
                SextanteConfig.setSettingValue(SextanteConfig.RECENT_ALGORITHMS, recentAlgsString)
     except:
         pass
开发者ID:Hardysong,项目名称:Quantum-GIS,代码行数:26,代码来源:SextanteLog.py


注:本文中的sextante.core.SextanteConfig.SextanteConfig.setSettingValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。