Unverified Commit 4ccc89da authored by Julien Veyssier's avatar Julien Veyssier
Browse files

attempt to implement macos compat, crashing in parallel step2


Signed-off-by: default avatarJulien Veyssier <eneiluj@posteo.net>
parent d6aef63c
......@@ -45,11 +45,17 @@ from hrudelin.pluginUtils.tools import isWindows, isMac, which, prepareGrassEnv
from multiprocessing import cpu_count
import multiprocessing
if platform.system() == 'Windows':
#if platform.system() == 'Windows':
if isWindows():
path = os.path.abspath(os.path.join(sys.exec_prefix, '../../bin/pythonw3.exe'))
multiprocessing.set_executable(path)
sys.argv = [None]
print('fix multiprocess for windows in plugin %s'%os.path.abspath(os.path.join(sys.exec_prefix, '../../bin/pythonw3.exe')))
elif isMac():
path = os.path.abspath(os.path.join(sys.exec_prefix, 'bin/python3'))
multiprocessing.set_executable(path)
sys.argv = [None]
print('fix multiprocess for Mac in plugin %s'%os.path.abspath(os.path.join(sys.exec_prefix, 'bin/python3')))
prepareGrassEnv()
from hrudelin.hrudelinCore.modules.hrudelin_1_init import main as main1
......
......@@ -45,6 +45,12 @@ def prepareGrassEnv():
pass
elif isMac():
qgisContents = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(sys.exec_prefix))))
for grassVersion in ['74', '75', '76', '77', '78', '79']:
candidatePath = os.path.join(qgisContents, 'Resources', 'grass7')
if os.path.isfile(os.path.join(candidatePath, 'bin', 'grass%s' % grassVersion)):
grassBasePath = candidatePath
break
pass
else:
grassBasePath = subprocess.check_output(['grass', '--config', 'path']).decode('utf-8').rstrip(os.linesep)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment