salome.kernel 9.14.0__cp37-cp37m-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of salome.kernel might be problematic. Click here for more details.

Files changed (400) hide show
  1. salome/bin/salome/IDLparser.py +882 -0
  2. salome/bin/salome/KernelHelpersUseCases +0 -0
  3. salome/bin/salome/NSparam.py +51 -0
  4. salome/bin/salome/ORBConfigFile.py +55 -0
  5. salome/bin/salome/SALOMEDS_Client +0 -0
  6. salome/bin/salome/SALOMEDS_Server +0 -0
  7. salome/bin/salome/SALOME_ConnectionManagerServer +0 -0
  8. salome/bin/salome/SALOME_Container +0 -0
  9. salome/bin/salome/SALOME_ContainerPy.py +397 -0
  10. salome/bin/salome/SALOME_Container_No_NS_Serv +0 -0
  11. salome/bin/salome/SALOME_Container_No_NS_Serv_OutProcess +0 -0
  12. salome/bin/salome/SALOME_Container_No_NS_Serv_OutProcess_FT +0 -0
  13. salome/bin/salome/SALOME_Container_No_NS_Serv_OutProcess_Replay +0 -0
  14. salome/bin/salome/SALOME_Container_No_NS_Serv_OutProcess_Replay_FT +0 -0
  15. salome/bin/salome/SALOME_DataScopeServer +0 -0
  16. salome/bin/salome/SALOME_DataScopeServer_SSL +0 -0
  17. salome/bin/salome/SALOME_LauncherServer +0 -0
  18. salome/bin/salome/SALOME_Logger_Server +0 -0
  19. salome/bin/salome/SALOME_ModuleCatalog_Client +0 -0
  20. salome/bin/salome/SALOME_ModuleCatalog_Server +0 -0
  21. salome/bin/salome/SALOME_Registry_Server +0 -0
  22. salome/bin/salome/TestComponentPy.py +71 -0
  23. salome/bin/salome/TestContainer +0 -0
  24. salome/bin/salome/TestContainerManager +0 -0
  25. salome/bin/salome/TestLauncher +0 -0
  26. salome/bin/salome/TestLifeCycleCORBA.py +89 -0
  27. salome/bin/salome/TestLogger +0 -0
  28. salome/bin/salome/TestLogger.py +27 -0
  29. salome/bin/salome/TestModuleCatalog.py +87 -0
  30. salome/bin/salome/Test_LifeCycleCORBA +0 -0
  31. salome/bin/salome/VERSION +3 -0
  32. salome/bin/salome/addToKillList.py +35 -0
  33. salome/bin/salome/app-quickstart.py +288 -0
  34. salome/bin/salome/appli/.bashrc +50 -0
  35. salome/bin/salome/appli/extra.env.d/001.py +39 -0
  36. salome/bin/salome/appli/python_test_driver.py +148 -0
  37. salome/bin/salome/appli/salome +193 -0
  38. salome/bin/salome/appli/salome_instance.py +31 -0
  39. salome/bin/salome/appli/salome_test_driver.py +150 -0
  40. salome/bin/salome/appli/salome_test_driver_gui.py +82 -0
  41. salome/bin/salome/appli_clean.sh +53 -0
  42. salome/bin/salome/appli_gen.py +606 -0
  43. salome/bin/salome/dummyexe_loggerTraceCollector +0 -0
  44. salome/bin/salome/envSalome.py +59 -0
  45. salome/bin/salome/killSalome.py +48 -0
  46. salome/bin/salome/killSalomeWithPort.py +56 -0
  47. salome/bin/salome/prepare_generating_doc.py +104 -0
  48. salome/bin/salome/pythonpath_reduction.py +184 -0
  49. salome/bin/salome/runConsole.py +39 -0
  50. salome/bin/salome/runIDLparser +58 -0
  51. salome/bin/salome/runRemote.py +101 -0
  52. salome/bin/salome/runSalome.py +30 -0
  53. salome/bin/salome/runSalomeNoServer.py +24 -0
  54. salome/bin/salome/runSalomeOld.py +36 -0
  55. salome/bin/salome/runSalomeOnDemand.py +41 -0
  56. salome/bin/salome/salomeContext.py +36 -0
  57. salome/bin/salome/salome_process_attach +44 -0
  58. salome/bin/salome/salome_process_launcher +58 -0
  59. salome/bin/salome/setenv.py +32 -0
  60. salome/bin/salome/showNS.py +33 -0
  61. salome/bin/salome/test/kernel/ArgvKeeper/CTestTestfile.cmake +31 -0
  62. salome/bin/salome/test/kernel/ArgvKeeper/TestArgvKeeper +0 -0
  63. salome/bin/salome/test/kernel/ArgvKeeper/test_ArgvKeeper.py +34 -0
  64. salome/bin/salome/test/kernel/CTestTestfile.cmake +49 -0
  65. salome/bin/salome/test/kernel/Container/CTestTestfile.cmake +29 -0
  66. salome/bin/salome/test/kernel/Container/testProxy.py +291 -0
  67. salome/bin/salome/test/kernel/Container/testcontainer.py +106 -0
  68. salome/bin/salome/test/kernel/KernelHelpers/CTestTestfile.cmake +31 -0
  69. salome/bin/salome/test/kernel/KernelHelpers/KernelHelpersUnitTests.hxx +58 -0
  70. salome/bin/salome/test/kernel/KernelHelpers/TestKernelHelpers +0 -0
  71. salome/bin/salome/test/kernel/KernelHelpers/TestKernelHelpers.py +55 -0
  72. salome/bin/salome/test/kernel/Launcher/CTestTestfile.cmake +43 -0
  73. salome/bin/salome/test/kernel/Launcher/TestSSLAttached.py +110 -0
  74. salome/bin/salome/test/kernel/Launcher/launcher_use_case.py +65 -0
  75. salome/bin/salome/test/kernel/Launcher/testCrashProofContainer.py +423 -0
  76. salome/bin/salome/test/kernel/Launcher/testPerfLogManager1.py +382 -0
  77. salome/bin/salome/test/kernel/Launcher/test_launcher.py +674 -0
  78. salome/bin/salome/test/kernel/Launcher/test_stress.sh +45 -0
  79. salome/bin/salome/test/kernel/Launcher_SWIG/CTestTestfile.cmake +30 -0
  80. salome/bin/salome/test/kernel/Launcher_SWIG/test_swig_launcher.py +706 -0
  81. salome/bin/salome/test/kernel/LifeCycleCORBA/CTestTestfile.cmake +27 -0
  82. salome/bin/salome/test/kernel/LifeCycleCORBA/LifeCycleCORBATest.hxx +105 -0
  83. salome/bin/salome/test/kernel/LifeCycleCORBA/TestLifeCycleCORBA +0 -0
  84. salome/bin/salome/test/kernel/LifeCycleCORBA/TestLifeCycleCORBA.py +93 -0
  85. salome/bin/salome/test/kernel/LifeCycleCORBA_SWIG/CTestTestfile.cmake +40 -0
  86. salome/bin/salome/test/kernel/LifeCycleCORBA_SWIG/CatalogResources_resource.xml +15 -0
  87. salome/bin/salome/test/kernel/LifeCycleCORBA_SWIG/LifeCycleCORBA_SWIGTest.py +217 -0
  88. salome/bin/salome/test/kernel/LifeCycleCORBA_SWIG/SALOME_TestComponentPy.py +49 -0
  89. salome/bin/salome/test/kernel/LifeCycleCORBA_SWIG/TestLifeCycleCORBA_SWIG.py +100 -0
  90. salome/bin/salome/test/kernel/LifeCycleCORBA_SWIG/testcontainermanager.py +88 -0
  91. salome/bin/salome/test/kernel/LifeCycleCORBA_SWIG/testresourcemanager.py +155 -0
  92. salome/bin/salome/test/kernel/NamingService/CTestTestfile.cmake +28 -0
  93. salome/bin/salome/test/kernel/NamingService/NamingServiceTest.hxx +169 -0
  94. salome/bin/salome/test/kernel/NamingService/TestNamingService +0 -0
  95. salome/bin/salome/test/kernel/NamingService/TestNamingService.py +64 -0
  96. salome/bin/salome/test/kernel/SALOMEDS/CTestTestfile.cmake +27 -0
  97. salome/bin/salome/test/kernel/SALOMEDS/SALOMEDSTest.hxx +192 -0
  98. salome/bin/salome/test/kernel/SALOMEDS/TestSALOMEDS +0 -0
  99. salome/bin/salome/test/kernel/SALOMEDS/TestSALOMEDS.py +55 -0
  100. salome/bin/salome/test/kernel/SALOMEDSImpl/CTestTestfile.cmake +27 -0
  101. salome/bin/salome/test/kernel/SALOMEDSImpl/SALOMEDSImplTest.hxx +51 -0
  102. salome/bin/salome/test/kernel/SALOMEDSImpl/TestSALOMEDSImpl +0 -0
  103. salome/bin/salome/test/kernel/SALOMEDSImpl/TestSALOMEDSImpl.py +55 -0
  104. salome/bin/salome/test/kernel/SALOMELocalTrace/CTestTestfile.cmake +27 -0
  105. salome/bin/salome/test/kernel/SALOMELocalTrace/SALOMELocalTraceTest.hxx +59 -0
  106. salome/bin/salome/test/kernel/SALOMELocalTrace/TestSALOMELocalTrace +0 -0
  107. salome/bin/salome/test/kernel/SALOMELocalTrace/TestSALOMELocalTrace.py +40 -0
  108. salome/bin/salome/test/kernel/SALOMETraceCollector/CTestTestfile.cmake +27 -0
  109. salome/bin/salome/test/kernel/SALOMETraceCollector/SALOMETraceCollectorTest.hxx +51 -0
  110. salome/bin/salome/test/kernel/SALOMETraceCollector/TestSALOMETraceCollector +0 -0
  111. salome/bin/salome/test/kernel/SALOMETraceCollector/TestSALOMETraceCollector.py +57 -0
  112. salome/bin/salome/test/kernel/UnitTests/CTestTestfile.cmake +28 -0
  113. salome/bin/salome/test/kernel/UnitTests/UnitTests +0 -0
  114. salome/bin/salome/test/kernel/UnitTests/UnitTests.py +89 -0
  115. salome/bin/salome/test/kernel/Utils/CTestTestfile.cmake +27 -0
  116. salome/bin/salome/test/kernel/Utils/TestUtils +0 -0
  117. salome/bin/salome/test/kernel/Utils/TestUtils.py +55 -0
  118. salome/bin/salome/test/kernel/Utils/UtilsTest.hxx +58 -0
  119. salome/bin/salome/test/kernel/lib/libLifeCycleCORBATest.so +0 -0
  120. salome/bin/salome/test/kernel/lib/libNamingServiceTest.so +0 -0
  121. salome/bin/salome/test/kernel/lib/libSALOMEDSImplTest.so +0 -0
  122. salome/bin/salome/test/kernel/lib/libSALOMEDSTest.so +0 -0
  123. salome/bin/salome/test/kernel/lib/libSALOMELocalTraceTest.so +0 -0
  124. salome/bin/salome/test/kernel/lib/libSALOMETraceCollectorTest.so +0 -0
  125. salome/bin/salome/test/kernel/lib/libSalomeKernelHelpersTest.so +0 -0
  126. salome/bin/salome/test/kernel/lib/libUtilsTest.so +0 -0
  127. salome/bin/salome/testDF +0 -0
  128. salome/bin/salome/testDS +0 -0
  129. salome/bin/salome/virtual_salome.py +38 -0
  130. salome/bin/salome/waitContainers.py +82 -0
  131. salome/bin/salome/waitNS.py +31 -0
  132. salome/kernel/ArgvKeeper.py +132 -0
  133. salome/kernel/Calcium_Ports_idl.py +645 -0
  134. salome/kernel/DSC_Engines_idl.py +443 -0
  135. salome/kernel/Engines/__init__.py +24 -0
  136. salome/kernel/Engines__POA/__init__.py +24 -0
  137. salome/kernel/Help.py +141 -0
  138. salome/kernel/KernelBasis.py +463 -0
  139. salome/kernel/KernelContainer.py +81 -0
  140. salome/kernel/KernelDS.py +87 -0
  141. salome/kernel/KernelLauncher.py +117 -0
  142. salome/kernel/KernelLogger.py +75 -0
  143. salome/kernel/KernelModuleCatalog.py +76 -0
  144. salome/kernel/KernelSDS.py +92 -0
  145. salome/kernel/KernelServices.py +105 -0
  146. salome/kernel/LifeCycleCORBA.py +92 -0
  147. salome/kernel/Logger_idl.py +89 -0
  148. salome/kernel/NSTEST/__init__.py +13 -0
  149. salome/kernel/NSTEST__POA/__init__.py +13 -0
  150. salome/kernel/NSparam_impl.py +50 -0
  151. salome/kernel/NamingService.py +365 -0
  152. salome/kernel/ORBConfigFile_impl.py +102 -0
  153. salome/kernel/Palm_Ports_idl.py +162 -0
  154. salome/kernel/PortManager.py +259 -0
  155. salome/kernel/Ports/Calcium_Ports/__init__.py +13 -0
  156. salome/kernel/Ports/Palm_Ports/__init__.py +13 -0
  157. salome/kernel/Ports/__init__.py +18 -0
  158. salome/kernel/Ports__POA/Calcium_Ports/__init__.py +13 -0
  159. salome/kernel/Ports__POA/Palm_Ports/__init__.py +13 -0
  160. salome/kernel/Ports__POA/__init__.py +18 -0
  161. salome/kernel/PyInterp.py +99 -0
  162. salome/kernel/Registry/__init__.py +13 -0
  163. salome/kernel/Registry__POA/__init__.py +13 -0
  164. salome/kernel/SALOME/__init__.py +19 -0
  165. salome/kernel/SALOMEDS/__init__.py +14 -0
  166. salome/kernel/SALOMEDS_Attributes_idl.py +2288 -0
  167. salome/kernel/SALOMEDS__POA/__init__.py +14 -0
  168. salome/kernel/SALOMEDS_idl.py +1590 -0
  169. salome/kernel/SALOMEWrappedStdType.py +383 -0
  170. salome/kernel/SALOME_Comm_idl.py +1045 -0
  171. salome/kernel/SALOME_CommonTypes_idl.py +69 -0
  172. salome/kernel/SALOME_ComponentPy.py +338 -0
  173. salome/kernel/SALOME_Component_idl.py +962 -0
  174. salome/kernel/SALOME_Container.py +242 -0
  175. salome/kernel/SALOME_ContainerHelper.py +840 -0
  176. salome/kernel/SALOME_ContainerManager_idl.py +236 -0
  177. salome/kernel/SALOME_DriverPy.py +86 -0
  178. salome/kernel/SALOME_Embedded_NamingService.py +41 -0
  179. salome/kernel/SALOME_Embedded_NamingService_ClientPy.py +59 -0
  180. salome/kernel/SALOME_Embedded_NamingService_idl.py +125 -0
  181. salome/kernel/SALOME_Exception_idl.py +75 -0
  182. salome/kernel/SALOME_ExternalServerLauncher_idl.py +199 -0
  183. salome/kernel/SALOME_GenericObj_idl.py +154 -0
  184. salome/kernel/SALOME_GlobalsImpl.py +38 -0
  185. salome/kernel/SALOME_Launcher_idl.py +327 -0
  186. salome/kernel/SALOME_Locker_idl.py +185 -0
  187. salome/kernel/SALOME_LogManager.py +103 -0
  188. salome/kernel/SALOME_LogManager_idl.py +348 -0
  189. salome/kernel/SALOME_Logger/__init__.py +13 -0
  190. salome/kernel/SALOME_Logger__POA/__init__.py +13 -0
  191. salome/kernel/SALOME_MPIObject_idl.py +100 -0
  192. salome/kernel/SALOME_ModuleCatalog/__init__.py +13 -0
  193. salome/kernel/SALOME_ModuleCatalog__POA/__init__.py +13 -0
  194. salome/kernel/SALOME_ModuleCatalog_idl.py +624 -0
  195. salome/kernel/SALOME_NamingServicePy.py +313 -0
  196. salome/kernel/SALOME_PACOExtension_idl.py +292 -0
  197. salome/kernel/SALOME_ParamPorts_idl.py +102 -0
  198. salome/kernel/SALOME_Parametric_idl.py +154 -0
  199. salome/kernel/SALOME_Ports_idl.py +347 -0
  200. salome/kernel/SALOME_PyNode.py +1557 -0
  201. salome/kernel/SALOME_PyNode_idl.py +387 -0
  202. salome/kernel/SALOME_Registry_idl.py +155 -0
  203. salome/kernel/SALOME_ResourcesManager_idl.py +215 -0
  204. salome/kernel/SALOME_SDS_idl.py +1181 -0
  205. salome/kernel/SALOME_Session_idl.py +214 -0
  206. salome/kernel/SALOME_TYPES/__init__.py +14 -0
  207. salome/kernel/SALOME_TYPES__POA/__init__.py +14 -0
  208. salome/kernel/SALOME_TestComponent_idl.py +121 -0
  209. salome/kernel/SALOME_TestModuleCatalog/__init__.py +13 -0
  210. salome/kernel/SALOME_TestModuleCatalog__POA/__init__.py +13 -0
  211. salome/kernel/SALOME_TestModuleCatalog_idl.py +194 -0
  212. salome/kernel/SALOME_Trace.py +96 -0
  213. salome/kernel/SALOME_Types_idl.py +81 -0
  214. salome/kernel/SALOME__POA/__init__.py +19 -0
  215. salome/kernel/SALOME_utilities.py +63 -0
  216. salome/kernel/SalomeSDSClt.py +552 -0
  217. salome/kernel/TestKiller.py +76 -0
  218. salome/kernel/Utils_Identity.py +93 -0
  219. salome/kernel/_ArgvKeeper.so +0 -0
  220. salome/kernel/_KernelBasis.so +0 -0
  221. salome/kernel/_KernelContainer.so +0 -0
  222. salome/kernel/_KernelDS.so +0 -0
  223. salome/kernel/_KernelLauncher.so +0 -0
  224. salome/kernel/_KernelLogger.so +0 -0
  225. salome/kernel/_KernelModuleCatalog.so +0 -0
  226. salome/kernel/_KernelSDS.so +0 -0
  227. salome/kernel/_KernelServices.so +0 -0
  228. salome/kernel/_NamingService.so +0 -0
  229. salome/kernel/_calcium.so +0 -0
  230. salome/kernel/_libNOTIFICATION.so +0 -0
  231. salome/kernel/_libSALOME_Comm.so +0 -0
  232. salome/kernel/_libSALOME_LifeCycleCORBA.so +0 -0
  233. salome/kernel/_pylauncher.so +0 -0
  234. salome/kernel/addToKillList_impl.py +127 -0
  235. salome/kernel/batchmode_salome.py +295 -0
  236. salome/kernel/calcium.py +866 -0
  237. salome/kernel/dsccalcium.py +98 -0
  238. salome/kernel/iparameters.py +255 -0
  239. salome/kernel/kernel_test.py +114 -0
  240. salome/kernel/killSalomeWithPort_impl.py +518 -0
  241. salome/kernel/killSalome_impl.py +94 -0
  242. salome/kernel/launchConfigureParser.py +1234 -0
  243. salome/kernel/launcher_proxy.py +122 -0
  244. salome/kernel/libNOTIFICATION.py +119 -0
  245. salome/kernel/libSALOME_Comm.py +85 -0
  246. salome/kernel/libSALOME_LifeCycleCORBA.py +232 -0
  247. salome/kernel/main.py +8 -0
  248. salome/kernel/nameserver.py +134 -0
  249. salome/kernel/nstest_idl.py +129 -0
  250. salome/kernel/omnipatch.py +136 -0
  251. salome/kernel/orbmodule.py +246 -0
  252. salome/kernel/parseConfigFile.py +261 -0
  253. salome/kernel/pylauncher.py +883 -0
  254. salome/kernel/runConsole_impl.py +224 -0
  255. salome/kernel/runSalomeCommon.py +418 -0
  256. salome/kernel/runSalomeNoServer_impl.py +48 -0
  257. salome/kernel/runSalomeOld_impl.py +603 -0
  258. salome/kernel/runSalomeOnDemand_impl.py +72 -0
  259. salome/kernel/runSalome_impl.py +341 -0
  260. salome/kernel/runSession.py +360 -0
  261. salome/kernel/runTests.py +90 -0
  262. salome/kernel/salome/__init__.py +646 -0
  263. salome/kernel/salome/kernel/__init__.py +111 -0
  264. salome/kernel/salome/kernel/datamodeler.py +363 -0
  265. salome/kernel/salome/kernel/deprecation.py +165 -0
  266. salome/kernel/salome/kernel/diclookup.py +137 -0
  267. salome/kernel/salome/kernel/enumerate.py +232 -0
  268. salome/kernel/salome/kernel/logconfig.py +27 -0
  269. salome/kernel/salome/kernel/logger.py +290 -0
  270. salome/kernel/salome/kernel/parametric/__init__.py +26 -0
  271. salome/kernel/salome/kernel/parametric/compo_utils.py +137 -0
  272. salome/kernel/salome/kernel/parametric/pyscript_utils.py +135 -0
  273. salome/kernel/salome/kernel/parametric/study_exchange_vars.py +285 -0
  274. salome/kernel/salome/kernel/pyunittester.py +184 -0
  275. salome/kernel/salome/kernel/services.py +267 -0
  276. salome/kernel/salome/kernel/studyedit.py +637 -0
  277. salome/kernel/salome/kernel/syshelper.py +116 -0
  278. salome/kernel/salome/kernel/termcolor.py +239 -0
  279. salome/kernel/salome/kernel/testdata.py +159 -0
  280. salome/kernel/salome/kernel/threadhelper.py +385 -0
  281. salome/kernel/salome/kernel/uiexception.py +121 -0
  282. salome/kernel/salome/kernel/unittester.py +89 -0
  283. salome/kernel/salomeContextUtils.py +353 -0
  284. salome/kernel/salomeContext_impl.py +731 -0
  285. salome/kernel/salome_ComponentGUI.py +92 -0
  286. salome/kernel/salome_genericobj.py +44 -0
  287. salome/kernel/salome_iapp.py +206 -0
  288. salome/kernel/salome_instance_impl.py +109 -0
  289. salome/kernel/salome_kernel_utils.py +88 -0
  290. salome/kernel/salome_notebook.py +183 -0
  291. salome/kernel/salome_psutil.py +94 -0
  292. salome/kernel/salome_pynode.py +74 -0
  293. salome/kernel/salome_study.py +347 -0
  294. salome/kernel/salome_test.py +56 -0
  295. salome/kernel/salome_utils.py +563 -0
  296. salome/kernel/salome_version.py +164 -0
  297. salome/kernel/searchFreePort.py +130 -0
  298. salome/kernel/server.py +154 -0
  299. salome/kernel/setenv_impl.py +240 -0
  300. salome/kernel/version_and_config.py +24 -0
  301. salome/share/salome/resources/kernel/Anita semi square.ttf +0 -0
  302. salome/share/salome/resources/kernel/CatalogModulePersonnel.xml_skel +24 -0
  303. salome/share/salome/resources/kernel/CatalogResources.xml +4 -0
  304. salome/share/salome/resources/kernel/KERNELCatalog.xml +102 -0
  305. salome/share/salome/resources/kernel/SALOMEDS_Resources +10 -0
  306. salome/share/salome/resources/kernel/ScriptsTemplate/SALOME_CM_LOCAL_MPI_LAN.py +19 -0
  307. salome/share/salome/resources/kernel/ScriptsTemplate/SALOME_CM_LOCAL_MPI_MPICH.py +18 -0
  308. salome/share/salome/resources/kernel/ScriptsTemplate/SALOME_CM_LOCAL_MPI_OPENMPI.py +21 -0
  309. salome/share/salome/resources/kernel/ScriptsTemplate/SALOME_CM_LOCAL_NO_MPI.py +25 -0
  310. salome/share/salome/resources/kernel/ScriptsTemplate/SALOME_CM_REMOTE.py +108 -0
  311. salome/share/salome/resources/kernel/ScriptsTemplate/SALOME_CM_REMOTE_OLD.py +115 -0
  312. salome/share/salome/resources/kernel/ScriptsTemplate/script_parameters.py +25 -0
  313. salome/share/salome/resources/kernel/app-template/CMakeLists.txt +125 -0
  314. salome/share/salome/resources/kernel/app-template/LICENCE +504 -0
  315. salome/share/salome/resources/kernel/app-template/README +0 -0
  316. salome/share/salome/resources/kernel/app-template/doc/CMakeLists.txt +31 -0
  317. salome/share/salome/resources/kernel/app-template/doc/README +1 -0
  318. salome/share/salome/resources/kernel/app-template/doc/conf.py.in +197 -0
  319. salome/share/salome/resources/kernel/app-template/doc/index.rst +14 -0
  320. salome/share/salome/resources/kernel/app-template/doc/intro.rst +4 -0
  321. salome/share/salome/resources/kernel/app-template/doc/link.rst +4 -0
  322. salome/share/salome/resources/kernel/app-template/resources/CMakeLists.txt +36 -0
  323. salome/share/salome/resources/kernel/app-template/resources/SalomeApp.xml.in +30 -0
  324. salome/share/salome/resources/kernel/app-template/resources/about.png +0 -0
  325. salome/share/salome/resources/kernel/app-template/resources/app_icon.png +0 -0
  326. salome/share/salome/resources/kernel/app-template/resources/app_logo.png +0 -0
  327. salome/share/salome/resources/kernel/app-template/resources/doc/CMakeLists.txt +27 -0
  328. salome/share/salome/resources/kernel/app-template/resources/doc/README +1 -0
  329. salome/share/salome/resources/kernel/app-template/resources/doc/sample.pdf +0 -0
  330. salome/share/salome/resources/kernel/app-template/resources/icon_about.png +0 -0
  331. salome/share/salome/resources/kernel/app-template/resources/splash.png +0 -0
  332. salome/share/salome/resources/kernel/app-template/src/CMakeLists.txt +22 -0
  333. salome/share/salome/resources/kernel/app-template/src/resources/CMakeLists.txt +34 -0
  334. salome/share/salome/resources/kernel/app-template/src/resources/LightApp_images.ts +23 -0
  335. salome/share/salome/resources/kernel/app-template/src/resources/LightApp_msg_en.ts +35 -0
  336. salome/share/salome/resources/kernel/app-template/src/resources/LightApp_msg_fr.ts +35 -0
  337. salome/share/salome/resources/kernel/app-template/src/resources/LightApp_msg_ja.ts +35 -0
  338. salome/share/salome/resources/kernel/app-template/src/tests/CMakeLists.txt +29 -0
  339. salome/share/salome/resources/kernel/app-template/src/tests/README +1 -0
  340. salome/share/salome/resources/kernel/app-template/src/tests/helloWorld.py +1 -0
  341. salome/share/salome/resources/kernel/background.png +0 -0
  342. salome/share/salome/resources/kernel/channel.cfg +278 -0
  343. salome/share/salome/resources/kernel/testLauncher.xml +10 -0
  344. salome.kernel-9.14.0.dist-info/METADATA +24 -0
  345. salome.kernel-9.14.0.dist-info/RECORD +399 -0
  346. salome.kernel-9.14.0.dist-info/WHEEL +6 -0
  347. salome.kernel-9.14.0.dist-info/entry_points.txt +2 -0
  348. salome.kernel.libs/libArgvKeeper-822351d5.so +0 -0
  349. salome.kernel.libs/libCOS4-b4544fb9.so.2.5 +0 -0
  350. salome.kernel.libs/libCOSDynamic4-618dbb1d.so.2.5 +0 -0
  351. salome.kernel.libs/libCalciumC-a61b99a1.so +0 -0
  352. salome.kernel.libs/libDF-281cc999.so +0 -0
  353. salome.kernel.libs/libLauncher-09c39914.so +0 -0
  354. salome.kernel.libs/libLauncherWrapHelper-5ee25ab2.so +0 -0
  355. salome.kernel.libs/libOpUtil-8d37ccc8.so +0 -0
  356. salome.kernel.libs/libRegistry-e4a63a9e.so +0 -0
  357. salome.kernel.libs/libResourcesManager-f4ef9548.so +0 -0
  358. salome.kernel.libs/libSALOMEBasics-f4d874ac.so +0 -0
  359. salome.kernel.libs/libSALOMELocalTrace-a3992e5b.so +0 -0
  360. salome.kernel.libs/libSALOMELog-55805468.so +0 -0
  361. salome.kernel.libs/libSalomeCalcium-6800d8d0.so +0 -0
  362. salome.kernel.libs/libSalomeCatalog-96c5b2bc.so +0 -0
  363. salome.kernel.libs/libSalomeCommunication-451307b4.so +0 -0
  364. salome.kernel.libs/libSalomeContainer-d1a25367.so +0 -0
  365. salome.kernel.libs/libSalomeContainerServer-372d46c2.so +0 -0
  366. salome.kernel.libs/libSalomeDS-34cd5abf.so +0 -0
  367. salome.kernel.libs/libSalomeDSCContainer-ee0cf498.so +0 -0
  368. salome.kernel.libs/libSalomeDSCSuperv-f529bca5.so +0 -0
  369. salome.kernel.libs/libSalomeDSCSupervBasic-e6a3b4cf.so +0 -0
  370. salome.kernel.libs/libSalomeDSClient-dc9947bb.so +0 -0
  371. salome.kernel.libs/libSalomeDSImpl-cb508584.so +0 -0
  372. salome.kernel.libs/libSalomeDatastream-755ff3cb.so +0 -0
  373. salome.kernel.libs/libSalomeGenericObj-3ccf0028.so +0 -0
  374. salome.kernel.libs/libSalomeHDFPersist-69945ed0.so +0 -0
  375. salome.kernel.libs/libSalomeIDLKernel-2eb1ed8e.so +0 -0
  376. salome.kernel.libs/libSalomeKernelHelpers-1514c9e0.so +0 -0
  377. salome.kernel.libs/libSalomeLauncher-6d57b2ba.so +0 -0
  378. salome.kernel.libs/libSalomeLifeCycleCORBA-69902a7b.so +0 -0
  379. salome.kernel.libs/libSalomeLoggerServer-3668e9ae.so +0 -0
  380. salome.kernel.libs/libSalomeNS-a03a7eba.so +0 -0
  381. salome.kernel.libs/libSalomeNotification-66efcfbd.so +0 -0
  382. salome.kernel.libs/libSalomeORB-f304f4df.so +0 -0
  383. salome.kernel.libs/libSalomePalm-4204405e.so +0 -0
  384. salome.kernel.libs/libSalomeResourcesManager-fd411949.so +0 -0
  385. salome.kernel.libs/libSalomeSDS-7822101d.so +0 -0
  386. salome.kernel.libs/libSalomeTestComponentEngine-9899af25.so +0 -0
  387. salome.kernel.libs/libTOOLSDS-db8e8629.so +0 -0
  388. salome.kernel.libs/libbatch-6b5b319f.so +0 -0
  389. salome.kernel.libs/libboost_atomic-489c2d94.so.1.81.0 +0 -0
  390. salome.kernel.libs/libboost_filesystem-e610b554.so.1.81.0 +0 -0
  391. salome.kernel.libs/libboost_system-4a7650ea.so.1.81.0 +0 -0
  392. salome.kernel.libs/libcppunit-1-17e77af1.12.so.1.0.0 +0 -0
  393. salome.kernel.libs/libhdf5-60e81d69.so.103.0.0 +0 -0
  394. salome.kernel.libs/liblzma-004595ca.so.5.2.2 +0 -0
  395. salome.kernel.libs/libomniDynamic4-9edc765d.so.2.5 +0 -0
  396. salome.kernel.libs/libomniORB4-4725824d.so.2.5 +0 -0
  397. salome.kernel.libs/libomnithread-99f9d0d3.so.4.1 +0 -0
  398. salome.kernel.libs/libwith_loggerTraceCollector-6b94c51b.so +0 -0
  399. salome.kernel.libs/libwith_loggerTraceCollector.so +0 -0
  400. salome.kernel.libs/libxml2-3998bec4.so.2.9.1 +0 -0
