From f83150d9d1be03cff23d2cd5336bfe0ee8fcf505 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 4 Jul 2018 18:18:10 +0200 Subject: [PATCH] check dir exsit for otb install --- otb/OTBAlgorithmProvider.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/otb/OTBAlgorithmProvider.py b/otb/OTBAlgorithmProvider.py index 690f35e..66b167a 100755 --- a/otb/OTBAlgorithmProvider.py +++ b/otb/OTBAlgorithmProvider.py @@ -77,7 +77,7 @@ class OTBAlgorithmProvider(QgsProcessingProvider): otb_app_dirs = self.otb_app_dir_list(v) if len(otb_app_dirs) < 1: self.setActive(False) - raise ValueError(self.tr("Invalid path given for 'OTB application folder'. OTB provider will be disabled")) + raise ValueError(self.tr("'{}' does not exist. OTB provider will be disabled".format(v))) #isValid is True if there is atleast one valid otb application is given path isValid = False @@ -121,6 +121,8 @@ class OTBAlgorithmProvider(QgsProcessingProvider): if not self.isActive(): return if not v or not os.path.exists(v): + self.setActive(False) + raise ValueError(self.tr("'{}' does not exist. OTB provider will be disabled".format(v))) return path = self.normalize_path(v) if not os.path.exists(os.path.join(path,'bin', otb_exe_file('otbApplicationLauncherCommandLine'))): -- GitLab