mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
This commit sets a different way of handling SAGA versions and a new way of checking saga installations This is done to fix the messy situation that SAGA causes due to its API changing in each release.
25 lines
604 B
Python
25 lines
604 B
Python
import os
|
|
import subprocess
|
|
|
|
def convertUiFile(f):
|
|
|
|
command = ["pyuic4.bat", f, "-o", "ui_" + os.path.splitext(f)[0] + ".py"]
|
|
|
|
proc = subprocess.Popen(
|
|
command,
|
|
shell=True,
|
|
stdout=subprocess.PIPE,
|
|
stdin=open(os.devnull),
|
|
stderr=subprocess.STDOUT,
|
|
universal_newlines=True,
|
|
).stdout
|
|
lines = []
|
|
for line in iter(proc.readline, ''):
|
|
pass
|
|
|
|
|
|
if __name__ == '__main__':
|
|
folder = "."
|
|
for descriptionFile in os.listdir(folder):
|
|
if descriptionFile.endswith('ui'):
|
|
convertUiFile(descriptionFile) |