--- /dev/null
+# Copyright (C) 2007-2013 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# This empty class is replaced by the class eficas.SalomeEntry
+# (defined in Salome EFICAS module) when Eficas is launched in Salome context.
+# It handles the objects that can be selected from Salome object browser.
+class SalomeEntry:
+ pass
from Extensions.commande_comm import COMMANDE_COMM
from Extensions.mcnuplet import MCNUPLET
+from A_SALOME_ENTRY import SalomeEntry
self.BSalome.setIcon(icon3)
mc = self.node.item.get_definition()
type = mc.type[0]
- if not(('grma' in repr(type)) or ('grno' in repr(type)) or ('SalomeEntry' in repr(type))) or not(self.editor.salome) :
+ from Accas import SalomeEntry
+ if not(('grma' in repr(type)) or ('grno' in repr(type)) or (isinstance(type, types.ClassType) and issubclass(type, SalomeEntry))) or not(self.editor.salome) :
self.BSalome.close()
self.BView2D.close()
for e in genea:
if "GROUP_NO" in e: kwType = "GROUP_NO"
if "GROUP_MA" in e: kwType = "GROUP_MA"
- mc = self.node.item.get_definition()
- type = mc.type[0]
+ if 'grno' in repr(kwType): kwType = "GROUP_NO"
+ if 'grma' in repr(kwType): kwType = "GROUP_NO"
- if 'grno' in repr(type): kwType = "GROUP_NO"
- if 'grma' in repr(type): kwType = "GROUP_NO"
- if 'SalomeEntry' in repr(type):
- selection, commentaire = self.appliEficas.selectEntryFromSalome(editor=self.editor)
+ from Accas import SalomeEntry
+ if isinstance(kwType, types.ClassType) and issubclass(kwType, SalomeEntry):
+ selection, commentaire = self.appliEficas.selectEntryFromSalome(kwType,editor=self.editor)
selection[0]=str(selection[0])
#print "BkwType",kwType
self.BFichier.close()
self.BRepertoire.close()
# TODO: Use type properties instead of hard-coded "grno" and "grma" type check
+ from Accas import SalomeEntry
enable_salome_selection = self.editor.salome and \
- (('grma' in repr(mctype)) or ('grno' in repr(mctype)) or ('SalomeEntry' in repr(mctype)) or
- (hasattr(mctype, "enable_salome_selection") and mctype.enable_salome_selection))
+ (('grma' in repr(mctype)) or ('grno' in repr(mctype)) or \
+ (isinstance(mctype, types.ClassType) and issubclass(mctype, SalomeEntry)))
if not enable_salome_selection:
self.BSalome.close()
if not(('grma' in repr(mctype)) or ('grno' in repr(mctype))) or not(self.editor.salome):
if "GROUP_NO" in e: kwType = "GROUP_NO"
if "GROUP_MA" in e: kwType = "GROUP_MA"
- mc = self.node.item.get_definition()
- type = mc.type[0]
- if 'grno' in repr(type): kwType = "GROUP_NO"
- if 'grma' in repr(type): kwType = "GROUP_NO"
+ if 'grno' in repr(kwType): kwType = "GROUP_NO"
+ if 'grma' in repr(kwType): kwType = "GROUP_NO"
if kwType in ("GROUP_NO","GROUP_MA"):
selection, commentaire = self.appliEficas.selectGroupFromSalome(kwType,editor=self.editor)
- if 'SalomeEntry' in repr(type):
- selection, commentaire = self.appliEficas.selectEntryFromSalome(editor=self.editor)
+ from Accas import SalomeEntry
+ if isinstance(kwType, types.ClassType) and issubclass(kwType, SalomeEntry):
+ selection, commentaire = self.appliEficas.selectEntryFromSalome(kwType,editor=self.editor)
if commentaire !="" :
self.Commentaire.setText(QString(commentaire))
self.listeAEnlever=[]
self.ListeCode=['Aster','Carmel3D','Cuve2dg','Openturns_Study','Openturns_Wrapper','MAP']
+ if self.salome:
+ import Accas
+ import eficasSalome
+ Accas.SalomeEntry = eficasSalome.SalomeEntry
+
self.RepIcon=os.path.join( os.path.dirname(os.path.abspath(__file__)),'../Editeur/icons')
self.multi=multi
if langue=='fr': self.langue=langue