From 1bbc40c54772e3114549698013068e16ccc9cb11 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Wed, 13 Jul 2016 16:46:39 +0200 Subject: [PATCH] Fix CEA 1868: python plugins MG-Cleaner and MG-SurfOpt does not launch when clicking on compute Bug found after 7.8.0 tag. Code reported from master. --- src/Tools/MGCleanerPlug/MGCleanerMonViewText.py | 7 +++++++ src/Tools/YamsPlug/monViewText.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py b/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py index e4030cc44..e10f673ef 100644 --- a/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py +++ b/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py @@ -84,12 +84,19 @@ class MGCleanerMonViewText(Ui_ViewExe, QDialog): f.write(cmds) f.close() + self.make_executable(nomFichier) + maBidouille=nomFichier self.monExe.start(maBidouille) self.monExe.closeWriteChannel() self.enregistreResultatsDone=False self.show() + def make_executable(self, path): + mode = os.stat(path).st_mode + mode |= (mode & 0o444) >> 2 # copy R bits to X + os.chmod(path, mode) + def saveFile(self): #recuperation du nom du fichier savedir=os.environ['HOME'] diff --git a/src/Tools/YamsPlug/monViewText.py b/src/Tools/YamsPlug/monViewText.py index 7d02228e4..b8c537452 100644 --- a/src/Tools/YamsPlug/monViewText.py +++ b/src/Tools/YamsPlug/monViewText.py @@ -68,12 +68,19 @@ class MonViewText(Ui_ViewExe, QDialog): f.write(cmds) f.close() + self.make_executable(nomFichier) + maBidouille=nomFichier self.monExe.start(maBidouille) self.monExe.closeWriteChannel() self.enregistreResultatsDone=False self.show() + def make_executable(self, path): + mode = os.stat(path).st_mode + mode |= (mode & 0o444) >> 2 # copy R bits to X + os.chmod(path, mode) + def saveFile(self): #recuperation du nom du fichier savedir=os.environ['HOME'] -- 2.39.2