Version: 8.3.0
YACS.YACS Class Reference
Inheritance diagram for YACS.YACS:
Collaboration diagram for YACS.YACS:

Public Member Functions

def __init__
 
def getVersion
 
def LoadProc
 
def convertSupervFile
 

Private Attributes

 _naming_service
 

Detailed Description

To be a SALOME component, this Python class must have the component name
(YACS) and inherit the YACS_Gen class build from idl compilation
with omniidl and also the class SALOME_ComponentPy_i which defines general
SALOME component behaviour.

Definition at line 234 of file YACS.py.

Constructor & Destructor Documentation

def YACS.YACS.__init__ (   self,
  orb,
  poa,
  contID,
  containerName,
  instanceName,
  interfaceName 
)

Definition at line 242 of file YACS.py.

243  interfaceName ):
244  print "YACS.__init__: ", containerName, ';', instanceName
245  SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa, contID,
246  containerName, instanceName,
247  interfaceName, False)
248  SALOME_DriverPy.SALOME_DriverPy_i.__init__(self, interfaceName)
249 
250  # --- store a naming service interface instance in _naming_service atribute
251  self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb )
252 
253  SALOMERuntime.RuntimeSALOME_setRuntime(1)
254  SALOMERuntime.SALOMEDispatcher_setSALOMEDispatcher()
255  r=pilot.getRuntime()
256 
257  try:
258  #try to load SALOME module catalogs
259  modul_catalog = self._naming_service.Resolve("/Kernel/ModulCatalog")
260  ior= orb.object_to_string(modul_catalog)
261  cata=r.loadCatalog("session",ior)
262  r.addCatalog(cata)
263  except :
264  pass

Member Function Documentation

def YACS.YACS.convertSupervFile (   self,
  xmlFile 
)
load a SUPERV xml graph, convert it and return the new filename.

Definition at line 305 of file YACS.py.

306  def convertSupervFile(self,xmlFile):
307  """
308  load a SUPERV xml graph, convert it and return the new filename.
309  """
310  try:
311  r = pilot.getRuntime()
312  lo = salomeloader.SalomeLoader()
313  e = pilot.ExecutorSwig()
314  p = lo.load(xmlFile)
315  s = pilot.SchemaSave(p)
316  hnd, convertedFile = tempfile.mkstemp(".xml","yacs_","/tmp")
317  s.save(convertedFile)
318  return convertedFile
319  except (IndexError):
320  return ""
def YACS.YACS.getVersion (   self)

Definition at line 268 of file YACS.py.

269  def getVersion( self ):
270  try:
271  rt = SALOMERuntime.getSALOMERuntime()
272  version = rt.getVersion()
273  except:
274  version = ""
275  pass
276  return version
def YACS.YACS.LoadProc (   self,
  xmlFile 
)
load an XML graph in a YACS::ENGINE::proc, create a CORBA servant
associated to the proc, and return a ref on the servant.

Definition at line 277 of file YACS.py.

278  def LoadProc(self,xmlFile):
279  """
280  load an XML graph in a YACS::ENGINE::proc, create a CORBA servant
281  associated to the proc, and return a ref on the servant.
282  """
283  try:
284  procExec_i = proc_i(xmlFile)
285  logger=procExec_i.p.getLogger("parser")
286  if not logger.isEmpty():
287  print "The imported file has errors :"
288  print logger.getStr()
289  sys.stdout.flush()
290  return None
291  except IOError, ex:
292  print >> sys.stderr ,"IO Error: ", ex
293  return None
294  except ValueError,ex:
295  print >> sys.stderr ,"Caught ValueError Exception:",ex
296  return None
297  except pilot.Exception,ex:
298  print >> sys.stderr ,ex.what()
299  return None
300  except:
301  traceback.print_exc()
302  return None
303  procExec_o = procExec_i._this()
304  return procExec_o

Member Data Documentation

YACS.YACS._naming_service
private

Definition at line 250 of file YACS.py.


The documentation for this class was generated from the following file: