From 5393ec7273edccb9c8c6a817f4887b01a35094de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Wed, 22 Apr 2020 14:42:56 +0200 Subject: [PATCH] [apps/code] Add matplotlib.pyplot in the var box --- apps/code/variable_box_controller.cpp | 2 +- apps/code/variable_box_controller.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/code/variable_box_controller.cpp b/apps/code/variable_box_controller.cpp index 32091d200..e50b83b62 100644 --- a/apps/code/variable_box_controller.cpp +++ b/apps/code/variable_box_controller.cpp @@ -356,7 +356,6 @@ void VariableBoxController::insertTextInCaller(const char * text, int textLength void VariableBoxController::loadBuiltinNodes(const char * textToAutocomplete, int textToAutocompleteLength) { //TODO LEA could be great to use strings defined in STATIC const char *const tok_kw[] from python/lexer.c //TODO LEA Prune these (check all are usable in our Python, but just comment those which aren't -> there might become usable later) - //TODO LEA add matplotlib.pyplot static const struct { const char * name; ScriptNode::Type type; } builtinNames[] = { {"False", ScriptNode::Type::WithoutParentheses}, {"None", ScriptNode::Type::WithoutParentheses}, @@ -432,6 +431,7 @@ void VariableBoxController::loadBuiltinNodes(const char * textToAutocomplete, in {qstr_str(MP_QSTR_locals), ScriptNode::Type::WithParentheses}, {qstr_str(MP_QSTR_map), ScriptNode::Type::WithParentheses}, {qstr_str(MP_QSTR_math), ScriptNode::Type::WithoutParentheses}, + {qstr_str(MP_QSTR_matplotlib_dot_pyplot), ScriptNode::Type::WithoutParentheses}, {qstr_str(MP_QSTR_max), ScriptNode::Type::WithParentheses}, //{qstr_str(MP_QSTR_memoryview), ScriptNode::Type::WithParentheses}, {qstr_str(MP_QSTR_min), ScriptNode::Type::WithParentheses}, diff --git a/apps/code/variable_box_controller.h b/apps/code/variable_box_controller.h index 6efe0228d..ca59edcfc 100644 --- a/apps/code/variable_box_controller.h +++ b/apps/code/variable_box_controller.h @@ -42,7 +42,7 @@ private: constexpr static int k_maxScriptObjectNameSize = 100; //TODO LEA constexpr static int k_maxNumberOfDisplayedRows = 8; // (240 - titlebar - margin)/27 //TODO LEA constexpr static int k_maxScriptNodesCount = 32; //TODO LEA - constexpr static int k_totalBuiltinNodesCount = 107; + constexpr static int k_totalBuiltinNodesCount = 108; constexpr static uint8_t k_scriptOriginsCount = 3; constexpr static uint8_t k_subtitleCellType = NodeCellType; // We don't care as it is not selectable constexpr static uint8_t k_itemCellType = LeafCellType; // So that upper class NestedMenuController knows it's a leaf