Salome HOME
Merge Python 3 porting.
authorrnv <rnv@opencascade.com>
Thu, 22 Jun 2017 16:01:19 +0000 (19:01 +0300)
committerrnv <rnv@opencascade.com>
Thu, 22 Jun 2017 16:01:35 +0000 (19:01 +0300)
1  2 
doc/dev/sphinx/fr/medop-prototype-develguide.rst
doc/dev/sphinx/fr/medop-prototype-medmem.rst
src/MEDCalc/cmp/test_medcalc_components.py

index 643ffe88cc1b3a18fe97ae671b05e54500263999,cb27e29303793c2a7702b94ab4d40ef3077987ec..8a2ed7e29ea86ea2ea995c861d39b9fe24861d75
@@@ -289,7 -289,7 +289,7 @@@ l'utilisateur pour désigner les champ
  Ces classes proxy sont conçues pour être le lieu d'implémentation de
  l'interprétation des commandes utilisateur et donc de l'ergonomie
  de manipulation des champs au niveau l'interface textuelle. Ce point
- est développé :ref:`plus bas <develguide_execFieldOperation>`.
+ est développé :ref:`plus bas <develguide_execFieldOperation-fr>`.
  
  Programmation de l'interface textuelle
  --------------------------------------
@@@ -312,9 -312,9 +312,9 @@@ graphique en images
  .. |IMG_SELECT| image:: ../images/medop-gui-selectfield_scale.png
  .. |IMG_ALIAS| image:: ../images/medop-gui-aliasfield_scale.png
  
- +---------------+---------------+
- | |IMG_SELECT|  | |IMG_ALIAS|   |
- +---------------+---------------+
+ +--------------+-------------+
+ | |IMG_SELECT| | |IMG_ALIAS| |
+ +--------------+-------------+
  
  L'image de gauche montre la sélection du pas de temps, l'image de
  droite la boîte de dialogue qui permet la saisie de l'alias avec
@@@ -423,7 -423,7 +423,7 @@@ associée à ce servant (en fait associ
  ``SALOME_MED::MEDOP`` créé sur demande par le servant
  ``SALOME_MED::MED``, voir la fonction ``getFieldFromMed(...)``).
  
- .. _develguide_execFieldOperation:
+ .. _develguide_execFieldOperation-fr:
  
  Exécution des opérations sur le champs
  --------------------------------------
@@@ -543,9 -543,9 +543,9 @@@ module du champ dans l'exemple impléme
  .. |IMG_VISU| image:: ../images/medop-gui-visufield_scale.png
  .. |IMG_RESULT| image:: ../images/medop-gui-result_scale.png
  
- +---------------+---------------+
- | |IMG_VISU|    | |IMG_RESULT|  |
- +---------------+---------------+
+ +------------+--------------+
+ | |IMG_VISU| | |IMG_RESULT| |
+ +------------+--------------+
  
  Cette fonction répond au besoin de contrôle interactif des résultats
  produits par les opérations de manipulation de champs.
