mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
from PyQt4.QtCore import *
|
|
from PyQt4.QtGui import *
|
|
import subprocess
|
|
from sextante.core.SextanteLog import SextanteLog
|
|
from sextante.core.SextanteConfig import SextanteConfig
|
|
import os
|
|
from sextante.core.SextanteUtils import SextanteUtils
|
|
|
|
class FusionUtils():
|
|
|
|
FUSION_FOLDER = "FUSION_FOLDER"
|
|
|
|
@staticmethod
|
|
def FusionPath():
|
|
folder = SextanteConfig.getSetting(FusionUtils.FUSION_FOLDER)
|
|
if folder == None:
|
|
folder =""
|
|
|
|
return folder
|
|
|
|
@staticmethod
|
|
def tempFileListFilepath():
|
|
filename = "fusion_files_list.txt";
|
|
filepath = SextanteUtils.userFolder() + os.sep + filename
|
|
return filepath
|
|
|
|
@staticmethod
|
|
def createFileList(files):
|
|
out = open(FusionUtils.tempFileListFilepath(), "w")
|
|
for f in files:
|
|
out.write(f + "\n")
|
|
out.close()
|
|
|
|
@staticmethod
|
|
def runFusion(commands, progress):
|
|
loglines = []
|
|
loglines.append("Fusion execution console output")
|
|
proc = subprocess.Popen(commands, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE,stderr=subprocess.STDOUT, universal_newlines=False).stdout
|
|
for line in iter(proc.readline, ""):
|
|
loglines.append(line)
|
|
SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines) |