From d59c836abd6482a22741410700f0c29570821a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 21 Nov 2018 11:13:49 +0100 Subject: [PATCH] [code] PythonToolbox: add 'eval' to the catalog --- apps/code/catalog.de.i18n | 1 + apps/code/catalog.en.i18n | 1 + apps/code/catalog.es.i18n | 1 + apps/code/catalog.fr.i18n | 1 + apps/code/catalog.pt.i18n | 1 + apps/code/catalog.universal.i18n | 1 + apps/code/python_toolbox.cpp | 3 ++- 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/code/catalog.de.i18n b/apps/code/catalog.de.i18n index f2ec249d6..31a639570 100644 --- a/apps/code/catalog.de.i18n +++ b/apps/code/catalog.de.i18n @@ -32,6 +32,7 @@ PythonDrawString = "Display a text from pixel (x,y)" PythonConstantE = "2.718281828459046" PythonErf = "Error function" PythonErfc = "Complementary error function" +PythonEval = "Returns the evaluated expression" PythonExp = "Exponential function" PythonExpm1 = "Compute exp(x)-1" PythonFabs = "Absolute value" diff --git a/apps/code/catalog.en.i18n b/apps/code/catalog.en.i18n index 24597a9e9..d228a5d85 100644 --- a/apps/code/catalog.en.i18n +++ b/apps/code/catalog.en.i18n @@ -32,6 +32,7 @@ PythonDrawString = "Display a text from pixel (x,y)" PythonConstantE = "2.718281828459046" PythonErf = "Error function" PythonErfc = "Complementary error function" +PythonEval = "Returns the evaluated expression" PythonExp = "Exponential function" PythonExpm1 = "Compute exp(x)-1" PythonFabs = "Absolute value" diff --git a/apps/code/catalog.es.i18n b/apps/code/catalog.es.i18n index 24597a9e9..d228a5d85 100644 --- a/apps/code/catalog.es.i18n +++ b/apps/code/catalog.es.i18n @@ -32,6 +32,7 @@ PythonDrawString = "Display a text from pixel (x,y)" PythonConstantE = "2.718281828459046" PythonErf = "Error function" PythonErfc = "Complementary error function" +PythonEval = "Returns the evaluated expression" PythonExp = "Exponential function" PythonExpm1 = "Compute exp(x)-1" PythonFabs = "Absolute value" diff --git a/apps/code/catalog.fr.i18n b/apps/code/catalog.fr.i18n index 825a1f526..b02f2aa94 100644 --- a/apps/code/catalog.fr.i18n +++ b/apps/code/catalog.fr.i18n @@ -32,6 +32,7 @@ PythonDrawString = "Affiche un texte au pixel (x,y)" PythonConstantE = "2.718281828459045" PythonErf = "Fonction d'erreur" PythonErfc = "Fonction d'erreur complémentaire" +PythonEval = "Evalue l'expression en argument " PythonExp = "Fonction exponentielle" PythonExpm1 = "Calcul de exp(x)-1" PythonFabs = "Valeur absolue" diff --git a/apps/code/catalog.pt.i18n b/apps/code/catalog.pt.i18n index c31c5a44a..192b9f13c 100644 --- a/apps/code/catalog.pt.i18n +++ b/apps/code/catalog.pt.i18n @@ -32,6 +32,7 @@ PythonDrawString = "Display a text from pixel (x,y)" PythonConstantE = "2.718281828459046" PythonErf = "Error function" PythonErfc = "Complementary error function" +PythonEval = "Returns the evaluated expression" PythonExp = "Exponential function" PythonExpm1 = "Compute exp(x)-1" PythonFabs = "Absolute value" diff --git a/apps/code/catalog.universal.i18n b/apps/code/catalog.universal.i18n index 2ae4a162d..190b08e4e 100644 --- a/apps/code/catalog.universal.i18n +++ b/apps/code/catalog.universal.i18n @@ -32,6 +32,7 @@ PythonCommandDrawString = "draw_string(\"text\",x,y)" PythonCommandConstantE = "e" PythonCommandErf = "erf(x)" PythonCommandErfc = "erfc(x)" +PythonCommandEval = "eval(\"expression\")" PythonCommandExp = "exp(x)" PythonCommandExpComplex = "exp(z)" PythonCommandExpm1 = "expm1(x)" diff --git a/apps/code/python_toolbox.cpp b/apps/code/python_toolbox.cpp index 982a03ca3..c70fcfd09 100644 --- a/apps/code/python_toolbox.cpp +++ b/apps/code/python_toolbox.cpp @@ -8,7 +8,7 @@ extern "C" { namespace Code { -static constexpr int catalogChildrenCount = 95; +static constexpr int catalogChildrenCount = 96; static constexpr int MathModuleChildrenCount = 43; static constexpr int KandinskyModuleChildrenCount = 7; static constexpr int CMathModuleChildrenCount = 13; @@ -177,6 +177,7 @@ const ToolboxMessageTree catalogChildren[catalogChildrenCount] = { ToolboxMessageTree(I18n::Message::PythonCommandConstantE, I18n::Message::PythonConstantE, I18n::Message::PythonCommandConstantE), ToolboxMessageTree(I18n::Message::PythonCommandErf, I18n::Message::PythonErf, I18n::Message::PythonCommandErf), ToolboxMessageTree(I18n::Message::PythonCommandErfc, I18n::Message::PythonErfc, I18n::Message::PythonCommandErfc), + ToolboxMessageTree(I18n::Message::PythonCommandEval, I18n::Message::PythonEval, I18n::Message::PythonCommandEval), ToolboxMessageTree(I18n::Message::PythonCommandExp, I18n::Message::PythonExp, I18n::Message::PythonCommandExp), ToolboxMessageTree(I18n::Message::PythonCommandExpm1, I18n::Message::PythonExpm1, I18n::Message::PythonCommandExpm1), ToolboxMessageTree(I18n::Message::PythonCommandFabs, I18n::Message::PythonFabs, I18n::Message::PythonCommandFabs),