Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Basthon
Basthon Kernel
Commits
6457899d
Commit
6457899d
authored
Jan 02, 2021
by
Romain Casati
Browse files
Better way of managing hacked modules.
parent
f63ea229
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/basthon.js
View file @
6457899d
...
...
@@ -357,17 +357,11 @@ var Basthon = (function() {
* Callback function for hacking several modules before import.
*/
that
.
hackPackagesCallback
=
function
(
toLoad
)
{
if
(
toLoad
.
includes
(
"
matplotlib
"
)
)
{
pyodide
.
globals
.
Basthon
.
hack_matplotlib
();
}
else
if
(
toLoad
.
includes
(
"
turtle
"
)
)
{
pyodide
.
globals
.
Basthon
.
hack_turtle
();
}
else
if
(
toLoad
.
includes
(
"
sympy
"
)
)
{
pyodide
.
globals
.
Basthon
.
hack_sympy
();
}
else
if
(
toLoad
.
includes
(
"
folium
"
)
)
{
pyodide
.
globals
.
Basthon
.
hack_folium
();
}
else
if
(
toLoad
.
includes
(
"
pandas
"
)
)
{
pyodide
.
globals
.
Basthon
.
hack_pandas
();
}
const
hacked
=
[
"
matplotlib
"
,
"
turtle
"
,
"
sympy
"
,
"
folium
"
,
"
pandas
"
];
for
(
const
p
of
toLoad
)
if
(
hacked
.
includes
(
p
)
)
pyodide
.
globals
.
Basthon
[
`hack_
${
p
}
`
]();
};
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment