Skip to content

Commit

Permalink
Make SEGYImport work great again on windows (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
roywilly authored Mar 24, 2023
1 parent a7f5aea commit afb37e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/fmu/sumo/uploader/_fileondisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ def _get_segyimport_cmdstr(blob_url, object_id, file_path, sample_unit):
url_conn = '"Suffix=?' + blob_url["auth"] + '"'
persistent_id = '"' + object_id + '"'

pythonPath = os.path.dirname(sys.executable)
path_to_SEGYImport = os.path.join(pythonPath, '..', 'bin', 'SEGYImport')
python_path = os.path.dirname(sys.executable)
path_to_SEGYImport = os.path.join(python_path, '..', 'bin', 'SEGYImport')
if sys.platform.startswith("win"):
path_to_SEGYImport = path_to_SEGYImport + ".exe"
if not os.path.isfile(path_to_SEGYImport):
path_to_SEGYImport = os.path.join(python_path, '..', 'shims', 'SEGYImport')


cmdstr = ' '.join([path_to_SEGYImport,
'--compression-method', 'RLE',
'--brick-size', '64',
Expand Down
2 changes: 2 additions & 0 deletions tests/test_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ def test_openvds_available(token):
python_path = os.path.dirname(sys.executable)
logger.info(python_path)
path_to_SEGYImport = os.path.join(python_path, '..', 'bin', 'SEGYImport')
if sys.platform.startswith("win"):
path_to_SEGYImport = path_to_SEGYImport + ".exe"
if not os.path.isfile(path_to_SEGYImport):
path_to_SEGYImport = os.path.join(python_path, '..', 'shims', 'SEGYImport')

Expand Down

0 comments on commit afb37e9

Please sign in to comment.