@@@ -561,6 -561,7 +561,6 @@@ donnée du servant ``SALOME_MED::FIELD`
     import VISU
  
     visuComp = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
 -   visuComp.SetCurrentStudy(salome.myStudy)
  
     # Then we can import the specified field in the VISU module. This
     # creates an study entry in the VISU folder.
index 8a9901bfce2e2e29f1571b281f817e3f6425c5ce,9b001ce43c69d2fa42dc97f7a8e051c3a4584cc4..dd99cec0e45e14b7d6564cc942a174de9aeba9f9
@@@ -291,7 -291,7 +291,7 @@@ Le passage des arguments par référenc
  pour éviter de passer un pointeur tout en évitant la récopie des
  données de la variable.
  
- .. _xmed-medmem_corbainterface:
+ .. _xmed-medmem_corbainterface-fr:
  
  L'interface CORBA SALOME_MED
  ============================
@@@ -478,6 -478,7 +478,6 @@@ les exemples précédents)
     # Get the VISU component
     import VISU
     visuComp = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
 -   visuComp.SetCurrentStudy(salome.myStudy)
  
     # Get the sobject associated to the med object named "Med"
     aSObject = salome.myStudy.FindObject("Med")
index d2db81bce3763bcd26c2a71ecd0af332c2bd9caa,e3e3ef00597562503aa872f2e218d9c724fee383..a4c211d33fa574ee8e121fc447cbc768d3d18660
@@@ -1,5 -1,4 +1,4 @@@
- #!/usr/bin/env python
- #  -*- coding: iso-8859-1 -*-
+ #!/usr/bin/env python3
  # Copyright (C) 2007-2016  CEA/DEN, EDF R&D
  #
  # This library is free software; you can redistribute it and/or
@@@ -61,7 -60,7 +60,7 @@@ if salome.lcc is None
  __import__(corbaModule)
  factory=salome.lcc.FindOrLoadComponent(containerType,componentName)
  # This is not the main CORBA component of the SALOME module MED
 -# (i.e. the engine associated to the active study), but the CORBA
 +# (i.e. the engine associated to the study), but the CORBA
  # entry point for MED fields operations (i.e. a CORBA component
  # reachable throughout the LifeCycleCORBA). This entry point is used to
  # get the other SALOME CORBA components required for MED field
@@@ -76,7 -75,7 +75,7 @@@ import o
  
  try:
      MED_ROOT_DIR=os.environ["MED_ROOT_DIR"]
- except KeyError, e:
+ except KeyError as e:
      raise RuntimeError("MED_ROOT_DIR should be defined to load the test data")
  
  RESDIR=os.path.join(MED_ROOT_DIR,"share","salome","resources","med","medcalc_testfiles")
@@@ -114,7 -113,7 +113,7 @@@ def TEST_loadDatasource()
      dataManager = factory.getDataManager()
      datasource = dataManager.loadDatasource(testFilePath)
      if datasource.name != testFileName:
-         print "ERR: datasource.name=%s (should be %s)"%(datasource.name,testFilePath)
+         print("ERR: datasource.name=%s (should be %s)"%(datasource.name,testFilePath))
          return False
  
      # We try to load the file twice. It should not load twice and
      sourceid_ref = datasource.id
      datasource = dataManager.loadDatasource(testFilePath)
      if datasource.id != sourceid_ref:
-         print "ERR: datasource.id=%s (should be %s)"%(datasource.id,sourceid_ref)
+         print("ERR: datasource.id=%s (should be %s)"%(datasource.id,sourceid_ref))
          return False
  
      return True
@@@ -141,7 -140,7 +140,7 @@@ def TEST_getFieldRepresentation()
      fieldHandlerList = dataManager.getFieldHandlerList()
      fieldHandler0 = fieldHandlerList[0]
  
-     print dataManager.getFieldRepresentation(fieldHandler0.id)
+     print(dataManager.getFieldRepresentation(fieldHandler0.id))
      return True
  
  def TEST_updateFieldMetadata():
                                      fieldHandler0.source)
  
      fieldHandlerModified = dataManager.getFieldHandler(fieldid)
-     print fieldHandlerModified
+     print(fieldHandlerModified)
  
      if fieldHandlerModified.fieldname != newname:
-         print "ERR: the name is %s (should be %s)"%(fieldHandlerModified.fieldname,newname)
+         print("ERR: the name is %s (should be %s)"%(fieldHandlerModified.fieldname,newname))
          return False
      return True
  
@@@ -174,15 -173,15 +173,15 @@@ def TEST_saveFields()
      fieldIdList = [fieldHandler0.id]
      filepath = "/tmp/test_xmed_saveFields.med"
  
-     print "fieldIdList = %s"%fieldIdList
-     print "filepath = %s"%filepath
+     print("fieldIdList = %s"%fieldIdList)
+     print("filepath = %s"%filepath)
  
      dataManager.saveFields(filepath,fieldIdList)
      # We just control that the file exists. But we should reload the
      # contents to check the fields
      import os
      if not os.path.exists(filepath):
-         print "ERR: the file %s does not exist"%(filepath)
+         print("ERR: the file %s does not exist"%(filepath))
          return False
      return True
  
@@@ -195,7 -194,7 +194,7 @@@ def TEST_MEDDataManager_getMeshList()
      dataManager = factory.getDataManager()
      datasourceHandler = dataManager.loadDatasource(testFilePath)
      meshHandlerList = dataManager.getMeshList(datasourceHandler.id)
-     print meshHandlerList
+     print(meshHandlerList)
  
      if len(meshHandlerList) == 0:
          return False
@@@ -208,7 -207,7 +207,7 @@@ def TEST_MEDDataManager_getMesh()
      for mRef in meshHandlerList:
          meshId = mRef.id
          mRes = dataManager.getMesh(meshId)
-         print mRes
+         print(mRes)
          if ( mRes.name != mRef.name ) or ( mRes.sourceid != mRef.sourceid):
              return False
      return True
@@@ -221,7 -220,7 +220,7 @@@ def TEST_MEDDataManager_getFieldseriesL
      # We look for the fieldseries defined on the first mesh of the list
      meshId = meshHandlerList[0].id
      fieldseriesList = dataManager.getFieldseriesListOnMesh(meshId)
-     print fieldseriesList
+     print(fieldseriesList)
  
      if len(fieldseriesList) == 0:
          return False
@@@ -242,7 -241,7 +241,7 @@@ def TEST_MEDDataManager_getFieldListInF
      # i.e. the time steps for this field.
      fieldseriesId = fieldseriesList[0].id
      fieldList = dataManager.getFieldListInFieldseries(fieldseriesId)
-     print fieldList
+     print(fieldList)
  
      if len(fieldList) == 0:
          return False
@@@ -261,22 -260,22 +260,22 @@@ def TEST_Calculator_basics()
      # Try to operate on the two first fields
      fieldHandler0 = fieldHandlerList[0]
      fieldHandler1 = fieldHandlerList[1]
-     print fieldHandler0
-     print fieldHandler1
+     print(fieldHandler0)
+     print(fieldHandler1)
  
      calculator = factory.getCalculator()
      add = calculator.add(fieldHandler0, fieldHandler1)
-     print add
+     print(add)
      sub = calculator.sub(fieldHandler0, fieldHandler1)
-     print sub
+     print(sub)
      mul = calculator.mul(fieldHandler0, fieldHandler1)
-     print mul
+     print(mul)
      div = calculator.div(fieldHandler0, fieldHandler1)
-     print div
+     print(div)
      #power = calculator.pow(fieldHandler0, 2)
-     #print power
+     # print(power)
      linear = calculator.lin(fieldHandler0, 3,2)
-     print linear
+     print(linear)
  
      return True
  
@@@ -291,12 -290,12 +290,12 @@@ def TEST_Calculator_applyFunc()
      import MEDCALC
      nbResultingComponent = MEDCALC.NBCOMP_DEFAULT
      res = calculator.fct(fieldHandler,"abs(u)",nbResultingComponent);
-     print res
+     print(res)
  
      # In this example, "a" stands for the first component
      nbResultingComponent = 1
      res = calculator.fct(fieldHandler,"a+2",nbResultingComponent)
-     print res
+     print(res)
  
      return True
  
@@@ -320,7 -319,7 +319,7 @@@ def TEST_markAsPersistent()
      dataManager.savePersistentFields(filepath)
      import os
      if not os.path.exists(filepath):
-         print "ERR: the file %s does not exist"%(filepath)
+         print("ERR: the file %s does not exist"%(filepath))
          return False
      return True