From 4221fe1b1d2ae044c8b6e8de34c95599bbd120c9 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 27 Aug 2019 09:55:53 +0300 Subject: [PATCH] Minor debug --- src/Config/Config_FeatureReader.cpp | 6 +++--- .../InitializationPlugin_PyInterp.cpp | 18 ++++++++++++++++++ src/PythonAddons/doc/addons_Features.rst | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index 072e61c01..7d93e060e 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -188,9 +188,9 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theFeatureNode, outFeatureMessage->setText(aText); bool isTitleInToolbar = getBooleanAttribute(theFeatureNode, FEATURE_TITLE_IN_TOOLBAR, true); outFeatureMessage->setTitleInToolbar(isTitleInToolbar); - //std::string aToolTip = Config_Translator::translate( - // anId, getProperty(theFeatureNode, FEATURE_TOOLTIP)); - //outFeatureMessage->setTooltip(aToolTip); + std::string aToolTip = Config_Translator::translate( + anId, getProperty(theFeatureNode, FEATURE_TOOLTIP)); + outFeatureMessage->setTooltip(aToolTip); outFeatureMessage->setIcon(getProperty(theFeatureNode, FEATURE_ICON)); outFeatureMessage->setKeysequence(getProperty(theFeatureNode, FEATURE_KEYSEQUENCE)); diff --git a/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp b/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp index de62f8b74..a2f99d56a 100644 --- a/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp +++ b/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp @@ -227,6 +227,24 @@ bool InitializationPlugin_PyInterp::initContext() _local_context = PyDict_New(); Py_INCREF(_local_context); + // to avoid "help()" hang in the python console + PyRun_SimpleString("def help(): print(\"Available modules:\\n\ + salome.shaper.model : higher level access to features and data model\\n\ + BuildAPI : Build plugin features allowing to build shapes\\n\ + ConfigAPI : configuration management: preferences and XML properties\\n\ + ConstructionAPI : Construction plugin for auxiliary features creation\\n\ + EventsAPI : application events receiving and emitting manager\\n\ + ExchangeAPI : Exchange plugin with import/export features\\n\ + FeaturesAPI : Features plugin with general 3D features\\n\ + GeomAlgoAPI : geometrical algorithms\\n\ + GeomAPI : geometrical data structures\\n\ + GeomDataAPI : specific geometrical data structures stored in the data model\\n\ + ModelAPI : general low-level interface to access data model\\n\ + ModelHighAPI : general high-level interface to access data model\\n\ + ParametersAPI : Parameters plugin for parameters feature management\\n\ + PartSetAPI : PartSet plugin for management Parts features\\n\ + SketchAPI : Sketch plugin with all sketch features\")"); + return PyRun_SimpleString("from math import *") == 0; } diff --git a/src/PythonAddons/doc/addons_Features.rst b/src/PythonAddons/doc/addons_Features.rst index ddeac8f89..85346ff09 100644 --- a/src/PythonAddons/doc/addons_Features.rst +++ b/src/PythonAddons/doc/addons_Features.rst @@ -13,7 +13,7 @@ A feature description includes 4 files: - feature.py with python commands, - icon.png with image of button in the toolbar (the file is located at sub-folder /icons). -Two examples of already created custom features are: +An example of already created custom features is: .. toctree:: :titlesonly: -- 2.39.2