本文整理汇总了Python中processing.core.ProcessingUtils.ProcessingUtils.userFolder方法的典型用法代码示例。如果您正苦于以下问题:Python ProcessingUtils.userFolder方法的具体用法?Python ProcessingUtils.userFolder怎么用?Python ProcessingUtils.userFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.core.ProcessingUtils.ProcessingUtils
的用法示例。
在下文中一共展示了ProcessingUtils.userFolder方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: modelsFolder
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def modelsFolder():
folder = ProcessingConfig.getSetting(ModelerUtils.MODELS_FOLDER)
if folder == None:
folder = unicode(os.path.join(ProcessingUtils.userFolder(), "models"))
mkdir(folder)
return os.path.abspath(folder)
示例2: RScriptsFolder
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def RScriptsFolder():
folder = ProcessingConfig.getSetting(RUtils.RSCRIPTS_FOLDER)
if folder == None:
folder = unicode(os.path.join(ProcessingUtils.userFolder(), "rscripts"))
mkdir(folder)
return os.path.abspath(folder)
示例3: sagaBatchJobFilename
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def sagaBatchJobFilename():
if ProcessingUtils.isWindows():
filename = "saga_batch_job.bat"
else:
filename = "saga_batch_job.sh"
batchfile = ProcessingUtils.userFolder() + os.sep + filename
return batchfile
示例4: createGrassScript
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def createGrassScript(commands):
folder = GrassUtils.grassPath()
shell = GrassUtils.grassWinShell()
script = GrassUtils.grassScriptFilename()
gisrc = ProcessingUtils.userFolder() + os.sep + "processing.gisrc"
#temporary gisrc file
output = open(gisrc, "w")
location = "temp_location"
gisdbase = GrassUtils.grassDataFolder()
#gisdbase = os.path.join(os.path.expanduser("~"), "processing", "tempdata", "grassdata")
output.write("GISDBASE: " + gisdbase + "\n");
output.write("LOCATION_NAME: " + location + "\n");
output.write("MAPSET: PERMANENT \n");
output.write("GRASS_GUI: text\n");
output.close()
output=open(script, "w")
output.write("set HOME=" + os.path.expanduser("~") + "\n");
output.write("set GISRC=" + gisrc + "\n")
output.write("set GRASS_SH=" + shell + "\\bin\\sh.exe\n")
output.write("set PATH=" + shell + os.sep + "bin;" + shell + os.sep + "lib;" + "%PATH%\n")
output.write("set WINGISBASE=" + folder + "\n")
output.write("set GISBASE=" + folder + "\n");
output.write("set GRASS_PROJSHARE=" + folder + os.sep + "share" + os.sep + "proj" + "\n")
output.write("set GRASS_MESSAGE_FORMAT=gui\n")
#Replacement code for etc/Init.bat
output.write("if \"%GRASS_ADDON_PATH%\"==\"\" set PATH=%WINGISBASE%\\bin;%WINGISBASE%\\lib;%PATH%\n")
output.write("if not \"%GRASS_ADDON_PATH%\"==\"\" set PATH=%WINGISBASE%\\bin;%WINGISBASE%\\lib;%GRASS_ADDON_PATH%;%PATH%\n")
output.write("\n")
output.write("set GRASS_VERSION=" + GrassUtils.getGrassVersion() + "\n")
output.write("if not \"%LANG%\"==\"\" goto langset\n")
output.write("FOR /F \"usebackq delims==\" %%i IN (`\"%WINGISBASE%\\etc\\winlocale\"`) DO @set LANG=%%i\n")
output.write(":langset\n")
output.write("\n")
output.write("set PATHEXT=%PATHEXT%;.PY\n")
output.write("set PYTHONPATH=%PYTHONPATH%;%WINGISBASE%\\etc\\python;%WINGISBASE%\\etc\\wxpython\\n")
output.write("\n")
output.write("g.gisenv.exe set=\"MAPSET=PERMANENT\"\n")
output.write("g.gisenv.exe set=\"LOCATION=" + location + "\"\n")
output.write("g.gisenv.exe set=\"LOCATION_NAME=" + location + "\"\n")
output.write("g.gisenv.exe set=\"GISDBASE=" + gisdbase + "\"\n")
output.write("g.gisenv.exe set=\"GRASS_GUI=text\"\n")
for command in commands:
output.write(command + "\n")
output.write("\n");
output.write("exit\n");
output.close();
示例5: prepareGrassExecution
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def prepareGrassExecution(commands):
if ProcessingUtils.isWindows():
GrassUtils.createGrassScript(commands)
command = ["cmd.exe", "/C ", GrassUtils.grassScriptFilename()]
else:
gisrc = ProcessingUtils.userFolder() + os.sep + "processing.gisrc"
os.putenv("GISRC", gisrc)
os.putenv("GRASS_MESSAGE_FORMAT", "gui")
os.putenv("GRASS_BATCH_JOB", GrassUtils.grassBatchJobFilename())
GrassUtils.createGrassBatchJobFileFromGrassCommands(commands)
os.chmod(GrassUtils.grassBatchJobFilename(), stat.S_IEXEC | stat.S_IREAD | stat.S_IWRITE)
if ProcessingUtils.isMac():
command = GrassUtils.grassPath() + os.sep + "grass.sh " + GrassUtils.grassMapsetFolder() + "/PERMANENT"
else:
command = "grass64 " + GrassUtils.grassMapsetFolder() + "/PERMANENT"
return command
示例6: commandsFolder
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def commandsFolder(self):
folder = unicode(os.path.join(ProcessingUtils.userFolder(), "commander"))
mkdir(folder)
return os.path.abspath(folder)
示例7: logFilename
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def logFilename():
batchfile = ProcessingUtils.userFolder() + os.sep + "processing_qgis.log"
return batchfile
示例8: getRScriptFilename
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def getRScriptFilename():
return ProcessingUtils.userFolder() + os.sep + "processing_script.r"
示例9: configFile
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def configFile():
return os.path.join(ProcessingUtils.userFolder(), "processing_qgis.conf")
示例10: tempFileListFilepath
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def tempFileListFilepath():
filename = "fusion_files_list.txt";
filepath = ProcessingUtils.userFolder() + os.sep + filename
return filepath
示例11: WpsDescriptionFolder
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def WpsDescriptionFolder():
folder = ProcessingConfig.getSetting(WpsAlgorithmProvider.WPS_DESCRIPTIONS)
if folder == None:
folder = unicode(os.path.join(ProcessingUtils.userFolder(), "wps"))
mkdir(folder)
return os.path.abspath(folder)
示例12: grassScriptFilename
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def grassScriptFilename():
'''this is used in windows. We create a script that initializes
GRASS and then uses grass commands'''
filename = "grass_script.bat"
filename = ProcessingUtils.userFolder() + os.sep + filename
return filename
示例13: grassBatchJobFilename
# 需要导入模块: from processing.core.ProcessingUtils import ProcessingUtils [as 别名]
# 或者: from processing.core.ProcessingUtils.ProcessingUtils import userFolder [as 别名]
def grassBatchJobFilename():
'''This is used in linux. This is the batch job that we assign to
GRASS_BATCH_JOB and then call GRASS and let it do the work'''
filename = "grass_batch_job.sh"
batchfile = ProcessingUtils.userFolder() + os.sep + filename
return batchfile