Salome HOME
projects
/
modules
/
gui.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated copyright message
[modules/gui.git]
/
src
/
SalomeApp
/
salome_pluginsmanager.py
diff --git
a/src/SalomeApp/salome_pluginsmanager.py
b/src/SalomeApp/salome_pluginsmanager.py
old mode 100755
(executable)
new mode 100644
(file)
index
f17bab2
..
fb27bef
--- a/
src/SalomeApp/salome_pluginsmanager.py
+++ b/
src/SalomeApp/salome_pluginsmanager.py
@@
-1,5
+1,5
@@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-20
16 CEA/DEN, EDF R&D
, OPEN CASCADE
+# Copyright (C) 2007-20
23 CEA, EDF
, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@
-244,8
+244,13
@@
class PluginsManager:
def importPlugins(self):
"""Execute the salome_plugins file that contains plugins definition """
def importPlugins(self):
"""Execute the salome_plugins file that contains plugins definition """
+ ior_fake_ns = None
+ prefix_ior = "--iorfakens="
+ presence_ior = [elt for elt in QApplication.arguments() if elt[:len(prefix_ior)]==prefix_ior]
+ if any(presence_ior):
+ ior_fake_ns = presence_ior[-1][len(prefix_ior):]
if self.lasttime ==0 or salome.myStudy == None:
if self.lasttime ==0 or salome.myStudy == None:
- salome.salome_init(embedded=True)
+ salome.salome_init(embedded=True
,iorfakensfile=ior_fake_ns
)
lasttime=0
lasttime=0
@@
-281,7
+286,8
@@
class PluginsManager:
sys.path.insert(0,directory)
logger.debug("The directory %s has been added to PYTHONPATH"%directory)
try:
sys.path.insert(0,directory)
logger.debug("The directory %s has been added to PYTHONPATH"%directory)
try:
- exec(compile(open(plugins_file,'rb').read(), plugins_file, 'exec'),globals(),{})
+ with open(plugins_file, 'rb') as fp:
+ exec(compile(fp.read(), plugins_file, 'exec'), globals(), {})
except:
logger.critical("Error while loading plugins from file %s"%plugins_file)
traceback.print_exc()
except:
logger.critical("Error while loading plugins from file %s"%plugins_file)
traceback.print_exc()