mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] properly display the importation source
- It sould be nameOfScript.py, not just nameOfScript, when the source is a script - Fix the source for script name variables. For instance, "from script1 import *" should display the node "script1" with the source "script1.py" - If a script has the same name as a module, the module will be imported and not the script, so do not load its variables (even if the module is not in the toolbox).
This commit is contained in:
@@ -438,11 +438,13 @@ PythonToolbox::PythonToolbox() :
|
||||
}
|
||||
|
||||
const ToolboxMessageTree * PythonToolbox::moduleChildren(const char * name, int * numberOfNodes) const {
|
||||
assert(numberOfNodes != nullptr);
|
||||
for (ToolboxMessageTree t : modulesChildren) {
|
||||
if (strcmp(I18n::translate(t.label()), name) == 0) {
|
||||
*numberOfNodes = t.numberOfChildren();
|
||||
assert(*numberOfNodes > 0);
|
||||
const int childrenCount = t.numberOfChildren();
|
||||
if (numberOfNodes != nullptr) {
|
||||
*numberOfNodes = childrenCount;
|
||||
}
|
||||
assert(childrenCount > 0);
|
||||
return static_cast<const ToolboxMessageTree *>(t.children(0));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user