File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 11import os
2+ import shutil
23import subprocess as sp
4+ from pathlib import Path
5+ import platform
36
47from omv .common .inout import inform , trim_path , is_verbose , check_output
58from omv .engines .engine import OMVEngine , EngineExecutionError
@@ -14,8 +17,19 @@ def get_environment():
1417
1518 if 'JNML_HOME' in os .environ :
1619 jnmlhome = os .environ ['JNML_HOME' ]
20+ elif shutil .which ("jnml" ) is not None :
21+ jnmlhome = Path (shutil .which ("jnml" )).parent
1722 else :
18- jnmlhome = os .path .join (os .environ ['HOME' ],'jnml/jNeuroMLJar' )
23+ osname = platform .system ()
24+ if osname == "Linux" :
25+ try :
26+ jnmlhome = os .path .join (os .environ ['XDG_DATA_HOME' ],'jnml/jNeuroMLJar' )
27+ except KeyError as e :
28+ jnmlhome = os .path .join (os .environ ['HOME' ],'.local/share/jnml/jNeuroMLJar' )
29+ elif osname == "Darwin" :
30+ jnmlhome = os .path .join (os .environ ['HOME' ],'Library/jnml/jNeuroMLJar' )
31+ else :
32+ jnmlhome = os .path .join (os .environ ['HOME' ],'jnml/jNeuroMLJar' )
1933
2034 environment_vars = {'JNML_HOME' : jnmlhome }
2135
You can’t perform that action at this time.
0 commit comments