Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5-bin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5-bin
Commits
62758292
Commit
62758292
authored
Jul 29, 2019
by
Boxiang Sun
Committed by
Romain Courteaud
Aug 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to load python packages in the JS cell
We have to initialize pyodide first
parent
3873f331
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
...ateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
+10
-0
No files found.
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
View file @
62758292
...
...
@@ -237,6 +237,7 @@
// import_name_to_package_name was defined when reading package.json
// https://github.com/iodide-project/pyodide/blob/master/pyodide_build/buildall.py#L58
window
.
pyodide
=
pyodide_instance
;
window
.
pyodide
.
loadPackage
=
pyodideLoadPackage
;
return
;
});
}
...
...
@@ -296,6 +297,15 @@
br
,
code
;
try
{
// In order to load Python package,
// we have to initialize pyodide first
if
(
text
.
includes
(
'
loadPackage
'
)
&&
!
is_pyodide_loaded
)
{
is_pyodide_loaded
=
true
;
return
initPyodide
()
.
push
(
function
()
{
return
eval
.
call
(
window
,
text
);
});
}
return
eval
.
call
(
window
,
text
);
}
catch
(
e
)
{
console
.
error
(
e
);
...
...
Write
Preview
Markdown
is supported
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