@@ -0,0 +1,137 @@
1
+ # -*- coding: iso-8859-1 -*-
2
+ # Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
3
+ #
4
+ # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5
+ # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6
+ #
7
+ # This library is free software; you can redistribute it and/or
8
+ # modify it under the terms of the GNU Lesser General Public
9
+ # License as published by the Free Software Foundation; either
10
+ # version 2.1 of the License, or (at your option) any later version.
11
+ #
12
+ # This library is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ # Lesser General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Lesser General Public
18
+ # License along with this library; if not, write to the Free Software
19
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
+ #
21
+ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22
+ #
23
+
24
+ ## \defgroup diclookup diclookup
25
+ # \{
26
+ # \details Smart dictionary with key/value lookup
27
+ # \}
28
+
29
+ __author__="gboulant"
30
+ __date__ ="$21 mai 2010 18:00:23$"
31
+
32
+
33
+ # search a dictionary for key or value
34
+ # using named functions or a class
35
+ # tested with Python25 by Ene Uran 01/19/2008
36
+
37
+ ## return the key of dictionary dic given the value
38
+ # \ingroup diclookup
39
+ def find_key(dic, val):
40
+ """return the key of dictionary dic given the value"""
41
+ return [k for k, v in dic.items() if v == val][0]
42
+
43
+ ## return the value of dictionary dic given the key
44
+ # \ingroup diclookup
45
+ def find_value(dic, key):
46
+ """return the value of dictionary dic given the key"""
47
+ return dic[key]
48
+
49
+ ## a dictionary which can lookup value by key, or keys by value
50
+ # \ingroup diclookup
51
+ class Lookup(dict):
52
+ """
53
+ a dictionary which can lookup value by key, or keys by value
54
+ """
55
+ ## items can be a list of pair_lists or a dictionary
56
+ def __init__(self, items=None):
57
+ """items can be a list of pair_lists or a dictionary"""
58
+ if items is None:
59
+ items = []
60
+ dict.__init__(self, items)
61
+
62
+ ## find the key(s) as a list given a value
63
+ def get_keys(self, value):
64
+ """find the key(s) as a list given a value"""
65
+ return [item[0] for item in list(self.items()) if item[1] == value]
66
+
67
+ ## find the key associated to the given a value. If several keys exist,
68
+ # only the first is given. To get the whole list, use get_keys instead.
69
+ def get_key(self, value):
70
+ """
71
+ find the key associated to the given a value. If several keys exist,
72
+ only the first is given. To get the whole list, use get_keys instead.
73
+ """
74
+ list = self.get_keys(value)
75
+ if len(list) == 0:
76
+ return None
77
+ return list[0]
78
+
79
+ ## find the value given a key
80
+ def get_value(self, key):
81
+ """find the value given a key"""
82
+ return self[key]
83
+
84
+ #
85
+ # ==============================================================================
86
+ # Use cases and unit tests
87
+ # ==============================================================================
88
+ #
89
+ def TEST_getTestDictionnary():
90
+ # dictionary of chemical symbols
91
+ symbol_dic = {
92
+ 'C': 'carbon',
93
+ 'H': 'hydrogen',
94
+ 'N': 'nitrogen',
95
+ 'Li': 'lithium',
96
+ 'Be': 'beryllium',
97
+ 'B': 'boron'
98
+ }
99
+ return symbol_dic
100
+
101
+ def TEST_find_value():
102
+ symbol_dic = TEST_getTestDictionnary()
103
+ print(find_key(symbol_dic, 'boron')) # B
104
+ print(find_value(symbol_dic, 'B')) # boron
105
+ print(find_value(symbol_dic, 'H')) # hydrogen
106
+ if find_key(symbol_dic, 'nitrogen') != 'N':
107
+ return False
108
+ return True
109
+
110
+ def TEST_lookup():
111
+ symbol_dic = TEST_getTestDictionnary()
112
+
113
+ name = 'lithium'
114
+ symbol = 'Li'
115
+ # use a dictionary as initialization argument
116
+ look = Lookup(symbol_dic)
117
+ print(look.get_key(name)) # [Li']
118
+ if look.get_key(name) != symbol:
119
+ print("get "+str(look.get_key(name))+" while "+str(symbol)+" was expected")
120
+ return False
121
+ print(look.get_value(symbol)) # lithium
122
+
123
+ # use a list of pairs instead of a dictionary as initialization argument
124
+ # (will be converted to a dictionary by the class internally)
125
+ age_list = [['Fred', 23], ['Larry', 28], ['Ene', 23]]
126
+ look2 = Lookup(age_list)
127
+ print(look2.get_keys(23)) # ['Ene', 'Fred']
128
+ if look2.get_keys(23)[0] != 'Ene' or look2.get_keys(23)[1] != 'Fred':
129
+ print("get "+str(look2.get_keys(23))+" while ['Ene', 'Fred'] was expected")
130
+ return False
131
+ print(look2.get_value('Fred')) # 23
132
+ return True
133
+
134
+ if __name__ == '__main__':
135
+ from . import unittester
136
+ unittester.run("diclookup", "TEST_find_value")
137
+ unittester.run("diclookup", "TEST_lookup")
@@ -0,0 +1,232 @@
1
+ # -*- coding: iso-8859-1 -*-
2
+ # Copyright (C) 2010-2024 CEA, EDF, OPEN CASCADE
3
+ #
4
+ # This library is free software; you can redistribute it and/or
5
+ # modify it under the terms of the GNU Lesser General Public
6
+ # License as published by the Free Software Foundation; either
7
+ # version 2.1 of the License, or (at your option) any later version.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
+ #
18
+ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
+ #
20
+
21
+ ## \defgroup enumerate enumerate
22
+ # \{
23
+ # \details Emulates a C-like enum for python
24
+ # \}
25
+
26
+ __author__ = "gboulant"
27
+ __date__ = "$1 avr. 2010 09:08:02$"
28
+
29
+ ## This class emulates a C-like enum for python. It is initialized with a list
30
+ # of strings to be used as the enum symbolic keys. The enum values are automatically
31
+ # generated as sequencing integer starting at the specified offset value.
32
+ # \ingroup enumerate
33
+ class Enumerate:
34
+ """
35
+ This class emulates a C-like enum for python. It is initialized with a list
36
+ of strings to be used as the enum symbolic keys. The enum values are automatically
37
+ generated as sequencing integer starting at the specified offset value.
38
+ """
39
+
40
+ ## Canonical constructor.
41
+ # \param keys a list of string to be used as the enum symbolic keys. The enum values
42
+ # are automatically generated as a sequence of integers starting at the specified
43
+ # offset value.
44
+ def __init__(self, keys, offset=0):
45
+ """
46
+ Canonical constructor
47
+ @keys a list of string to be used as the enum symbolic keys. The enum values
48
+ are automatically generated as a sequence of integers starting at the specified
49
+ offset value.
50
+ """
51
+ self._dict_keynumbers = {}
52
+ for number, key in enumerate(keys):
53
+ value = offset + number
54
+ setattr(self, key, value)
55
+ self._dict_keynumbers[key] = value
56
+ self._dict_numberkeys = {v: k for k, v in self._dict_keynumbers.items()}
57
+
58
+ ## Return true if this enumerate contains the specified key string
59
+ # \param key a key string to test
60
+ def contains(self, key):
61
+ """
62
+ Return true if this enumerate contains the specified key string
63
+ @key a key string to test
64
+ """
65
+ return key in self._dict_keynumbers
66
+
67
+ ## Returns true if the specified integer value is defined as an identifier
68
+ # in this enumerate.
69
+ # \param value a value to test
70
+ def isValid(self, value):
71
+ """
72
+ Returns true if the specified integer value is defined as an identifier
73
+ in this enumerate.
74
+ @value a value to test
75
+ """
76
+ return value in self._dict_numberkeys
77
+
78
+ ## Returns the list of keys in this enumerate.
79
+ def listkeys(self):
80
+ """
81
+ Returns the list of keys in this enumerate.
82
+ """
83
+ return sorted(self._dict_keynumbers)
84
+
85
+ ## Returns the list of values specified to initiate this enumerate.
86
+ def listvalues(self):
87
+ """
88
+ Returns the list of values specified to initiate this enumerate.
89
+ """
90
+ return sorted(self._dict_numberkeys)
91
+
92
+ ## Returns the symbolic key string associated to the specified identifier value.
93
+ # \param value an integer value whose associated key string is requested.
94
+ def keyOf(self, value):
95
+ """
96
+ Returns the symbolic key string associated to the specified identifier
97
+ value.
98
+ @param value : an integer value whose associated key string is requested.
99
+ """
100
+ if not self.isValid(value):
101
+ return None
102
+ # _MEM_ We assume here that the keys and associated values are in the
103
+ # same order in their list.
104
+ return self._dict_numberkeys[value]
105
+
106
+ # If not, weshould use a longer implementation such that:
107
+ #for key in self._dict_keynumbers.keys():
108
+ # if self._dict_keynumbers[key] == value:
109
+ # return key
110
+
111
+ #
112
+ # ==============================================================================
113
+ # Basic use cases and unit test functions
114
+ # ==============================================================================
115
+ #
116
+
117
+ def TEST_simple():
118
+ TYPES_LIST = Enumerate([
119
+ 'SEP',
120
+ 'OTHER'
121
+ ])
122
+ print(TYPES_LIST.listvalues())
123
+ return True
124
+
125
+ def TEST_createFromList():
126
+ codes = Enumerate([
127
+ 'KERNEL', # This should take the value 0
128
+ 'GUI', # This should take the value 1
129
+ 'GEOM', # ...
130
+ 'MED',
131
+ 'SMESH'])
132
+
133
+ print(codes.KERNEL)
134
+ print(codes.GEOM)
135
+ if (codes.KERNEL == 0 and codes.GEOM == 2):
136
+ return True
137
+ else:
138
+ return False
139
+
140
+ def TEST_createFromString():
141
+ aList = "KERNEL GUI GEOM MED"
142
+
143
+ codes = Enumerate(aList.split())
144
+
145
+ print(codes.KERNEL)
146
+ print(codes.GEOM)
147
+ if (codes.KERNEL == 0 and codes.GEOM == 2):
148
+ return True
149
+ else:
150
+ return False
151
+
152
+ def TEST_contains():
153
+ codes = Enumerate([
154
+ 'KERNEL', # This should take the value 0
155
+ 'GUI', # This should take the value 1
156
+ 'GEOM', # ...
157
+ 'MED',
158
+ 'SMESH'])
159
+
160
+ print("VISU in enumerate?", codes.contains("VISU"))
161
+ if (not codes.contains("VISU")):
162
+ return True
163
+ else:
164
+ return False
165
+
166
+ def TEST_isValid():
167
+ codes = Enumerate([
168
+ 'KERNEL', # This should take the value 0
169
+ 'GUI', # This should take the value 1
170
+ 'GEOM', # ...
171
+ 'MED',
172
+ 'SMESH'])
173
+
174
+ if (not codes.isValid(23)):
175
+ return True
176
+ else:
177
+ return False
178
+
179
+ def TEST_offset():
180
+ codes = Enumerate([
181
+ 'KERNEL', # This should take the value 0
182
+ 'GUI', # This should take the value 1
183
+ 'GEOM', # ...
184
+ 'MED',
185
+ 'SMESH'], offset=20)
186
+
187
+ print(codes.KERNEL)
188
+ print(codes.GEOM)
189
+ if (codes.KERNEL == 20 and codes.GEOM == 22):
190
+ return True
191
+ else:
192
+ return False
193
+
194
+ def TEST_listvalues():
195
+ codes = Enumerate([
196
+ 'KERNEL', # This should take the value 0
197
+ 'GUI', # This should take the value 1
198
+ 'GEOM', # ...
199
+ 'MED',
200
+ 'SMESH'], offset=20)
201
+
202
+ print(codes.listvalues())
203
+ if codes.listvalues() != [20, 21, 22, 23, 24]:
204
+ return False
205
+ return True
206
+
207
+ def TEST_keyOf():
208
+ codes = Enumerate([
209
+ 'KERNEL', # This should take the value 0
210
+ 'GUI', # This should take the value 1
211
+ 'GEOM', # ...
212
+ 'MED',
213
+ 'SMESH'])
214
+
215
+ if ( codes.keyOf(codes.KERNEL) != 'KERNEL' or
216
+ codes.keyOf(codes.GUI) != 'GUI' or
217
+ codes.keyOf(codes.GEOM) != 'GEOM' or
218
+ codes.keyOf(codes.MED) != 'MED' or
219
+ codes.keyOf(codes.SMESH) != 'SMESH'):
220
+ return False
221
+ return True
222
+
223
+ if __name__ == "__main__":
224
+ from . import unittester
225
+ unittester.run("enumerate", "TEST_simple")
226
+ unittester.run("enumerate", "TEST_createFromList")
227
+ unittester.run("enumerate", "TEST_createFromString")
228
+ unittester.run("enumerate", "TEST_contains")
229
+ unittester.run("enumerate", "TEST_isValid")
230
+ unittester.run("enumerate", "TEST_offset")
231
+ unittester.run("enumerate", "TEST_listvalues")
232
+ unittester.run("enumerate", "TEST_keyOf")
@@ -0,0 +1,27 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
+ #
19
+ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20
+ #
21
+ """
22
+ This module defines a variable to indicate which traces should be logged.
23
+ """
24
+
25
+ import logging
26
+
27
+ loggingLevel = logging.WARNING
@@ -0,0 +1,290 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
+ #
19
+ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20
+ #
21
+
22
+ #=============================================================================
23
+ # Author : Guillaume Boulant (CSSI)
24
+ # Rewritten by Renaud Barate (EDF R&D)
25
+ #=============================================================================
26
+
27
+ ## \defgroup logger logger
28
+ # \{
29
+ # \details
30
+ # This module defines a class which provides logging facility in Salome.
31
+ # \}
32
+
33
+ """
34
+ This module defines a class which provides logging facility in Salome:
35
+ """
36
+
37
+ import sys, os
38
+ import logging
39
+
40
+ from salome.kernel.salome.kernel.deprecation import deprecated
41
+ from salome.kernel.salome.kernel import termcolor
42
+ import salome.kernel.salome.kernel.logconfig
43
+
44
+ ## This class formats and displays log messages in Salome environment. It
45
+ # inherits \b logging.Logger class defined in \b logging module from Python
46
+ # library, so all methods from \b logging.Logger can be used here.
47
+ # The format of the traces is:
48
+ # LEVEL[keyword] : Message
49
+ #
50
+ # ,where \em LEVEL is the level of the message (\em DEBUG, \em INFO, etc.),
51
+ # \em keyword is the name of the logger, and \em Message is the message to log.
52
+ #
53
+ # When creating a new Logger object, the parameter \em keyword defines the
54
+ # name of the logger, \em level defines the logging level (default is
55
+ # \b logging.DEBUG if KERNEL module is configured with --enable-debug option
56
+ # or \b logging.WARNING otherwise), and \em color defines the color
57
+ # of the log messages for this logger (log messages will appear in color
58
+ # only when displayed on color - capable ASCII terminals). See module
59
+ # \ref termcolor "salome.kernel.termcolor" for the color constants.
60
+ #
61
+ # By default, log messages will be displayed only on standard output. They
62
+ # can also be recorded in a file (see method setLogFile()). For now,
63
+ # the CORBA-based logging facility can not be used through this class.
64
+ #
65
+ # A source filename \em sourceFileName can be defined. If this argument is
66
+ # specified, then the \em keyword is modified to the basename of the
67
+ # \em sourceFileName
68
+ #
69
+ # Basic usage::
70
+ # \code
71
+ # from salome.kernel.logger import Logger
72
+ # log = Logger("Test")
73
+ # log.debug("Debug message")
74
+ # log.info("Information message")
75
+ # log.warning("Warning message")
76
+ # log.error("Error message")
77
+ # log.critical("Fatal error message")
78
+ # \endcode
79
+ # \ingroup logger
80
+ class Logger(logging.Logger):
81
+ """
82
+ This class formats and displays log messages in Salome environment. It
83
+ inherits :class:`Logger<logging.Logger>` class defined in :mod:`logging`
84
+ module from Python library, so all methods from :class:`logging.Logger`
85
+ can be used here. The format of the traces is:
86
+
87
+ LEVEL [keyword] : Message
88
+
89
+ where `LEVEL` is the level of the message (`DEBUG`, `INFO`, etc.),
90
+ `keyword` is the name of the logger, and `Message` is the message to log.
91
+
92
+ When creating a new Logger object, the parameter `keyword` defines the
93
+ name of the logger, `level` defines the logging level (default is
94
+ :const:`logging.DEBUG` if KERNEL module is configured with --enable-debug
95
+ option or :const:`logging.WARNING` otherwise), and `color` defines the color
96
+ of the log messages for this logger (log messages will appear in color
97
+ only when displayed on color-capable ASCII terminals). See module
98
+ :mod:`salome.kernel.termcolor` for the color constants.
99
+
100
+ By default, log messages will be displayed only on standard output. They
101
+ can also be recorded in a file (see method :meth:`setLogFile`). For now,
102
+ the CORBA-based logging facility can not be used through this class.
103
+
104
+ A source filename `sourceFileName` can be defined. If this argument is
105
+ specified, then the `keyword` is modified to the basename of the `sourceFileName`
106
+
107
+ Basic usage::
108
+
109
+ from salome.kernel.salome.kernel.logger import Logger
110
+ log = Logger("Test")
111
+ log.debug("Debug message")
112
+ log.info("Information message")
113
+ log.warning("Warning message")
114
+ log.error("Error message")
115
+ log.critical("Fatal error message")
116
+
117
+ """
118
+
119
+ def __init__(self, keyword = "KEY", level = salome.kernel.salome.kernel.logconfig.loggingLevel,
120
+ color = None, sourceFileName=None):
121
+
122
+ if sourceFileName is not None:
123
+ keyword = os.path.basename(sourceFileName).split('.')[0]
124
+ logging.Logger.__init__(self, keyword, level)
125
+ self._baseFormatString = "%(levelname)-8s [%(name)s] : %(message)s"
126
+ self._baseFormatter = logging.Formatter(self._baseFormatString)
127
+ if hasattr(sys.stdout, "flush"):
128
+ self._stdoutStream = sys.stdout
129
+ else:
130
+ self._stdoutStream = _UnFlushableLogStream(sys.stdout)
131
+ self._stdoutHandler = logging.StreamHandler(self._stdoutStream)
132
+ self._stdoutHandler.setLevel(logging.DEBUG)
133
+ self.setColor(color)
134
+ self.addHandler(self._stdoutHandler)
135
+ self._fileHandler = None
136
+
137
+ ## Log all messages, including DEBUG level messages (equivalent to
138
+ # setLevel(logging.DEBUG)).
139
+ def showDebug(self):
140
+ """
141
+ Log all messages, including DEBUG level messages (equivalent to
142
+ ``setLevel(logging.DEBUG)``).
143
+ """
144
+ self.setLevel(logging.DEBUG)
145
+
146
+ ## Define a log file to record the log messages (in addition to the
147
+ # standard output).
148
+ def setLogFile(self, logFilename):
149
+ """
150
+ Define a log file to record the log messages (in addition to the
151
+ standard output).
152
+ """
153
+ self.closeLogFile()
154
+ self._fileHandler = logging.FileHandler(logFilename, 'w')
155
+ self._fileHandler.setLevel(logging.DEBUG)
156
+ self._fileHandler.setFormatter(self._baseFormatter)
157
+ self.addHandler(self._fileHandler)
158
+
159
+ ## Set the color of log messages on color-capable terminals. If \em color
160
+ # is \b None, the default color will be used.
161
+ def setColor(self, color):
162
+ """
163
+ Set the color of log messages on color-capable terminals. If `color`
164
+ is :const:`None`, the default color will be used.
165
+ """
166
+ if color is None or not termcolor.canDisplayColor(self._stdoutStream):
167
+ stdoutFormatter = self._baseFormatter
168
+ else:
169
+ format = ("%s%s%s" %
170
+ (termcolor.getControlSequence(color),
171
+ self._baseFormatString,
172
+ termcolor.getControlSequence(termcolor.DEFAULT)))
173
+ stdoutFormatter = logging.Formatter(format)
174
+ self._stdoutHandler.setFormatter(stdoutFormatter)
175
+
176
+ ## Close the log file.
177
+ def closeLogFile(self):
178
+ """Close the log file."""
179
+ if self._fileHandler is not None:
180
+ self.removeHandler(self._fileHandler)
181
+ self._fileHandler.close()
182
+ self._fileHandler = None
183
+
184
+ ## Hide DEBUG level messages (equivalent to setLevel(logging.INFO)).
185
+ def hideDebug(self):
186
+ """
187
+ Hide DEBUG level messages (equivalent to ``setLevel(logging.INFO)``).
188
+ """
189
+ self.setLevel(logging.INFO)
190
+
191
+ @deprecated("Deprecated since version 5.1.5. Please replace with "
192
+ "Logger.critical(message)")
193
+
194
+ ## Log a message with CRITICAL level. This method only exists for
195
+ # backward compatibility and is equivalent to \b critical(message).
196
+ def fatal(self, message):
197
+ """
198
+ Log a message with CRITICAL level. This method only exists for
199
+ backward compatibility and is equivalent to ``critical(message)``.
200
+ """
201
+ self.critical(message)
202
+
203
+ ## This utility class allows to log messages to a stream with no \b flush
204
+ # method. This is useful to send log messages to \b PyOut objects.
205
+ # \ingroup logger
206
+ class _UnFlushableLogStream:
207
+ """
208
+ This utility class allows to log messages to a stream with no `flush`
209
+ method. This is useful to send log messages to `PyOut` objects.
210
+ """
211
+
212
+ def __init__(self, stream):
213
+ self._stream = stream
214
+
215
+ def write(self, msg):
216
+ self._stream.write(msg)
217
+
218
+ def flush(self):
219
+ pass
220
+
221
+ ## This class extends Logger class and adds exception information
222
+ # when DEBUG messages are recorded. It exists mainly for backward
223
+ # compatibility, as the same thing can be done by calling
224
+ # <em> Logger.debug(message, exc_info = True) </em>.
225
+ # \ingroup logger
226
+ class ExtLogger(Logger):
227
+ """
228
+ This class extends :class:`Logger` class and adds exception information
229
+ when DEBUG messages are recorded. It exists mainly for backward
230
+ compatibility, as the same thing can be done by calling
231
+ ``Logger.debug(message, exc_info = True)``.
232
+ """
233
+
234
+ @deprecated("Class ExtLogger is deprecated since version 5.1.5. See "
235
+ "documentation for replacement.")
236
+ def __init__(self, keyword = "KEY",
237
+ level = salome.kernel.salome.kernel.logconfig.loggingLevel,
238
+ color = None, sourceFileName=None):
239
+ Logger.__init__(self, keyword, level, color, sourceFileName)
240
+
241
+ ## Log a DEBUG message with exception information (equivalent to
242
+ # <em> Logger.debug(message, exc_info = True) </em>).
243
+ def debug( self, message ):
244
+ """
245
+ Log a DEBUG message with exception information (equivalent to
246
+ ``Logger.debug(message, exc_info = True)``).
247
+ """
248
+ Logger.debug(self, message, exc_info = True)
249
+
250
+ ## Test function for logger module
251
+ # \ingroup logger
252
+ def TEST_Logger():
253
+ """Test function for logger module"""
254
+ log = Logger("TST")
255
+
256
+ # Base methods
257
+ log.info("Information message")
258
+ log.debug("Debug message")
259
+ log.fatal("Fatal error message")
260
+
261
+ # Message building
262
+ data = 12
263
+ log.info("This message displays data = " + str(data))
264
+
265
+ data = {}
266
+ data["KERNEL"] = "V1"
267
+ data["GEOM"] = "V2"
268
+ log.info("This message displays data = " + str(data))
269
+
270
+ # Test with a non-string parameter
271
+ log.info(data)
272
+
273
+ # Test with a default instance
274
+ log = Logger()
275
+ log.info("Default logger")
276
+
277
+ # Test showDebug method
278
+ log.setLogFile("test.log")
279
+ log.debug("Debug trace")
280
+ log.hideDebug()
281
+ log.debug("This trace should NOT be displayed")
282
+ log.showDebug()
283
+ log.debug("This trace should be displayed")
284
+ log.closeLogFile()
285
+ log.info("After closing the log file")
286
+
287
+
288
+ # Main function only used to test the module
289
+ if __name__ == "__main__":
290
+ TEST_Logger()