Commit 904c3b13 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

fix version file parsing (not saved in config)

parent 24be1f26
......@@ -81,6 +81,8 @@ class OTBAlgorithmProvider(QgsProcessingProvider):
for otb_app in os.listdir(app_dir):
if not otb_app.startswith('otbapp_'):
if otb_app in ['TestApplication','ApplicationExample']:
app_name = os.path.basename(otb_app).split('.')[0][7:]
dfile = os.path.join(descr_folder, app_name + '.txt')
isValid = True
......@@ -108,9 +110,9 @@ class OTBAlgorithmProvider(QgsProcessingProvider):
raise ValueError("Cannot find '{}'. OTB will be disabled".format(os.path.join(v,'bin', 'otbApplicationLauncherCommandLine'))))
# install_dir #otb issue 1557
version_file = os.path.join(v, 'share', 'doc', 'OTB-6.5', 'VERSION')
version_file = os.path.join(v, 'share', 'doc', 'OTB-6.6', 'VERSION')
# build_dir
if os.path.isfile(version_file):
if not os.path.isfile(version_file):
version_file = os.path.join(v, 'VERSION')
if os.path.isfile(version_file):
with open(version_file) as vf:
......@@ -118,8 +120,8 @@ class OTBAlgorithmProvider(QgsProcessingProvider):
vlines = [l.strip() for l in vlines]
vline = vlines[0]
if 'OTB Version:' in vline:
self.version = vline.split(':')[1]
ProcessingConfig.setSettingValue(OTBUtils.VERSION, self.version)
self.version = vline.split(':')[1].strip()
#ProcessingConfig.setSettingValue(OTBUtils.VERSION, self.version)
env_profile = os.path.join(v, 'otbenv.profile')
if os.path.isfile(env_profile):
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